@exulu/backend 1.14.0 → 1.14.1
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/CHANGELOG.md +3 -3
- package/dist/index.cjs +40 -17
- package/dist/index.js +40 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
## [1.14.1](https://github.com/Qventu/exulu-backend/compare/v1.14.0...v1.14.1) (2025-08-21)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* function for default values in core schema and init-db ([2b9a786](https://github.com/Qventu/exulu-backend/commit/2b9a7862e343c02f97a59230a07d5197c056ac56))
|
|
7
7
|
|
|
8
8
|
# [1.1.0](https://github.com/Qventu/exulu-backend/compare/v1.0.1...v1.1.0) (2025-07-30)
|
|
9
9
|
|
package/dist/index.cjs
CHANGED
|
@@ -305,57 +305,80 @@ var bullmqDecorator = async ({
|
|
|
305
305
|
// src/registry/utils/map-types.ts
|
|
306
306
|
var mapType = (t, type, name, defaultValue, unique) => {
|
|
307
307
|
if (type === "text" || type === "enum") {
|
|
308
|
-
|
|
308
|
+
if (defaultValue) {
|
|
309
|
+
t.text(name).defaultTo(defaultValue);
|
|
310
|
+
} else {
|
|
311
|
+
t.text(name);
|
|
312
|
+
}
|
|
309
313
|
if (unique) t.unique(name);
|
|
310
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
311
314
|
return;
|
|
312
315
|
}
|
|
313
316
|
if (type === "longText") {
|
|
314
|
-
|
|
317
|
+
if (defaultValue) {
|
|
318
|
+
t.text(name).defaultTo(defaultValue);
|
|
319
|
+
} else {
|
|
320
|
+
t.text(name);
|
|
321
|
+
}
|
|
315
322
|
if (unique) t.unique(name);
|
|
316
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
317
323
|
return;
|
|
318
324
|
}
|
|
319
325
|
if (type === "shortText") {
|
|
320
|
-
|
|
326
|
+
if (defaultValue) {
|
|
327
|
+
t.string(name, 100).defaultTo(defaultValue);
|
|
328
|
+
} else {
|
|
329
|
+
t.string(name, 100);
|
|
330
|
+
}
|
|
321
331
|
if (unique) t.unique(name);
|
|
322
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
323
332
|
return;
|
|
324
333
|
}
|
|
325
334
|
if (type === "number") {
|
|
326
|
-
|
|
335
|
+
if (defaultValue) {
|
|
336
|
+
t.float(name).defaultTo(defaultValue);
|
|
337
|
+
} else {
|
|
338
|
+
t.float(name);
|
|
339
|
+
}
|
|
327
340
|
if (unique) t.unique(name);
|
|
328
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
329
341
|
return;
|
|
330
342
|
}
|
|
331
343
|
if (type === "boolean") {
|
|
332
344
|
t.boolean(name).defaultTo(defaultValue || false);
|
|
333
345
|
if (unique) t.unique(name);
|
|
334
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
335
346
|
return;
|
|
336
347
|
}
|
|
337
348
|
if (type === "code") {
|
|
338
|
-
|
|
349
|
+
if (defaultValue) {
|
|
350
|
+
t.text(name).defaultTo(defaultValue);
|
|
351
|
+
} else {
|
|
352
|
+
t.text(name);
|
|
353
|
+
}
|
|
339
354
|
if (unique) t.unique(name);
|
|
340
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
341
355
|
return;
|
|
342
356
|
}
|
|
343
357
|
if (type === "json") {
|
|
344
|
-
|
|
358
|
+
if (defaultValue) {
|
|
359
|
+
t.jsonb(name).defaultTo(defaultValue);
|
|
360
|
+
} else {
|
|
361
|
+
t.jsonb(name);
|
|
362
|
+
}
|
|
345
363
|
if (unique) t.unique(name);
|
|
346
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
347
364
|
return;
|
|
348
365
|
}
|
|
349
366
|
if (type === "date") {
|
|
350
|
-
|
|
367
|
+
if (defaultValue) {
|
|
368
|
+
t.timestamp(name).defaultTo(defaultValue);
|
|
369
|
+
} else {
|
|
370
|
+
t.timestamp(name);
|
|
371
|
+
}
|
|
351
372
|
if (unique) t.unique(name);
|
|
352
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
353
373
|
return;
|
|
354
374
|
}
|
|
355
375
|
if (type === "uuid") {
|
|
356
|
-
|
|
376
|
+
if (defaultValue) {
|
|
377
|
+
t.uuid(name).defaultTo(defaultValue);
|
|
378
|
+
} else {
|
|
379
|
+
t.uuid(name);
|
|
380
|
+
}
|
|
357
381
|
if (unique) t.unique(name);
|
|
358
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
359
382
|
return;
|
|
360
383
|
}
|
|
361
384
|
throw new Error("Invalid type: " + type);
|
package/dist/index.js
CHANGED
|
@@ -263,57 +263,80 @@ var bullmqDecorator = async ({
|
|
|
263
263
|
// src/registry/utils/map-types.ts
|
|
264
264
|
var mapType = (t, type, name, defaultValue, unique) => {
|
|
265
265
|
if (type === "text" || type === "enum") {
|
|
266
|
-
|
|
266
|
+
if (defaultValue) {
|
|
267
|
+
t.text(name).defaultTo(defaultValue);
|
|
268
|
+
} else {
|
|
269
|
+
t.text(name);
|
|
270
|
+
}
|
|
267
271
|
if (unique) t.unique(name);
|
|
268
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
269
272
|
return;
|
|
270
273
|
}
|
|
271
274
|
if (type === "longText") {
|
|
272
|
-
|
|
275
|
+
if (defaultValue) {
|
|
276
|
+
t.text(name).defaultTo(defaultValue);
|
|
277
|
+
} else {
|
|
278
|
+
t.text(name);
|
|
279
|
+
}
|
|
273
280
|
if (unique) t.unique(name);
|
|
274
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
275
281
|
return;
|
|
276
282
|
}
|
|
277
283
|
if (type === "shortText") {
|
|
278
|
-
|
|
284
|
+
if (defaultValue) {
|
|
285
|
+
t.string(name, 100).defaultTo(defaultValue);
|
|
286
|
+
} else {
|
|
287
|
+
t.string(name, 100);
|
|
288
|
+
}
|
|
279
289
|
if (unique) t.unique(name);
|
|
280
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
281
290
|
return;
|
|
282
291
|
}
|
|
283
292
|
if (type === "number") {
|
|
284
|
-
|
|
293
|
+
if (defaultValue) {
|
|
294
|
+
t.float(name).defaultTo(defaultValue);
|
|
295
|
+
} else {
|
|
296
|
+
t.float(name);
|
|
297
|
+
}
|
|
285
298
|
if (unique) t.unique(name);
|
|
286
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
287
299
|
return;
|
|
288
300
|
}
|
|
289
301
|
if (type === "boolean") {
|
|
290
302
|
t.boolean(name).defaultTo(defaultValue || false);
|
|
291
303
|
if (unique) t.unique(name);
|
|
292
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
293
304
|
return;
|
|
294
305
|
}
|
|
295
306
|
if (type === "code") {
|
|
296
|
-
|
|
307
|
+
if (defaultValue) {
|
|
308
|
+
t.text(name).defaultTo(defaultValue);
|
|
309
|
+
} else {
|
|
310
|
+
t.text(name);
|
|
311
|
+
}
|
|
297
312
|
if (unique) t.unique(name);
|
|
298
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
299
313
|
return;
|
|
300
314
|
}
|
|
301
315
|
if (type === "json") {
|
|
302
|
-
|
|
316
|
+
if (defaultValue) {
|
|
317
|
+
t.jsonb(name).defaultTo(defaultValue);
|
|
318
|
+
} else {
|
|
319
|
+
t.jsonb(name);
|
|
320
|
+
}
|
|
303
321
|
if (unique) t.unique(name);
|
|
304
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
305
322
|
return;
|
|
306
323
|
}
|
|
307
324
|
if (type === "date") {
|
|
308
|
-
|
|
325
|
+
if (defaultValue) {
|
|
326
|
+
t.timestamp(name).defaultTo(defaultValue);
|
|
327
|
+
} else {
|
|
328
|
+
t.timestamp(name);
|
|
329
|
+
}
|
|
309
330
|
if (unique) t.unique(name);
|
|
310
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
311
331
|
return;
|
|
312
332
|
}
|
|
313
333
|
if (type === "uuid") {
|
|
314
|
-
|
|
334
|
+
if (defaultValue) {
|
|
335
|
+
t.uuid(name).defaultTo(defaultValue);
|
|
336
|
+
} else {
|
|
337
|
+
t.uuid(name);
|
|
338
|
+
}
|
|
315
339
|
if (unique) t.unique(name);
|
|
316
|
-
if (defaultValue) t.defaultTo(defaultValue);
|
|
317
340
|
return;
|
|
318
341
|
}
|
|
319
342
|
throw new Error("Invalid type: " + type);
|