@ackplus/nest-crud-request 1.1.1 → 1.1.2
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/package.json +2 -2
- package/src/index.d.ts.map +1 -0
- package/src/lib/query-builder.d.ts.map +1 -0
- package/src/lib/relation-builder.d.ts.map +1 -0
- package/src/lib/types.d.ts +1 -0
- package/src/lib/types.d.ts.map +1 -0
- package/src/lib/utils.d.ts.map +1 -0
- package/src/lib/where-builder.d.ts.map +1 -0
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- package/dist/lib/query-builder.d.ts.map +0 -1
- package/dist/lib/query-builder.js +0 -169
- package/dist/lib/relation-builder.d.ts.map +0 -1
- package/dist/lib/relation-builder.js +0 -58
- package/dist/lib/types.d.ts +0 -53
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js +0 -31
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -11
- package/dist/lib/where-builder.d.ts.map +0 -1
- package/dist/lib/where-builder.js +0 -146
- package/eslint.config.mjs +0 -22
- package/jest.config.ts +0 -10
- package/project.json +0 -46
- package/src/index.ts +0 -3
- package/src/lib/query-builder.ts +0 -189
- package/src/lib/relation-builder.ts +0 -68
- package/src/lib/types.js +0 -35
- package/src/lib/types.js.map +0 -1
- package/src/lib/types.ts +0 -61
- package/src/lib/utils.ts +0 -11
- package/src/lib/where-builder.ts +0 -159
- package/src/test/query-builder-where.spec.ts +0 -173
- package/src/test/query-builder.spec.ts +0 -140
- package/src/test/relation-builder.spec.ts +0 -32
- package/src/test/where-builder-complex.spec.ts +0 -173
- package/tsconfig.json +0 -17
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -15
- /package/{dist → src}/index.d.ts +0 -0
- /package/{dist → src}/lib/query-builder.d.ts +0 -0
- /package/{dist → src}/lib/relation-builder.d.ts +0 -0
- /package/{dist → src}/lib/utils.d.ts +0 -0
- /package/{dist → src}/lib/where-builder.d.ts +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/nest-crud-request/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/nest-crud-request/src/lib/query-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,EAAgB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGtE,qBAAa,YAAY;IAErB,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,YAAY,CAAoC;IAExD,OAAO,CAAC,eAAe,CAA0C;gBAErD,OAAO,CAAC,EAAE,mBAAmB;IAMzC,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAO9C,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,UAAQ,GAAG,IAAI;IAc9D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAa1C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAY7C,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAKnF,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKtC,KAAK,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK3C,QAAQ,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK9C,OAAO,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK7C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAQ1D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAOlC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;IAK1C,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;IAK1C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAKlC,QAAQ,CAAC,uBAAuB,UAAQ;;;;;;;;;;;IAoDxC,MAAM;CAKT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/nest-crud-request/src/lib/relation-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/E,qBAAa,eAAe;IAExB,OAAO,CAAC,SAAS,CAAsB;gBAE3B,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM;IAOhD,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI;IAe9C,KAAK,IAAI,IAAI;IAKb,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAgB3E,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAK9B,YAAY,IAAI,OAAO;IAIvB,QAAQ,IAAI,cAAc;IAI1B,MAAM,IAAI,MAAM;CAInB"}
|
package/src/lib/types.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../packages/nest-crud-request/src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACrC,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,MAAM,CAAC;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,oBAAY,wBAAwB;IAChC,GAAG,SAAS;IACZ,EAAE,QAAQ;CACb;AAED,oBAAY,iBAAiB;IACzB,EAAE,QAAQ;IACV,MAAM,QAAQ;IACd,EAAE,QAAQ;IACV,QAAQ,SAAS;IACjB,EAAE,QAAQ;IACV,QAAQ,SAAS;IACjB,EAAE,QAAQ;IACV,MAAM,WAAW;IACjB,IAAI,UAAU;IACd,QAAQ,aAAa;IACrB,KAAK,WAAW;IAChB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,WAAW,eAAe;IAC1B,OAAO,aAAa;IACpB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACxB;AAED,oBAAY,kBAAkB;IAC1B,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACnC,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,WAAW,EAAE,CAAC;AAGvD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../packages/nest-crud-request/src/lib/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAUvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"where-builder.d.ts","sourceRoot":"","sources":["../../../../../packages/nest-crud-request/src/lib/where-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;AAEjJ,qBAAa,YAAY;IAErB,OAAO,CAAC,WAAW,CAA2B;gBAElC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAIhD,OAAO,CAAC,UAAU;IAIlB,KAAK,IAAI,IAAI;IAKb,KAAK,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK3C,QAAQ,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK9C,OAAO,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK7C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAehC,aAAa,IAAI,OAAO;IAIxB,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI/B,MAAM,IAAI,MAAM;IAIhB,OAAO,CAAC,cAAc;IAuDtB,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,eAAe;CA0B1B"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-builder.d.ts","sourceRoot":"","sources":["../../src/lib/query-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,EAAgB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGtE,qBAAa,YAAY;IAErB,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,YAAY,CAAoC;IAExD,OAAO,CAAC,eAAe,CAA0C;gBAErD,OAAO,CAAC,EAAE,mBAAmB;IAMzC,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAO9C,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,UAAQ,GAAG,IAAI;IAc9D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAa1C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAY7C,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAKnF,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKtC,KAAK,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK3C,QAAQ,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK9C,OAAO,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK7C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAQ1D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAOlC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;IAK1C,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;IAK1C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAKlC,QAAQ,CAAC,uBAAuB,UAAQ;;;;;;;;;;;IAoDxC,MAAM;CAKT"}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { RelationBuilder } from './relation-builder';
|
|
2
|
-
import { deepMerge } from './utils';
|
|
3
|
-
import { WhereBuilder } from './where-builder';
|
|
4
|
-
export class QueryBuilder {
|
|
5
|
-
options = {};
|
|
6
|
-
whereBuilder = new WhereBuilder();
|
|
7
|
-
relationBuilder = new RelationBuilder();
|
|
8
|
-
constructor(options) {
|
|
9
|
-
if (options) {
|
|
10
|
-
this.setOptions(options);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
setOptions(options) {
|
|
14
|
-
this.options = options;
|
|
15
|
-
this.whereBuilder = new WhereBuilder(options.where);
|
|
16
|
-
this.relationBuilder = new RelationBuilder(options.relations);
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
mergeOptions(options, deep = false) {
|
|
20
|
-
let updatedOptions = {};
|
|
21
|
-
if (deep) {
|
|
22
|
-
updatedOptions = deepMerge(this.options, options);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
updatedOptions = {
|
|
26
|
-
...this.options,
|
|
27
|
-
...options,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
this.setOptions(updatedOptions);
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
addSelect(fields) {
|
|
34
|
-
// Ensure select is always an array
|
|
35
|
-
if (!this.options.select || typeof this.options.select === 'string') {
|
|
36
|
-
this.options.select = [];
|
|
37
|
-
}
|
|
38
|
-
if (Array.isArray(fields)) {
|
|
39
|
-
this.options.select.push(...fields);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.options.select.push(fields);
|
|
43
|
-
}
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
removeSelect(fields) {
|
|
47
|
-
// Ensure select is an array before filtering
|
|
48
|
-
if (this.options.select && Array.isArray(this.options.select)) {
|
|
49
|
-
if (Array.isArray(fields)) {
|
|
50
|
-
this.options.select = this.options.select.filter(field => !fields.includes(field));
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.options.select = this.options.select.filter(field => field !== fields);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
addRelation(relation, select, where) {
|
|
59
|
-
this.relationBuilder.add(relation, select, where);
|
|
60
|
-
return this;
|
|
61
|
-
}
|
|
62
|
-
removeRelation(relation) {
|
|
63
|
-
this.relationBuilder.remove(relation);
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
where(...args) {
|
|
67
|
-
this.whereBuilder.where(...args);
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
andWhere(...args) {
|
|
71
|
-
this.whereBuilder.andWhere(...args);
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
orWhere(...args) {
|
|
75
|
-
this.whereBuilder.orWhere(...args);
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
addOrder(orderBy, order) {
|
|
79
|
-
if (!this.options.order) {
|
|
80
|
-
this.options.order = {};
|
|
81
|
-
}
|
|
82
|
-
this.options.order[orderBy] = order;
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
removeOrder(orderBy) {
|
|
86
|
-
if (this.options.order) {
|
|
87
|
-
delete this.options.order[orderBy];
|
|
88
|
-
}
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
setSkip(skip) {
|
|
92
|
-
this.options.skip = skip;
|
|
93
|
-
return this;
|
|
94
|
-
}
|
|
95
|
-
setTake(take) {
|
|
96
|
-
this.options.take = take;
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
setWithDeleted(withDeleted) {
|
|
100
|
-
this.options.withDeleted = withDeleted;
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
setOnlyDeleted(onlyDeleted) {
|
|
104
|
-
this.options.onlyDeleted = onlyDeleted;
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
set(key, value) {
|
|
108
|
-
this.options[key] = value;
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
|
-
toObject(constrainToNestedObject = false) {
|
|
112
|
-
const options = {
|
|
113
|
-
...this.options,
|
|
114
|
-
};
|
|
115
|
-
// Convert where conditions to JSON string
|
|
116
|
-
if (this.whereBuilder.hasConditions()) {
|
|
117
|
-
if (constrainToNestedObject) {
|
|
118
|
-
options.where = this.whereBuilder.toObject();
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
options.where = JSON.stringify(this.whereBuilder.toObject());
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
delete options.where;
|
|
126
|
-
}
|
|
127
|
-
// Convert relations to JSON string
|
|
128
|
-
if (this.relationBuilder.hasRelations()) {
|
|
129
|
-
if (constrainToNestedObject) {
|
|
130
|
-
options.relations = this.relationBuilder.toObject();
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
options.relations = JSON.stringify(this.relationBuilder.toObject());
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
delete options.relations;
|
|
138
|
-
}
|
|
139
|
-
// Convert order to JSON string if it exists
|
|
140
|
-
if (options.order && Object.keys(options.order).length > 0) {
|
|
141
|
-
if (constrainToNestedObject) {
|
|
142
|
-
options.order = options.order;
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
options.order = JSON.stringify(options.order);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
delete options.order;
|
|
150
|
-
}
|
|
151
|
-
// Convert select to JSON string if it exists
|
|
152
|
-
if (options.select && options.select.length > 0) {
|
|
153
|
-
if (constrainToNestedObject) {
|
|
154
|
-
options.select = options.select;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
options.select = JSON.stringify(options.select);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
delete options.select;
|
|
162
|
-
}
|
|
163
|
-
return options;
|
|
164
|
-
}
|
|
165
|
-
toJson() {
|
|
166
|
-
const obj = this.toObject(true);
|
|
167
|
-
return JSON.stringify(obj);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relation-builder.d.ts","sourceRoot":"","sources":["../../src/lib/relation-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/E,qBAAa,eAAe;IAExB,OAAO,CAAC,SAAS,CAAsB;gBAE3B,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM;IAOhD,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI;IAe9C,KAAK,IAAI,IAAI;IAKb,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAgB3E,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAK9B,YAAY,IAAI,OAAO;IAIvB,QAAQ,IAAI,cAAc;IAI1B,MAAM,IAAI,MAAM;CAInB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export class RelationBuilder {
|
|
2
|
-
relations = {};
|
|
3
|
-
constructor(relations) {
|
|
4
|
-
if (relations) {
|
|
5
|
-
const relationOptions = typeof relations === 'string' ? JSON.parse(relations) : relations;
|
|
6
|
-
this.setRelations(relationOptions);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
setRelations(relations) {
|
|
10
|
-
if (relations) {
|
|
11
|
-
if (Array.isArray(relations)) {
|
|
12
|
-
relations.forEach(relation => {
|
|
13
|
-
this.add(relation);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
else if (typeof relations === 'string') {
|
|
17
|
-
this.add(relations);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.relations = relations;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
clear() {
|
|
26
|
-
this.relations = {};
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
add(relation, select, where) {
|
|
30
|
-
if (!select && !where) {
|
|
31
|
-
this.relations[relation] = true;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
const obj = {};
|
|
35
|
-
if (select) {
|
|
36
|
-
obj.select = select;
|
|
37
|
-
}
|
|
38
|
-
if (where) {
|
|
39
|
-
obj.where = where;
|
|
40
|
-
}
|
|
41
|
-
this.relations[relation] = obj;
|
|
42
|
-
}
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
remove(relation) {
|
|
46
|
-
delete this.relations[relation];
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
hasRelations() {
|
|
50
|
-
return Object.keys(this.relations).length > 0;
|
|
51
|
-
}
|
|
52
|
-
toObject() {
|
|
53
|
-
return this.relations;
|
|
54
|
-
}
|
|
55
|
-
toJson() {
|
|
56
|
-
return JSON.stringify(this.relations);
|
|
57
|
-
}
|
|
58
|
-
}
|
package/dist/lib/types.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export interface QueryBuilderOptions {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
select?: string[] | string;
|
|
4
|
-
relations?: RelationOptions | string;
|
|
5
|
-
where?: WhereOptions | string;
|
|
6
|
-
order?: Record<string, OrderDirectionEnum> | string;
|
|
7
|
-
skip?: number;
|
|
8
|
-
take?: number;
|
|
9
|
-
withDeleted?: boolean;
|
|
10
|
-
onlyDeleted?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare enum WhereLogicalOperatorEnum {
|
|
13
|
-
AND = "$and",
|
|
14
|
-
OR = "$or"
|
|
15
|
-
}
|
|
16
|
-
export declare enum WhereOperatorEnum {
|
|
17
|
-
EQ = "$eq",
|
|
18
|
-
NOT_EQ = "$ne",
|
|
19
|
-
GT = "$gt",
|
|
20
|
-
GT_OR_EQ = "$gte",
|
|
21
|
-
LT = "$lt",
|
|
22
|
-
LT_OR_EQ = "$lte",
|
|
23
|
-
IN = "$in",
|
|
24
|
-
NOT_IN = "$notIn",
|
|
25
|
-
LIKE = "$like",
|
|
26
|
-
NOT_LIKE = "$notLike",
|
|
27
|
-
ILIKE = "$iLike",
|
|
28
|
-
NOT_ILIKE = "$notIlike",
|
|
29
|
-
IS_NULL = "$isNull",
|
|
30
|
-
IS_NOT_NULL = "$isNotNull",
|
|
31
|
-
BETWEEN = "$between",
|
|
32
|
-
NOT_BETWEEN = "$notBetween",
|
|
33
|
-
IS_TRUE = "$isTrue",
|
|
34
|
-
IS_FALSE = "$isFalse"
|
|
35
|
-
}
|
|
36
|
-
export declare enum OrderDirectionEnum {
|
|
37
|
-
ASC = "ASC",
|
|
38
|
-
DESC = "DESC"
|
|
39
|
-
}
|
|
40
|
-
export type WhereObject = {
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
$and?: WhereObject | WhereObject[];
|
|
43
|
-
$or?: WhereObject | WhereObject[];
|
|
44
|
-
};
|
|
45
|
-
export type WhereOptions = WhereObject | WhereObject[];
|
|
46
|
-
export type RelationObjectValue = {
|
|
47
|
-
select?: string[];
|
|
48
|
-
where?: WhereObject | WhereObject[];
|
|
49
|
-
joinType?: 'left' | 'inner';
|
|
50
|
-
};
|
|
51
|
-
export type RelationObject = Record<string, RelationObjectValue | boolean>;
|
|
52
|
-
export type RelationOptions = string | string[] | RelationObject;
|
|
53
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/lib/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACrC,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,MAAM,CAAC;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,oBAAY,wBAAwB;IAChC,GAAG,SAAS;IACZ,EAAE,QAAQ;CACb;AAED,oBAAY,iBAAiB;IACzB,EAAE,QAAQ;IACV,MAAM,QAAQ;IACd,EAAE,QAAQ;IACV,QAAQ,SAAS;IACjB,EAAE,QAAQ;IACV,QAAQ,SAAS;IACjB,EAAE,QAAQ;IACV,MAAM,WAAW;IACjB,IAAI,UAAU;IACd,QAAQ,aAAa;IACrB,KAAK,WAAW;IAChB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,WAAW,eAAe;IAC1B,OAAO,aAAa;IACpB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACxB;AAED,oBAAY,kBAAkB;IAC1B,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED,MAAM,MAAM,WAAW,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACnC,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,WAAW,EAAE,CAAC;AAGvD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC"}
|
package/dist/lib/types.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export var WhereLogicalOperatorEnum;
|
|
2
|
-
(function (WhereLogicalOperatorEnum) {
|
|
3
|
-
WhereLogicalOperatorEnum["AND"] = "$and";
|
|
4
|
-
WhereLogicalOperatorEnum["OR"] = "$or";
|
|
5
|
-
})(WhereLogicalOperatorEnum || (WhereLogicalOperatorEnum = {}));
|
|
6
|
-
export var WhereOperatorEnum;
|
|
7
|
-
(function (WhereOperatorEnum) {
|
|
8
|
-
WhereOperatorEnum["EQ"] = "$eq";
|
|
9
|
-
WhereOperatorEnum["NOT_EQ"] = "$ne";
|
|
10
|
-
WhereOperatorEnum["GT"] = "$gt";
|
|
11
|
-
WhereOperatorEnum["GT_OR_EQ"] = "$gte";
|
|
12
|
-
WhereOperatorEnum["LT"] = "$lt";
|
|
13
|
-
WhereOperatorEnum["LT_OR_EQ"] = "$lte";
|
|
14
|
-
WhereOperatorEnum["IN"] = "$in";
|
|
15
|
-
WhereOperatorEnum["NOT_IN"] = "$notIn";
|
|
16
|
-
WhereOperatorEnum["LIKE"] = "$like";
|
|
17
|
-
WhereOperatorEnum["NOT_LIKE"] = "$notLike";
|
|
18
|
-
WhereOperatorEnum["ILIKE"] = "$iLike";
|
|
19
|
-
WhereOperatorEnum["NOT_ILIKE"] = "$notIlike";
|
|
20
|
-
WhereOperatorEnum["IS_NULL"] = "$isNull";
|
|
21
|
-
WhereOperatorEnum["IS_NOT_NULL"] = "$isNotNull";
|
|
22
|
-
WhereOperatorEnum["BETWEEN"] = "$between";
|
|
23
|
-
WhereOperatorEnum["NOT_BETWEEN"] = "$notBetween";
|
|
24
|
-
WhereOperatorEnum["IS_TRUE"] = "$isTrue";
|
|
25
|
-
WhereOperatorEnum["IS_FALSE"] = "$isFalse";
|
|
26
|
-
})(WhereOperatorEnum || (WhereOperatorEnum = {}));
|
|
27
|
-
export var OrderDirectionEnum;
|
|
28
|
-
(function (OrderDirectionEnum) {
|
|
29
|
-
OrderDirectionEnum["ASC"] = "ASC";
|
|
30
|
-
OrderDirectionEnum["DESC"] = "DESC";
|
|
31
|
-
})(OrderDirectionEnum || (OrderDirectionEnum = {}));
|
package/dist/lib/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAUvD"}
|
package/dist/lib/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"where-builder.d.ts","sourceRoot":"","sources":["../../src/lib/where-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,CAAC;AAEjJ,qBAAa,YAAY;IAErB,OAAO,CAAC,WAAW,CAA2B;gBAElC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAIhD,OAAO,CAAC,UAAU;IAIlB,KAAK,IAAI,IAAI;IAKb,KAAK,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK3C,QAAQ,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK9C,OAAO,CAAC,GAAG,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK7C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAehC,aAAa,IAAI,OAAO;IAIxB,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI/B,MAAM,IAAI,MAAM;IAIhB,OAAO,CAAC,cAAc;IAuDtB,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,eAAe;CA0B1B"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { WhereLogicalOperatorEnum, WhereOperatorEnum } from './types';
|
|
2
|
-
export class WhereBuilder {
|
|
3
|
-
whereObject = {};
|
|
4
|
-
constructor(where) {
|
|
5
|
-
this.whereObject = typeof where === 'string' ? JSON.parse(where) : where || {};
|
|
6
|
-
}
|
|
7
|
-
isOperator(value) {
|
|
8
|
-
return `${value}`.startsWith('$');
|
|
9
|
-
}
|
|
10
|
-
clear() {
|
|
11
|
-
this.whereObject = {};
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
where(...args) {
|
|
15
|
-
this.parseCondition(null, ...args);
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
andWhere(...args) {
|
|
19
|
-
this.parseCondition(WhereLogicalOperatorEnum.AND, ...args);
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
orWhere(...args) {
|
|
23
|
-
this.parseCondition(WhereLogicalOperatorEnum.OR, ...args);
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
removeWhere(field) {
|
|
27
|
-
const keys = field.split('.');
|
|
28
|
-
let current = this.whereObject;
|
|
29
|
-
for (let i = 0; i < keys.length - 1; i++) {
|
|
30
|
-
if (!current[keys[i]]) {
|
|
31
|
-
return this; // If the path doesn't exist, do nothing
|
|
32
|
-
}
|
|
33
|
-
current = current[keys[i]];
|
|
34
|
-
}
|
|
35
|
-
delete current[keys[keys.length - 1]];
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
hasConditions() {
|
|
39
|
-
return Object.keys(this.whereObject).length > 0;
|
|
40
|
-
}
|
|
41
|
-
toObject() {
|
|
42
|
-
return this.whereObject;
|
|
43
|
-
}
|
|
44
|
-
toJson() {
|
|
45
|
-
return JSON.stringify(this.whereObject);
|
|
46
|
-
}
|
|
47
|
-
parseCondition(type, ...args) {
|
|
48
|
-
let field;
|
|
49
|
-
let operator;
|
|
50
|
-
let value;
|
|
51
|
-
if (args.length === 0) {
|
|
52
|
-
// Do nothing
|
|
53
|
-
}
|
|
54
|
-
else if (args.length === 1) {
|
|
55
|
-
const condition = args[0];
|
|
56
|
-
if (typeof condition === 'function') {
|
|
57
|
-
// If the condition is a function, create a new WhereBuilder and call the function with it
|
|
58
|
-
const builder = new WhereBuilder();
|
|
59
|
-
condition(builder);
|
|
60
|
-
this.updateCondition(builder.toObject(), type);
|
|
61
|
-
}
|
|
62
|
-
else if (condition instanceof WhereBuilder) {
|
|
63
|
-
// If the condition is a WhereBuilder
|
|
64
|
-
this.updateCondition(condition.toObject(), type);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// If the condition is a simple object
|
|
68
|
-
this.updateCondition(condition, type);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else if (args.length === 2 || args.length === 3) {
|
|
72
|
-
if (args.length === 2) {
|
|
73
|
-
// if there are only two arguments, the operator is EQ
|
|
74
|
-
field = args[0];
|
|
75
|
-
value = args[1];
|
|
76
|
-
if (typeof value === 'object') {
|
|
77
|
-
const firstKey = Object.keys(value)[0];
|
|
78
|
-
// if the first key is a operator, update the value with the operator
|
|
79
|
-
if (firstKey.startsWith('$')) {
|
|
80
|
-
this.updateCondition({ [field]: value }, type);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.updateCondition({ [field]: { [WhereOperatorEnum.EQ]: value } }, type);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else if (this.isOperator(value)) {
|
|
87
|
-
this.updateCondition({ [field]: { [value]: true } }, type);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
this.updateCondition({ [field]: { [WhereOperatorEnum.EQ]: value } }, type);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
// if there are three arguments, the operator is the second argument
|
|
95
|
-
field = args[0];
|
|
96
|
-
operator = args[1];
|
|
97
|
-
value = args[2];
|
|
98
|
-
this.updateCondition({ [field]: { [operator]: value } }, type);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
// private updateCondition(condition: Record<string, any>, type: '$and' | '$or'): void {
|
|
104
|
-
// this.whereObject[type] = [...(this.whereObject[type] || []), condition].filter(Boolean);
|
|
105
|
-
// }
|
|
106
|
-
updateCondition(condition, type) {
|
|
107
|
-
if (type === null) {
|
|
108
|
-
// For direct where conditions, we need to merge intelligently
|
|
109
|
-
this.mergeConditions(this.whereObject, condition);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
// For logical operators ($and, $or), add to the array
|
|
113
|
-
this.whereObject[type] = [...(this.whereObject[type] || []), condition].filter(Boolean);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Intelligently merge two condition objects, handling logical operators properly
|
|
118
|
-
*/
|
|
119
|
-
mergeConditions(target, source) {
|
|
120
|
-
for (const key in source) {
|
|
121
|
-
const sourceValue = source[key];
|
|
122
|
-
if (key === '$and' || key === '$or') {
|
|
123
|
-
// Handle logical operators - merge arrays
|
|
124
|
-
if (target[key]) {
|
|
125
|
-
// If target already has this logical operator, merge the arrays
|
|
126
|
-
target[key] = [...(target[key] || []), ...(Array.isArray(sourceValue) ? sourceValue : [sourceValue])];
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
// If target doesn't have this logical operator, set it
|
|
130
|
-
target[key] = Array.isArray(sourceValue) ? sourceValue : [sourceValue];
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
// Handle regular field conditions
|
|
135
|
-
if (target[key] && typeof target[key] === 'object' && typeof sourceValue === 'object') {
|
|
136
|
-
// If both target and source have the same field with object values, merge them
|
|
137
|
-
target[key] = { ...target[key], ...sourceValue };
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
// Otherwise, simply assign the value
|
|
141
|
-
target[key] = sourceValue;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
package/eslint.config.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import baseConfig from '../../eslint.base.config';
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
...baseConfig,
|
|
5
|
-
{
|
|
6
|
-
files: ['**/*.json'],
|
|
7
|
-
rules: {
|
|
8
|
-
'@nx/dependency-checks': [
|
|
9
|
-
'error',
|
|
10
|
-
{
|
|
11
|
-
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}'],
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
languageOptions: {
|
|
16
|
-
parser: await import('jsonc-eslint-parser'),
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
ignores: ['**/out-tsc'],
|
|
21
|
-
},
|
|
22
|
-
];
|
package/jest.config.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
displayName: 'nest-crud-request',
|
|
3
|
-
preset: '../../jest.preset.js',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
transform: {
|
|
6
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
|
7
|
-
},
|
|
8
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
9
|
-
coverageDirectory: '../../coverage/packages/nest-crud-request',
|
|
10
|
-
};
|
package/project.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nest-crud-request",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/nest-crud-request/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"release": {
|
|
7
|
-
"version": {
|
|
8
|
-
"manifestRootsToUpdate": [
|
|
9
|
-
"dist/{projectRoot}"
|
|
10
|
-
],
|
|
11
|
-
"currentVersionResolver": "git-tag",
|
|
12
|
-
"fallbackCurrentVersionResolver": "disk"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"tags": [],
|
|
16
|
-
"targets": {
|
|
17
|
-
"build": {
|
|
18
|
-
"executor": "@nx/js:tsc",
|
|
19
|
-
"outputs": [
|
|
20
|
-
"{options.outputPath}"
|
|
21
|
-
],
|
|
22
|
-
"options": {
|
|
23
|
-
"outputPath": "dist/packages/nest-crud-request",
|
|
24
|
-
"main": "packages/nest-crud-request/src/index.ts",
|
|
25
|
-
"tsConfig": "packages/nest-crud-request/tsconfig.lib.json",
|
|
26
|
-
"assets": [
|
|
27
|
-
"packages/nest-crud-request/*.md"
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"nx-release-publish": {
|
|
32
|
-
"options": {
|
|
33
|
-
"packageRoot": "dist/{projectRoot}"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"test": {
|
|
37
|
-
"executor": "@nx/jest:jest",
|
|
38
|
-
"outputs": [
|
|
39
|
-
"{workspaceRoot}/coverage/{projectRoot}"
|
|
40
|
-
],
|
|
41
|
-
"options": {
|
|
42
|
-
"jestConfig": "packages/nest-crud-request/jest.config.ts"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
package/src/index.ts
DELETED