@react-querybuilder/core 8.9.1 → 8.10.0

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.
Files changed (106) hide show
  1. package/dist/arrayUtils-C9sO4qLO.mjs +50 -0
  2. package/dist/arrayUtils-C9sO4qLO.mjs.map +1 -0
  3. package/dist/arrayUtils-QxZOZTf6.js +73 -0
  4. package/dist/arrayUtils-QxZOZTf6.js.map +1 -0
  5. package/dist/basic-BmpEwexQ.d.mts +363 -0
  6. package/dist/basic-CDDA-KZa.d.ts +363 -0
  7. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +569 -1252
  8. package/dist/cjs/react-querybuilder_core.cjs.development.js +430 -140
  9. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  10. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +569 -1252
  11. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  12. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  13. package/dist/convertQuery-BUgyz1GA.mjs +75 -0
  14. package/dist/convertQuery-BUgyz1GA.mjs.map +1 -0
  15. package/dist/export-Ccjfea21.d.mts +453 -0
  16. package/dist/{export-DyrnTh6K.d.ts → export-GUuxJ7zR.d.ts} +3 -2
  17. package/dist/formatQuery.d.mts +668 -0
  18. package/dist/formatQuery.d.ts +3 -2
  19. package/dist/formatQuery.js +217 -87
  20. package/dist/formatQuery.js.map +1 -1
  21. package/dist/formatQuery.mjs +2496 -0
  22. package/dist/formatQuery.mjs.map +1 -0
  23. package/dist/{import-Cksobmln.d.ts → import-D-hm1phN.d.ts} +2 -2
  24. package/dist/import-Dxevzw_-.d.mts +28 -0
  25. package/dist/isRuleGroup-CGe_rb2w.mjs +40 -0
  26. package/dist/isRuleGroup-CGe_rb2w.mjs.map +1 -0
  27. package/dist/isRuleGroup-DqAs2x4E.js.map +1 -1
  28. package/dist/{optGroupUtils-CXLgyg2i.js → optGroupUtils-B0hTpodo.js} +114 -1
  29. package/dist/optGroupUtils-B0hTpodo.js.map +1 -0
  30. package/dist/optGroupUtils-DrubUpx0.mjs +185 -0
  31. package/dist/optGroupUtils-DrubUpx0.mjs.map +1 -0
  32. package/dist/parseCEL.d.mts +315 -0
  33. package/dist/parseCEL.d.ts +292 -11
  34. package/dist/parseCEL.js +114 -30
  35. package/dist/parseCEL.js.map +1 -1
  36. package/dist/parseCEL.mjs +2631 -0
  37. package/dist/parseCEL.mjs.map +1 -0
  38. package/dist/parseJSONata.d.mts +37 -0
  39. package/dist/parseJSONata.d.ts +3 -2
  40. package/dist/parseJSONata.js +49 -77
  41. package/dist/parseJSONata.js.map +1 -1
  42. package/dist/parseJSONata.mjs +267 -0
  43. package/dist/parseJSONata.mjs.map +1 -0
  44. package/dist/parseJsonLogic.d.mts +37 -0
  45. package/dist/parseJsonLogic.d.ts +4 -3
  46. package/dist/parseJsonLogic.js +5 -6
  47. package/dist/parseJsonLogic.js.map +1 -1
  48. package/dist/parseJsonLogic.mjs +190 -0
  49. package/dist/parseJsonLogic.mjs.map +1 -0
  50. package/dist/parseMongoDB.d.mts +80 -0
  51. package/dist/parseMongoDB.d.ts +3 -2
  52. package/dist/parseMongoDB.js +15 -16
  53. package/dist/parseMongoDB.js.map +1 -1
  54. package/dist/parseMongoDB.mjs +266 -0
  55. package/dist/parseMongoDB.mjs.map +1 -0
  56. package/dist/parseNumber-B_-sR6d5.mjs +24 -0
  57. package/dist/parseNumber-B_-sR6d5.mjs.map +1 -0
  58. package/dist/{parseNumber-Bcys1kOH.js → parseNumber-D4iQDxK-.js} +1 -1
  59. package/dist/{parseNumber-Bcys1kOH.js.map → parseNumber-D4iQDxK-.js.map} +1 -1
  60. package/dist/parseSQL.d.mts +38 -0
  61. package/dist/parseSQL.d.ts +3 -2
  62. package/dist/parseSQL.js +11 -15
  63. package/dist/parseSQL.js.map +1 -1
  64. package/dist/parseSQL.mjs +6622 -0
  65. package/dist/parseSQL.mjs.map +1 -0
  66. package/dist/parseSpEL.d.mts +35 -0
  67. package/dist/parseSpEL.d.ts +3 -2
  68. package/dist/parseSpEL.js +7 -9
  69. package/dist/parseSpEL.js.map +1 -1
  70. package/dist/parseSpEL.mjs +272 -0
  71. package/dist/parseSpEL.mjs.map +1 -0
  72. package/dist/{prepareQueryObjects-BqFEs4eV.js → prepareQueryObjects-BOUWfel5.js} +4 -5
  73. package/dist/prepareQueryObjects-BOUWfel5.js.map +1 -0
  74. package/dist/prepareQueryObjects-CJNpnGcJ.mjs +153 -0
  75. package/dist/prepareQueryObjects-CJNpnGcJ.mjs.map +1 -0
  76. package/dist/query-builder-layout.css +1 -1
  77. package/dist/query-builder-layout.css.map +1 -1
  78. package/dist/query-builder.css +1 -1
  79. package/dist/query-builder.css.map +1 -1
  80. package/dist/react-querybuilder_core.d.mts +569 -1252
  81. package/dist/react-querybuilder_core.legacy-esm.d.ts +569 -1252
  82. package/dist/react-querybuilder_core.legacy-esm.js +430 -136
  83. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  84. package/dist/react-querybuilder_core.mjs +426 -141
  85. package/dist/react-querybuilder_core.mjs.map +1 -1
  86. package/dist/react-querybuilder_core.production.d.mts +569 -1252
  87. package/dist/react-querybuilder_core.production.mjs +1 -1
  88. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  89. package/dist/styles/_layout.scss +61 -17
  90. package/dist/styles/_main.scss +17 -4
  91. package/dist/{transformQuery-FL_nlpp5.js → transformQuery-CWDPogO5.js} +1 -1
  92. package/dist/{transformQuery-FL_nlpp5.js.map → transformQuery-CWDPogO5.js.map} +1 -1
  93. package/dist/transformQuery-DHvtgDgZ.mjs +41 -0
  94. package/dist/transformQuery-DHvtgDgZ.mjs.map +1 -0
  95. package/dist/transformQuery.d.mts +118 -0
  96. package/dist/transformQuery.d.ts +1 -1
  97. package/dist/transformQuery.js +1 -1
  98. package/dist/transformQuery.mjs +4 -0
  99. package/package.json +78 -28
  100. package/dist/arrayUtils-D5EoIsKP.js +0 -164
  101. package/dist/arrayUtils-D5EoIsKP.js.map +0 -1
  102. package/dist/basic-C8xXKHIA.d.ts +0 -1235
  103. package/dist/objectUtils-BBZSfZJz.js +0 -17
  104. package/dist/objectUtils-BBZSfZJz.js.map +0 -1
  105. package/dist/optGroupUtils-CXLgyg2i.js.map +0 -1
  106. package/dist/prepareQueryObjects-BqFEs4eV.js.map +0 -1
