@cuboapp/api-backend 1.0.8 → 1.0.9
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-lock.json +512 -0
- package/package.json +7 -10
- package/src/constants/index.ts +73 -2
- package/src/helpers/convert.ts +24 -49
- package/src/helpers/data.ts +3 -4
- package/src/helpers/index.ts +189 -47
- package/src/helpers/withes.ts +3 -3
- package/src/index.ts +45 -103
- package/src/types/basic.ts +1 -1
- package/src/types/db.ts +3 -1
- package/pnpm-lock.yaml +0 -378
- package/src/constants/backend.ts +0 -74
- package/src/constants/base.ts +0 -11
- package/src/helpers/entities.ts +0 -30
- package/src/helpers/query.ts +0 -157
- package/src/helpers/users.ts +0 -37
- package/src/utils/index.ts +0 -128
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cuboapp/api-backend",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "@cuboapp/api-backend",
|
|
9
|
+
"version": "1.0.8",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@cuboapp/config": "^0.0.9",
|
|
13
|
+
"@cuboapp/constants": "../constants",
|
|
14
|
+
"@cuboapp/database": "../database",
|
|
15
|
+
"@cuboapp/types": "../types",
|
|
16
|
+
"@cuboapp/utils": "../utils",
|
|
17
|
+
"pg": "^8.16.3",
|
|
18
|
+
"sequelize": "^6.37.7"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^22.0.0",
|
|
22
|
+
"typescript": "^5.8.2"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"../constants": {
|
|
26
|
+
"name": "@cuboapp/constants",
|
|
27
|
+
"version": "2.0.2",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@cuboapp/types": "2.0.2"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"../database": {
|
|
34
|
+
"name": "@cuboapp/database",
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"sequelize": "^6.37.7"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^24.0.0",
|
|
42
|
+
"typescript": "^5.9.3"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"../types": {
|
|
46
|
+
"name": "@cuboapp/types",
|
|
47
|
+
"version": "2.0.4",
|
|
48
|
+
"license": "MIT"
|
|
49
|
+
},
|
|
50
|
+
"../utils": {
|
|
51
|
+
"name": "@cuboapp/utils",
|
|
52
|
+
"version": "1.0.3",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/node": "^24.9.1",
|
|
56
|
+
"typescript": "^5.9.3"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"node_modules/@cuboapp/config": {
|
|
60
|
+
"version": "0.0.9",
|
|
61
|
+
"resolved": "https://registry.npmjs.org/@cuboapp/config/-/config-0.0.9.tgz",
|
|
62
|
+
"integrity": "sha512-xkCZFOGTO6E8FhowmebthZ50deslWyak6HxhSPGUqktRazMa/6DVyZnTFQBs4Xt271GBXoRekXy8xNGVJnzCrg==",
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@cuboapp/types": "1.0.21",
|
|
66
|
+
"dotenv": "^16.4.7",
|
|
67
|
+
"dotenv-expand": "^12.0.1"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"node_modules/@cuboapp/config/node_modules/@cuboapp/types": {
|
|
71
|
+
"version": "1.0.21",
|
|
72
|
+
"resolved": "https://registry.npmjs.org/@cuboapp/types/-/types-1.0.21.tgz",
|
|
73
|
+
"integrity": "sha512-DIxfZRAEVX+PupP86Lii6lQXZ+CC6MWDxNUOO1FSWfJVqphXtvW52DFguhd9tu+TN50sHYS/BcjMLD1nJXw4KQ==",
|
|
74
|
+
"license": "MIT",
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@types/events": "^3.0.3"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"node_modules/@cuboapp/constants": {
|
|
80
|
+
"resolved": "../constants",
|
|
81
|
+
"link": true
|
|
82
|
+
},
|
|
83
|
+
"node_modules/@cuboapp/database": {
|
|
84
|
+
"resolved": "../database",
|
|
85
|
+
"link": true
|
|
86
|
+
},
|
|
87
|
+
"node_modules/@cuboapp/types": {
|
|
88
|
+
"resolved": "../types",
|
|
89
|
+
"link": true
|
|
90
|
+
},
|
|
91
|
+
"node_modules/@cuboapp/utils": {
|
|
92
|
+
"resolved": "../utils",
|
|
93
|
+
"link": true
|
|
94
|
+
},
|
|
95
|
+
"node_modules/@types/debug": {
|
|
96
|
+
"version": "4.1.12",
|
|
97
|
+
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz",
|
|
98
|
+
"integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==",
|
|
99
|
+
"license": "MIT",
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"@types/ms": "*"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"node_modules/@types/events": {
|
|
105
|
+
"version": "3.0.3",
|
|
106
|
+
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz",
|
|
107
|
+
"integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==",
|
|
108
|
+
"license": "MIT"
|
|
109
|
+
},
|
|
110
|
+
"node_modules/@types/ms": {
|
|
111
|
+
"version": "2.1.0",
|
|
112
|
+
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
|
|
113
|
+
"integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
|
|
114
|
+
"license": "MIT"
|
|
115
|
+
},
|
|
116
|
+
"node_modules/@types/node": {
|
|
117
|
+
"version": "22.19.1",
|
|
118
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.1.tgz",
|
|
119
|
+
"integrity": "sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==",
|
|
120
|
+
"license": "MIT",
|
|
121
|
+
"dependencies": {
|
|
122
|
+
"undici-types": "~6.21.0"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"node_modules/@types/validator": {
|
|
126
|
+
"version": "13.15.9",
|
|
127
|
+
"resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.9.tgz",
|
|
128
|
+
"integrity": "sha512-9ENIuq9PUX45M1QRtfJDprgfErED4fBiMPmjlPci4W9WiBelVtHYCjF3xkQNcSnmUeuruLS1kH6hSl5M1vz4Sw==",
|
|
129
|
+
"license": "MIT"
|
|
130
|
+
},
|
|
131
|
+
"node_modules/debug": {
|
|
132
|
+
"version": "4.4.3",
|
|
133
|
+
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
|
134
|
+
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
|
135
|
+
"license": "MIT",
|
|
136
|
+
"dependencies": {
|
|
137
|
+
"ms": "^2.1.3"
|
|
138
|
+
},
|
|
139
|
+
"engines": {
|
|
140
|
+
"node": ">=6.0"
|
|
141
|
+
},
|
|
142
|
+
"peerDependenciesMeta": {
|
|
143
|
+
"supports-color": {
|
|
144
|
+
"optional": true
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"node_modules/dotenv": {
|
|
149
|
+
"version": "16.6.1",
|
|
150
|
+
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",
|
|
151
|
+
"integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",
|
|
152
|
+
"license": "BSD-2-Clause",
|
|
153
|
+
"engines": {
|
|
154
|
+
"node": ">=12"
|
|
155
|
+
},
|
|
156
|
+
"funding": {
|
|
157
|
+
"url": "https://dotenvx.com"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"node_modules/dotenv-expand": {
|
|
161
|
+
"version": "12.0.3",
|
|
162
|
+
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.3.tgz",
|
|
163
|
+
"integrity": "sha512-uc47g4b+4k/M/SeaW1y4OApx+mtLWl92l5LMPP0GNXctZqELk+YGgOPIIC5elYmUH4OuoK3JLhuRUYegeySiFA==",
|
|
164
|
+
"license": "BSD-2-Clause",
|
|
165
|
+
"dependencies": {
|
|
166
|
+
"dotenv": "^16.4.5"
|
|
167
|
+
},
|
|
168
|
+
"engines": {
|
|
169
|
+
"node": ">=12"
|
|
170
|
+
},
|
|
171
|
+
"funding": {
|
|
172
|
+
"url": "https://dotenvx.com"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"node_modules/dottie": {
|
|
176
|
+
"version": "2.0.6",
|
|
177
|
+
"resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz",
|
|
178
|
+
"integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==",
|
|
179
|
+
"license": "MIT"
|
|
180
|
+
},
|
|
181
|
+
"node_modules/inflection": {
|
|
182
|
+
"version": "1.13.4",
|
|
183
|
+
"resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz",
|
|
184
|
+
"integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==",
|
|
185
|
+
"engines": [
|
|
186
|
+
"node >= 0.4.0"
|
|
187
|
+
],
|
|
188
|
+
"license": "MIT"
|
|
189
|
+
},
|
|
190
|
+
"node_modules/lodash": {
|
|
191
|
+
"version": "4.17.21",
|
|
192
|
+
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
|
193
|
+
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
|
194
|
+
"license": "MIT"
|
|
195
|
+
},
|
|
196
|
+
"node_modules/moment": {
|
|
197
|
+
"version": "2.30.1",
|
|
198
|
+
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
|
|
199
|
+
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
|
|
200
|
+
"license": "MIT",
|
|
201
|
+
"engines": {
|
|
202
|
+
"node": "*"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"node_modules/moment-timezone": {
|
|
206
|
+
"version": "0.5.48",
|
|
207
|
+
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.48.tgz",
|
|
208
|
+
"integrity": "sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==",
|
|
209
|
+
"license": "MIT",
|
|
210
|
+
"dependencies": {
|
|
211
|
+
"moment": "^2.29.4"
|
|
212
|
+
},
|
|
213
|
+
"engines": {
|
|
214
|
+
"node": "*"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"node_modules/ms": {
|
|
218
|
+
"version": "2.1.3",
|
|
219
|
+
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
|
220
|
+
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
|
221
|
+
"license": "MIT"
|
|
222
|
+
},
|
|
223
|
+
"node_modules/pg": {
|
|
224
|
+
"version": "8.16.3",
|
|
225
|
+
"resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz",
|
|
226
|
+
"integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==",
|
|
227
|
+
"license": "MIT",
|
|
228
|
+
"dependencies": {
|
|
229
|
+
"pg-connection-string": "^2.9.1",
|
|
230
|
+
"pg-pool": "^3.10.1",
|
|
231
|
+
"pg-protocol": "^1.10.3",
|
|
232
|
+
"pg-types": "2.2.0",
|
|
233
|
+
"pgpass": "1.0.5"
|
|
234
|
+
},
|
|
235
|
+
"engines": {
|
|
236
|
+
"node": ">= 16.0.0"
|
|
237
|
+
},
|
|
238
|
+
"optionalDependencies": {
|
|
239
|
+
"pg-cloudflare": "^1.2.7"
|
|
240
|
+
},
|
|
241
|
+
"peerDependencies": {
|
|
242
|
+
"pg-native": ">=3.0.1"
|
|
243
|
+
},
|
|
244
|
+
"peerDependenciesMeta": {
|
|
245
|
+
"pg-native": {
|
|
246
|
+
"optional": true
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"node_modules/pg-cloudflare": {
|
|
251
|
+
"version": "1.2.7",
|
|
252
|
+
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz",
|
|
253
|
+
"integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==",
|
|
254
|
+
"license": "MIT",
|
|
255
|
+
"optional": true
|
|
256
|
+
},
|
|
257
|
+
"node_modules/pg-connection-string": {
|
|
258
|
+
"version": "2.9.1",
|
|
259
|
+
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz",
|
|
260
|
+
"integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==",
|
|
261
|
+
"license": "MIT"
|
|
262
|
+
},
|
|
263
|
+
"node_modules/pg-int8": {
|
|
264
|
+
"version": "1.0.1",
|
|
265
|
+
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
|
|
266
|
+
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
|
|
267
|
+
"license": "ISC",
|
|
268
|
+
"engines": {
|
|
269
|
+
"node": ">=4.0.0"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"node_modules/pg-pool": {
|
|
273
|
+
"version": "3.10.1",
|
|
274
|
+
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz",
|
|
275
|
+
"integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==",
|
|
276
|
+
"license": "MIT",
|
|
277
|
+
"peerDependencies": {
|
|
278
|
+
"pg": ">=8.0"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"node_modules/pg-protocol": {
|
|
282
|
+
"version": "1.10.3",
|
|
283
|
+
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz",
|
|
284
|
+
"integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==",
|
|
285
|
+
"license": "MIT"
|
|
286
|
+
},
|
|
287
|
+
"node_modules/pg-types": {
|
|
288
|
+
"version": "2.2.0",
|
|
289
|
+
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
|
|
290
|
+
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
|
|
291
|
+
"license": "MIT",
|
|
292
|
+
"dependencies": {
|
|
293
|
+
"pg-int8": "1.0.1",
|
|
294
|
+
"postgres-array": "~2.0.0",
|
|
295
|
+
"postgres-bytea": "~1.0.0",
|
|
296
|
+
"postgres-date": "~1.0.4",
|
|
297
|
+
"postgres-interval": "^1.1.0"
|
|
298
|
+
},
|
|
299
|
+
"engines": {
|
|
300
|
+
"node": ">=4"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"node_modules/pgpass": {
|
|
304
|
+
"version": "1.0.5",
|
|
305
|
+
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
|
|
306
|
+
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
|
|
307
|
+
"license": "MIT",
|
|
308
|
+
"dependencies": {
|
|
309
|
+
"split2": "^4.1.0"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"node_modules/postgres-array": {
|
|
313
|
+
"version": "2.0.0",
|
|
314
|
+
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
|
|
315
|
+
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
|
|
316
|
+
"license": "MIT",
|
|
317
|
+
"engines": {
|
|
318
|
+
"node": ">=4"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"node_modules/postgres-bytea": {
|
|
322
|
+
"version": "1.0.0",
|
|
323
|
+
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
|
|
324
|
+
"integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==",
|
|
325
|
+
"license": "MIT",
|
|
326
|
+
"engines": {
|
|
327
|
+
"node": ">=0.10.0"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
"node_modules/postgres-date": {
|
|
331
|
+
"version": "1.0.7",
|
|
332
|
+
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
|
|
333
|
+
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
|
|
334
|
+
"license": "MIT",
|
|
335
|
+
"engines": {
|
|
336
|
+
"node": ">=0.10.0"
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"node_modules/postgres-interval": {
|
|
340
|
+
"version": "1.2.0",
|
|
341
|
+
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
|
|
342
|
+
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
|
|
343
|
+
"license": "MIT",
|
|
344
|
+
"dependencies": {
|
|
345
|
+
"xtend": "^4.0.0"
|
|
346
|
+
},
|
|
347
|
+
"engines": {
|
|
348
|
+
"node": ">=0.10.0"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"node_modules/retry-as-promised": {
|
|
352
|
+
"version": "7.1.1",
|
|
353
|
+
"resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.1.1.tgz",
|
|
354
|
+
"integrity": "sha512-hMD7odLOt3LkTjcif8aRZqi/hybjpLNgSk5oF5FCowfCjok6LukpN2bDX7R5wDmbgBQFn7YoBxSagmtXHaJYJw==",
|
|
355
|
+
"license": "MIT"
|
|
356
|
+
},
|
|
357
|
+
"node_modules/semver": {
|
|
358
|
+
"version": "7.7.3",
|
|
359
|
+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
|
|
360
|
+
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
|
|
361
|
+
"license": "ISC",
|
|
362
|
+
"bin": {
|
|
363
|
+
"semver": "bin/semver.js"
|
|
364
|
+
},
|
|
365
|
+
"engines": {
|
|
366
|
+
"node": ">=10"
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"node_modules/sequelize": {
|
|
370
|
+
"version": "6.37.7",
|
|
371
|
+
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.7.tgz",
|
|
372
|
+
"integrity": "sha512-mCnh83zuz7kQxxJirtFD7q6Huy6liPanI67BSlbzSYgVNl5eXVdE2CN1FuAeZwG1SNpGsNRCV+bJAVVnykZAFA==",
|
|
373
|
+
"funding": [
|
|
374
|
+
{
|
|
375
|
+
"type": "opencollective",
|
|
376
|
+
"url": "https://opencollective.com/sequelize"
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"license": "MIT",
|
|
380
|
+
"dependencies": {
|
|
381
|
+
"@types/debug": "^4.1.8",
|
|
382
|
+
"@types/validator": "^13.7.17",
|
|
383
|
+
"debug": "^4.3.4",
|
|
384
|
+
"dottie": "^2.0.6",
|
|
385
|
+
"inflection": "^1.13.4",
|
|
386
|
+
"lodash": "^4.17.21",
|
|
387
|
+
"moment": "^2.29.4",
|
|
388
|
+
"moment-timezone": "^0.5.43",
|
|
389
|
+
"pg-connection-string": "^2.6.1",
|
|
390
|
+
"retry-as-promised": "^7.0.4",
|
|
391
|
+
"semver": "^7.5.4",
|
|
392
|
+
"sequelize-pool": "^7.1.0",
|
|
393
|
+
"toposort-class": "^1.0.1",
|
|
394
|
+
"uuid": "^8.3.2",
|
|
395
|
+
"validator": "^13.9.0",
|
|
396
|
+
"wkx": "^0.5.0"
|
|
397
|
+
},
|
|
398
|
+
"engines": {
|
|
399
|
+
"node": ">=10.0.0"
|
|
400
|
+
},
|
|
401
|
+
"peerDependenciesMeta": {
|
|
402
|
+
"ibm_db": {
|
|
403
|
+
"optional": true
|
|
404
|
+
},
|
|
405
|
+
"mariadb": {
|
|
406
|
+
"optional": true
|
|
407
|
+
},
|
|
408
|
+
"mysql2": {
|
|
409
|
+
"optional": true
|
|
410
|
+
},
|
|
411
|
+
"oracledb": {
|
|
412
|
+
"optional": true
|
|
413
|
+
},
|
|
414
|
+
"pg": {
|
|
415
|
+
"optional": true
|
|
416
|
+
},
|
|
417
|
+
"pg-hstore": {
|
|
418
|
+
"optional": true
|
|
419
|
+
},
|
|
420
|
+
"snowflake-sdk": {
|
|
421
|
+
"optional": true
|
|
422
|
+
},
|
|
423
|
+
"sqlite3": {
|
|
424
|
+
"optional": true
|
|
425
|
+
},
|
|
426
|
+
"tedious": {
|
|
427
|
+
"optional": true
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"node_modules/sequelize-pool": {
|
|
432
|
+
"version": "7.1.0",
|
|
433
|
+
"resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz",
|
|
434
|
+
"integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==",
|
|
435
|
+
"license": "MIT",
|
|
436
|
+
"engines": {
|
|
437
|
+
"node": ">= 10.0.0"
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"node_modules/split2": {
|
|
441
|
+
"version": "4.2.0",
|
|
442
|
+
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
|
443
|
+
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
|
444
|
+
"license": "ISC",
|
|
445
|
+
"engines": {
|
|
446
|
+
"node": ">= 10.x"
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
"node_modules/toposort-class": {
|
|
450
|
+
"version": "1.0.1",
|
|
451
|
+
"resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz",
|
|
452
|
+
"integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==",
|
|
453
|
+
"license": "MIT"
|
|
454
|
+
},
|
|
455
|
+
"node_modules/typescript": {
|
|
456
|
+
"version": "5.9.3",
|
|
457
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
458
|
+
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
459
|
+
"dev": true,
|
|
460
|
+
"license": "Apache-2.0",
|
|
461
|
+
"bin": {
|
|
462
|
+
"tsc": "bin/tsc",
|
|
463
|
+
"tsserver": "bin/tsserver"
|
|
464
|
+
},
|
|
465
|
+
"engines": {
|
|
466
|
+
"node": ">=14.17"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"node_modules/undici-types": {
|
|
470
|
+
"version": "6.21.0",
|
|
471
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
|
472
|
+
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
|
473
|
+
"license": "MIT"
|
|
474
|
+
},
|
|
475
|
+
"node_modules/uuid": {
|
|
476
|
+
"version": "8.3.2",
|
|
477
|
+
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
|
478
|
+
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
|
479
|
+
"license": "MIT",
|
|
480
|
+
"bin": {
|
|
481
|
+
"uuid": "dist/bin/uuid"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
"node_modules/validator": {
|
|
485
|
+
"version": "13.15.23",
|
|
486
|
+
"resolved": "https://registry.npmjs.org/validator/-/validator-13.15.23.tgz",
|
|
487
|
+
"integrity": "sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==",
|
|
488
|
+
"license": "MIT",
|
|
489
|
+
"engines": {
|
|
490
|
+
"node": ">= 0.10"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
"node_modules/wkx": {
|
|
494
|
+
"version": "0.5.0",
|
|
495
|
+
"resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz",
|
|
496
|
+
"integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==",
|
|
497
|
+
"license": "MIT",
|
|
498
|
+
"dependencies": {
|
|
499
|
+
"@types/node": "*"
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
"node_modules/xtend": {
|
|
503
|
+
"version": "4.0.2",
|
|
504
|
+
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
|
505
|
+
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
|
506
|
+
"license": "MIT",
|
|
507
|
+
"engines": {
|
|
508
|
+
"node": ">=0.4"
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
package/package.json
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuboapp/api-backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Backend Api for CuboApp",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"repository": "git@github.com:cuboapp/api-backend.git",
|
|
7
7
|
"author": "CuboSoft",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
},
|
|
13
10
|
"dependencies": {
|
|
14
|
-
"@cuboapp/
|
|
15
|
-
"@cuboapp/
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
11
|
+
"@cuboapp/constants": "2.0.4",
|
|
12
|
+
"@cuboapp/database": "1.0.1",
|
|
13
|
+
"@cuboapp/types": "2.0.5",
|
|
14
|
+
"@cuboapp/utils": "1.0.4",
|
|
15
|
+
"pg": "^8.16.3",
|
|
16
|
+
"sequelize": "^6.37.7"
|
|
19
17
|
},
|
|
20
18
|
"devDependencies": {
|
|
21
|
-
"@types/lodash-es": "^4.17.12",
|
|
22
19
|
"@types/node": "^22.0.0",
|
|
23
20
|
"typescript": "^5.8.2"
|
|
24
21
|
}
|
package/src/constants/index.ts
CHANGED
|
@@ -1,2 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { CUBO_ENTITY_FIELD_TYPE } from '@cuboapp/constants'
|
|
2
|
+
import { CuboEntityField } from '@cuboapp/types'
|
|
3
|
+
|
|
4
|
+
export const CUBO_CRUD_QUERY_KEY_REGEX = /[^a-zA-Z\.\_]/g
|
|
5
|
+
|
|
6
|
+
export const CUBO_CRUD_QUERY_SYMBOL_NOT = 'not'
|
|
7
|
+
|
|
8
|
+
export const CUBO_CRUD_DEFAULT_PAGE_LIMIT = 25
|
|
9
|
+
export const CUBO_CRUD_MAX_PAGE_LIMIT = 500
|
|
10
|
+
|
|
11
|
+
export const CUBO_CRUD_QUERY_CONDITION = {
|
|
12
|
+
EQ: 'eq',
|
|
13
|
+
EX: 'ex',
|
|
14
|
+
LIKE: 'like',
|
|
15
|
+
ILIKE: 'ilike',
|
|
16
|
+
IN: 'in',
|
|
17
|
+
NIN: 'nin',
|
|
18
|
+
GT: 'gt',
|
|
19
|
+
LT: 'lt',
|
|
20
|
+
GTE: 'gte',
|
|
21
|
+
LTE: 'lte'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const CUBO_CRUD_DEFAULT_FIELDS: Pick<CuboEntityField, 'type' | 'alias' | 'extra'>[] = [
|
|
25
|
+
{
|
|
26
|
+
type: CUBO_ENTITY_FIELD_TYPE.NUMBER,
|
|
27
|
+
alias: 'id',
|
|
28
|
+
extra: {
|
|
29
|
+
number_subtype: 'int'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: CUBO_ENTITY_FIELD_TYPE.TIMESTAMP,
|
|
34
|
+
alias: 'created_at',
|
|
35
|
+
extra: {}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: CUBO_ENTITY_FIELD_TYPE.SELECT,
|
|
39
|
+
alias: 'created_by',
|
|
40
|
+
extra: {
|
|
41
|
+
select_subtype: 'user',
|
|
42
|
+
select_entity_key: 'created_by'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: CUBO_ENTITY_FIELD_TYPE.TIMESTAMP,
|
|
47
|
+
alias: 'modified_at',
|
|
48
|
+
extra: {}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: CUBO_ENTITY_FIELD_TYPE.SELECT,
|
|
52
|
+
alias: 'modified_by',
|
|
53
|
+
extra: {
|
|
54
|
+
select_subtype: 'user',
|
|
55
|
+
select_entity_key: 'modified_by'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: CUBO_ENTITY_FIELD_TYPE.TIMESTAMP,
|
|
60
|
+
alias: 'deleted_at',
|
|
61
|
+
extra: {}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: CUBO_ENTITY_FIELD_TYPE.SELECT,
|
|
65
|
+
alias: 'deleted_by',
|
|
66
|
+
extra: {
|
|
67
|
+
select_subtype: 'user',
|
|
68
|
+
select_entity_key: 'modified_by'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
export const CUBO_CRUD_DEFAULT_FIELDS_ALIASES = CUBO_CRUD_DEFAULT_FIELDS.map((i) => i.alias)
|