@aenode/prop 0.0.7 → 0.0.21
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/graphql/filter-dtos.d.ts +69 -0
- package/dist/graphql/filter-dtos.d.ts.map +1 -0
- package/dist/graphql/filter-dtos.js +370 -0
- package/dist/graphql/filter-dtos.js.map +1 -0
- package/dist/graphql/index.d.ts +6 -0
- package/dist/graphql/index.d.ts.map +1 -1
- package/dist/graphql/index.js +6 -0
- package/dist/graphql/index.js.map +1 -1
- package/dist/graphql/prop-order-count.d.ts +2 -0
- package/dist/graphql/prop-order-count.d.ts.map +1 -0
- package/dist/graphql/prop-order-count.js +11 -0
- package/dist/graphql/prop-order-count.js.map +1 -0
- package/dist/graphql/prop-order.d.ts +2 -0
- package/dist/graphql/prop-order.d.ts.map +1 -0
- package/dist/graphql/prop-order.js +11 -0
- package/dist/graphql/prop-order.js.map +1 -0
- package/dist/graphql/prop.d.ts.map +1 -1
- package/dist/graphql/prop.js +15 -5
- package/dist/graphql/prop.js.map +1 -1
- package/dist/graphql/register-enums.d.ts +2 -0
- package/dist/graphql/register-enums.d.ts.map +1 -0
- package/dist/graphql/register-enums.js +11 -0
- package/dist/graphql/register-enums.js.map +1 -0
- package/dist/graphql/sort-count.dto.d.ts +5 -0
- package/dist/graphql/sort-count.dto.d.ts.map +1 -0
- package/dist/graphql/sort-count.dto.js +22 -0
- package/dist/graphql/sort-count.dto.js.map +1 -0
- package/dist/peers.d.ts +2 -0
- package/dist/peers.d.ts.map +1 -0
- package/dist/peers.js +3 -0
- package/dist/peers.js.map +1 -0
- package/dist/restapi/filter-dtos.d.ts +44 -0
- package/dist/restapi/filter-dtos.d.ts.map +1 -0
- package/dist/restapi/filter-dtos.js +202 -0
- package/dist/restapi/filter-dtos.js.map +1 -0
- package/dist/restapi/index.d.ts +5 -0
- package/dist/restapi/index.d.ts.map +1 -1
- package/dist/restapi/index.js +6 -0
- package/dist/restapi/index.js.map +1 -1
- package/dist/restapi/prop-order-count.d.ts +2 -0
- package/dist/restapi/prop-order-count.d.ts.map +1 -0
- package/dist/restapi/prop-order-count.js +11 -0
- package/dist/restapi/prop-order-count.js.map +1 -0
- package/dist/restapi/prop-order.d.ts +2 -0
- package/dist/restapi/prop-order.d.ts.map +1 -0
- package/dist/restapi/prop-order.js +11 -0
- package/dist/restapi/prop-order.js.map +1 -0
- package/dist/restapi/sort-count.dto.d.ts +5 -0
- package/dist/restapi/sort-count.dto.d.ts.map +1 -0
- package/dist/restapi/sort-count.dto.js +18 -0
- package/dist/restapi/sort-count.dto.js.map +1 -0
- package/dist/restapi/to-api-property-options.d.ts.map +1 -1
- package/dist/restapi/to-api-property-options.js +19 -2
- package/dist/restapi/to-api-property-options.js.map +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const QueryMode: {
|
|
2
|
+
readonly default: "default";
|
|
3
|
+
readonly insensitive: "insensitive";
|
|
4
|
+
};
|
|
5
|
+
export type QueryMode = keyof typeof QueryMode;
|
|
6
|
+
export declare class IntFilterDto {
|
|
7
|
+
equals?: number;
|
|
8
|
+
in?: number[];
|
|
9
|
+
notIn?: number[];
|
|
10
|
+
lt?: number;
|
|
11
|
+
lte?: number;
|
|
12
|
+
gt?: number;
|
|
13
|
+
gte?: number;
|
|
14
|
+
not?: IntFilterDto;
|
|
15
|
+
}
|
|
16
|
+
export declare class DateFilterDto {
|
|
17
|
+
equals?: Date;
|
|
18
|
+
in?: Date[];
|
|
19
|
+
notIn?: Date[];
|
|
20
|
+
lt?: Date;
|
|
21
|
+
lte?: Date;
|
|
22
|
+
gt?: Date;
|
|
23
|
+
gte?: Date;
|
|
24
|
+
not?: DateFilterDto;
|
|
25
|
+
}
|
|
26
|
+
export declare class BooleanFilterDto {
|
|
27
|
+
equals?: boolean;
|
|
28
|
+
not?: BooleanFilterDto;
|
|
29
|
+
}
|
|
30
|
+
export declare class StringFilterDto {
|
|
31
|
+
equals?: string;
|
|
32
|
+
in?: string[];
|
|
33
|
+
notIn?: string[];
|
|
34
|
+
lt?: string;
|
|
35
|
+
lte?: string;
|
|
36
|
+
gt?: string;
|
|
37
|
+
gte?: string;
|
|
38
|
+
contains?: string;
|
|
39
|
+
startsWith?: string;
|
|
40
|
+
endsWith?: string;
|
|
41
|
+
mode?: QueryMode;
|
|
42
|
+
not?: StringFilterDto;
|
|
43
|
+
}
|
|
44
|
+
export declare class StringArrayFilterDto {
|
|
45
|
+
isEmpty?: boolean;
|
|
46
|
+
has?: string;
|
|
47
|
+
equals?: string[];
|
|
48
|
+
hasEvery?: string[];
|
|
49
|
+
hasSome?: string[];
|
|
50
|
+
}
|
|
51
|
+
export declare class BooleanArrayFilterDto {
|
|
52
|
+
isEmpty?: boolean;
|
|
53
|
+
equals?: boolean[];
|
|
54
|
+
hasEvery?: boolean[];
|
|
55
|
+
hasSome?: boolean[];
|
|
56
|
+
}
|
|
57
|
+
export declare class IntArrayFilterDto {
|
|
58
|
+
isEmpty?: boolean;
|
|
59
|
+
has?: number;
|
|
60
|
+
equals?: number[];
|
|
61
|
+
hasEvery?: number[];
|
|
62
|
+
hasSome?: number[];
|
|
63
|
+
}
|
|
64
|
+
export declare class JsonFilterDto {
|
|
65
|
+
mode?: QueryMode;
|
|
66
|
+
string_contains?: string;
|
|
67
|
+
not: JsonFilterDto;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=filter-dtos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-dtos.d.ts","sourceRoot":"","sources":["../../src/graphql/filter-dtos.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,SAAS,CAAC;AAE/C,qBACa,YAAY;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IACqB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACiB,GAAG,CAAC,EAAE,YAAY,CAAC;CAC1D;AAED,qBACa,aAAa;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;IACqB,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IAClD,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,GAAG,CAAC,EAAE,IAAI,CAAC;IACoB,GAAG,CAAC,EAAE,aAAa,CAAC;CAC5D;AAED,qBACa,gBAAgB;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACiB,GAAG,CAAC,EAAE,gBAAgB,CAAC;CAClE;AAED,qBACa,eAAe;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IACqB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE1B,IAAI,CAAC,EAAE,SAAS,CAAyB;IACA,GAAG,CAAC,EAAE,eAAe,CAAC;CAChE;AAED,qBACa,oBAAoB;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IACmB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACjE;AAED,qBACa,qBAAqB;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IACoB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;CACnE;AAED,qBACa,iBAAiB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IACmB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACjE;AAED,qBACa,aAAa;IACS,IAAI,CAAC,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,aAAa,CAAC;CAC3D"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
3
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
4
|
+
import { InputType } from './input-type.js';
|
|
5
|
+
import { Prop } from './prop.js';
|
|
6
|
+
export const QueryMode = {
|
|
7
|
+
default: 'default',
|
|
8
|
+
insensitive: 'insensitive'
|
|
9
|
+
};
|
|
10
|
+
export class IntFilterDto {
|
|
11
|
+
constructor(){
|
|
12
|
+
_define_property(this, "equals", void 0);
|
|
13
|
+
_define_property(this, "in", void 0);
|
|
14
|
+
_define_property(this, "notIn", void 0);
|
|
15
|
+
_define_property(this, "lt", void 0);
|
|
16
|
+
_define_property(this, "lte", void 0);
|
|
17
|
+
_define_property(this, "gt", void 0);
|
|
18
|
+
_define_property(this, "gte", void 0);
|
|
19
|
+
_define_property(this, "not", void 0);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
_ts_decorate([
|
|
23
|
+
Prop(),
|
|
24
|
+
_ts_metadata("design:type", Number)
|
|
25
|
+
], IntFilterDto.prototype, "equals", void 0);
|
|
26
|
+
_ts_decorate([
|
|
27
|
+
Prop({
|
|
28
|
+
type: ()=>Number,
|
|
29
|
+
isArray: true
|
|
30
|
+
}),
|
|
31
|
+
_ts_metadata("design:type", Array)
|
|
32
|
+
], IntFilterDto.prototype, "in", void 0);
|
|
33
|
+
_ts_decorate([
|
|
34
|
+
Prop({
|
|
35
|
+
type: ()=>Number,
|
|
36
|
+
isArray: true
|
|
37
|
+
}),
|
|
38
|
+
_ts_metadata("design:type", Array)
|
|
39
|
+
], IntFilterDto.prototype, "notIn", void 0);
|
|
40
|
+
_ts_decorate([
|
|
41
|
+
Prop(),
|
|
42
|
+
_ts_metadata("design:type", Number)
|
|
43
|
+
], IntFilterDto.prototype, "lt", void 0);
|
|
44
|
+
_ts_decorate([
|
|
45
|
+
Prop(),
|
|
46
|
+
_ts_metadata("design:type", Number)
|
|
47
|
+
], IntFilterDto.prototype, "lte", void 0);
|
|
48
|
+
_ts_decorate([
|
|
49
|
+
Prop(),
|
|
50
|
+
_ts_metadata("design:type", Number)
|
|
51
|
+
], IntFilterDto.prototype, "gt", void 0);
|
|
52
|
+
_ts_decorate([
|
|
53
|
+
Prop(),
|
|
54
|
+
_ts_metadata("design:type", Number)
|
|
55
|
+
], IntFilterDto.prototype, "gte", void 0);
|
|
56
|
+
_ts_decorate([
|
|
57
|
+
Prop({
|
|
58
|
+
object: ()=>IntFilterDto
|
|
59
|
+
}),
|
|
60
|
+
_ts_metadata("design:type", Object)
|
|
61
|
+
], IntFilterDto.prototype, "not", void 0);
|
|
62
|
+
IntFilterDto = _ts_decorate([
|
|
63
|
+
InputType()
|
|
64
|
+
], IntFilterDto);
|
|
65
|
+
export class DateFilterDto {
|
|
66
|
+
constructor(){
|
|
67
|
+
_define_property(this, "equals", void 0);
|
|
68
|
+
_define_property(this, "in", void 0);
|
|
69
|
+
_define_property(this, "notIn", void 0);
|
|
70
|
+
_define_property(this, "lt", void 0);
|
|
71
|
+
_define_property(this, "lte", void 0);
|
|
72
|
+
_define_property(this, "gt", void 0);
|
|
73
|
+
_define_property(this, "gte", void 0);
|
|
74
|
+
_define_property(this, "not", void 0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_ts_decorate([
|
|
78
|
+
Prop(),
|
|
79
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
80
|
+
], DateFilterDto.prototype, "equals", void 0);
|
|
81
|
+
_ts_decorate([
|
|
82
|
+
Prop({
|
|
83
|
+
type: ()=>Date,
|
|
84
|
+
isArray: true
|
|
85
|
+
}),
|
|
86
|
+
_ts_metadata("design:type", Array)
|
|
87
|
+
], DateFilterDto.prototype, "in", void 0);
|
|
88
|
+
_ts_decorate([
|
|
89
|
+
Prop({
|
|
90
|
+
type: ()=>Date,
|
|
91
|
+
isArray: true
|
|
92
|
+
}),
|
|
93
|
+
_ts_metadata("design:type", Array)
|
|
94
|
+
], DateFilterDto.prototype, "notIn", void 0);
|
|
95
|
+
_ts_decorate([
|
|
96
|
+
Prop(),
|
|
97
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
98
|
+
], DateFilterDto.prototype, "lt", void 0);
|
|
99
|
+
_ts_decorate([
|
|
100
|
+
Prop(),
|
|
101
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
102
|
+
], DateFilterDto.prototype, "lte", void 0);
|
|
103
|
+
_ts_decorate([
|
|
104
|
+
Prop(),
|
|
105
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
106
|
+
], DateFilterDto.prototype, "gt", void 0);
|
|
107
|
+
_ts_decorate([
|
|
108
|
+
Prop(),
|
|
109
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
110
|
+
], DateFilterDto.prototype, "gte", void 0);
|
|
111
|
+
_ts_decorate([
|
|
112
|
+
Prop({
|
|
113
|
+
object: ()=>DateFilterDto
|
|
114
|
+
}),
|
|
115
|
+
_ts_metadata("design:type", Object)
|
|
116
|
+
], DateFilterDto.prototype, "not", void 0);
|
|
117
|
+
DateFilterDto = _ts_decorate([
|
|
118
|
+
InputType()
|
|
119
|
+
], DateFilterDto);
|
|
120
|
+
export class BooleanFilterDto {
|
|
121
|
+
constructor(){
|
|
122
|
+
_define_property(this, "equals", void 0);
|
|
123
|
+
_define_property(this, "not", void 0);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
_ts_decorate([
|
|
127
|
+
Prop(),
|
|
128
|
+
_ts_metadata("design:type", Boolean)
|
|
129
|
+
], BooleanFilterDto.prototype, "equals", void 0);
|
|
130
|
+
_ts_decorate([
|
|
131
|
+
Prop({
|
|
132
|
+
object: ()=>BooleanFilterDto
|
|
133
|
+
}),
|
|
134
|
+
_ts_metadata("design:type", Object)
|
|
135
|
+
], BooleanFilterDto.prototype, "not", void 0);
|
|
136
|
+
BooleanFilterDto = _ts_decorate([
|
|
137
|
+
InputType()
|
|
138
|
+
], BooleanFilterDto);
|
|
139
|
+
export class StringFilterDto {
|
|
140
|
+
constructor(){
|
|
141
|
+
_define_property(this, "equals", void 0);
|
|
142
|
+
_define_property(this, "in", void 0);
|
|
143
|
+
_define_property(this, "notIn", void 0);
|
|
144
|
+
_define_property(this, "lt", void 0);
|
|
145
|
+
_define_property(this, "lte", void 0);
|
|
146
|
+
_define_property(this, "gt", void 0);
|
|
147
|
+
_define_property(this, "gte", void 0);
|
|
148
|
+
_define_property(this, "contains", void 0);
|
|
149
|
+
_define_property(this, "startsWith", void 0);
|
|
150
|
+
_define_property(this, "endsWith", void 0);
|
|
151
|
+
_define_property(this, "mode", QueryMode.insensitive);
|
|
152
|
+
_define_property(this, "not", void 0);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
_ts_decorate([
|
|
156
|
+
Prop(),
|
|
157
|
+
_ts_metadata("design:type", String)
|
|
158
|
+
], StringFilterDto.prototype, "equals", void 0);
|
|
159
|
+
_ts_decorate([
|
|
160
|
+
Prop({
|
|
161
|
+
type: ()=>String,
|
|
162
|
+
isArray: true
|
|
163
|
+
}),
|
|
164
|
+
_ts_metadata("design:type", Array)
|
|
165
|
+
], StringFilterDto.prototype, "in", void 0);
|
|
166
|
+
_ts_decorate([
|
|
167
|
+
Prop({
|
|
168
|
+
type: ()=>String,
|
|
169
|
+
isArray: true
|
|
170
|
+
}),
|
|
171
|
+
_ts_metadata("design:type", Array)
|
|
172
|
+
], StringFilterDto.prototype, "notIn", void 0);
|
|
173
|
+
_ts_decorate([
|
|
174
|
+
Prop(),
|
|
175
|
+
_ts_metadata("design:type", String)
|
|
176
|
+
], StringFilterDto.prototype, "lt", void 0);
|
|
177
|
+
_ts_decorate([
|
|
178
|
+
Prop(),
|
|
179
|
+
_ts_metadata("design:type", String)
|
|
180
|
+
], StringFilterDto.prototype, "lte", void 0);
|
|
181
|
+
_ts_decorate([
|
|
182
|
+
Prop(),
|
|
183
|
+
_ts_metadata("design:type", String)
|
|
184
|
+
], StringFilterDto.prototype, "gt", void 0);
|
|
185
|
+
_ts_decorate([
|
|
186
|
+
Prop(),
|
|
187
|
+
_ts_metadata("design:type", String)
|
|
188
|
+
], StringFilterDto.prototype, "gte", void 0);
|
|
189
|
+
_ts_decorate([
|
|
190
|
+
Prop(),
|
|
191
|
+
_ts_metadata("design:type", String)
|
|
192
|
+
], StringFilterDto.prototype, "contains", void 0);
|
|
193
|
+
_ts_decorate([
|
|
194
|
+
Prop(),
|
|
195
|
+
_ts_metadata("design:type", String)
|
|
196
|
+
], StringFilterDto.prototype, "startsWith", void 0);
|
|
197
|
+
_ts_decorate([
|
|
198
|
+
Prop(),
|
|
199
|
+
_ts_metadata("design:type", String)
|
|
200
|
+
], StringFilterDto.prototype, "endsWith", void 0);
|
|
201
|
+
_ts_decorate([
|
|
202
|
+
Prop({
|
|
203
|
+
enum: ()=>QueryMode,
|
|
204
|
+
defaultValue: QueryMode.insensitive
|
|
205
|
+
}),
|
|
206
|
+
_ts_metadata("design:type", typeof QueryMode === "undefined" ? Object : QueryMode)
|
|
207
|
+
], StringFilterDto.prototype, "mode", void 0);
|
|
208
|
+
_ts_decorate([
|
|
209
|
+
Prop({
|
|
210
|
+
object: ()=>StringFilterDto
|
|
211
|
+
}),
|
|
212
|
+
_ts_metadata("design:type", Object)
|
|
213
|
+
], StringFilterDto.prototype, "not", void 0);
|
|
214
|
+
StringFilterDto = _ts_decorate([
|
|
215
|
+
InputType()
|
|
216
|
+
], StringFilterDto);
|
|
217
|
+
export class StringArrayFilterDto {
|
|
218
|
+
constructor(){
|
|
219
|
+
_define_property(this, "isEmpty", void 0);
|
|
220
|
+
_define_property(this, "has", void 0);
|
|
221
|
+
_define_property(this, "equals", void 0);
|
|
222
|
+
_define_property(this, "hasEvery", void 0);
|
|
223
|
+
_define_property(this, "hasSome", void 0);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
_ts_decorate([
|
|
227
|
+
Prop(),
|
|
228
|
+
_ts_metadata("design:type", Boolean)
|
|
229
|
+
], StringArrayFilterDto.prototype, "isEmpty", void 0);
|
|
230
|
+
_ts_decorate([
|
|
231
|
+
Prop({
|
|
232
|
+
type: ()=>String,
|
|
233
|
+
isArray: true
|
|
234
|
+
}),
|
|
235
|
+
_ts_metadata("design:type", String)
|
|
236
|
+
], StringArrayFilterDto.prototype, "has", void 0);
|
|
237
|
+
_ts_decorate([
|
|
238
|
+
Prop({
|
|
239
|
+
type: ()=>String,
|
|
240
|
+
isArray: true
|
|
241
|
+
}),
|
|
242
|
+
_ts_metadata("design:type", Array)
|
|
243
|
+
], StringArrayFilterDto.prototype, "equals", void 0);
|
|
244
|
+
_ts_decorate([
|
|
245
|
+
Prop({
|
|
246
|
+
type: ()=>String,
|
|
247
|
+
isArray: true
|
|
248
|
+
}),
|
|
249
|
+
_ts_metadata("design:type", Array)
|
|
250
|
+
], StringArrayFilterDto.prototype, "hasEvery", void 0);
|
|
251
|
+
_ts_decorate([
|
|
252
|
+
Prop({
|
|
253
|
+
type: ()=>String,
|
|
254
|
+
isArray: true
|
|
255
|
+
}),
|
|
256
|
+
_ts_metadata("design:type", Array)
|
|
257
|
+
], StringArrayFilterDto.prototype, "hasSome", void 0);
|
|
258
|
+
StringArrayFilterDto = _ts_decorate([
|
|
259
|
+
InputType()
|
|
260
|
+
], StringArrayFilterDto);
|
|
261
|
+
export class BooleanArrayFilterDto {
|
|
262
|
+
constructor(){
|
|
263
|
+
_define_property(this, "isEmpty", void 0);
|
|
264
|
+
_define_property(this, "equals", void 0);
|
|
265
|
+
_define_property(this, "hasEvery", void 0);
|
|
266
|
+
_define_property(this, "hasSome", void 0);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
_ts_decorate([
|
|
270
|
+
Prop(),
|
|
271
|
+
_ts_metadata("design:type", Boolean)
|
|
272
|
+
], BooleanArrayFilterDto.prototype, "isEmpty", void 0);
|
|
273
|
+
_ts_decorate([
|
|
274
|
+
Prop({
|
|
275
|
+
type: ()=>Boolean,
|
|
276
|
+
isArray: true
|
|
277
|
+
}),
|
|
278
|
+
_ts_metadata("design:type", Array)
|
|
279
|
+
], BooleanArrayFilterDto.prototype, "equals", void 0);
|
|
280
|
+
_ts_decorate([
|
|
281
|
+
Prop({
|
|
282
|
+
type: ()=>Boolean,
|
|
283
|
+
isArray: true
|
|
284
|
+
}),
|
|
285
|
+
_ts_metadata("design:type", Array)
|
|
286
|
+
], BooleanArrayFilterDto.prototype, "hasEvery", void 0);
|
|
287
|
+
_ts_decorate([
|
|
288
|
+
Prop({
|
|
289
|
+
type: ()=>Boolean,
|
|
290
|
+
isArray: true
|
|
291
|
+
}),
|
|
292
|
+
_ts_metadata("design:type", Array)
|
|
293
|
+
], BooleanArrayFilterDto.prototype, "hasSome", void 0);
|
|
294
|
+
BooleanArrayFilterDto = _ts_decorate([
|
|
295
|
+
InputType()
|
|
296
|
+
], BooleanArrayFilterDto);
|
|
297
|
+
export class IntArrayFilterDto {
|
|
298
|
+
constructor(){
|
|
299
|
+
_define_property(this, "isEmpty", void 0);
|
|
300
|
+
_define_property(this, "has", void 0);
|
|
301
|
+
_define_property(this, "equals", void 0);
|
|
302
|
+
_define_property(this, "hasEvery", void 0);
|
|
303
|
+
_define_property(this, "hasSome", void 0);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
_ts_decorate([
|
|
307
|
+
Prop(),
|
|
308
|
+
_ts_metadata("design:type", Boolean)
|
|
309
|
+
], IntArrayFilterDto.prototype, "isEmpty", void 0);
|
|
310
|
+
_ts_decorate([
|
|
311
|
+
Prop({
|
|
312
|
+
type: ()=>Number,
|
|
313
|
+
isArray: true
|
|
314
|
+
}),
|
|
315
|
+
_ts_metadata("design:type", Number)
|
|
316
|
+
], IntArrayFilterDto.prototype, "has", void 0);
|
|
317
|
+
_ts_decorate([
|
|
318
|
+
Prop({
|
|
319
|
+
type: ()=>Number,
|
|
320
|
+
isArray: true
|
|
321
|
+
}),
|
|
322
|
+
_ts_metadata("design:type", Array)
|
|
323
|
+
], IntArrayFilterDto.prototype, "equals", void 0);
|
|
324
|
+
_ts_decorate([
|
|
325
|
+
Prop({
|
|
326
|
+
type: ()=>Number,
|
|
327
|
+
isArray: true
|
|
328
|
+
}),
|
|
329
|
+
_ts_metadata("design:type", Array)
|
|
330
|
+
], IntArrayFilterDto.prototype, "hasEvery", void 0);
|
|
331
|
+
_ts_decorate([
|
|
332
|
+
Prop({
|
|
333
|
+
type: ()=>Number,
|
|
334
|
+
isArray: true
|
|
335
|
+
}),
|
|
336
|
+
_ts_metadata("design:type", Array)
|
|
337
|
+
], IntArrayFilterDto.prototype, "hasSome", void 0);
|
|
338
|
+
IntArrayFilterDto = _ts_decorate([
|
|
339
|
+
InputType()
|
|
340
|
+
], IntArrayFilterDto);
|
|
341
|
+
export class JsonFilterDto {
|
|
342
|
+
constructor(){
|
|
343
|
+
_define_property(this, "mode", void 0);
|
|
344
|
+
_define_property(this, "string_contains", void 0);
|
|
345
|
+
_define_property(this, "not", void 0);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
_ts_decorate([
|
|
349
|
+
Prop({
|
|
350
|
+
enum: ()=>QueryMode
|
|
351
|
+
}),
|
|
352
|
+
_ts_metadata("design:type", typeof QueryMode === "undefined" ? Object : QueryMode)
|
|
353
|
+
], JsonFilterDto.prototype, "mode", void 0);
|
|
354
|
+
_ts_decorate([
|
|
355
|
+
Prop({
|
|
356
|
+
type: ()=>String
|
|
357
|
+
}),
|
|
358
|
+
_ts_metadata("design:type", String)
|
|
359
|
+
], JsonFilterDto.prototype, "string_contains", void 0);
|
|
360
|
+
_ts_decorate([
|
|
361
|
+
Prop({
|
|
362
|
+
object: ()=>JsonFilterDto
|
|
363
|
+
}),
|
|
364
|
+
_ts_metadata("design:type", Object)
|
|
365
|
+
], JsonFilterDto.prototype, "not", void 0);
|
|
366
|
+
JsonFilterDto = _ts_decorate([
|
|
367
|
+
InputType()
|
|
368
|
+
], JsonFilterDto);
|
|
369
|
+
|
|
370
|
+
//# sourceMappingURL=filter-dtos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/filter-dtos.ts"],"sourcesContent":["import { InputType } from './input-type.js';\nimport { Prop } from './prop.js';\n\nexport const QueryMode = {\n default: 'default',\n insensitive: 'insensitive',\n} as const;\n\nexport type QueryMode = keyof typeof QueryMode;\n\n@InputType()\nexport class IntFilterDto {\n @Prop() equals?: number;\n @Prop({ type: () => Number, isArray: true }) in?: number[];\n @Prop({ type: () => Number, isArray: true }) notIn?: number[];\n @Prop() lt?: number;\n @Prop() lte?: number;\n @Prop() gt?: number;\n @Prop() gte?: number;\n @Prop({ object: () => IntFilterDto }) not?: IntFilterDto;\n}\n\n@InputType()\nexport class DateFilterDto {\n @Prop() equals?: Date;\n @Prop({ type: () => Date, isArray: true }) in?: Date[];\n @Prop({ type: () => Date, isArray: true }) notIn?: Date[];\n @Prop() lt?: Date;\n @Prop() lte?: Date;\n @Prop() gt?: Date;\n @Prop() gte?: Date;\n @Prop({ object: () => DateFilterDto }) not?: DateFilterDto;\n}\n\n@InputType()\nexport class BooleanFilterDto {\n @Prop() equals?: boolean;\n @Prop({ object: () => BooleanFilterDto }) not?: BooleanFilterDto;\n}\n\n@InputType()\nexport class StringFilterDto {\n @Prop() equals?: string;\n @Prop({ type: () => String, isArray: true }) in?: string[];\n @Prop({ type: () => String, isArray: true }) notIn?: string[];\n @Prop() lt?: string;\n @Prop() lte?: string;\n @Prop() gt?: string;\n @Prop() gte?: string;\n @Prop() contains?: string;\n @Prop() startsWith?: string;\n @Prop() endsWith?: string;\n @Prop({ enum: () => QueryMode, defaultValue: QueryMode.insensitive })\n mode?: QueryMode = QueryMode.insensitive;\n @Prop({ object: () => StringFilterDto }) not?: StringFilterDto;\n}\n\n@InputType()\nexport class StringArrayFilterDto {\n @Prop() isEmpty?: boolean;\n @Prop({ type: () => String, isArray: true }) has?: string;\n @Prop({ type: () => String, isArray: true }) equals?: string[];\n @Prop({ type: () => String, isArray: true }) hasEvery?: string[];\n @Prop({ type: () => String, isArray: true }) hasSome?: string[];\n}\n\n@InputType()\nexport class BooleanArrayFilterDto {\n @Prop() isEmpty?: boolean;\n @Prop({ type: () => Boolean, isArray: true }) equals?: boolean[];\n @Prop({ type: () => Boolean, isArray: true }) hasEvery?: boolean[];\n @Prop({ type: () => Boolean, isArray: true }) hasSome?: boolean[];\n}\n\n@InputType()\nexport class IntArrayFilterDto {\n @Prop() isEmpty?: boolean;\n @Prop({ type: () => Number, isArray: true }) has?: number;\n @Prop({ type: () => Number, isArray: true }) equals?: number[];\n @Prop({ type: () => Number, isArray: true }) hasEvery?: number[];\n @Prop({ type: () => Number, isArray: true }) hasSome?: number[];\n}\n\n@InputType()\nexport class JsonFilterDto {\n @Prop({ enum: () => QueryMode }) mode?: QueryMode;\n @Prop({ type: () => String }) string_contains?: string;\n @Prop({ object: () => JsonFilterDto }) not: JsonFilterDto;\n}\n"],"names":["InputType","Prop","QueryMode","default","insensitive","IntFilterDto","equals","in","notIn","lt","lte","gt","gte","not","type","Number","isArray","object","DateFilterDto","Date","BooleanFilterDto","StringFilterDto","contains","startsWith","endsWith","mode","String","enum","defaultValue","StringArrayFilterDto","isEmpty","has","hasEvery","hasSome","BooleanArrayFilterDto","Boolean","IntArrayFilterDto","JsonFilterDto","string_contains"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,IAAI,QAAQ,YAAY;AAEjC,OAAO,MAAMC,YAAY;IACvBC,SAAS;IACTC,aAAa;AACf,EAAW;AAKX,OAAO,MAAMC;;QACX,uBAAQC,UAAR,KAAA;QACA,uBAA6CC,MAA7C,KAAA;QACA,uBAA6CC,SAA7C,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAsCC,OAAtC,KAAA;;AACF;;;;;;;QAPUC,MAAM,IAAMC;QAAQC,SAAS;;;;;;QAC7BF,MAAM,IAAMC;QAAQC,SAAS;;;;;;;;;;;;;;;;;;;;;;QAK7BC,QAAQ,IAAMZ;;;;;;;AAIxB,OAAO,MAAMa;;QACX,uBAAQZ,UAAR,KAAA;QACA,uBAA2CC,MAA3C,KAAA;QACA,uBAA2CC,SAA3C,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAuCC,OAAvC,KAAA;;AACF;;;;;;;QAPUC,MAAM,IAAMK;QAAMH,SAAS;;;;;;QAC3BF,MAAM,IAAMK;QAAMH,SAAS;;;;;;;;;;;;;;;;;;;;;;QAK3BC,QAAQ,IAAMC;;;;;;;AAIxB,OAAO,MAAME;;QACX,uBAAQd,UAAR,KAAA;QACA,uBAA0CO,OAA1C,KAAA;;AACF;;;;;;;QADUI,QAAQ,IAAMG;;;;;;;AAIxB,OAAO,MAAMC;;QACX,uBAAQf,UAAR,KAAA;QACA,uBAA6CC,MAA7C,KAAA;QACA,uBAA6CC,SAA7C,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQU,YAAR,KAAA;QACA,uBAAQC,cAAR,KAAA;QACA,uBAAQC,YAAR,KAAA;QACA,uBACAC,QAAmBvB,UAAUE,WAAW;QACxC,uBAAyCS,OAAzC,KAAA;;AACF;;;;;;;QAZUC,MAAM,IAAMY;QAAQV,SAAS;;;;;;QAC7BF,MAAM,IAAMY;QAAQV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAQ7BW,MAAM,IAAMzB;QAAW0B,cAAc1B,UAAUE,WAAW;;;;;;QAE1Da,QAAQ,IAAMI;;;;;;;AAIxB,OAAO,MAAMQ;;QACX,uBAAQC,WAAR,KAAA;QACA,uBAA6CC,OAA7C,KAAA;QACA,uBAA6CzB,UAA7C,KAAA;QACA,uBAA6C0B,YAA7C,KAAA;QACA,uBAA6CC,WAA7C,KAAA;;AACF;;;;;;;QAJUnB,MAAM,IAAMY;QAAQV,SAAS;;;;;;QAC7BF,MAAM,IAAMY;QAAQV,SAAS;;;;;;QAC7BF,MAAM,IAAMY;QAAQV,SAAS;;;;;;QAC7BF,MAAM,IAAMY;QAAQV,SAAS;;;;;;;AAIvC,OAAO,MAAMkB;;QACX,uBAAQJ,WAAR,KAAA;QACA,uBAA8CxB,UAA9C,KAAA;QACA,uBAA8C0B,YAA9C,KAAA;QACA,uBAA8CC,WAA9C,KAAA;;AACF;;;;;;;QAHUnB,MAAM,IAAMqB;QAASnB,SAAS;;;;;;QAC9BF,MAAM,IAAMqB;QAASnB,SAAS;;;;;;QAC9BF,MAAM,IAAMqB;QAASnB,SAAS;;;;;;;AAIxC,OAAO,MAAMoB;;QACX,uBAAQN,WAAR,KAAA;QACA,uBAA6CC,OAA7C,KAAA;QACA,uBAA6CzB,UAA7C,KAAA;QACA,uBAA6C0B,YAA7C,KAAA;QACA,uBAA6CC,WAA7C,KAAA;;AACF;;;;;;;QAJUnB,MAAM,IAAMC;QAAQC,SAAS;;;;;;QAC7BF,MAAM,IAAMC;QAAQC,SAAS;;;;;;QAC7BF,MAAM,IAAMC;QAAQC,SAAS;;;;;;QAC7BF,MAAM,IAAMC;QAAQC,SAAS;;;;;;;AAIvC,OAAO,MAAMqB;;QACX,uBAAiCZ,QAAjC,KAAA;QACA,uBAA8Ba,mBAA9B,KAAA;QACA,uBAAuCzB,OAAvC,KAAA;;AACF;;;QAHUc,MAAM,IAAMzB;;;;;;QACZY,MAAM,IAAMY;;;;;;QACZT,QAAQ,IAAMoB"}
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import './register-enums.js';
|
|
2
|
+
export * from './filter-dtos.js';
|
|
1
3
|
export * from './input-type.js';
|
|
2
4
|
export * from './object-type.js';
|
|
5
|
+
export * from './prop-order-count.js';
|
|
6
|
+
export * from './prop-order.js';
|
|
3
7
|
export * from './prop.js';
|
|
8
|
+
export * from './register-enums.js';
|
|
9
|
+
export * from './sort-count.dto.js';
|
|
4
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graphql/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graphql/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
package/dist/graphql/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import './register-enums.js';
|
|
1
2
|
// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)
|
|
3
|
+
export * from './filter-dtos.js';
|
|
2
4
|
export * from './input-type.js';
|
|
3
5
|
export * from './object-type.js';
|
|
6
|
+
export * from './prop-order-count.js';
|
|
7
|
+
export * from './prop-order.js';
|
|
4
8
|
export * from './prop.js';
|
|
9
|
+
export * from './register-enums.js';
|
|
10
|
+
export * from './sort-count.dto.js';
|
|
5
11
|
|
|
6
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/graphql/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)\nexport * from './input-type.js';\nexport * from './object-type.js';\nexport * from './prop.js';\n"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,YAAY"}
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/index.ts"],"sourcesContent":["import './register-enums.js';\n\n// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)\nexport * from './filter-dtos.js';\nexport * from './input-type.js';\nexport * from './object-type.js';\nexport * from './prop-order-count.js';\nexport * from './prop-order.js';\nexport * from './prop.js';\nexport * from './register-enums.js';\nexport * from './sort-count.dto.js';\n"],"names":[],"mappings":"AAAA,OAAO,sBAAsB;AAE7B,gFAAgF;AAChF,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,YAAY;AAC1B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-order-count.d.ts","sourceRoot":"","sources":["../../src/graphql/prop-order-count.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,IAAI,iBAAiB,CAIlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/prop-order-count.ts"],"sourcesContent":["import { Prop } from './prop.js';\nimport { SortCountDto } from './sort-count.dto.js';\n\nexport function PropOrderCount(): PropertyDecorator {\n return (...args) => {\n Prop({ object: () => SortCountDto })(...args);\n };\n}\n"],"names":["Prop","SortCountDto","PropOrderCount","args","object"],"mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AACjC,SAASC,YAAY,QAAQ,sBAAsB;AAEnD,OAAO,SAASC;IACd,OAAO,CAAC,GAAGC;QACTH,KAAK;YAAEI,QAAQ,IAAMH;QAAa,MAAME;IAC1C;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-order.d.ts","sourceRoot":"","sources":["../../src/graphql/prop-order.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,IAAI,iBAAiB,CAI7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/prop-order.ts"],"sourcesContent":["import { SortOrder } from '@aenode/types';\nimport { Prop } from './prop.js';\n\nexport function PropOrder(): PropertyDecorator {\n return (...args) => {\n Prop({ enum: () => SortOrder })(...args);\n };\n}\n"],"names":["SortOrder","Prop","PropOrder","args","enum"],"mappings":"AAAA,SAASA,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,IAAI,QAAQ,YAAY;AAEjC,OAAO,SAASC;IACd,OAAO,CAAC,GAAGC;QACTF,KAAK;YAAEG,MAAM,IAAMJ;QAAU,MAAMG;IACrC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop.d.ts","sourceRoot":"","sources":["../../src/graphql/prop.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"prop.d.ts","sourceRoot":"","sources":["../../src/graphql/prop.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AAGjC;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,qBAA0B,GAAG,iBAAiB,CAiB3E"}
|
package/dist/graphql/prop.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PropValidation } from '@aenode/prop-validation';
|
|
2
|
-
import { getPropertyType } from '@aenode/reflect';
|
|
3
2
|
import { Field } from '@nestjs/graphql';
|
|
4
3
|
/**
|
|
5
4
|
* Graphql field property
|
|
@@ -8,11 +7,22 @@ import { Field } from '@nestjs/graphql';
|
|
|
8
7
|
* @returns
|
|
9
8
|
*/ export function Prop(options = {}) {
|
|
10
9
|
return (...args)=>{
|
|
11
|
-
|
|
10
|
+
var _ref;
|
|
11
|
+
const nullable = options.isRequired !== true;
|
|
12
12
|
PropValidation(options)(...args);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const { type: primitiveType, object: objectType, enum: enumType } = options;
|
|
14
|
+
const type = (_ref = primitiveType !== null && primitiveType !== void 0 ? primitiveType : enumType) !== null && _ref !== void 0 ? _ref : objectType;
|
|
15
|
+
if (type) {
|
|
16
|
+
Field(()=>type(), {
|
|
17
|
+
defaultValue: options.defaultValue,
|
|
18
|
+
nullable
|
|
19
|
+
})(...args);
|
|
20
|
+
} else {
|
|
21
|
+
Field({
|
|
22
|
+
defaultValue: options.defaultValue,
|
|
23
|
+
nullable
|
|
24
|
+
})(...args);
|
|
25
|
+
}
|
|
16
26
|
};
|
|
17
27
|
}
|
|
18
28
|
|
package/dist/graphql/prop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/graphql/prop.ts"],"sourcesContent":["import {\n PropValidation,\n type PropValidationOptions,\n} from '@aenode/prop-validation';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/prop.ts"],"sourcesContent":["import {\n PropValidation,\n type PropValidationOptions,\n} from '@aenode/prop-validation';\nimport { Field } from '@nestjs/graphql';\n\n/**\n * Graphql field property\n *\n * @param options\n * @returns\n */\nexport function Prop(options: PropValidationOptions = {}): PropertyDecorator {\n return (...args) => {\n const nullable = options.isRequired !== true;\n PropValidation(options)(...args);\n\n const { type: primitiveType, object: objectType, enum: enumType } = options;\n\n const type = primitiveType ?? enumType ?? objectType;\n\n if (type) {\n Field(() => type(), { defaultValue: options.defaultValue, nullable })(\n ...args,\n );\n } else {\n Field({ defaultValue: options.defaultValue, nullable })(...args);\n }\n };\n}\n"],"names":["PropValidation","Field","Prop","options","args","primitiveType","nullable","isRequired","type","object","objectType","enum","enumType","defaultValue"],"mappings":"AAAA,SACEA,cAAc,QAET,0BAA0B;AACjC,SAASC,KAAK,QAAQ,kBAAkB;AAExC;;;;;CAKC,GACD,OAAO,SAASC,KAAKC,UAAiC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAGC;YAMIC;QALb,MAAMC,WAAWH,QAAQI,UAAU,KAAK;QACxCP,eAAeG,YAAYC;QAE3B,MAAM,EAAEI,MAAMH,aAAa,EAAEI,QAAQC,UAAU,EAAEC,MAAMC,QAAQ,EAAE,GAAGT;QAEpE,MAAMK,QAAOH,OAAAA,0BAAAA,2BAAAA,gBAAiBO,sBAAjBP,kBAAAA,OAA6BK;QAE1C,IAAIF,MAAM;YACRP,MAAM,IAAMO,QAAQ;gBAAEK,cAAcV,QAAQU,YAAY;gBAAEP;YAAS,MAC9DF;QAEP,OAAO;YACLH,MAAM;gBAAEY,cAAcV,QAAQU,YAAY;gBAAEP;YAAS,MAAMF;QAC7D;IACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-enums.d.ts","sourceRoot":"","sources":["../../src/graphql/register-enums.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SortOrder } from '@aenode/types';
|
|
2
|
+
import { registerEnumType } from '@nestjs/graphql';
|
|
3
|
+
import { QueryMode } from './filter-dtos.js';
|
|
4
|
+
registerEnumType(SortOrder, {
|
|
5
|
+
name: 'SortOrder'
|
|
6
|
+
});
|
|
7
|
+
registerEnumType(QueryMode, {
|
|
8
|
+
name: 'QueryMode'
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=register-enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/register-enums.ts"],"sourcesContent":["import { SortOrder } from '@aenode/types';\nimport { registerEnumType } from '@nestjs/graphql';\nimport { QueryMode } from './filter-dtos.js';\n\nregisterEnumType(SortOrder, {\n name: 'SortOrder',\n});\n\nregisterEnumType(QueryMode, {\n name: 'QueryMode',\n});\n"],"names":["SortOrder","registerEnumType","QueryMode","name"],"mappings":"AAAA,SAASA,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,SAAS,QAAQ,mBAAmB;AAE7CD,iBAAiBD,WAAW;IAC1BG,MAAM;AACR;AAEAF,iBAAiBC,WAAW;IAC1BC,MAAM;AACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-count.dto.d.ts","sourceRoot":"","sources":["../../src/graphql/sort-count.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,qBACa,YAAY;IACU,MAAM,CAAC,EAAE,SAAS,CAAC;CACrD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
3
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
4
|
+
import { SortOrder } from '@aenode/types';
|
|
5
|
+
import { InputType } from '@nestjs/graphql';
|
|
6
|
+
import { Prop } from './prop.js';
|
|
7
|
+
export class SortCountDto {
|
|
8
|
+
constructor(){
|
|
9
|
+
_define_property(this, "_count", void 0);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
_ts_decorate([
|
|
13
|
+
Prop({
|
|
14
|
+
enum: ()=>SortOrder
|
|
15
|
+
}),
|
|
16
|
+
_ts_metadata("design:type", typeof SortOrder === "undefined" ? Object : SortOrder)
|
|
17
|
+
], SortCountDto.prototype, "_count", void 0);
|
|
18
|
+
SortCountDto = _ts_decorate([
|
|
19
|
+
InputType()
|
|
20
|
+
], SortCountDto);
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=sort-count.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/graphql/sort-count.dto.ts"],"sourcesContent":["import { SortOrder } from '@aenode/types';\nimport { InputType } from '@nestjs/graphql';\nimport { Prop } from './prop.js';\n\n@InputType()\nexport class SortCountDto {\n @Prop({ enum: () => SortOrder }) _count?: SortOrder;\n}\n"],"names":["SortOrder","InputType","Prop","SortCountDto","_count","enum"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,IAAI,QAAQ,YAAY;AAGjC,OAAO,MAAMC;;QACX,uBAAiCC,UAAjC,KAAA;;AACF;;;QADUC,MAAM,IAAML"}
|
package/dist/peers.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peers.d.ts","sourceRoot":"","sources":["../src/peers.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC"}
|
package/dist/peers.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/peers.ts"],"sourcesContent":["import '@aenode/reflect';\n"],"names":[],"mappings":"AAAA,OAAO,kBAAkB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const QueryMode: {
|
|
2
|
+
readonly default: "default";
|
|
3
|
+
readonly insensitive: "insensitive";
|
|
4
|
+
};
|
|
5
|
+
export type QueryMode = keyof typeof QueryMode;
|
|
6
|
+
export declare class IntFilterDto {
|
|
7
|
+
equals?: number;
|
|
8
|
+
in?: number[];
|
|
9
|
+
notIn?: number[];
|
|
10
|
+
lt?: number;
|
|
11
|
+
lte?: number;
|
|
12
|
+
gt?: number;
|
|
13
|
+
gte?: number;
|
|
14
|
+
not?: IntFilterDto;
|
|
15
|
+
}
|
|
16
|
+
export declare class DateFilterDto {
|
|
17
|
+
equals?: Date;
|
|
18
|
+
in?: Date[];
|
|
19
|
+
notIn?: Date[];
|
|
20
|
+
lt?: Date;
|
|
21
|
+
lte?: Date;
|
|
22
|
+
gt?: Date;
|
|
23
|
+
gte?: Date;
|
|
24
|
+
not?: DateFilterDto;
|
|
25
|
+
}
|
|
26
|
+
export declare class BooleanFilterDto {
|
|
27
|
+
equals?: boolean;
|
|
28
|
+
not?: BooleanFilterDto;
|
|
29
|
+
}
|
|
30
|
+
export declare class StringFilterDto {
|
|
31
|
+
equals?: string;
|
|
32
|
+
in?: string[];
|
|
33
|
+
notIn?: string[];
|
|
34
|
+
lt?: string;
|
|
35
|
+
lte?: string;
|
|
36
|
+
gt?: string;
|
|
37
|
+
gte?: string;
|
|
38
|
+
contains?: string;
|
|
39
|
+
startsWith?: string;
|
|
40
|
+
endsWith?: string;
|
|
41
|
+
mode?: QueryMode;
|
|
42
|
+
not?: StringFilterDto;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=filter-dtos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-dtos.d.ts","sourceRoot":"","sources":["../../src/restapi/filter-dtos.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,SAAS,CAAC;AAE/C,qBAAa,YAAY;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IACqB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACiB,GAAG,CAAC,EAAE,YAAY,CAAC;CAC1D;AAED,qBAAa,aAAa;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;IACqB,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IAClD,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,qBAAa,gBAAgB;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACiB,GAAG,CAAC,EAAE,gBAAgB,CAAC;CAClE;AAED,qBAAa,eAAe;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IACqB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IACO,IAAI,CAAC,EAAE,SAAS,CAAC;IACT,GAAG,CAAC,EAAE,eAAe,CAAC;CAChE"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
3
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
4
|
+
import { Prop } from './prop.js';
|
|
5
|
+
export const QueryMode = {
|
|
6
|
+
default: 'default',
|
|
7
|
+
insensitive: 'insensitive'
|
|
8
|
+
};
|
|
9
|
+
export class IntFilterDto {
|
|
10
|
+
constructor(){
|
|
11
|
+
_define_property(this, "equals", void 0);
|
|
12
|
+
_define_property(this, "in", void 0);
|
|
13
|
+
_define_property(this, "notIn", void 0);
|
|
14
|
+
_define_property(this, "lt", void 0);
|
|
15
|
+
_define_property(this, "lte", void 0);
|
|
16
|
+
_define_property(this, "gt", void 0);
|
|
17
|
+
_define_property(this, "gte", void 0);
|
|
18
|
+
_define_property(this, "not", void 0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
_ts_decorate([
|
|
22
|
+
Prop(),
|
|
23
|
+
_ts_metadata("design:type", Number)
|
|
24
|
+
], IntFilterDto.prototype, "equals", void 0);
|
|
25
|
+
_ts_decorate([
|
|
26
|
+
Prop({
|
|
27
|
+
type: ()=>Number,
|
|
28
|
+
isArray: true
|
|
29
|
+
}),
|
|
30
|
+
_ts_metadata("design:type", Array)
|
|
31
|
+
], IntFilterDto.prototype, "in", void 0);
|
|
32
|
+
_ts_decorate([
|
|
33
|
+
Prop({
|
|
34
|
+
type: ()=>Number,
|
|
35
|
+
isArray: true
|
|
36
|
+
}),
|
|
37
|
+
_ts_metadata("design:type", Array)
|
|
38
|
+
], IntFilterDto.prototype, "notIn", void 0);
|
|
39
|
+
_ts_decorate([
|
|
40
|
+
Prop(),
|
|
41
|
+
_ts_metadata("design:type", Number)
|
|
42
|
+
], IntFilterDto.prototype, "lt", void 0);
|
|
43
|
+
_ts_decorate([
|
|
44
|
+
Prop(),
|
|
45
|
+
_ts_metadata("design:type", Number)
|
|
46
|
+
], IntFilterDto.prototype, "lte", void 0);
|
|
47
|
+
_ts_decorate([
|
|
48
|
+
Prop(),
|
|
49
|
+
_ts_metadata("design:type", Number)
|
|
50
|
+
], IntFilterDto.prototype, "gt", void 0);
|
|
51
|
+
_ts_decorate([
|
|
52
|
+
Prop(),
|
|
53
|
+
_ts_metadata("design:type", Number)
|
|
54
|
+
], IntFilterDto.prototype, "gte", void 0);
|
|
55
|
+
_ts_decorate([
|
|
56
|
+
Prop({
|
|
57
|
+
object: ()=>IntFilterDto
|
|
58
|
+
}),
|
|
59
|
+
_ts_metadata("design:type", Object)
|
|
60
|
+
], IntFilterDto.prototype, "not", void 0);
|
|
61
|
+
export class DateFilterDto {
|
|
62
|
+
constructor(){
|
|
63
|
+
_define_property(this, "equals", void 0);
|
|
64
|
+
_define_property(this, "in", void 0);
|
|
65
|
+
_define_property(this, "notIn", void 0);
|
|
66
|
+
_define_property(this, "lt", void 0);
|
|
67
|
+
_define_property(this, "lte", void 0);
|
|
68
|
+
_define_property(this, "gt", void 0);
|
|
69
|
+
_define_property(this, "gte", void 0);
|
|
70
|
+
_define_property(this, "not", void 0);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_ts_decorate([
|
|
74
|
+
Prop(),
|
|
75
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
76
|
+
], DateFilterDto.prototype, "equals", void 0);
|
|
77
|
+
_ts_decorate([
|
|
78
|
+
Prop({
|
|
79
|
+
type: ()=>Date,
|
|
80
|
+
isArray: true
|
|
81
|
+
}),
|
|
82
|
+
_ts_metadata("design:type", Array)
|
|
83
|
+
], DateFilterDto.prototype, "in", void 0);
|
|
84
|
+
_ts_decorate([
|
|
85
|
+
Prop({
|
|
86
|
+
type: ()=>Date,
|
|
87
|
+
isArray: true
|
|
88
|
+
}),
|
|
89
|
+
_ts_metadata("design:type", Array)
|
|
90
|
+
], DateFilterDto.prototype, "notIn", void 0);
|
|
91
|
+
_ts_decorate([
|
|
92
|
+
Prop(),
|
|
93
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
94
|
+
], DateFilterDto.prototype, "lt", void 0);
|
|
95
|
+
_ts_decorate([
|
|
96
|
+
Prop(),
|
|
97
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
98
|
+
], DateFilterDto.prototype, "lte", void 0);
|
|
99
|
+
_ts_decorate([
|
|
100
|
+
Prop(),
|
|
101
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
102
|
+
], DateFilterDto.prototype, "gt", void 0);
|
|
103
|
+
_ts_decorate([
|
|
104
|
+
Prop(),
|
|
105
|
+
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
|
106
|
+
], DateFilterDto.prototype, "gte", void 0);
|
|
107
|
+
_ts_decorate([
|
|
108
|
+
Prop(),
|
|
109
|
+
_ts_metadata("design:type", Object)
|
|
110
|
+
], DateFilterDto.prototype, "not", void 0);
|
|
111
|
+
export class BooleanFilterDto {
|
|
112
|
+
constructor(){
|
|
113
|
+
_define_property(this, "equals", void 0);
|
|
114
|
+
_define_property(this, "not", void 0);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
_ts_decorate([
|
|
118
|
+
Prop(),
|
|
119
|
+
_ts_metadata("design:type", Boolean)
|
|
120
|
+
], BooleanFilterDto.prototype, "equals", void 0);
|
|
121
|
+
_ts_decorate([
|
|
122
|
+
Prop({
|
|
123
|
+
object: ()=>BooleanFilterDto
|
|
124
|
+
}),
|
|
125
|
+
_ts_metadata("design:type", Object)
|
|
126
|
+
], BooleanFilterDto.prototype, "not", void 0);
|
|
127
|
+
export class StringFilterDto {
|
|
128
|
+
constructor(){
|
|
129
|
+
_define_property(this, "equals", void 0);
|
|
130
|
+
_define_property(this, "in", void 0);
|
|
131
|
+
_define_property(this, "notIn", void 0);
|
|
132
|
+
_define_property(this, "lt", void 0);
|
|
133
|
+
_define_property(this, "lte", void 0);
|
|
134
|
+
_define_property(this, "gt", void 0);
|
|
135
|
+
_define_property(this, "gte", void 0);
|
|
136
|
+
_define_property(this, "contains", void 0);
|
|
137
|
+
_define_property(this, "startsWith", void 0);
|
|
138
|
+
_define_property(this, "endsWith", void 0);
|
|
139
|
+
_define_property(this, "mode", void 0);
|
|
140
|
+
_define_property(this, "not", void 0);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
_ts_decorate([
|
|
144
|
+
Prop(),
|
|
145
|
+
_ts_metadata("design:type", String)
|
|
146
|
+
], StringFilterDto.prototype, "equals", void 0);
|
|
147
|
+
_ts_decorate([
|
|
148
|
+
Prop({
|
|
149
|
+
type: ()=>String,
|
|
150
|
+
isArray: true
|
|
151
|
+
}),
|
|
152
|
+
_ts_metadata("design:type", Array)
|
|
153
|
+
], StringFilterDto.prototype, "in", void 0);
|
|
154
|
+
_ts_decorate([
|
|
155
|
+
Prop({
|
|
156
|
+
type: ()=>String,
|
|
157
|
+
isArray: true
|
|
158
|
+
}),
|
|
159
|
+
_ts_metadata("design:type", Array)
|
|
160
|
+
], StringFilterDto.prototype, "notIn", void 0);
|
|
161
|
+
_ts_decorate([
|
|
162
|
+
Prop(),
|
|
163
|
+
_ts_metadata("design:type", String)
|
|
164
|
+
], StringFilterDto.prototype, "lt", void 0);
|
|
165
|
+
_ts_decorate([
|
|
166
|
+
Prop(),
|
|
167
|
+
_ts_metadata("design:type", String)
|
|
168
|
+
], StringFilterDto.prototype, "lte", void 0);
|
|
169
|
+
_ts_decorate([
|
|
170
|
+
Prop(),
|
|
171
|
+
_ts_metadata("design:type", String)
|
|
172
|
+
], StringFilterDto.prototype, "gt", void 0);
|
|
173
|
+
_ts_decorate([
|
|
174
|
+
Prop(),
|
|
175
|
+
_ts_metadata("design:type", String)
|
|
176
|
+
], StringFilterDto.prototype, "gte", void 0);
|
|
177
|
+
_ts_decorate([
|
|
178
|
+
Prop(),
|
|
179
|
+
_ts_metadata("design:type", String)
|
|
180
|
+
], StringFilterDto.prototype, "contains", void 0);
|
|
181
|
+
_ts_decorate([
|
|
182
|
+
Prop(),
|
|
183
|
+
_ts_metadata("design:type", String)
|
|
184
|
+
], StringFilterDto.prototype, "startsWith", void 0);
|
|
185
|
+
_ts_decorate([
|
|
186
|
+
Prop(),
|
|
187
|
+
_ts_metadata("design:type", String)
|
|
188
|
+
], StringFilterDto.prototype, "endsWith", void 0);
|
|
189
|
+
_ts_decorate([
|
|
190
|
+
Prop({
|
|
191
|
+
enum: ()=>QueryMode
|
|
192
|
+
}),
|
|
193
|
+
_ts_metadata("design:type", typeof QueryMode === "undefined" ? Object : QueryMode)
|
|
194
|
+
], StringFilterDto.prototype, "mode", void 0);
|
|
195
|
+
_ts_decorate([
|
|
196
|
+
Prop({
|
|
197
|
+
object: ()=>StringFilterDto
|
|
198
|
+
}),
|
|
199
|
+
_ts_metadata("design:type", Object)
|
|
200
|
+
], StringFilterDto.prototype, "not", void 0);
|
|
201
|
+
|
|
202
|
+
//# sourceMappingURL=filter-dtos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/restapi/filter-dtos.ts"],"sourcesContent":["import { Prop } from './prop.js';\n\nexport const QueryMode = {\n default: 'default',\n insensitive: 'insensitive',\n} as const;\n\nexport type QueryMode = keyof typeof QueryMode;\n\nexport class IntFilterDto {\n @Prop() equals?: number;\n @Prop({ type: () => Number, isArray: true }) in?: number[];\n @Prop({ type: () => Number, isArray: true }) notIn?: number[];\n @Prop() lt?: number;\n @Prop() lte?: number;\n @Prop() gt?: number;\n @Prop() gte?: number;\n @Prop({ object: () => IntFilterDto }) not?: IntFilterDto;\n}\n\nexport class DateFilterDto {\n @Prop() equals?: Date;\n @Prop({ type: () => Date, isArray: true }) in?: Date[];\n @Prop({ type: () => Date, isArray: true }) notIn?: Date[];\n @Prop() lt?: Date;\n @Prop() lte?: Date;\n @Prop() gt?: Date;\n @Prop() gte?: Date;\n @Prop() not?: DateFilterDto;\n}\n\nexport class BooleanFilterDto {\n @Prop() equals?: boolean;\n @Prop({ object: () => BooleanFilterDto }) not?: BooleanFilterDto;\n}\n\nexport class StringFilterDto {\n @Prop() equals?: string;\n @Prop({ type: () => String, isArray: true }) in?: string[];\n @Prop({ type: () => String, isArray: true }) notIn?: string[];\n @Prop() lt?: string;\n @Prop() lte?: string;\n @Prop() gt?: string;\n @Prop() gte?: string;\n @Prop() contains?: string;\n @Prop() startsWith?: string;\n @Prop() endsWith?: string;\n @Prop({ enum: () => QueryMode }) mode?: QueryMode;\n @Prop({ object: () => StringFilterDto }) not?: StringFilterDto;\n}\n"],"names":["Prop","QueryMode","default","insensitive","IntFilterDto","equals","in","notIn","lt","lte","gt","gte","not","type","Number","isArray","object","DateFilterDto","Date","BooleanFilterDto","StringFilterDto","contains","startsWith","endsWith","mode","String","enum"],"mappings":";;;AAAA,SAASA,IAAI,QAAQ,YAAY;AAEjC,OAAO,MAAMC,YAAY;IACvBC,SAAS;IACTC,aAAa;AACf,EAAW;AAIX,OAAO,MAAMC;;QACX,uBAAQC,UAAR,KAAA;QACA,uBAA6CC,MAA7C,KAAA;QACA,uBAA6CC,SAA7C,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAsCC,OAAtC,KAAA;;AACF;;;;;;;QAPUC,MAAM,IAAMC;QAAQC,SAAS;;;;;;QAC7BF,MAAM,IAAMC;QAAQC,SAAS;;;;;;;;;;;;;;;;;;;;;;QAK7BC,QAAQ,IAAMZ;;;;AAGxB,OAAO,MAAMa;;QACX,uBAAQZ,UAAR,KAAA;QACA,uBAA2CC,MAA3C,KAAA;QACA,uBAA2CC,SAA3C,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;;AACF;;;;;;;QAPUC,MAAM,IAAMK;QAAMH,SAAS;;;;;;QAC3BF,MAAM,IAAMK;QAAMH,SAAS;;;;;;;;;;;;;;;;;;;;;;;;AAQrC,OAAO,MAAMI;;QACX,uBAAQd,UAAR,KAAA;QACA,uBAA0CO,OAA1C,KAAA;;AACF;;;;;;;QADUI,QAAQ,IAAMG;;;;AAGxB,OAAO,MAAMC;;QACX,uBAAQf,UAAR,KAAA;QACA,uBAA6CC,MAA7C,KAAA;QACA,uBAA6CC,SAA7C,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQC,MAAR,KAAA;QACA,uBAAQC,OAAR,KAAA;QACA,uBAAQU,YAAR,KAAA;QACA,uBAAQC,cAAR,KAAA;QACA,uBAAQC,YAAR,KAAA;QACA,uBAAiCC,QAAjC,KAAA;QACA,uBAAyCZ,OAAzC,KAAA;;AACF;;;;;;;QAXUC,MAAM,IAAMY;QAAQV,SAAS;;;;;;QAC7BF,MAAM,IAAMY;QAAQV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAQ7BW,MAAM,IAAMzB;;;;;;QACZe,QAAQ,IAAMI"}
|
package/dist/restapi/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/restapi/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/restapi/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC"}
|
package/dist/restapi/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)
|
|
2
|
+
export * from './filter-dtos.js';
|
|
3
|
+
export * from './prop-order-count.js';
|
|
4
|
+
export * from './prop-order.js';
|
|
1
5
|
export * from './prop.js';
|
|
6
|
+
export * from './sort-count.dto.js';
|
|
7
|
+
export * from './to-api-property-options.js';
|
|
2
8
|
|
|
3
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/restapi/index.ts"],"sourcesContent":["export * from './prop.js';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY"}
|
|
1
|
+
{"version":3,"sources":["../../src/restapi/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)\nexport * from './filter-dtos.js';\nexport * from './prop-order-count.js';\nexport * from './prop-order.js';\nexport * from './prop.js';\nexport * from './sort-count.dto.js';\nexport * from './to-api-property-options.js';\n"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc,mBAAmB;AACjC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,YAAY;AAC1B,cAAc,sBAAsB;AACpC,cAAc,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-order-count.d.ts","sourceRoot":"","sources":["../../src/restapi/prop-order-count.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,IAAI,iBAAiB,CAIlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/restapi/prop-order-count.ts"],"sourcesContent":["import { Prop } from './prop.js';\nimport { SortCountDto } from './sort-count.dto.js';\n\nexport function PropOrderCount(): PropertyDecorator {\n return (...args) => {\n Prop({ object: () => SortCountDto })(...args);\n };\n}\n"],"names":["Prop","SortCountDto","PropOrderCount","args","object"],"mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AACjC,SAASC,YAAY,QAAQ,sBAAsB;AAEnD,OAAO,SAASC;IACd,OAAO,CAAC,GAAGC;QACTH,KAAK;YAAEI,QAAQ,IAAMH;QAAa,MAAME;IAC1C;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-order.d.ts","sourceRoot":"","sources":["../../src/restapi/prop-order.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,IAAI,iBAAiB,CAI7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/restapi/prop-order.ts"],"sourcesContent":["import { SortOrder } from '@aenode/types';\nimport { Prop } from './prop.js';\n\nexport function PropOrder(): PropertyDecorator {\n return (...args) => {\n Prop({ enum: () => SortOrder })(...args);\n };\n}\n"],"names":["SortOrder","Prop","PropOrder","args","enum"],"mappings":"AAAA,SAASA,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,IAAI,QAAQ,YAAY;AAEjC,OAAO,SAASC;IACd,OAAO,CAAC,GAAGC;QACTF,KAAK;YAAEG,MAAM,IAAMJ;QAAU,MAAMG;IACrC;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-count.dto.d.ts","sourceRoot":"","sources":["../../src/restapi/sort-count.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,qBAAa,YAAY;IACU,MAAM,CAAC,EAAE,SAAS,CAAC;CACrD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
3
|
+
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
|
|
4
|
+
import { SortOrder } from '@aenode/types';
|
|
5
|
+
import { Prop } from './prop.js';
|
|
6
|
+
export class SortCountDto {
|
|
7
|
+
constructor(){
|
|
8
|
+
_define_property(this, "_count", void 0);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
_ts_decorate([
|
|
12
|
+
Prop({
|
|
13
|
+
enum: ()=>SortOrder
|
|
14
|
+
}),
|
|
15
|
+
_ts_metadata("design:type", typeof SortOrder === "undefined" ? Object : SortOrder)
|
|
16
|
+
], SortCountDto.prototype, "_count", void 0);
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=sort-count.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/restapi/sort-count.dto.ts"],"sourcesContent":["import { SortOrder } from '@aenode/types';\nimport { Prop } from './prop.js';\n\nexport class SortCountDto {\n @Prop({ enum: () => SortOrder }) _count?: SortOrder;\n}\n"],"names":["SortOrder","Prop","SortCountDto","_count","enum"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,IAAI,QAAQ,YAAY;AAEjC,OAAO,MAAMC;;QACX,uBAAiCC,UAAjC,KAAA;;AACF;;;QADUC,MAAM,IAAMJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-api-property-options.d.ts","sourceRoot":"","sources":["../../src/restapi/to-api-property-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAC7B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"to-api-property-options.d.ts","sourceRoot":"","sources":["../../src/restapi/to-api-property-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAC7B,kBAAkB,CAgCpB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
1
3
|
export function toApiPropertyOptions(options) {
|
|
2
4
|
const required = options.isRequired === true;
|
|
3
|
-
|
|
4
|
-
type: options.type,
|
|
5
|
+
const common = {
|
|
5
6
|
required,
|
|
6
7
|
nullable: required === false,
|
|
7
8
|
minLength: options.minLength,
|
|
@@ -15,6 +16,22 @@ export function toApiPropertyOptions(options) {
|
|
|
15
16
|
minItems: options.minItems,
|
|
16
17
|
description: options.description
|
|
17
18
|
};
|
|
19
|
+
if (options.type) {
|
|
20
|
+
return _object_spread_props(_object_spread({}, common), {
|
|
21
|
+
type: options.type
|
|
22
|
+
});
|
|
23
|
+
} else if (options.enum) {
|
|
24
|
+
return _object_spread_props(_object_spread({}, common), {
|
|
25
|
+
enum: options.enum
|
|
26
|
+
});
|
|
27
|
+
} else if (options.object) {
|
|
28
|
+
return _object_spread_props(_object_spread({}, common), {
|
|
29
|
+
type: options.object
|
|
30
|
+
});
|
|
31
|
+
} else if (options.isArray) {
|
|
32
|
+
throw new Error(`One of type, enum, or object option must be provided for an array properties`);
|
|
33
|
+
}
|
|
34
|
+
return _object_spread({}, common);
|
|
18
35
|
}
|
|
19
36
|
|
|
20
37
|
//# sourceMappingURL=to-api-property-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/restapi/to-api-property-options.ts"],"sourcesContent":["import { type PropValidationOptions } from '@aenode/prop-validation';\nimport { type ApiPropertyOptions } from '@nestjs/swagger';\n\nexport function toApiPropertyOptions(\n options: PropValidationOptions,\n): ApiPropertyOptions {\n const required = options.isRequired === true;\n\n
|
|
1
|
+
{"version":3,"sources":["../../src/restapi/to-api-property-options.ts"],"sourcesContent":["import { type PropValidationOptions } from '@aenode/prop-validation';\nimport { type ApiPropertyOptions } from '@nestjs/swagger';\n\nexport function toApiPropertyOptions(\n options: PropValidationOptions,\n): ApiPropertyOptions {\n const required = options.isRequired === true;\n\n const common: ApiPropertyOptions = {\n required,\n\n nullable: required === false,\n minLength: options.minLength,\n maxLength: options.maxLength,\n maximum: options.max,\n minimum: options.min,\n format: options.format,\n default: options.defaultValue,\n pattern: options.pattern,\n maxItems: options.maxItems,\n minItems: options.minItems,\n description: options.description,\n };\n\n if (options.type) {\n return { ...common, type: options.type };\n } else if (options.enum) {\n return { ...common, enum: options.enum };\n } else if (options.object) {\n return { ...common, type: options.object };\n } else if (options.isArray) {\n throw new Error(\n `One of type, enum, or object option must be provided for an array properties`,\n );\n }\n\n return { ...common };\n}\n"],"names":["toApiPropertyOptions","options","required","isRequired","common","nullable","minLength","maxLength","maximum","max","minimum","min","format","default","defaultValue","pattern","maxItems","minItems","description","type","enum","object","isArray","Error"],"mappings":";;AAGA,OAAO,SAASA,qBACdC,OAA8B;IAE9B,MAAMC,WAAWD,QAAQE,UAAU,KAAK;IAExC,MAAMC,SAA6B;QACjCF;QAEAG,UAAUH,aAAa;QACvBI,WAAWL,QAAQK,SAAS;QAC5BC,WAAWN,QAAQM,SAAS;QAC5BC,SAASP,QAAQQ,GAAG;QACpBC,SAAST,QAAQU,GAAG;QACpBC,QAAQX,QAAQW,MAAM;QACtBC,SAASZ,QAAQa,YAAY;QAC7BC,SAASd,QAAQc,OAAO;QACxBC,UAAUf,QAAQe,QAAQ;QAC1BC,UAAUhB,QAAQgB,QAAQ;QAC1BC,aAAajB,QAAQiB,WAAW;IAClC;IAEA,IAAIjB,QAAQkB,IAAI,EAAE;QAChB,OAAO,wCAAKf;YAAQe,MAAMlB,QAAQkB,IAAI;;IACxC,OAAO,IAAIlB,QAAQmB,IAAI,EAAE;QACvB,OAAO,wCAAKhB;YAAQgB,MAAMnB,QAAQmB,IAAI;;IACxC,OAAO,IAAInB,QAAQoB,MAAM,EAAE;QACzB,OAAO,wCAAKjB;YAAQe,MAAMlB,QAAQoB,MAAM;;IAC1C,OAAO,IAAIpB,QAAQqB,OAAO,EAAE;QAC1B,MAAM,IAAIC,MACR,CAAC,4EAA4E,CAAC;IAElF;IAEA,OAAO,mBAAKnB;AACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aenode/prop",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Nestjs/Graphql data transfer object property decorators",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types"
|
|
@@ -66,14 +66,15 @@
|
|
|
66
66
|
"@nestjs/common": "^11.2.1",
|
|
67
67
|
"@nestjs/graphql": "^13.4.5",
|
|
68
68
|
"@nestjs/swagger": "^11.4.7",
|
|
69
|
-
"@aenode/prop-validation": "0.0.
|
|
70
|
-
"@aenode/reflect": "0.0.
|
|
71
|
-
"@aenode/types": "0.0.
|
|
69
|
+
"@aenode/prop-validation": "0.0.21",
|
|
70
|
+
"@aenode/reflect": "0.0.21",
|
|
71
|
+
"@aenode/types": "0.0.21"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@nestjs/graphql": "^13.4.5",
|
|
75
75
|
"@nestjs/swagger": "^11.4.7",
|
|
76
|
-
"@aenode/
|
|
77
|
-
"@aenode/
|
|
76
|
+
"@aenode/types": "0.0.21",
|
|
77
|
+
"@aenode/prop-validation": "0.0.21",
|
|
78
|
+
"@aenode/reflect": "0.0.21"
|
|
78
79
|
}
|
|
79
80
|
}
|