@@ -0,0 +1,668 @@
1
+ import { RuleGroupTypeAny, RuleType } from "./basic-BmpEwexQ.mjs";
2
+ import { ConstituentWordOrder, ExportFormat, ExportObjectFormats, ExportOperatorMap, FormatQueryOptions, GroupVariantCondition, NLTranslationKey, NLTranslations, ParameterizedNamedSQL, ParameterizedSQL, RQBJsonLogic, RuleGroupProcessor, RuleProcessor, SQLPreset, ValueProcessorByRule, ValueProcessorLegacy, ValueProcessorOptions } from "./export-Ccjfea21.mjs";
3
+ import { SetRequired } from "type-fest";
4
+ import { Column, Operators, SQL, Table } from "drizzle-orm";
5
+ import { WhereOptions } from "sequelize";
6
+
7
+ //#region src/utils/formatQuery/defaultRuleProcessorCEL.d.ts
8
+ /**
9
+ * Default rule processor used by {@link formatQuery} for "cel" format.
10
+ *
11
+ * @group Export
12
+ */
13
+ declare const defaultRuleProcessorCEL: RuleProcessor;
14
+ //#endregion
15
+ //#region src/utils/formatQuery/defaultRuleProcessorMongoDB.d.ts
16
+ /**
17
+ * Default rule processor used by {@link formatQuery} for "mongodb" format.
18
+ *
19
+ * Note that the "mongodb" format is deprecated in favor of the "mongodb_query" format.
20
+ *
21
+ * @group Export
22
+ */
23
+ declare const defaultRuleProcessorMongoDB: RuleProcessor;
24
+ //#endregion
25
+ //#region src/utils/formatQuery/defaultRuleProcessorSpEL.d.ts
26
+ /**
27
+ * Default rule processor used by {@link formatQuery} for "spel" format.
28
+ *
29
+ * @group Export
30
+ */
31
+ declare const defaultRuleProcessorSpEL: RuleProcessor;
32
+ //#endregion
33
+ //#region src/utils/formatQuery/defaultValueProcessorByRule.d.ts
34
+ /**
35
+ * Default value processor used by {@link formatQuery} for "sql" format.
36
+ *
37
+ * @group Export
38
+ */
39
+ declare const defaultValueProcessorByRule: ValueProcessorByRule;
40
+ //#endregion
41
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorCEL.d.ts
42
+ /**
43
+ * Rule group processor used by {@link formatQuery} for "cel" format.
44
+ *
45
+ * @group Export
46
+ */
47
+ declare const defaultRuleGroupProcessorCEL: RuleGroupProcessor<string>;
48
+ //#endregion
49
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorDrizzle.d.ts
50
+ /**
51
+ * Default rule group processor used by {@link formatQuery} for the "drizzle" format. The returned
52
+ * function can be assigned to the `where` property in the Drizzle relational queries API.
53
+ *
54
+ * @example
55
+ * const where = formatQuery(query, 'drizzle');
56
+ * const results = db.query.users.findMany({ where });
57
+ *
58
+ * @returns Function that takes a Drizzle table config and an object of Drizzle operators.
59
+ *
60
+ * @group Export
61
+ */
62
+ declare const defaultRuleGroupProcessorDrizzle: RuleGroupProcessor<(columns: Record<string, Column> | Table, drizzleOperators: Operators) => SQL | undefined>;
63
+ //#endregion
64
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorElasticSearch.d.ts
65
+ /**
66
+ * Rule group processor used by {@link formatQuery} for "elasticsearch" format.
67
+ *
68
+ * @group Export
69
+ */
70
+ declare const defaultRuleGroupProcessorElasticSearch: RuleGroupProcessor<Record<string, unknown>>;
71
+ //#endregion
72
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorJSONata.d.ts
73
+ /**
74
+ * Rule group processor used by {@link formatQuery} for "jsonata" format.
75
+ *
76
+ * @group Export
77
+ */
78
+ declare const defaultRuleGroupProcessorJSONata: RuleGroupProcessor<string>;
79
+ //#endregion
80
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorJsonLogic.d.ts
81
+ /**
82
+ * Rule group processor used by {@link formatQuery} for "jsonlogic" format.
83
+ *
84
+ * @group Export
85
+ */
86
+ declare const defaultRuleGroupProcessorJsonLogic: RuleGroupProcessor<RQBJsonLogic>;
87
+ //#endregion
88
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorLDAP.d.ts
89
+ /**
90
+ * Rule group processor used by {@link formatQuery} for "ldap" format.
91
+ *
92
+ * @group Export
93
+ */
94
+ declare const defaultRuleGroupProcessorLDAP: RuleGroupProcessor<string>;
95
+ //#endregion
96
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorMongoDB.d.ts
97
+ /**
98
+ * Rule group processor used by {@link formatQuery} for "mongodb" format.
99
+ *
100
+ * Note that the "mongodb" format is deprecated in favor of the "mongodb_query" format.
101
+ *
102
+ * @group Export
103
+ */
104
+ declare const defaultRuleGroupProcessorMongoDB: RuleGroupProcessor<string>;
105
+ //#endregion
106
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorMongoDBQuery.d.ts
107
+ /**
108
+ * Default fallback object used by {@link formatQuery} for "mongodb_query" format.
109
+ *
110
+ * @group Export
111
+ */
112
+ declare const mongoDbFallback: {
113
+ readonly $and: readonly [{
114
+ readonly $expr: true;
115
+ }];
116
+ };
117
+ /**
118
+ * Rule group processor used by {@link formatQuery} for "mongodb_query" format.
119
+ *
120
+ * @group Export
121
+ */
122
+ declare const defaultRuleGroupProcessorMongoDBQuery: RuleGroupProcessor;
123
+ //#endregion
124
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorNL.d.ts
125
+ /**
126
+ * Rule group processor used by {@link formatQuery} for "natural_language" format.
127
+ *
128
+ * @group Export
129
+ */
130
+ declare const defaultRuleGroupProcessorNL: RuleGroupProcessor<string>;
131
+ //#endregion
132
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorParameterized.d.ts
133
+ /**
134
+ * Rule group processor used by {@link formatQuery} for "parameterized" and
135
+ * "parameterized_named" formats.
136
+ *
137
+ * @group Export
138
+ */
139
+ declare const defaultRuleGroupProcessorParameterized: RuleGroupProcessor<ParameterizedSQL | ParameterizedNamedSQL>;
140
+ //#endregion
141
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorPrisma.d.ts
142
+ /**
143
+ * Default fallback object used by {@link formatQuery} for "prisma" format.
144
+ *
145
+ * @group Export
146
+ */
147
+ declare const prismaFallback: {};
148
+ /**
149
+ * Rule group processor used by {@link formatQuery} for "prisma" format.
150
+ *
151
+ * @group Export
152
+ */
153
+ declare const defaultRuleGroupProcessorPrisma: RuleGroupProcessor<Record<string, unknown> | undefined>;
154
+ //#endregion
155
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorSequelize.d.ts
156
+ /**
157
+ * Rule group processor used by {@link formatQuery} for "sequelize" format.
158
+ *
159
+ * @group Export
160
+ */
161
+ declare const defaultRuleGroupProcessorSequelize: RuleGroupProcessor<WhereOptions | undefined>;
162
+ //#endregion
163
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorSpEL.d.ts
164
+ /**
165
+ * Default rule processor used by {@link formatQuery} for "spel" format.
166
+ *
167
+ * @group Export
168
+ */
169
+ declare const defaultRuleGroupProcessorSpEL: RuleGroupProcessor<string>;
170
+ //#endregion
171
+ //#region src/utils/formatQuery/defaultRuleGroupProcessorSQL.d.ts
172
+ /**
173
+ * Default rule processor used by {@link formatQuery} for "sql" format.
174
+ *
175
+ * @group Export
176
+ */
177
+ declare const defaultRuleGroupProcessorSQL: RuleGroupProcessor<string>;
178
+ //#endregion
179
+ //#region src/utils/formatQuery/defaultRuleProcessorDrizzle.d.ts
180
+ /**
181
+ * Default rule processor used by {@link formatQuery} for the "drizzle" format.
182
+ *
183
+ * @group Export
184
+ */
185
+ declare const defaultRuleProcessorDrizzle: RuleProcessor;
186
+ //#endregion
187
+ //#region src/utils/formatQuery/defaultRuleProcessorElasticSearch.d.ts
188
+ /**
189
+ * Default rule processor used by {@link formatQuery} for "elasticsearch" format.
190
+ *
191
+ * @group Export
192
+ */
193
+ declare const defaultRuleProcessorElasticSearch: RuleProcessor;
194
+ //#endregion
195
+ //#region src/utils/formatQuery/defaultRuleProcessorJSONata.d.ts
196
+ /**
197
+ * Default rule processor used by {@link formatQuery} for "jsonata" format.
198
+ *
199
+ * @group Export
200
+ */
201
+ declare const defaultRuleProcessorJSONata: RuleProcessor;
202
+ //#endregion
203
+ //#region src/utils/formatQuery/defaultRuleProcessorJsonLogic.d.ts
204
+ /**
205
+ * Default rule processor used by {@link formatQuery} for "jsonlogic" format.
206
+ *
207
+ * @group Export
208
+ */
209
+ declare const defaultRuleProcessorJsonLogic: RuleProcessor;
210
+ //#endregion
211
+ //#region src/utils/formatQuery/defaultRuleProcessorLDAP.d.ts
212
+ /**
213
+ * Default rule processor used by {@link formatQuery} for "ldap" format.
214
+ *
215
+ * @group Export
216
+ */
217
+ declare const defaultRuleProcessorLDAP: RuleProcessor;
218
+ //#endregion
219
+ //#region src/utils/formatQuery/defaultRuleProcessorMongoDBQuery.d.ts
220
+ /**
221
+ * Default rule processor used by {@link formatQuery} for "mongodb_query" format.
222
+ *
223
+ * @group Export
224
+ */
225
+ declare const defaultRuleProcessorMongoDBQuery: RuleProcessor;
226
+ //#endregion
227
+ //#region src/utils/formatQuery/defaultRuleProcessorNL.d.ts
228
+ /**
229
+ * Default operator map used by {@link formatQuery} for "natural_language" format.
230
+ *
231
+ * @group Export
232
+ */
233
+ declare const defaultExportOperatorMap: ExportOperatorMap;
234
+ /**
235
+ * Default operator processor used by {@link formatQuery} for "natural_language" format.
236
+ *
237
+ * @group Export
238
+ */
239
+ declare const defaultOperatorProcessorNL: RuleProcessor;
240
+ /**
241
+ * Default rule processor used by {@link formatQuery} for "natural_language" format.
242
+ *
243
+ * @group Export
244
+ */
245
+ declare const defaultRuleProcessorNL: RuleProcessor;
246
+ //#endregion
247
+ //#region src/utils/formatQuery/defaultRuleProcessorParameterized.d.ts
248
+ /**
249
+ * Default rule processor used by {@link formatQuery} for "parameterized" and
250
+ * "parameterized_named" formats.
251
+ *
252
+ * @group Export
253
+ */
254
+ declare const defaultRuleProcessorParameterized: RuleProcessor;
255
+ //#endregion
256
+ //#region src/utils/formatQuery/defaultRuleProcessorPrisma.d.ts
257
+ /**
258
+ * Default rule processor used by {@link formatQuery} for "prisma" format.
259
+ *
260
+ * @group Export
261
+ */
262
+ declare const defaultRuleProcessorPrisma: RuleProcessor;
263
+ //#endregion
264
+ //#region src/utils/formatQuery/defaultRuleProcessorSequelize.d.ts
265
+ /**
266
+ * Default rule processor used by {@link formatQuery} for the "sequelize" format.
267
+ *
268
+ * @group Export
269
+ */
270
+ declare const defaultRuleProcessorSequelize: RuleProcessor;
271
+ //#endregion
272
+ //#region src/utils/formatQuery/defaultRuleProcessorSQL.d.ts
273
+ /**
274
+ * Default operator processor used by {@link formatQuery} for "sql" and "parameterized*" formats.
275
+ *
276
+ * @group Export
277
+ */
278
+ declare const defaultOperatorProcessorSQL: RuleProcessor;
279
+ /**
280
+ * Default rule processor used by {@link formatQuery} for "sql" format.
281
+ *
282
+ * @group Export
283
+ */
284
+ declare const defaultRuleProcessorSQL: RuleProcessor;
285
+ //#endregion
286
+ //#region src/utils/formatQuery/defaultValueProcessorNL.d.ts
287
+ /**
288
+ * Default value processor used by {@link formatQuery} for "natural_language" format.
289
+ *
290
+ * @group Export
291
+ */
292
+ declare const defaultValueProcessorNL: ValueProcessorByRule;
293
+ //#endregion
294
+ //#region src/utils/formatQuery/formatQuery.d.ts
295
+ /**
296
+ * A collection of option presets for {@link formatQuery}, specifically for SQL-based formats.
297
+ *
298
+ * @group Export
299
+ */
300
+ declare const sqlDialectPresets: Record<SQLPreset, FormatQueryOptions>;
301
+ /**
302
+ * A collection of option presets for {@link formatQuery}.
303
+ *
304
+ * @group Export
305
+ */
306
+ declare const formatQueryOptionPresets: Record<string, FormatQueryOptions>;
307
+ /**
308
+ * Generates a formatted (indented two spaces) JSON string from a query object.
309
+ *
310
+ * @group Export
311
+ */
312
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny): string;
313
+ /**
314
+ * Generates a result based on the provided rule group processor.
315
+ *
316
+ * @group Export
317
+ */
318
+ declare function formatQuery<TResult = unknown>(ruleGroup: RuleGroupTypeAny, options: FormatQueryOptions & {
319
+ ruleGroupProcessor: RuleGroupProcessor<TResult>;
320
+ }): TResult;
321
+ /**
322
+ * Generates a {@link index!ParameterizedSQL ParameterizedSQL} object from a query object.
323
+ *
324
+ * @group Export
325
+ */
326
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "parameterized" | (FormatQueryOptions & {
327
+ format: "parameterized";
328
+ })): ParameterizedSQL;
329
+ /**
330
+ * Generates a {@link index!ParameterizedNamedSQL ParameterizedNamedSQL} object from a query object.
331
+ *
332
+ * @group Export
333
+ */
334
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "parameterized_named" | (FormatQueryOptions & {
335
+ format: "parameterized_named";
336
+ })): ParameterizedNamedSQL;
337
+ /**
338
+ * Generates a {@link index!RQBJsonLogic JsonLogic} object from a query object.
339
+ *
340
+ * @group Export
341
+ */
342
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "jsonlogic" | (FormatQueryOptions & {
343
+ format: "jsonlogic";
344
+ })): RQBJsonLogic;
345
+ /**
346
+ * Generates an ElasticSearch query object from an RQB query object.
347
+ *
348
+ * NOTE: Support for the ElasticSearch format is experimental.
349
+ * You may have better results exporting "sql" format then using
350
+ * [ElasticSearch SQL](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-sql.html).
351
+ *
352
+ * @group Export
353
+ */
354
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "elasticsearch" | (FormatQueryOptions & {
355
+ format: "elasticsearch";
356
+ })): Record<string, any>;
357
+ /**
358
+ * Generates a MongoDB query object from an RQB query object.
359
+ *
360
+ * This is equivalent to the "mongodb" format, but returns a JSON object
361
+ * instead of a string.
362
+ *
363
+ * @group Export
364
+ */
365
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "mongodb_query" | (FormatQueryOptions & {
366
+ format: "mongodb_query";
367
+ })): Record<string, any>;
368
+ /**
369
+ * Generates a JSON.stringify'd MongoDB query object from an RQB query object.
370
+ *
371
+ * This is equivalent to the "mongodb_query" format, but returns a string
372
+ * instead of a JSON object.
373
+ *
374
+ * @deprecated Use the "mongodb_query" format for greater flexibility.
375
+ *
376
+ * @group Export
377
+ */
378
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "mongodb" | (FormatQueryOptions & {
379
+ format: "mongodb";
380
+ })): string;
381
+ /**
382
+ * Generates a Prisma ORM query object from an RQB query object.
383
+ *
384
+ * @group Export
385
+ */
386
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "prisma" | (FormatQueryOptions & {
387
+ format: "prisma";
388
+ })): Record<string, any>;
389
+ /**
390
+ * Generates a Drizzle ORM query function from an RQB query object. The function can
391
+ * be assigned to the `where` property in the Drizzle relational queries API.
392
+ *
393
+ * @group Export
394
+ */
395
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "drizzle" | (FormatQueryOptions & {
396
+ format: "drizzle";
397
+ })): ReturnType<typeof defaultRuleGroupProcessorDrizzle>;
398
+ /**
399
+ * Generates a Sequelize query object from an RQB query object. The object can
400
+ * be assigned to the `where` property in the Sequelize query functions.
401
+ *
402
+ * @group Export
403
+ */
404
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "sequelize" | (FormatQueryOptions & {
405
+ format: "sequelize";
406
+ })): ReturnType<typeof defaultRuleGroupProcessorSequelize>;
407
+ /**
408
+ * Generates a JSONata query string from an RQB query object.
409
+ *
410
+ * NOTE: Either `parseNumbers: "strict-limited"` or `parseNumbers: true`
411
+ * are recommended for this format.
412
+ *
413
+ * @group Export
414
+ */
415
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "jsonata" | (FormatQueryOptions & {
416
+ format: "jsonata";
417
+ })): string;
418
+ /**
419
+ * Generates an LDAP query string from an RQB query object.
420
+ *
421
+ * @group Export
422
+ */
423
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: "ldap" | (FormatQueryOptions & {
424
+ format: "ldap";
425
+ })): string;
426
+ /**
427
+ * Generates a formatted (indented two spaces) JSON string from a query object.
428
+ *
429
+ * @group Export
430
+ */
431
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: FormatQueryOptions): string;
432
+ /**
433
+ * Generates a query string in the requested format.
434
+ *
435
+ * @group Export
436
+ */
437
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: Exclude<ExportFormat, ExportObjectFormats>): string;
438
+ /**
439
+ * Generates a query string in the requested format.
440
+ *
441
+ * @group Export
442
+ */
443
+ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: FormatQueryOptions & {
444
+ format: Exclude<ExportFormat, ExportObjectFormats>;
445
+ }): string;
446
+ //#endregion
447
+ //#region src/utils/formatQuery/utils.d.ts
448
+ /**
449
+ * Maps a {@link DefaultOperatorName} to a SQL operator.
450
+ *
451
+ * @group Export
452
+ */
453
+ declare const mapSQLOperator: (rqbOperator: string) => string;
454
+ /**
455
+ * Maps a (lowercase) {@link DefaultOperatorName} to a MongoDB operator.
456
+ *
457
+ * @group Export
458
+ */
459
+ declare const mongoOperators: {
460
+ "=": string;
461
+ "!=": string;
462
+ "<": string;
463
+ "<=": string;
464
+ ">": string;
465
+ ">=": string;
466
+ in: string;
467
+ notin: string;
468
+ notIn: string;
469
+ };
470
+ /**
471
+ * Maps a (lowercase) {@link DefaultOperatorName} to a Prisma ORM operator.
472
+ *
473
+ * @group Export
474
+ */
475
+ declare const prismaOperators: {
476
+ "=": string;
477
+ "!=": string;
478
+ "<": string;
479
+ "<=": string;
480
+ ">": string;
481
+ ">=": string;
482
+ in: string;
483
+ notin: string;
484
+ };
485
+ /**
486
+ * Maps a {@link DefaultCombinatorName} to a CEL combinator.
487
+ *
488
+ * @group Export
489
+ */
490
+ declare const celCombinatorMap: {
491
+ and: "&&";
492
+ or: "||";
493
+ };
494
+ /**
495
+ * Register these operators with `jsonLogic` before applying the result
496
+ * of `formatQuery(query, 'jsonlogic')`.
497
+ *
498
+ * @example
499
+ * ```
500
+ * for (const [op, func] of Object.entries(jsonLogicAdditionalOperators)) {
501
+ * jsonLogic.add_operation(op, func);
502
+ * }
503
+ * jsonLogic.apply({ "startsWith": [{ "var": "firstName" }, "Stev"] }, data);
504
+ * ```
505
+ *
506
+ * @group Export
507
+ */
508
+ declare const jsonLogicAdditionalOperators: Record<"startsWith" | "endsWith", (a: string, b: string) => boolean>;
509
+ /**
510
+ * Converts all `string`-type `value` properties of a query object into `number` where appropriate.
511
+ *
512
+ * Used by {@link formatQuery} for the `json*` formats when `parseNumbers` is `true`.
513
+ *
514
+ * @group Export
515
+ */
516
+ declare const numerifyValues: (rg: RuleGroupTypeAny, options: SetRequired<FormatQueryOptions, "fields">) => RuleGroupTypeAny;
517
+ /**
518
+ * Determines whether a value is _anything_ except an empty `string` or `NaN`.
519
+ *
520
+ * @group Export
521
+ */
522
+ declare const isValidValue: (value: any) => boolean;
523
+ /**
524
+ * Determines whether {@link formatQuery} should render the given value as a number.
525
+ * As long as `parseNumbers` is `true`, `number` and `bigint` values will return `true` and
526
+ * `string` values will return `true` if they test positive against {@link numericRegex}.
527
+ *
528
+ * @group Export
529
+ */
530
+ declare const shouldRenderAsNumber: (value: any, parseNumbers?: boolean) => boolean;
531
+ /**
532
+ * Used by {@link formatQuery} to determine whether the given value processor is a
533
+ * "legacy" value processor by counting the number of arguments. Legacy value
534
+ * processors take 3 arguments (not counting any arguments with default values), while
535
+ * rule-based value processors take no more than 2 arguments.
536
+ *
537
+ * @group Export
538
+ */
539
+ declare const isValueProcessorLegacy: (valueProcessor: ValueProcessorLegacy | ValueProcessorByRule) => valueProcessor is ValueProcessorLegacy;
540
+ /**
541
+ * Converts the `quoteFieldNamesWith` option into an array of two strings.
542
+ * If the option is a string, the array elements are both that string.
543
+ *
544
+ * @default
545
+ * ['', '']
546
+ *
547
+ * @group Export
548
+ */
549
+ declare const getQuoteFieldNamesWithArray: (quoteFieldNamesWith?: null | string | [string, string]) => [string, string];
550
+ /**
551
+ * Given a field name and relevant {@link ValueProcessorOptions}, returns the field name
552
+ * wrapped in the configured quote character(s).
553
+ *
554
+ * @group Export
555
+ */
556
+ declare const getQuotedFieldName: (fieldName: string, {
557
+ quoteFieldNamesWith,
558
+ fieldIdentifierSeparator
559
+ }: ValueProcessorOptions) => string;
560
+ /**
561
+ * Given a [Constituent word order](https://en.wikipedia.org/wiki/Word_order#Constituent_word_orders)
562
+ * like "svo" or "sov", returns a permutation of `["S", "V", "O"]` based on the first occurrence of
563
+ * each letter in the input string (case insensitive). This widens the valid input from abbreviations
564
+ * like "svo" to more expressive strings like "subject-verb-object" or "sub ver obj". Any missing
565
+ * letters are appended in the default order "SVO" (e.g., "object" would yield `["O", "S", "V"]`).
566
+ *
567
+ * @group Export
568
+ */
569
+ declare const normalizeConstituentWordOrder: (input: string) => ConstituentWordOrder;
570
+ /**
571
+ * Default translations used by {@link formatQuery} for "natural_language" format.
572
+ *
573
+ * @group Export
574
+ */
575
+ declare const defaultNLTranslations: NLTranslations;
576
+ /**
577
+ * Used by {@link formatQuery} to get a translation based on certain conditions
578
+ * for the "natural_language" format.
579
+ *
580
+ * @group Export
581
+ */
582
+ declare const getNLTranslataion: (key: NLTranslationKey, translations: NLTranslations, conditions?: GroupVariantCondition[]) => string;
583
+ type ProcessedMatchMode = {
584
+ mode: "all";
585
+ threshold?: number | null | undefined;
586
+ } | {
587
+ mode: "none";
588
+ threshold?: number | null | undefined;
589
+ } | {
590
+ mode: "some";
591
+ threshold?: number | null | undefined;
592
+ } | {
593
+ mode: "atleast";
594
+ threshold: number;
595
+ } | {
596
+ mode: "atmost";
597
+ threshold: number;
598
+ } | {
599
+ mode: "exactly";
600
+ threshold: number;
601
+ };
602
+ declare const processMatchMode: (rule: RuleType) => void | false | ProcessedMatchMode;
603
+ /**
604
+ * "Replacer" method for JSON.stringify's second argument. Converts `bigint` values to
605
+ * objects with a `$bigint` property having a value of a string representation of
606
+ * the actual `bigint`-type value.
607
+ *
608
+ * Inverse of {@link bigIntJsonParseReviver}.
609
+ *
610
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json
611
+ */
612
+ declare const bigIntJsonStringifyReplacer: (_key: string, value: unknown) => unknown;
613
+ /**
614
+ * "Reviver" method for JSON.parse's second argument. Converts objects having a single
615
+ * `$bigint: string` property to an actual `bigint` value.
616
+ *
617
+ * Inverse of {@link bigIntJsonStringifyReplacer}.
618
+ *
619
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json
620
+ */
621
+ declare const bigIntJsonParseReviver: (_key: string, value: unknown) => unknown;
622
+ //#endregion
623
+ //#region src/utils/formatQuery/index.d.ts
624
+ /**
625
+ * Default value processor used by {@link formatQuery} for "sql" format.
626
+ *
627
+ * @group Export
628
+ */
629
+ declare const defaultValueProcessor: ValueProcessorLegacy;
630
+ /**
631
+ * @deprecated Prefer {@link defaultRuleProcessorMongoDB}.
632
+ *
633
+ * @group Export
634
+ */
635
+ declare const defaultMongoDBValueProcessor: ValueProcessorLegacy;
636
+ /**
637
+ * @deprecated Prefer {@link defaultRuleProcessorCEL}.
638
+ *
639
+ * @group Export
640
+ */
641
+ declare const defaultCELValueProcessor: ValueProcessorLegacy;
642
+ /**
643
+ * @deprecated Prefer {@link defaultRuleProcessorSpEL}.
644
+ *
645
+ * @group Export
646
+ */
647
+ declare const defaultSpELValueProcessor: ValueProcessorLegacy;
648
+ /**
649
+ * @deprecated Renamed to {@link defaultRuleProcessorCEL}.
650
+ *
651
+ * @group Export
652
+ */
653
+ declare const defaultValueProcessorCELByRule: RuleProcessor;
654
+ /**
655
+ * @deprecated Renamed to {@link defaultRuleProcessorMongoDB}.
656
+ *
657
+ * @group Export
658
+ */
659
+ declare const defaultValueProcessorMongoDBByRule: RuleProcessor;
660
+ /**
661
+ * @deprecated Renamed to {@link defaultRuleProcessorSpEL}.
662
+ *
663
+ * @group Export
664
+ */
665
+ declare const defaultValueProcessorSpELByRule: RuleProcessor;
666
+ //#endregion
667
+ export { bigIntJsonParseReviver, bigIntJsonStringifyReplacer, celCombinatorMap, defaultCELValueProcessor, defaultExportOperatorMap, defaultMongoDBValueProcessor, defaultNLTranslations, defaultOperatorProcessorNL, defaultOperatorProcessorSQL, defaultRuleGroupProcessorCEL, defaultRuleGroupProcessorDrizzle, defaultRuleGroupProcessorElasticSearch, defaultRuleGroupProcessorJSONata, defaultRuleGroupProcessorJsonLogic, defaultRuleGroupProcessorLDAP, defaultRuleGroupProcessorMongoDB, defaultRuleGroupProcessorMongoDBQuery, defaultRuleGroupProcessorNL, defaultRuleGroupProcessorParameterized, defaultRuleGroupProcessorPrisma, defaultRuleGroupProcessorSQL, defaultRuleGroupProcessorSequelize, defaultRuleGroupProcessorSpEL, defaultRuleProcessorCEL, defaultRuleProcessorDrizzle, defaultRuleProcessorElasticSearch, defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, defaultRuleProcessorLDAP, defaultRuleProcessorMongoDB, defaultRuleProcessorMongoDBQuery, defaultRuleProcessorNL, defaultRuleProcessorParameterized, defaultRuleProcessorPrisma, defaultRuleProcessorSQL, defaultRuleProcessorSequelize, defaultRuleProcessorSpEL, defaultSpELValueProcessor, defaultValueProcessor, defaultValueProcessorByRule, defaultValueProcessorCELByRule, defaultValueProcessorMongoDBByRule, defaultValueProcessorNL, defaultValueProcessorSpELByRule, formatQuery, formatQueryOptionPresets, getNLTranslataion, getQuoteFieldNamesWithArray, getQuotedFieldName, isValidValue, isValueProcessorLegacy, jsonLogicAdditionalOperators, mapSQLOperator, mongoDbFallback, mongoOperators, normalizeConstituentWordOrder, numerifyValues, prismaFallback, prismaOperators, processMatchMode, shouldRenderAsNumber, sqlDialectPresets };
668
+ //# sourceMappingURL=formatQuery.d.mts.map
@@ -1,5 +1,6 @@
1
- import { RuleGroupTypeAny, RuleType, SetRequired } from "./basic-C8xXKHIA.js";
2
- import { ConstituentWordOrder, ExportFormat, ExportObjectFormats, ExportOperatorMap, FormatQueryOptions, GroupVariantCondition, NLTranslationKey, NLTranslations, ParameterizedNamedSQL, ParameterizedSQL, RQBJsonLogic, RuleGroupProcessor, RuleProcessor, SQLPreset, ValueProcessorByRule, ValueProcessorLegacy, ValueProcessorOptions } from "./export-DyrnTh6K.js";
1
+ import { RuleGroupTypeAny, RuleType } from "./basic-CDDA-KZa.js";
2
+ import { ConstituentWordOrder, ExportFormat, ExportObjectFormats, ExportOperatorMap, FormatQueryOptions, GroupVariantCondition, NLTranslationKey, NLTranslations, ParameterizedNamedSQL, ParameterizedSQL, RQBJsonLogic, RuleGroupProcessor, RuleProcessor, SQLPreset, ValueProcessorByRule, ValueProcessorLegacy, ValueProcessorOptions } from "./export-GUuxJ7zR.js";
3
+ import { SetRequired } from "type-fest";
3
4
  import { Column, Operators, SQL, Table } from "drizzle-orm";
4
5
  import { WhereOptions } from "sequelize";
5
6