@mrxsys/mrx-core 2.11.0 → 2.12.0-1-and-288-20251203
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/{chunk-sbpj7f3p.js → chunk-kne89z1w.js} +1 -1
- package/dist/{chunk-7j86h1nd.js → chunk-s53cbgkb.js} +14 -9
- package/dist/chunk-txazb0xn.js +27 -0
- package/dist/modules/database/index.js +2 -2
- package/dist/modules/elysia/db-resolver/index.js +50 -7
- package/dist/modules/repository/index.js +1 -1
- package/dist/modules/repository/repository.d.ts +19 -3
- package/dist/modules/repository/types/filter.d.ts +2 -5
- package/dist/modules/repository/types/global-search.d.ts +12 -0
- package/dist/modules/repository/types/index.d.ts +2 -1
- package/dist/modules/repository/types/{order-by-item.d.ts → order-by.d.ts} +3 -3
- package/dist/modules/repository/types/query-options.d.ts +4 -5
- package/dist/modules/schema-builder/build-adaptive-where-clause-schema.d.ts +17 -0
- package/dist/modules/schema-builder/build-count-schema.d.ts +12 -0
- package/dist/modules/{elysia/crud/utils/create-delete-schema.d.ts → schema-builder/build-delete-schema.d.ts} +3 -3
- package/dist/modules/schema-builder/build-filters-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-find-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-global-search-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-insert-schema.d.ts +3 -0
- package/dist/modules/schema-builder/build-order-by-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-selected-fields.d.ts +12 -0
- package/dist/modules/schema-builder/build-update-one-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-update-schema.d.ts +12 -0
- package/dist/modules/schema-builder/clean-schema.d.ts +2 -0
- package/dist/modules/schema-builder/index.d.ts +12 -0
- package/dist/modules/schema-builder/index.js +230 -0
- package/dist/modules/{elysia/crud → schema-builder}/types/count-schema.d.ts +3 -3
- package/dist/modules/schema-builder/types/delete-schema.d.ts +12 -0
- package/dist/modules/schema-builder/types/filter-schema.d.ts +12 -0
- package/dist/modules/schema-builder/types/find-schema.d.ts +16 -0
- package/dist/modules/{elysia/crud/types/q-schema.d.ts → schema-builder/types/global-search-schema.d.ts} +1 -1
- package/dist/modules/schema-builder/types/index.d.ts +12 -0
- package/dist/modules/{elysia/crud → schema-builder}/types/insert-schema.d.ts +1 -1
- package/dist/modules/schema-builder/types/order-by-schema.d.ts +5 -0
- package/dist/modules/{elysia/crud → schema-builder}/types/update-schema.d.ts +4 -4
- package/dist/{shared → modules/schema-builder}/utils/flatten.d.ts +1 -1
- package/dist/modules/schema-builder/utils/index.d.ts +2 -0
- package/dist/modules/schema-builder/utils/index.js +9 -0
- package/dist/shared/types/index.d.ts +0 -1
- package/dist/shared/utils/index.d.ts +0 -1
- package/dist/shared/utils/index.js +1 -5
- package/package.json +7 -9
- package/dist/chunk-4g0x6g4j.js +0 -365
- package/dist/chunk-9dzsj7f2.js +0 -23
- package/dist/chunk-tmvj28bq.js +0 -284
- package/dist/chunk-w7h898m3.js +0 -14
- package/dist/chunk-yzgdqb02.js +0 -53
- package/dist/modules/elysia/crud/crud-schema.d.ts +0 -18
- package/dist/modules/elysia/crud/crud.d.ts +0 -38
- package/dist/modules/elysia/crud/enums/crud-success-keys.d.ts +0 -10
- package/dist/modules/elysia/crud/enums/index.d.ts +0 -1
- package/dist/modules/elysia/crud/enums/index.js +0 -7
- package/dist/modules/elysia/crud/index.d.ts +0 -2
- package/dist/modules/elysia/crud/index.js +0 -153
- package/dist/modules/elysia/crud/operations/count.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/delete.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/deleteOne.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/find.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/findOne.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/index.d.ts +0 -8
- package/dist/modules/elysia/crud/operations/index.js +0 -34
- package/dist/modules/elysia/crud/operations/insert.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/update.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/updateOne.d.ts +0 -274
- package/dist/modules/elysia/crud/operations/utils/get-db-injection.d.ts +0 -8
- package/dist/modules/elysia/crud/types/count-response-200-schema.d.ts +0 -5
- package/dist/modules/elysia/crud/types/crud-operation-base.d.ts +0 -4
- package/dist/modules/elysia/crud/types/crud-operation-count.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-delete-one.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-delete.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-find-one.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-find.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-insert.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-update-one.d.ts +0 -16
- package/dist/modules/elysia/crud/types/crud-operation-update.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operations.d.ts +0 -19
- package/dist/modules/elysia/crud/types/crud-options.d.ts +0 -44
- package/dist/modules/elysia/crud/types/crud-schema-models-type.d.ts +0 -12
- package/dist/modules/elysia/crud/types/crud-schema-operations.d.ts +0 -10
- package/dist/modules/elysia/crud/types/crud-schema-options.d.ts +0 -13
- package/dist/modules/elysia/crud/types/delete-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/types/filter-schema.d.ts +0 -9
- package/dist/modules/elysia/crud/types/find-schema.d.ts +0 -16
- package/dist/modules/elysia/crud/types/id-param-schema.d.ts +0 -4
- package/dist/modules/elysia/crud/types/index.d.ts +0 -29
- package/dist/modules/elysia/crud/types/order-schema.d.ts +0 -11
- package/dist/modules/elysia/crud/types/properties-schema.d.ts +0 -9
- package/dist/modules/elysia/crud/types/response-200-schema.d.ts +0 -11
- package/dist/modules/elysia/crud/utils/create-adaptive-where-clause-schema.d.ts +0 -17
- package/dist/modules/elysia/crud/utils/create-count-response-200-schema.d.ts +0 -8
- package/dist/modules/elysia/crud/utils/create-count-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-filters-schema.d.ts +0 -14
- package/dist/modules/elysia/crud/utils/create-find-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-id-param-schema.d.ts +0 -2
- package/dist/modules/elysia/crud/utils/create-insert-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/create-order-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-properties-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-q-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-response-200-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/create-selected-fields-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-update-one-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/create-update-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/index.d.ts +0 -16
- package/dist/modules/elysia/crud/utils/index.js +0 -41
- /package/dist/modules/{elysia/crud → schema-builder}/types/adaptive-where-clause-schema.d.ts +0 -0
- /package/dist/modules/{elysia/crud → schema-builder}/types/index.js +0 -0
- /package/dist/modules/{elysia/crud/types/selected-field-schema.d.ts → schema-builder/types/selected-fields-schema.d.ts} +0 -0
- /package/dist/{shared → modules/schema-builder}/types/tflatten.d.ts +0 -0
- /package/dist/modules/{elysia/crud → schema-builder}/types/update-one-schema.d.ts +0 -0
- /package/dist/modules/{elysia/crud → schema-builder}/utils/is-date-from-elysia-typebox.d.ts +0 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
flatten,
|
|
4
|
+
isDateFromElysiaTypeBox
|
|
5
|
+
} from "../../chunk-txazb0xn.js";
|
|
6
|
+
import {
|
|
7
|
+
filterByKeyExclusionRecursive
|
|
8
|
+
} from "../../chunk-hv6g22kf.js";
|
|
9
|
+
import"../../chunk-10w8mg8e.js";
|
|
10
|
+
import"../../chunk-jz3wd472.js";
|
|
11
|
+
|
|
12
|
+
// source/modules/schema-builder/build-adaptive-where-clause-schema.ts
|
|
13
|
+
import { KindGuard } from "@sinclair/typebox/type";
|
|
14
|
+
import { t } from "elysia";
|
|
15
|
+
var buildAdaptiveWhereClauseSchema = (schema) => {
|
|
16
|
+
const common = {
|
|
17
|
+
$eq: schema,
|
|
18
|
+
$neq: schema,
|
|
19
|
+
$isNull: t.Boolean()
|
|
20
|
+
};
|
|
21
|
+
const strNumDate = KindGuard.IsString(schema) || KindGuard.IsNumber(schema) || isDateFromElysiaTypeBox(schema) ? {
|
|
22
|
+
$in: t.Array(schema, { minItems: 1, uniqueItems: true }),
|
|
23
|
+
$nin: t.Array(schema, { minItems: 1, uniqueItems: true }),
|
|
24
|
+
$like: t.String(),
|
|
25
|
+
$nlike: t.String()
|
|
26
|
+
} : {};
|
|
27
|
+
const numDate = KindGuard.IsNumber(schema) || isDateFromElysiaTypeBox(schema) ? {
|
|
28
|
+
$lt: schema,
|
|
29
|
+
$lte: schema,
|
|
30
|
+
$gt: schema,
|
|
31
|
+
$gte: schema,
|
|
32
|
+
$between: t.Tuple([schema, schema]),
|
|
33
|
+
$nbetween: t.Tuple([schema, schema])
|
|
34
|
+
} : {};
|
|
35
|
+
return t.Partial(t.Object({
|
|
36
|
+
...common,
|
|
37
|
+
...strNumDate,
|
|
38
|
+
...numDate
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
// source/modules/schema-builder/build-count-schema.ts
|
|
42
|
+
import { t as t4 } from "elysia";
|
|
43
|
+
|
|
44
|
+
// source/modules/schema-builder/build-filters-schema.ts
|
|
45
|
+
import { t as t3 } from "elysia";
|
|
46
|
+
|
|
47
|
+
// source/modules/schema-builder/build-global-search-schema.ts
|
|
48
|
+
import { t as t2 } from "elysia/type-system";
|
|
49
|
+
var buildGlobalSearchSchema = (schema) => t2.Union([
|
|
50
|
+
t2.Object({
|
|
51
|
+
selectedFields: t2.Union([
|
|
52
|
+
t2.KeyOf(schema),
|
|
53
|
+
t2.Array(t2.KeyOf(schema), {
|
|
54
|
+
minItems: 1,
|
|
55
|
+
uniqueItems: true
|
|
56
|
+
})
|
|
57
|
+
]),
|
|
58
|
+
value: t2.Union([
|
|
59
|
+
t2.Number(),
|
|
60
|
+
t2.String()
|
|
61
|
+
])
|
|
62
|
+
}),
|
|
63
|
+
t2.Number(),
|
|
64
|
+
t2.String()
|
|
65
|
+
]);
|
|
66
|
+
|
|
67
|
+
// source/modules/schema-builder/build-filters-schema.ts
|
|
68
|
+
var buildFilterSchema = (schema) => {
|
|
69
|
+
const clauseSchema = {
|
|
70
|
+
$q: buildGlobalSearchSchema(schema)
|
|
71
|
+
};
|
|
72
|
+
for (const [key, propertySchema] of Object.entries(schema.properties))
|
|
73
|
+
clauseSchema[key] = flatten(t3.Union([
|
|
74
|
+
propertySchema,
|
|
75
|
+
buildAdaptiveWhereClauseSchema(propertySchema)
|
|
76
|
+
]));
|
|
77
|
+
return t3.Object(clauseSchema, {
|
|
78
|
+
minProperties: 1
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// source/modules/schema-builder/clean-schema.ts
|
|
83
|
+
var cleanSchema = (schema) => filterByKeyExclusionRecursive(schema, [
|
|
84
|
+
"minLength",
|
|
85
|
+
"maxLength",
|
|
86
|
+
"pattern",
|
|
87
|
+
"minimum",
|
|
88
|
+
"maximum",
|
|
89
|
+
"exclusiveMinimum",
|
|
90
|
+
"exclusiveMaximum",
|
|
91
|
+
"multipleOf",
|
|
92
|
+
"minItems",
|
|
93
|
+
"maxItems",
|
|
94
|
+
"maxContains",
|
|
95
|
+
"minContains",
|
|
96
|
+
"minProperties",
|
|
97
|
+
"maxProperties",
|
|
98
|
+
"uniqueItems",
|
|
99
|
+
"minimumTimestamp",
|
|
100
|
+
"maximumTimestamp",
|
|
101
|
+
"exclusiveMinimumTimestamp",
|
|
102
|
+
"exclusiveMaximumTimestamp",
|
|
103
|
+
"multipleOfTimestamp",
|
|
104
|
+
"required",
|
|
105
|
+
"default"
|
|
106
|
+
]);
|
|
107
|
+
|
|
108
|
+
// source/modules/schema-builder/build-count-schema.ts
|
|
109
|
+
var buildCountSchema = (schema) => {
|
|
110
|
+
const sanitizedSchema = cleanSchema(schema);
|
|
111
|
+
const filterSchema = buildFilterSchema(sanitizedSchema);
|
|
112
|
+
return t4.Partial(t4.Object({
|
|
113
|
+
queryOptions: t4.Partial(t4.Object({
|
|
114
|
+
filters: t4.Union([
|
|
115
|
+
filterSchema,
|
|
116
|
+
t4.Array(filterSchema, { minItems: 1, uniqueItems: true })
|
|
117
|
+
])
|
|
118
|
+
}))
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
// source/modules/schema-builder/build-delete-schema.ts
|
|
122
|
+
import { t as t6 } from "elysia";
|
|
123
|
+
|
|
124
|
+
// source/modules/schema-builder/build-selected-fields.ts
|
|
125
|
+
import { t as t5 } from "elysia/type-system";
|
|
126
|
+
var buildSelectedFieldsSchema = (schema) => t5.Union([
|
|
127
|
+
t5.KeyOf(schema),
|
|
128
|
+
t5.Literal("*"),
|
|
129
|
+
t5.Array(t5.KeyOf(schema), {
|
|
130
|
+
minItems: 1,
|
|
131
|
+
uniqueItems: true
|
|
132
|
+
})
|
|
133
|
+
]);
|
|
134
|
+
|
|
135
|
+
// source/modules/schema-builder/build-delete-schema.ts
|
|
136
|
+
var buildDeleteSchema = (schema) => {
|
|
137
|
+
const sanitizedSchema = cleanSchema(schema);
|
|
138
|
+
const filterSchema = buildFilterSchema(sanitizedSchema);
|
|
139
|
+
return t6.Object({
|
|
140
|
+
queryOptions: t6.Object({
|
|
141
|
+
selectedFields: t6.Optional(buildSelectedFieldsSchema(sanitizedSchema)),
|
|
142
|
+
filters: t6.Union([
|
|
143
|
+
filterSchema,
|
|
144
|
+
t6.Array(filterSchema, { minItems: 1 })
|
|
145
|
+
])
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
// source/modules/schema-builder/build-find-schema.ts
|
|
150
|
+
import { t as t8 } from "elysia";
|
|
151
|
+
|
|
152
|
+
// source/modules/schema-builder/build-order-by-schema.ts
|
|
153
|
+
import { t as t7 } from "elysia/type-system";
|
|
154
|
+
var buildOrderBySchema = (schema) => t7.Object({
|
|
155
|
+
selectedField: t7.KeyOf(schema),
|
|
156
|
+
direction: t7.Union([t7.Literal("asc"), t7.Literal("desc")])
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// source/modules/schema-builder/build-find-schema.ts
|
|
160
|
+
var buildFindSchema = (schema) => {
|
|
161
|
+
const sanitizedSchema = cleanSchema(schema);
|
|
162
|
+
const filterSchema = buildFilterSchema(sanitizedSchema);
|
|
163
|
+
return t8.Partial(t8.Object({
|
|
164
|
+
queryOptions: t8.Partial(t8.Object({
|
|
165
|
+
selectedFields: buildSelectedFieldsSchema(sanitizedSchema),
|
|
166
|
+
orderBy: buildOrderBySchema(sanitizedSchema),
|
|
167
|
+
filters: t8.Union([
|
|
168
|
+
filterSchema,
|
|
169
|
+
t8.Array(filterSchema, { minItems: 1, uniqueItems: true })
|
|
170
|
+
]),
|
|
171
|
+
limit: t8.Number({
|
|
172
|
+
default: 100,
|
|
173
|
+
minimum: 1
|
|
174
|
+
}),
|
|
175
|
+
offset: t8.Number({
|
|
176
|
+
default: 0,
|
|
177
|
+
minimum: 0
|
|
178
|
+
})
|
|
179
|
+
}))
|
|
180
|
+
}));
|
|
181
|
+
};
|
|
182
|
+
// source/modules/schema-builder/build-insert-schema.ts
|
|
183
|
+
import { t as t9 } from "elysia";
|
|
184
|
+
var buildInsertSchema = (schema) => t9.Object({
|
|
185
|
+
queryOptions: t9.Optional(t9.Object({
|
|
186
|
+
selectedFields: buildSelectedFieldsSchema(schema)
|
|
187
|
+
})),
|
|
188
|
+
data: t9.Union([
|
|
189
|
+
schema,
|
|
190
|
+
t9.Array(schema, {
|
|
191
|
+
minItems: 1,
|
|
192
|
+
uniqueItems: true
|
|
193
|
+
})
|
|
194
|
+
])
|
|
195
|
+
});
|
|
196
|
+
// source/modules/schema-builder/build-update-one-schema.ts
|
|
197
|
+
import { t as t10 } from "elysia";
|
|
198
|
+
var buildUpdateOneSchema = (schema) => t10.Object({
|
|
199
|
+
data: t10.Partial(schema)
|
|
200
|
+
});
|
|
201
|
+
// source/modules/schema-builder/build-update-schema.ts
|
|
202
|
+
import { t as t11 } from "elysia";
|
|
203
|
+
var buildUpdateSchema = (schema) => {
|
|
204
|
+
const sanitizedSchema = cleanSchema(schema);
|
|
205
|
+
const filterSchema = buildFilterSchema(sanitizedSchema);
|
|
206
|
+
return t11.Object({
|
|
207
|
+
queryOptions: t11.Object({
|
|
208
|
+
selectedFields: t11.Optional(buildSelectedFieldsSchema(sanitizedSchema)),
|
|
209
|
+
filters: t11.Union([
|
|
210
|
+
filterSchema,
|
|
211
|
+
t11.Array(filterSchema, { minItems: 1, uniqueItems: true })
|
|
212
|
+
])
|
|
213
|
+
}),
|
|
214
|
+
data: t11.Partial(schema)
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
export {
|
|
218
|
+
cleanSchema,
|
|
219
|
+
buildUpdateSchema,
|
|
220
|
+
buildUpdateOneSchema,
|
|
221
|
+
buildSelectedFieldsSchema,
|
|
222
|
+
buildOrderBySchema,
|
|
223
|
+
buildInsertSchema,
|
|
224
|
+
buildGlobalSearchSchema,
|
|
225
|
+
buildFindSchema,
|
|
226
|
+
buildFilterSchema,
|
|
227
|
+
buildDeleteSchema,
|
|
228
|
+
buildCountSchema,
|
|
229
|
+
buildAdaptiveWhereClauseSchema
|
|
230
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { TArray, TObject, TPartial, TUnion } from '@sinclair/typebox/type';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FilterSchema } from './filter-schema';
|
|
3
3
|
export type CountSchema<TSourceCountSchema extends TObject> = TPartial<TObject<{
|
|
4
4
|
queryOptions: TPartial<TObject<{
|
|
5
5
|
filters: TUnion<[
|
|
6
|
-
|
|
7
|
-
TArray<
|
|
6
|
+
FilterSchema<TSourceCountSchema>,
|
|
7
|
+
TArray<FilterSchema<TSourceCountSchema>>
|
|
8
8
|
]>;
|
|
9
9
|
}>>;
|
|
10
10
|
}>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TArray, TObject, TOptional, TUnion } from '@sinclair/typebox/type';
|
|
2
|
+
import type { FilterSchema } from './filter-schema';
|
|
3
|
+
import type { SelectedFieldsSchema } from './selected-fields-schema';
|
|
4
|
+
export type DeleteSchema<TSourceDeleteSchema extends TObject> = TObject<{
|
|
5
|
+
queryOptions: TObject<{
|
|
6
|
+
selectedFields: TOptional<SelectedFieldsSchema<TSourceDeleteSchema>>;
|
|
7
|
+
filters: TUnion<[
|
|
8
|
+
FilterSchema<TSourceDeleteSchema>,
|
|
9
|
+
TArray<FilterSchema<TSourceDeleteSchema>>
|
|
10
|
+
]>;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Static, TObject, TPartial, TUnion } from '@sinclair/typebox/type';
|
|
2
|
+
import type { AdaptiveWhereClauseSchema } from './adaptive-where-clause-schema';
|
|
3
|
+
import type { GlobalSearchSchema } from './global-search-schema';
|
|
4
|
+
import type { TFlatten } from './tflatten';
|
|
5
|
+
export type FilterSchema<TSourceSchema extends TObject> = TPartial<TObject<{
|
|
6
|
+
$q: GlobalSearchSchema<TSourceSchema>;
|
|
7
|
+
} & {
|
|
8
|
+
[K in keyof Static<TSourceSchema>]: TFlatten<TUnion<[
|
|
9
|
+
TSourceSchema['properties'][K],
|
|
10
|
+
AdaptiveWhereClauseSchema<TSourceSchema['properties'][K]>
|
|
11
|
+
]>>;
|
|
12
|
+
}>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TArray, TNumber, TObject, TPartial, TUnion } from '@sinclair/typebox/type';
|
|
2
|
+
import type { FilterSchema } from './filter-schema';
|
|
3
|
+
import type { OrderBySchema } from './order-by-schema';
|
|
4
|
+
import type { SelectedFieldsSchema } from './selected-fields-schema';
|
|
5
|
+
export type FindSchema<TSourceFindSchema extends TObject> = TPartial<TObject<{
|
|
6
|
+
queryOptions: TPartial<TObject<{
|
|
7
|
+
selectedFields: SelectedFieldsSchema<TSourceFindSchema>;
|
|
8
|
+
orderBy: OrderBySchema<TSourceFindSchema>;
|
|
9
|
+
filters: TUnion<[
|
|
10
|
+
FilterSchema<TSourceFindSchema>,
|
|
11
|
+
TArray<FilterSchema<TSourceFindSchema>>
|
|
12
|
+
]>;
|
|
13
|
+
limit: TNumber;
|
|
14
|
+
offset: TNumber;
|
|
15
|
+
}>>;
|
|
16
|
+
}>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TArray, TKeyOf, TNumber, TObject, TString, TUnion } from '@sinclair/typebox/type';
|
|
2
|
-
export type
|
|
2
|
+
export type GlobalSearchSchema<TSourceSchema extends TObject> = TUnion<[
|
|
3
3
|
TObject<{
|
|
4
4
|
selectedFields: TUnion<[
|
|
5
5
|
TKeyOf<TSourceSchema>,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { AdaptiveWhereClauseSchema } from './adaptive-where-clause-schema';
|
|
2
|
+
export type { CountSchema } from './count-schema';
|
|
3
|
+
export type { DeleteSchema } from './delete-schema';
|
|
4
|
+
export type { FilterSchema } from './filter-schema';
|
|
5
|
+
export type { FindSchema } from './find-schema';
|
|
6
|
+
export type { GlobalSearchSchema } from './global-search-schema';
|
|
7
|
+
export type { InsertSchema } from './insert-schema';
|
|
8
|
+
export type { OrderBySchema } from './order-by-schema';
|
|
9
|
+
export type { SelectedFieldsSchema } from './selected-fields-schema';
|
|
10
|
+
export type { TFlatten } from './tflatten';
|
|
11
|
+
export type { UpdateOneSchema } from './update-one-schema';
|
|
12
|
+
export type { UpdateSchema } from './update-schema';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TArray, TObject, TOptional, TUnion } from '@sinclair/typebox/type';
|
|
2
|
-
import type { SelectedFieldsSchema } from '
|
|
2
|
+
import type { SelectedFieldsSchema } from './selected-fields-schema';
|
|
3
3
|
export type InsertSchema<TSourceInsertSchema extends TObject> = TObject<{
|
|
4
4
|
queryOptions: TOptional<TObject<{
|
|
5
5
|
selectedFields: SelectedFieldsSchema<TSourceInsertSchema>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { TArray, TObject, TOptional, TPartial, TUnion } from '@sinclair/typebox/type';
|
|
2
|
-
import type {
|
|
3
|
-
import type { SelectedFieldsSchema } from '
|
|
2
|
+
import type { FilterSchema } from './filter-schema';
|
|
3
|
+
import type { SelectedFieldsSchema } from './selected-fields-schema';
|
|
4
4
|
export type UpdateSchema<TSourceUpdateSchema extends TObject> = TObject<{
|
|
5
5
|
queryOptions: TObject<{
|
|
6
6
|
selectedFields: TOptional<SelectedFieldsSchema<TSourceUpdateSchema>>;
|
|
7
7
|
filters: TUnion<[
|
|
8
|
-
|
|
9
|
-
TArray<
|
|
8
|
+
FilterSchema<TSourceUpdateSchema>,
|
|
9
|
+
TArray<FilterSchema<TSourceUpdateSchema>>
|
|
10
10
|
]>;
|
|
11
11
|
}>;
|
|
12
12
|
data: TPartial<TSourceUpdateSchema>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TSchema } from '@sinclair/typebox/type';
|
|
2
|
-
import type { TFlatten } from '
|
|
2
|
+
import type { TFlatten } from '../../../modules/schema-builder/types/tflatten';
|
|
3
3
|
export declare const flatten: <Type extends TSchema>(type: Type) => TFlatten<Type>;
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
UTILS_ERROR_KEYS
|
|
4
4
|
} from "../../chunk-n0n14mf8.js";
|
|
5
|
-
import {
|
|
6
|
-
flatten
|
|
7
|
-
} from "../../chunk-9dzsj7f2.js";
|
|
8
5
|
import {
|
|
9
6
|
isDateString,
|
|
10
7
|
makeStreamAsyncIterable
|
|
@@ -25,6 +22,5 @@ var validateEnv = (schema, env = process.env) => {
|
|
|
25
22
|
export {
|
|
26
23
|
validateEnv,
|
|
27
24
|
makeStreamAsyncIterable,
|
|
28
|
-
isDateString
|
|
29
|
-
flatten
|
|
25
|
+
isDateString
|
|
30
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrxsys/mrx-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0-1-and-288-20251203",
|
|
4
4
|
"author": "Ruby",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@eslint/js": "^9.39.1",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
9
9
|
"@types/bun": "^1.3.3",
|
|
10
10
|
"@types/nodemailer": "^7.0.4",
|
|
11
|
-
"elysia": "1.4.
|
|
11
|
+
"elysia": "1.4.17",
|
|
12
12
|
"eslint": "^9.39.1",
|
|
13
13
|
"globals": "^16.5.0",
|
|
14
14
|
"ioredis": "^5.8.2",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"knex": "^3.1.0",
|
|
17
17
|
"mssql": "^12.1.1",
|
|
18
18
|
"nodemailer": "^7.0.11",
|
|
19
|
-
"typescript-eslint": "^8.48.
|
|
19
|
+
"typescript-eslint": "^8.48.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@sinclair/typebox": "0.34.41",
|
|
23
|
-
"elysia": "^1.4.
|
|
23
|
+
"elysia": "^1.4.17",
|
|
24
24
|
"ioredis": "^5.8.2",
|
|
25
25
|
"jose": "^6.1.2",
|
|
26
26
|
"mssql": "^12.1.1",
|
|
@@ -41,11 +41,6 @@
|
|
|
41
41
|
"./modules/database/types": "./dist/modules/database/types/index.js",
|
|
42
42
|
"./modules/elysia/cache": "./dist/modules/elysia/cache/index.js",
|
|
43
43
|
"./modules/elysia/cache/types": "./dist/modules/elysia/cache/types/index.js",
|
|
44
|
-
"./modules/elysia/crud": "./dist/modules/elysia/crud/index.js",
|
|
45
|
-
"./modules/elysia/crud/enums": "./dist/modules/elysia/crud/enums/index.js",
|
|
46
|
-
"./modules/elysia/crud/operations": "./dist/modules/elysia/crud/operations/index.js",
|
|
47
|
-
"./modules/elysia/crud/types": "./dist/modules/elysia/crud/types/index.js",
|
|
48
|
-
"./modules/elysia/crud/utils": "./dist/modules/elysia/crud/utils/index.js",
|
|
49
44
|
"./modules/elysia/db-resolver": "./dist/modules/elysia/db-resolver/index.js",
|
|
50
45
|
"./modules/elysia/db-resolver/enums": "./dist/modules/elysia/db-resolver/enums/index.js",
|
|
51
46
|
"./modules/elysia/error": "./dist/modules/elysia/error/index.js",
|
|
@@ -73,6 +68,9 @@
|
|
|
73
68
|
"./modules/mailer/types": "./dist/modules/mailer/types/index.js",
|
|
74
69
|
"./modules/repository": "./dist/modules/repository/index.js",
|
|
75
70
|
"./modules/repository/types": "./dist/modules/repository/types/index.js",
|
|
71
|
+
"./modules/schema-builder": "./dist/modules/schema-builder/index.js",
|
|
72
|
+
"./modules/schema-builder/types": "./dist/modules/schema-builder/types/index.js",
|
|
73
|
+
"./modules/schema-builder/utils": "./dist/modules/schema-builder/utils/index.js",
|
|
76
74
|
"./modules/singleton-manager": "./dist/modules/singleton-manager/index.js",
|
|
77
75
|
"./modules/singleton-manager/enums": "./dist/modules/singleton-manager/enums/index.js",
|
|
78
76
|
"./modules/totp": "./dist/modules/totp/index.js",
|