@yongdall/common 0.2.0 → 0.3.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.
- package/index.d.mts +77 -15
- package/index.mjs +129 -17
- package/index.mjs.map +1 -1
- package/package.json +2 -2
package/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Search } from "@yongdall/common";
|
|
1
2
|
import { Permission } from "@yongdall/types";
|
|
2
3
|
|
|
3
4
|
//#region \0rolldown/runtime.js
|
|
@@ -22,7 +23,7 @@ type FieldValue = {
|
|
|
22
23
|
};
|
|
23
24
|
type Value = string | number | boolean | RecursiveArray<string> | FieldValue | null;
|
|
24
25
|
type Field = string | [string, ...number[]];
|
|
25
|
-
type Match = [fields: Field[], value: Value
|
|
26
|
+
type Match = [fields: Field[], value: Value, operator: string | null, sign?: string];
|
|
26
27
|
type Children = [fields: Field[], children: AndList];
|
|
27
28
|
type Or = {
|
|
28
29
|
or?: OrList | undefined;
|
|
@@ -64,11 +65,12 @@ declare function exec(data: Record<string, any>, exec: (value: ExecParam) => boo
|
|
|
64
65
|
*/
|
|
65
66
|
declare function asyncExec(data: Record<string, any>, exec: (value: ExecParam) => PromiseLike<boolean | null> | (boolean | null), and?: (Match | Children)[], or?: (Match | Children | Or)[]): Promise<boolean | null>;
|
|
66
67
|
type ExecParam = {
|
|
67
|
-
fields:
|
|
68
|
+
fields: Field[];
|
|
68
69
|
operator: string;
|
|
69
70
|
sign?: string | null | undefined;
|
|
70
71
|
value: any;
|
|
71
72
|
values: any[];
|
|
73
|
+
field?: string | undefined;
|
|
72
74
|
};
|
|
73
75
|
//#endregion
|
|
74
76
|
//#region packages/common/Search/fill.d.mts
|
|
@@ -76,17 +78,17 @@ type ExecParam = {
|
|
|
76
78
|
*
|
|
77
79
|
* @template {Match | Children | Or} T
|
|
78
80
|
* @param {T[]} match
|
|
79
|
-
* @returns {Generator<Value
|
|
81
|
+
* @returns {Generator<Value, T[]?, Value | null>}
|
|
80
82
|
*/
|
|
81
|
-
declare function fillMatches<T extends Match | Children | Or>(match: T[]): Generator<Value
|
|
83
|
+
declare function fillMatches<T extends Match | Children | Or>(match: T[]): Generator<Value, T[] | null, Value | null>;
|
|
82
84
|
/**
|
|
83
85
|
*
|
|
84
86
|
* @template {Match | Children | Or} T
|
|
85
87
|
* @param {T[] | null | undefined} match
|
|
86
|
-
* @param {(placeholder: string) =>
|
|
88
|
+
* @param {(placeholder: string) => Value | null} getPlaceholder
|
|
87
89
|
* @returns {T[]}
|
|
88
90
|
*/
|
|
89
|
-
declare function fill<T extends Match | Children | Or>(match: T[] | null | undefined, getPlaceholder: (placeholder: string) =>
|
|
91
|
+
declare function fill<T extends Match | Children | Or>(match: T[] | null | undefined, getPlaceholder: (placeholder: string) => Value | null): T[];
|
|
90
92
|
//#endregion
|
|
91
93
|
//#region packages/common/Search/merge.d.mts
|
|
92
94
|
/** @import { Param } from './types.mjs' */
|
|
@@ -137,11 +139,60 @@ declare function runGenerator<T, TReturn, TNext>(generator: Generator<T, TReturn
|
|
|
137
139
|
*/
|
|
138
140
|
declare function asyncRunGenerator<T, TReturn, TNext>(generator: Generator<T, TReturn, TNext>, run: (value: T) => PromiseLike<TNext> | TNext, def: TNext): Promise<TReturn>;
|
|
139
141
|
//#endregion
|
|
140
|
-
//#region packages/common/Search/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
//#region packages/common/Search/toWhere.d.mts
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @template TField
|
|
146
|
+
* @template TParam
|
|
147
|
+
* @template TWhere
|
|
148
|
+
* @typedef {object} Where
|
|
149
|
+
* @property {(where: TWhere) => boolean?} [value]
|
|
150
|
+
* @property {(list: TWhere[]) => TWhere?} or
|
|
151
|
+
* @property {(list: TWhere[]) => TWhere?} and
|
|
152
|
+
* @property {ItemToWhere<TField, TParam, TWhere>} build
|
|
153
|
+
*/
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* @template TField
|
|
157
|
+
* @template TParam
|
|
158
|
+
* @template TWhere
|
|
159
|
+
* @callback ToWhere
|
|
160
|
+
* @param {TField} fields
|
|
161
|
+
* @param {Search.AndList} [and]
|
|
162
|
+
* @param {...Search.OrList | null | undefined} orList
|
|
163
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
164
|
+
*/
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* @template TField
|
|
168
|
+
* @template TParam
|
|
169
|
+
* @template TWhere
|
|
170
|
+
* @callback ItemToWhere
|
|
171
|
+
* @param {ToWhere<TField, TParam, TWhere>} toWhere
|
|
172
|
+
* @param {TField} fields
|
|
173
|
+
* @param {Search.Match | Search.Children} and
|
|
174
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
175
|
+
*/
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* @template TField
|
|
179
|
+
* @template TParam
|
|
180
|
+
* @template TWhere
|
|
181
|
+
* @param {Where<TField, TParam, TWhere>} where
|
|
182
|
+
* @param {TField} fields
|
|
183
|
+
* @param {Search.AndList} [and]
|
|
184
|
+
* @param {...Search.OrList | null | undefined} orList
|
|
185
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
186
|
+
*/
|
|
187
|
+
declare function toWhere<TField, TParam, TWhere>(where: Where<TField, TParam, TWhere>, fields: TField, and?: Search.AndList, ...orList: (Search.OrList | null | undefined)[]): Generator<TParam, TWhere | null, TWhere | null>;
|
|
188
|
+
type Where<TField, TParam, TWhere> = {
|
|
189
|
+
value?: ((where: TWhere) => boolean | null) | undefined;
|
|
190
|
+
or: (list: TWhere[]) => TWhere | null;
|
|
191
|
+
and: (list: TWhere[]) => TWhere | null;
|
|
192
|
+
build: ItemToWhere<TField, TParam, TWhere>;
|
|
193
|
+
};
|
|
194
|
+
type ToWhere<TField, TParam, TWhere> = (fields: TField, and?: Search.AndList | undefined, ...orList: (Search.OrList | null | undefined)[]) => Generator<TParam, TWhere | null, TWhere | null>;
|
|
195
|
+
type ItemToWhere<TField, TParam, TWhere> = (toWhere: ToWhere<TField, TParam, TWhere>, fields: TField, and: Search.Match | Search.Children) => Generator<TParam, TWhere | null, TWhere | null>;
|
|
145
196
|
//#endregion
|
|
146
197
|
//#region packages/common/Search/parse.d.mts
|
|
147
198
|
/**
|
|
@@ -151,9 +202,18 @@ interface WhereLike {
|
|
|
151
202
|
*/
|
|
152
203
|
declare function parse(search: string, split?: string): Param;
|
|
153
204
|
declare namespace index_d_exports {
|
|
154
|
-
export { AndItem, AndList, Children, ExecParam, Field, FieldValue, Match, Or, OrItem, OrList, Param, Value,
|
|
205
|
+
export { AndItem, AndList, Children, ExecParam, Field, FieldValue, ItemToWhere, Match, Or, OrItem, OrList, Param, ToWhere, Value, Where, asyncExec, asyncRunGenerator, exec, fill, fillMatches, merge, parse, runGenerator, stringify, toWhere };
|
|
155
206
|
}
|
|
156
207
|
//#endregion
|
|
208
|
+
//#region packages/common/transformError.d.mts
|
|
209
|
+
/**
|
|
210
|
+
* @template T
|
|
211
|
+
* @template {Error} E
|
|
212
|
+
* @param {Map<any, (error: E) => T>} transforms
|
|
213
|
+
* @param {E} error
|
|
214
|
+
*/
|
|
215
|
+
declare function transformError<T, E extends Error>(transforms: Map<any, (error: E) => T>, error: E): T;
|
|
216
|
+
//#endregion
|
|
157
217
|
//#region packages/common/Hook.d.mts
|
|
158
218
|
/**
|
|
159
219
|
* @template T
|
|
@@ -279,13 +339,13 @@ declare function yieldPermissionConstraintFields({
|
|
|
279
339
|
*/
|
|
280
340
|
/**
|
|
281
341
|
* @typedef {object} BootConfiguration
|
|
342
|
+
* @property {string} [id]
|
|
282
343
|
* @property {string} [route] 路由管理器
|
|
283
344
|
* @property {string} [theme] 界面主题
|
|
284
345
|
* @property {string} [authenticator] 登陆器
|
|
285
346
|
* @property {boolean} [authRequired] 是否强制登陆
|
|
286
347
|
* @property {string} [skin]
|
|
287
348
|
* @property {boolean} [multiUser]
|
|
288
|
-
* @property {string} [application]
|
|
289
349
|
* @property {string} [domain]
|
|
290
350
|
* @property {string | number} [port]
|
|
291
351
|
* @property {string} [path]
|
|
@@ -299,6 +359,7 @@ declare function yieldPermissionConstraintFields({
|
|
|
299
359
|
* @property {string} [type]
|
|
300
360
|
* @property {string} [help] 帮助链接
|
|
301
361
|
* @property {any[]} [userMenus]
|
|
362
|
+
* @property {any[]} [menus]
|
|
302
363
|
*/
|
|
303
364
|
/**
|
|
304
365
|
* @typedef {object} Importmap
|
|
@@ -326,6 +387,7 @@ type Plugin = {
|
|
|
326
387
|
styles?: string[] | undefined;
|
|
327
388
|
};
|
|
328
389
|
type BootConfiguration = {
|
|
390
|
+
id?: string | undefined;
|
|
329
391
|
/**
|
|
330
392
|
* 路由管理器
|
|
331
393
|
*/
|
|
@@ -344,7 +406,6 @@ type BootConfiguration = {
|
|
|
344
406
|
authRequired?: boolean | undefined;
|
|
345
407
|
skin?: string | undefined;
|
|
346
408
|
multiUser?: boolean | undefined;
|
|
347
|
-
application?: string | undefined;
|
|
348
409
|
domain?: string | undefined;
|
|
349
410
|
port?: string | number | undefined;
|
|
350
411
|
path?: string | undefined;
|
|
@@ -359,6 +420,7 @@ type BootConfiguration = {
|
|
|
359
420
|
*/
|
|
360
421
|
help?: string | undefined;
|
|
361
422
|
userMenus?: any[] | undefined;
|
|
423
|
+
menus?: any[] | undefined;
|
|
362
424
|
};
|
|
363
425
|
type Importmap = {
|
|
364
426
|
imports: Record<string, string>;
|
|
@@ -390,4 +452,4 @@ declare namespace Pages {
|
|
|
390
452
|
};
|
|
391
453
|
}
|
|
392
454
|
//#endregion
|
|
393
|
-
export { BootConfiguration, Hook, Importmap, Indicator, Pages, Plugin, RecursiveArray, index_d_exports as Search, findPluginIdRegex, getPatternFields, isFunction, pluginIdRegex, runPattern, yieldPermissionConstraintFields };
|
|
455
|
+
export { BootConfiguration, Hook, Importmap, Indicator, Pages, Plugin, RecursiveArray, index_d_exports as Search, findPluginIdRegex, getPatternFields, isFunction, pluginIdRegex, runPattern, transformError, yieldPermissionConstraintFields };
|
package/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "@yongdall/common";
|
|
2
|
+
|
|
1
3
|
//#region \0rolldown/runtime.js
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
3
5
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -99,22 +101,23 @@ function selectValue(list, field) {
|
|
|
99
101
|
}
|
|
100
102
|
/**
|
|
101
103
|
* @typedef {object} ExecParam
|
|
102
|
-
* @property {
|
|
104
|
+
* @property {Field[]} fields
|
|
103
105
|
* @property {string} operator
|
|
104
106
|
* @property {string?} [sign]
|
|
105
107
|
* @property {any} value
|
|
106
108
|
* @property {any[]} values
|
|
109
|
+
* @property {string} [field]
|
|
107
110
|
*/
|
|
108
111
|
/**
|
|
109
112
|
*
|
|
110
113
|
* @param {Record<string, any>[]} data
|
|
111
|
-
* @param {
|
|
114
|
+
* @param {Field[]} parentFields
|
|
112
115
|
* @param {Match} match
|
|
113
116
|
* @returns {Generator<ExecParam, boolean?, boolean?>}
|
|
114
117
|
*/
|
|
115
118
|
function* execMatch(data, parentFields, match) {
|
|
116
119
|
const fields = [...match[0]];
|
|
117
|
-
const currentFields = [...parentFields, ...fields
|
|
120
|
+
const currentFields = [...parentFields, ...fields];
|
|
118
121
|
const last = fields.pop();
|
|
119
122
|
if (!last) return null;
|
|
120
123
|
const lastField = typeof last === "string" ? last : last[0];
|
|
@@ -151,6 +154,7 @@ function* execMatch(data, parentFields, match) {
|
|
|
151
154
|
operator,
|
|
152
155
|
sign,
|
|
153
156
|
value: item[field],
|
|
157
|
+
field,
|
|
154
158
|
values: [item[lastField]]
|
|
155
159
|
};
|
|
156
160
|
if (result === null) continue;
|
|
@@ -161,7 +165,7 @@ function* execMatch(data, parentFields, match) {
|
|
|
161
165
|
/**
|
|
162
166
|
*
|
|
163
167
|
* @param {Record<string, any>[]} data
|
|
164
|
-
* @param {
|
|
168
|
+
* @param {Field[]} parentFields
|
|
165
169
|
* @param {Match | Children | Or} match
|
|
166
170
|
* @returns {Generator<ExecParam, boolean?, boolean?>}
|
|
167
171
|
*/
|
|
@@ -175,7 +179,7 @@ function* execItem(data, parentFields, match) {
|
|
|
175
179
|
let defResult = null;
|
|
176
180
|
const values = select(data, match[0]);
|
|
177
181
|
if (!values.length) return false;
|
|
178
|
-
const fields = [...parentFields, ...match[0]
|
|
182
|
+
const fields = [...parentFields, ...match[0]];
|
|
179
183
|
for (const item of match[1]) {
|
|
180
184
|
const result = yield* execItem(values, fields, item);
|
|
181
185
|
if (result === null) continue;
|
|
@@ -187,7 +191,7 @@ function* execItem(data, parentFields, match) {
|
|
|
187
191
|
/**
|
|
188
192
|
*
|
|
189
193
|
* @param {Record<string, any>[]} list
|
|
190
|
-
* @param {
|
|
194
|
+
* @param {Field[]} parentFields
|
|
191
195
|
* @param {(Match | Children)[]} [and]
|
|
192
196
|
* @param {(Match | Children | Or)[]} [or]
|
|
193
197
|
* @returns {Generator<ExecParam, boolean?, boolean?>}
|
|
@@ -238,7 +242,7 @@ async function asyncExec(data, exec, and, or) {
|
|
|
238
242
|
*
|
|
239
243
|
* @template {Match | Children | Or} T
|
|
240
244
|
* @param {T[]} match
|
|
241
|
-
* @returns {Generator<Value
|
|
245
|
+
* @returns {Generator<Value, T[]?, Value | null>}
|
|
242
246
|
*/
|
|
243
247
|
function* fillList(match) {
|
|
244
248
|
/** @type {T[]} */
|
|
@@ -255,7 +259,7 @@ function* fillList(match) {
|
|
|
255
259
|
*
|
|
256
260
|
* @template {Match | Children | Or} T
|
|
257
261
|
* @param {T} match
|
|
258
|
-
* @returns {Generator<Value
|
|
262
|
+
* @returns {Generator<Value, T?, Value | null>}
|
|
259
263
|
*/
|
|
260
264
|
function* fillMatch(match) {
|
|
261
265
|
if (!Array.isArray(match)) {
|
|
@@ -284,7 +288,7 @@ function* fillMatch(match) {
|
|
|
284
288
|
*
|
|
285
289
|
* @template {Match | Children | Or} T
|
|
286
290
|
* @param {T[]} match
|
|
287
|
-
* @returns {Generator<Value
|
|
291
|
+
* @returns {Generator<Value, T[]?, Value | null>}
|
|
288
292
|
*/
|
|
289
293
|
function* fillMatches(match) {
|
|
290
294
|
/** @type {T[]} */
|
|
@@ -301,16 +305,16 @@ function* fillMatches(match) {
|
|
|
301
305
|
*
|
|
302
306
|
* @template {Match | Children | Or} T
|
|
303
307
|
* @param {T[] | null | undefined} match
|
|
304
|
-
* @param {(placeholder: string) =>
|
|
308
|
+
* @param {(placeholder: string) => Value | null} getPlaceholder
|
|
305
309
|
* @returns {T[]}
|
|
306
310
|
*/
|
|
307
311
|
function fill(match, getPlaceholder) {
|
|
308
312
|
if (!match) return [];
|
|
309
313
|
/**
|
|
310
314
|
*
|
|
311
|
-
* @template {Value
|
|
315
|
+
* @template {Value} T
|
|
312
316
|
* @param {T} match
|
|
313
|
-
* @returns {Value |
|
|
317
|
+
* @returns {Value | null}
|
|
314
318
|
*/
|
|
315
319
|
function fillValue(match) {
|
|
316
320
|
if (!match || typeof match !== "object") return null;
|
|
@@ -550,7 +554,7 @@ function parse(search, split = "&") {
|
|
|
550
554
|
const placeholders = {};
|
|
551
555
|
/** @type {(Parse.Match & {groups: string[]})[]} */
|
|
552
556
|
const allMatches = [];
|
|
553
|
-
for (const s of search.split(split)) {
|
|
557
|
+
for (const s of typeof search === "string" ? search.split(split) : []) {
|
|
554
558
|
if (s[0] === "=") {
|
|
555
559
|
values.push(s.slice(1));
|
|
556
560
|
continue;
|
|
@@ -782,6 +786,93 @@ function stringify({ values, where, orWhere, sort, select, limit, offset, page,
|
|
|
782
786
|
return queries.join("&");
|
|
783
787
|
}
|
|
784
788
|
|
|
789
|
+
//#endregion
|
|
790
|
+
//#region packages/common/Search/toWhere.mjs
|
|
791
|
+
/**
|
|
792
|
+
*
|
|
793
|
+
* @template TField
|
|
794
|
+
* @template TParam
|
|
795
|
+
* @template TWhere
|
|
796
|
+
* @typedef {object} Where
|
|
797
|
+
* @property {(where: TWhere) => boolean?} [value]
|
|
798
|
+
* @property {(list: TWhere[]) => TWhere?} or
|
|
799
|
+
* @property {(list: TWhere[]) => TWhere?} and
|
|
800
|
+
* @property {ItemToWhere<TField, TParam, TWhere>} build
|
|
801
|
+
*/
|
|
802
|
+
/**
|
|
803
|
+
*
|
|
804
|
+
* @template TField
|
|
805
|
+
* @template TParam
|
|
806
|
+
* @template TWhere
|
|
807
|
+
* @callback ToWhere
|
|
808
|
+
* @param {TField} fields
|
|
809
|
+
* @param {Search.AndList} [and]
|
|
810
|
+
* @param {...Search.OrList | null | undefined} orList
|
|
811
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
812
|
+
*/
|
|
813
|
+
/**
|
|
814
|
+
*
|
|
815
|
+
* @template TField
|
|
816
|
+
* @template TParam
|
|
817
|
+
* @template TWhere
|
|
818
|
+
* @callback ItemToWhere
|
|
819
|
+
* @param {ToWhere<TField, TParam, TWhere>} toWhere
|
|
820
|
+
* @param {TField} fields
|
|
821
|
+
* @param {Search.Match | Search.Children} and
|
|
822
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
823
|
+
*/
|
|
824
|
+
/**
|
|
825
|
+
*
|
|
826
|
+
* @template TField
|
|
827
|
+
* @template TParam
|
|
828
|
+
* @template TWhere
|
|
829
|
+
* @param {Where<TField, TParam, TWhere>} where
|
|
830
|
+
* @param {TField} fields
|
|
831
|
+
* @param {Search.AndList} [and]
|
|
832
|
+
* @param {...Search.OrList | null | undefined} orList
|
|
833
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
834
|
+
*/
|
|
835
|
+
function toWhere(where, fields, and, ...orList) {
|
|
836
|
+
/**
|
|
837
|
+
*
|
|
838
|
+
* @param {TField} fields
|
|
839
|
+
* @param {Search.AndList} [and]
|
|
840
|
+
* @param {...Search.OrList | null | undefined} orList
|
|
841
|
+
* @returns {Generator<TParam, TWhere?, TWhere?>}
|
|
842
|
+
*/
|
|
843
|
+
function* toWhere(fields, and, ...orList) {
|
|
844
|
+
/** @type {TWhere[]} */
|
|
845
|
+
const list = [];
|
|
846
|
+
if (and) for (const item of and) {
|
|
847
|
+
const w = yield* where.build(toWhere, fields, item);
|
|
848
|
+
if (w == null) continue;
|
|
849
|
+
if (where.value?.(w) === false) return w;
|
|
850
|
+
list.push(w);
|
|
851
|
+
}
|
|
852
|
+
orFor: for (const or of orList) {
|
|
853
|
+
if (!or) continue;
|
|
854
|
+
/** @type {TWhere[]} */
|
|
855
|
+
const orList = [];
|
|
856
|
+
for (const item of or) {
|
|
857
|
+
const w = Array.isArray(item) ? yield* where.build(toWhere, fields, item) : yield* toWhere(fields, item.and, item.or);
|
|
858
|
+
if (w == null) continue;
|
|
859
|
+
if (where.value?.(w) === true) {
|
|
860
|
+
list.push(w);
|
|
861
|
+
continue orFor;
|
|
862
|
+
}
|
|
863
|
+
orList.push(w);
|
|
864
|
+
}
|
|
865
|
+
const w = orList.length ? where.or(orList) : null;
|
|
866
|
+
if (w == null) continue;
|
|
867
|
+
if (where.value?.(w) === false) return w;
|
|
868
|
+
list.push(w);
|
|
869
|
+
}
|
|
870
|
+
if (!list.length) return null;
|
|
871
|
+
return where.and(list);
|
|
872
|
+
}
|
|
873
|
+
return toWhere(fields, and, ...orList);
|
|
874
|
+
}
|
|
875
|
+
|
|
785
876
|
//#endregion
|
|
786
877
|
//#region packages/common/Search/index.mjs
|
|
787
878
|
var Search_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -793,9 +884,29 @@ var Search_exports = /* @__PURE__ */ __exportAll({
|
|
|
793
884
|
merge: () => merge,
|
|
794
885
|
parse: () => parse,
|
|
795
886
|
runGenerator: () => runGenerator,
|
|
796
|
-
stringify: () => stringify
|
|
887
|
+
stringify: () => stringify,
|
|
888
|
+
toWhere: () => toWhere
|
|
797
889
|
});
|
|
798
890
|
|
|
891
|
+
//#endregion
|
|
892
|
+
//#region packages/common/transformError.mjs
|
|
893
|
+
const prototype = Error.prototype;
|
|
894
|
+
/**
|
|
895
|
+
* @template T
|
|
896
|
+
* @template {Error} E
|
|
897
|
+
* @param {Map<any, (error: E) => T>} transforms
|
|
898
|
+
* @param {E} error
|
|
899
|
+
*/
|
|
900
|
+
function transformError(transforms, error) {
|
|
901
|
+
if (!(error instanceof Error)) throw error;
|
|
902
|
+
for (let p = Object.getPrototypeOf(error); p; p = Object.getPrototypeOf(p)) {
|
|
903
|
+
const fn = transforms.get(p);
|
|
904
|
+
if (typeof fn === "function") return fn(error);
|
|
905
|
+
if (p === prototype) break;
|
|
906
|
+
}
|
|
907
|
+
throw error;
|
|
908
|
+
}
|
|
909
|
+
|
|
799
910
|
//#endregion
|
|
800
911
|
//#region packages/common/Hook.mjs
|
|
801
912
|
/**
|
|
@@ -1082,7 +1193,7 @@ function runPattern(pattern, document) {
|
|
|
1082
1193
|
const doc = typeof document === "object" && document || {};
|
|
1083
1194
|
return pattern.replace(regex, (_, v) => {
|
|
1084
1195
|
if (Object.hasOwn(doc, v)) return doc[v] ?? "";
|
|
1085
|
-
return
|
|
1196
|
+
return `${v}`;
|
|
1086
1197
|
});
|
|
1087
1198
|
}
|
|
1088
1199
|
|
|
@@ -1120,13 +1231,13 @@ const findPluginIdRegex = /^(?<pluginId>(?:(?<scope>@[a-zA-Z\d_.-]+)\/)?(?<name>
|
|
|
1120
1231
|
*/
|
|
1121
1232
|
/**
|
|
1122
1233
|
* @typedef {object} BootConfiguration
|
|
1234
|
+
* @property {string} [id]
|
|
1123
1235
|
* @property {string} [route] 路由管理器
|
|
1124
1236
|
* @property {string} [theme] 界面主题
|
|
1125
1237
|
* @property {string} [authenticator] 登陆器
|
|
1126
1238
|
* @property {boolean} [authRequired] 是否强制登陆
|
|
1127
1239
|
* @property {string} [skin]
|
|
1128
1240
|
* @property {boolean} [multiUser]
|
|
1129
|
-
* @property {string} [application]
|
|
1130
1241
|
* @property {string} [domain]
|
|
1131
1242
|
* @property {string | number} [port]
|
|
1132
1243
|
* @property {string} [path]
|
|
@@ -1140,6 +1251,7 @@ const findPluginIdRegex = /^(?<pluginId>(?:(?<scope>@[a-zA-Z\d_.-]+)\/)?(?<name>
|
|
|
1140
1251
|
* @property {string} [type]
|
|
1141
1252
|
* @property {string} [help] 帮助链接
|
|
1142
1253
|
* @property {any[]} [userMenus]
|
|
1254
|
+
* @property {any[]} [menus]
|
|
1143
1255
|
*/
|
|
1144
1256
|
/**
|
|
1145
1257
|
* @typedef {object} Importmap
|
|
@@ -1162,5 +1274,5 @@ function isFunction(v) {
|
|
|
1162
1274
|
}
|
|
1163
1275
|
|
|
1164
1276
|
//#endregion
|
|
1165
|
-
export { Hook, Search_exports as Search, findPluginIdRegex, getPatternFields, isFunction, pluginIdRegex, runPattern, yieldPermissionConstraintFields };
|
|
1277
|
+
export { Hook, Search_exports as Search, findPluginIdRegex, getPatternFields, isFunction, pluginIdRegex, runPattern, transformError, yieldPermissionConstraintFields };
|
|
1166
1278
|
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["#config","#hooks","#stringTag","#keys"],"sources":["../../packages/common/Search/util.mjs","../../packages/common/Search/exec.mjs","../../packages/common/Search/fill.mjs","../../packages/common/Search/parse.mjs","../../packages/common/Search/merge.mjs","../../packages/common/Search/stringify.mjs","../../packages/common/Search/index.mjs","../../packages/common/Hook.mjs","../../packages/common/model.mjs","../../packages/common/yieldPermissionConstraintFields.mjs","../../packages/common/index.mjs"],"sourcesContent":["\n/**\n * @template T\n * @template TReturn\n * @template TNext\n * @param {Generator<T, TReturn, TNext>} generator \n * @param {(value: T) => TNext} run \n * @param {TNext} def \n */\nexport function runGenerator(generator, run, def) {\n\t/** @type {TNext} */\n\tlet value = def;\n\tfor (; ;) {\n\t\tconst result = generator.next(value);\n\t\tif (result.done) {\n\t\t\treturn result.value;\n\t\t}\n\t\tvalue = run(result.value);\n\t}\n}\n/**\n * @template T\n * @template TReturn\n * @template TNext\n * @param {Generator<T, TReturn, TNext>} generator \n * @param {(value: T) => PromiseLike<TNext> | TNext} run \n * @param {TNext} def \n */\nexport async function asyncRunGenerator(generator, run, def) {\n\t/** @type {TNext} */\n\tlet value = def;\n\tfor (; ;) {\n\t\tconst result = generator.next(value);\n\t\tif (result.done) {\n\t\t\treturn result.value;\n\t\t}\n\t\tvalue = await run(result.value);\n\t}\n}\n","/** @import { Children, Field, Match, Or } from './types.mjs' */\nimport { asyncRunGenerator, runGenerator } from './util.mjs';\n\n\n/**\n * \n * @param {Record<string, any>[]} data \n * @param {Field[]} fields \n * @returns {any[]}\n */\nfunction select(data, fields) {\n\tlet list = data;\n\tfor (let item of fields) {\n\t\tconst [field, ...sub] = typeof item === 'string' ? [item] : item;\n\n\t\tif (!list.length) { continue; }\n\t\t/** @type {any[]} */\n\t\tconst subList = [];\n\t\tit: for (const item of list) {\n\t\t\tif (!item || typeof item !== 'object') { continue; }\n\t\t\tif (!Object.hasOwn(item, field)) { continue; }\n\t\t\tlet value = item[field];\n\t\t\tfor (const index of sub) {\n\t\t\t\tif (!Array.isArray(value)) { continue it; }\n\t\t\t\tvalue = value[index];\n\t\t\t}\n\t\t\tsubList.push(value);\n\t\t}\n\t\tlist = subList.flat(Infinity).filter(v => v && typeof v === 'object');\n\t}\n\treturn list;\n\n}\n\n/**\n * \n * @param {Record<string, any>[]} list \n * @param {string} field \n * @returns {any[]}\n */\nfunction selectValue(list, field) {\n\t/** @type {any[]} */\n\tconst subList = [];\n\tfor (const item of list) {\n\t\tif (!item || typeof item !== 'object') { continue; }\n\t\tif (!Object.hasOwn(item, field)) { continue; }\n\t\tsubList.push(item[field]);\n\t}\n\treturn subList;\n\n}\n/**\n * @typedef {object} ExecParam\n * @property {string[]} fields\n * @property {string} operator\n * @property {string?} [sign]\n * @property {any} value\n * @property {any[]} values\n */\n/**\n * \n * @param {Record<string, any>[]} data \n * @param {string[]} parentFields \n * @param {Match} match \n * @returns {Generator<ExecParam, boolean?, boolean?>}\n */\nfunction* execMatch(data, parentFields, match) {\n\tconst fields = [...match[0]];\n\tconst currentFields = [...parentFields, ...fields.map(v => typeof v === 'string' ? v : v[0])];\n\tconst last = fields.pop();\n\tif (!last) { return null; }\n\tconst lastField = typeof last === 'string' ? last : last[0];\n\tconst records = select(data, fields);\n\tif (!records.length) { return false; }\n\tconst [, value, operator, sign] = match;\n\tif (operator === null) {\n\t\tconst values = selectValue(records, lastField);\n\t\treturn sign ? values.find(v => v === null) : values.find(v => v !== null);\n\t}\n\tif (typeof value !== 'object' || !value || Array.isArray(value)) {\n\n\t\tconst values = selectValue(records, lastField);\n\t\tif (!values.length) { return false; }\n\n\t\treturn yield ({ fields: currentFields, operator, sign, value, values });\n\t}\n\n\tif (value.filter || value.table || value.placeholder) { return null; }\n\tconst field = value.field;\n\tif (!field) { return null; }\n\n\t/** @type {boolean?} */\n\tlet defResult = false;\n\tfor (const item of records) {\n\t\tif (!item || typeof item !== 'object') { continue; }\n\t\tif (!Object.hasOwn(item, field)) { continue; }\n\t\tif (!Object.hasOwn(item, lastField)) { continue; }\n\t\tdefResult = null;\n\t\tconst result = yield ({ fields: currentFields, operator, sign, value: item[field], values: [item[lastField]] });\n\t\tif (result === null) { continue; }\n\t\treturn result;\n\t}\n\treturn defResult;\n\n}\n/**\n * \n * @param {Record<string, any>[]} data \n * @param {string[]} parentFields \n * @param {Match | Children | Or} match \n * @returns {Generator<ExecParam, boolean?, boolean?>}\n */\nfunction* execItem(data, parentFields, match) {\n\tif (!Array.isArray(match)) {\n\t\tconst { and, or } = match;\n\t\treturn yield* execOr(data, parentFields, and, or);\n\t}\n\tif (match.length !== 2) {\n\t\treturn yield* execMatch(data, parentFields, match);\n\n\t}\n\t/** @type {boolean?} */\n\tlet defResult = null;\n\tconst values = select(data, match[0]);\n\tif (!values.length) { return false; }\n\tconst fields = [...parentFields, ...match[0].map(v => typeof v === 'string' ? v : v[0])];\n\tfor (const item of match[1]) {\n\t\tconst result = yield* execItem(values, fields, item);\n\t\tif (result === null) { continue; }\n\t\tif (!result) { return false; }\n\t\tdefResult = true;\n\t}\n\treturn defResult;\n}\n/**\n * \n * @param {Record<string, any>[]} list \n * @param {string[]} parentFields \n * @param {(Match | Children)[]} [and] \n * @param {(Match | Children | Or)[]} [or] \n * @returns {Generator<ExecParam, boolean?, boolean?>}\n */\nfunction* execOr(list, parentFields, and, or) {\n\t/** @type {boolean?} */\n\tlet defResult = null;\n\tif (Array.isArray(and)) {\n\t\tfor (const item of and) {\n\t\t\tconst result = yield* execItem(list, parentFields, item);\n\t\t\tif (result === null) { continue; }\n\t\t\tif (!result) { return false; }\n\t\t\tdefResult = true;\n\t\t}\n\t}\n\tif (Array.isArray(or)) {\n\t\tfor (const item of or) {\n\t\t\tconst result = yield* execItem(list, parentFields, item);\n\t\t\tif (result === null) { continue; }\n\t\t\tif (result) { return true; }\n\t\t\tdefResult = true;\n\t\t}\n\t}\n\treturn defResult;\n\n}\n\n/**\n * \n * @param {Record<string, any>} data \n * @param {(value: ExecParam) => boolean?} exec \n * @param {(Match | Children)[]} [and] \n * @param {(Match | Children | Or)[]} [or] \n */\nexport function exec(data, exec, and, or) {\n\treturn runGenerator(execOr([data].flat(), [], and, or), exec, null);\n}\n\n/**\n * \n * @param {Record<string, any>} data \n * @param {(value: ExecParam) => PromiseLike<boolean?> | boolean?} exec \n * @param {(Match | Children)[]} [and] \n * @param {(Match | Children | Or)[]} [or] \n */\nexport async function asyncExec(data, exec, and, or) {\n\treturn asyncRunGenerator(execOr([data].flat(), [], and, or), exec, null);\n}\n","/** @import { Value } from './types.mjs' */\n/** @import { Children, Field, FieldValue, Match, Or } from './types.mjs' */\n\nimport { runGenerator } from './util.mjs';\n\n\n\n\n\n\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T[]} match \n * @returns {Generator<Value | (() => Value), T[]?, Value | (() => string | null) | null>}\n */\nfunction* fillList(match) {\n\t/** @type {T[]} */\n\tlet list = [];\n\tlet has = false;\n\tfor (const child of match) {\n\t\tconst val = yield* fillMatch(child);\n\t\tlist.push(val || child);\n\t\tif (val) { has = true; }\n\t}\n\treturn has ? list : null;\n\n}\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T} match \n * @returns {Generator<Value | (() => Value), T?, Value | (() => string | null) | null>}\n */\nfunction* fillMatch(match) {\n\tif (!Array.isArray(match)) {\n\t\tconst and = match.and && (yield* fillMatches(match.and));\n\t\tconst or = match.or && (yield* fillMatches(match.or));\n\t\tif (!and && !or) { return null; }\n\t\t/** @type {Or} */\n\t\tconst item = { and: and || match.and, or: or || match.or };\n\t\treturn /** @type {T} */(item);\n\t}\n\tif (match.length === 2) {\n\t\tlet children = yield* fillMatches(match[1]);\n\t\tif (!children) { return null; }\n\t\t/** @type {Children} */\n\t\tconst item = [match[0], match[1]];\n\t\treturn /** @type {T} */(item);\n\t}\n\tconst value = yield match[1];\n\tif (value === null) { return null; }\n\t/** @type {Match} */\n\tconst item = [match[0], value, match[2], match[3]];\n\treturn /** @type {T} */(item);\n\n}\n\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T[]} match \n * @returns {Generator<Value | (() => Value), T[]?, Value | (() => string | null) | null>}\n */\nexport function* fillMatches(match) {\n\t/** @type {T[]} */\n\tconst list = [];\n\tlet has = false;\n\tfor (const child of match) {\n\t\tconst val = yield* fillMatch(child);\n\t\tlist.push(val || child);\n\t\tif (val) { has = true; }\n\t}\n\treturn has ? list : null;\n\n}\n\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T[] | null | undefined} match \n * @param {(placeholder: string) => string | (() => string | null) | null} getPlaceholder \n * @returns {T[]}\n */\nexport function fill(match, getPlaceholder) {\n\tif (!match) { return []; }\n\t/**\n\t * \n\t * @template {Value | (() => Value)} T \n\t * @param {T} match \n\t * @returns {Value | (() => string | null) | null}\n\t */\n\tfunction fillValue(match) {\n\t\tif (!match || typeof match !== 'object') { return null; }\n\t\tif (Array.isArray(match)) { return null; }\n\t\tconst placeholder = match.placeholder;\n\t\tif (!placeholder || typeof placeholder !== 'string') { return null; }\n\t\treturn getPlaceholder(placeholder);\n\t}\n\treturn runGenerator(fillList(match), fillValue, null) || match;\n}\n","/** @import { RecursiveArray } from '../types/types.mjs' */\n/** @import { Children, Field, Match, Or, Param, Value } from './types.mjs' */\n\n\n\n/**\n * @typedef {object} Parse.Field\n * @property {string} field\n * @property {string?} [group]\n * @property {number[]} sub\n */\n/**\n * @typedef {object} Parse.Match\n * @property {null} [children]\n * @property {Parse.Field[]} fields\n * @property {string?} operator\n * @property {string} [sign]\n * @property {Value} value\n */\n\n\n/**\n * @typedef {object} Parse.Children\n * @property {Parse.Field[]} fields\n * @property {(Parse.Match | Parse.Children)[]} children\n */\n\n/**\n * \n * @param {Parse.Field[]} fields \n * @returns {Field[]}\n */\nfunction compressFields(fields) {\n\treturn fields.map(\n\t\t({ field, sub }) => sub.length ? [field, ...sub] : field\n\t);\n}\n\n/**\n * \n * @param {Parse.Match | Parse.Children} v \n * @returns {Match | Children}\n */\nfunction compressAndItem(v) {\n\tif (v.children) {\n\treturn [compressFields(v.fields), v.children.map(compressAndItem)];\n\n\t}\n\tconst { fields, operator, value, sign } = v;\n\treturn [compressFields(fields), value, operator, sign];\n}\n\nconst fieldParserRegex = /^([-_\\d\\p{L}]+)((?:\\[-?\\d+\\])*)$/u;\n/**\n * \n * @param {string} l \n */\nfunction parseFields(l) {\n\t/** @type {Parse.Field[]} */\n\tconst fields = [];\n\tfor (const v of l.split('.')) {\n\t\tif (!v || v[0] === '?') { return null; }\n\t\tconst index = v.indexOf('?');\n\t\tconst r = fieldParserRegex.exec(index > 0 ? v.slice(0, index) : v);\n\t\tif (!r) { return null; }\n\t\tconst sub = r[2]?.split(/\\[|\\]/).filter(Boolean).map(v => parseInt(v) || 0) || [];\n\t\tconst group = index > 0 ? v.slice(index) : undefined;\n\t\tfields.push({ field: r[1], group, sub });\n\t}\n\treturn fields;\n\n}\n\n\n/** @param {string} v */\nconst decodeValue = v => decodeURIComponent(v.replaceAll('+', ' '));\n/**\n * \n * @param {string} s \n * @returns {string | RecursiveArray<string>?}\n */\nfunction parseArrayValue(s) {\n\t/** @type {(string | RecursiveArray<string>)[]} */\n\tconst root = [];\n\t/** @type {(string | RecursiveArray<string>)[][]} */\n\tconst stack = [];\n\tlet current = root;\n\t/** @type {string[]} */\n\tlet strings = [];\n\tlet end = false;\n\tlet must = true;\n\tfunction add() {\n\t\tcurrent.push(decodeValue(strings.join()));\n\t\tstrings = [];\n\t}\n\n\tfor (const c of s) {\n\t\tif (c === ',') {\n\t\t\tif (end) {\n\t\t\t\tend = false;\n\t\t\t} else {\n\t\t\t\tadd();\n\t\t\t}\n\t\t\tmust = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (c === ')') {\n\t\t\tif (must || strings.length) {\n\t\t\t\tadd();\n\t\t\t\tmust = false;\n\t\t\t}\n\t\t\tconst last = stack.pop();\n\t\t\tif (!last) { return null; }\n\t\t\tlast.push(current);\n\t\t\tcurrent = last;\n\t\t\tend = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (end) { return null; }\n\t\tmust = false;\n\t\tif (c !== '(') {\n\t\t\tstrings.push(c);\n\t\t\tcontinue;\n\t\t}\n\t\tif (strings.length) { return null; }\n\t\tstack.push(current);\n\t\tcurrent = [];\n\t}\n\tif (must || strings.length) {\n\t\tadd();\n\t}\n\tif (stack.length) { return null; }\n\treturn root.length === 1 ? root[0] : root;\n}\n\nconst valueQRegex = /^([-_\\d\\p{L}]+)@([-_\\d\\p{L}]+)/u;\n\n\n/**\n * \n * @param {string?} v \n * @returns {Value | true}\n */\nfunction parseValue(v) {\n\tif (v === null) { return true; }\n\tif (v[0] === '?') {\n\t\treturn { placeholder: decodeValue(v.slice(1)) };\n\t}\n\tif (v[0] === ':') {\n\t\treturn { field: decodeValue(v.slice(1)) };\n\t}\n\tif (v[0] === '@') {\n\t\t// TODO: \n\t\treturn null;\n\t}\n\tconst vq = valueQRegex.test(v);\n\tif (vq) {\n\t\t// TODO: \n\t\treturn null;\n\t}\n\tif (v.includes('(') || v.includes(')')) {\n\t\tconst list = parseArrayValue(v);\n\t\tif (list) { return list; }\n\t}\n\tif (v.includes(',')) {\n\t\treturn v.split(',').map(v => decodeValue(v.replaceAll('+', ' ')));\n\t}\n\treturn decodeValue(v);\n}\n/**\n * \n * @param {(Parse.Match | Parse.Children)[]} list \n * @returns {Iterable<Match | Children>}\n */\nfunction* toAnd(list) {\n\t/** @type {[(Parse.Match | Parse.Children), Parse.Field[], Parse.Field[]][]} */\n\tconst values = list.map(v => {\n\t\tconst fields = v.fields;\n\t\tconst index = fields.findLastIndex(v => v.group);\n\t\tif (index < 0 || index >= fields.length - 1) {\n\t\t\treturn [v, [], []];\n\t\t}\n\t\tconst field = fields[index];\n\t\tif (!field) { return [v, [], []]; }\n\t\treturn [{ ...v, fields: fields.slice(index + 1) }, fields.slice(0, index + 1), [...fields.slice(0, index), { ...field, group: undefined }]];\n\t});\n\tconst map = Object.groupBy(values, v => JSON.stringify(v[1]));\n\tyield* map['[]']?.map(v => compressAndItem(v[0])) || [];\n\tdelete map['[]'];\n\t/** @type {Parse.Children[]} */\n\tconst result = Object.values(map).filter(Boolean).map((list = []) => {\n\t\tif (!list?.length) { return { fields: [], children: [] }; }\n\t\treturn { fields: list[0][2] || [], children: list.map(v => v[0]) };\n\t}).filter(v => v.fields.length);\n\tif (!result.length) { return; }\n\n\tyield* toAnd(result);\n}\n\n/**\n * \n * @param {(Parse.Match & {groups: string[]})[]} list \n * @returns {Or}\n */\nfunction toOr(list) {\n\tconst map = Map.groupBy(list, v => v.groups.shift() ?? null);\n\tconst and = map.get(null) || [];\n\tconst baseOr = map.get('') || [];\n\tmap.delete(null);\n\tmap.delete('');\n\n\treturn {\n\t\tor: [\n\t\t\t...baseOr.map(v => compressAndItem(v)),\n\t\t\t...[...map.values()].map(v => toOr(v)),\n\t\t],\n\t\tand: [...toAnd(and)],\n\t};\n}\n/**\n * \n * @param {string} search \n * @returns {Param}\n */\nexport function parse(search, split = '&') {\n\t/** @type {string[]} */\n\tconst values = [];\n\t/** @type {string[]} */\n\tconst select = [];\n\t/** @type {[field: string, desc?: boolean][]} */\n\tconst sorts = [];\n\tlet limit = 0;\n\tlet offset = 0;\n\tlet page = 0;\n\tlet total = false;\n\t/** @type {Record<string, string>} */\n\tconst placeholders = {};\n\n\n\t/** @type {(Parse.Match & {groups: string[]})[]} */\n\tconst allMatches = [];\n\n\tfor (const s of search.split(split)) {\n\t\tif (s[0] === '=') {\n\t\t\tvalues.push(s.slice(1));\n\t\t\tcontinue;\n\t\t}\n\t\tconst index = s.indexOf('=');\n\t\tconst key = index < 0 ? s : s.slice(0, index);\n\t\tconst val = index < 0 ? null : s.slice(index + 1);\n\t\tif (index <= 0) { continue; }\n\t\tif (`.!@^*<>{}[]()+|;,\"'\\`\\\\/`.includes(key[0])) { continue; }\n\t\tif (key[0] === '?') {\n\t\t\tplaceholders[decodeValue(key.slice(1))] = decodeValue(val || '');\n\t\t\tcontinue;\n\t\t}\n\t\tif (key[0] === ':') {\n\t\t\tconst name = key.slice(1);\n\t\t\tif (!val) { continue; }\n\t\t\tif (name === 'sort') {\n\t\t\t\tsorts.push(...val.split(',').filter(Boolean).map(v => {\n\t\t\t\t\tconst desc = v[0] === '-';\n\t\t\t\t\tconst name = desc ? v.slice(1) : v;\n\t\t\t\t\treturn /** @type {[field: string, desc?: boolean]} */([decodeValue(name), desc]);\n\t\t\t\t}).filter(Boolean));\n\t\t\t} else if (name === 'select') {\n\t\t\t\tselect.push(...val.split(',').map(decodeValue).filter(Boolean));\n\t\t\t} else if (name === 'limit') {\n\t\t\t\tif (val && /^\\d+$/.test(val)) { limit = parseInt(val); }\n\t\t\t} else if (name === 'offset') {\n\t\t\t\tif (val && /^\\d+$/.test(val)) { offset = parseInt(val); }\n\t\t\t} else if (name === 'page') {\n\t\t\t\tif (val && /^\\d+$/.test(val)) { page = parseInt(val); }\n\t\t\t} else if (name === 'total') {\n\t\t\t\tif (val) { total = true; }\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tconst sg = key.split('~');\n\t\tlet field = sg.pop() || '';\n\t\tlet sign = '';\n\t\tif ('!'.includes(field[field.length - 1])) {\n\t\t\tsign = '!';\n\t\t\tfield = field.slice(0, -1);\n\t\t}\n\n\t\tconst l = field.split(':', 3);\n\t\tif (l.length > 2) { continue; }\n\t\tconst fields = parseFields(l[0]);\n\t\tif (!fields) { continue; }\n\t\tconst value = parseValue(val);\n\t\tif (value === null) { continue; }\n\n\t\tconst operator = decodeValue(l[1] || '');\n\t\tconst groupIndex = sg.indexOf('');\n\t\tconst groups = groupIndex < 0 ? sg : sg.slice(0, groupIndex + 1);\n\t\tallMatches.push({\n\t\t\tgroups,\n\t\t\tfields,\n\t\t\toperator: !operator && value === true ? null : operator,\n\t\t\tsign,\n\t\t\tvalue: value === true ? null : value\n\t\t});\n\t}\n\n\tconst { and, or } = toOr(allMatches);\n\n\t/** @type {Param} */\n\tconst result = {};\n\tif (values?.length) {\n\t\tresult.values = values;\n\t}\n\tif (total) {\n\t\tresult.total = total;\n\t}\n\tif (limit && limit > 0) {\n\t\tresult.limit = limit;\n\t}\n\tif (page && page > 0) {\n\t\tresult.page = page;\n\t}\n\tif (offset && offset > 0) {\n\t\tresult.offset = offset;\n\t}\n\tif (select?.length) {\n\t\tresult.select = select;\n\t}\n\tif (sorts?.length) {\n\t\tresult.sort = sorts;\n\t}\n\tconst where = and;\n\tif (where?.length) {\n\t\tresult.where = where;\n\t}\n\tconst orWhere = or;\n\tif (orWhere?.length) {\n\t\tresult.orWhere = orWhere;\n\t}\n\tif (Array.isArray(placeholders) && placeholders.length) {\n\t\tresult.placeholders = placeholders;\n\t}\n\n\n\treturn result\n}\n","/** @import { Param } from './types.mjs' */\n\n/**\n * \n * @param {Partial<Param>} a \n * @param {Partial<Param>} b \n * @returns {Param}\n */\nexport function merge(a, b) {\n\tconst limit = b.limit || a.limit || 10;\n\tconst page = b.page ?? a.page;\n\tconst offset = \n\tb.offset ?? (b.limit && (b.page || b.page === 0) ? (Math.floor(Math.max(b.page || 0, 1)) - 1) * b.limit : null)\n\t?? a.offset ?? (a.limit && (a.page || a.page === 0) ? (Math.floor(Math.max(a.page || 0, 1)) - 1) * a.limit : null)\n\t?? (Math.floor(Math.max(page || 0, 1)) - 1) * limit;\n\n\tconst values = [...a.values || [], ...b.values || []]\n\tconst sort = [...a.sort || [], ...b.sort || []]\n\tconst select = [...a.select || [], ...b.select || []]\n\tconst where = [...a.where || [], ...b.where || []]\n\tconst orWhere = [...a.orWhere || [], ...b.orWhere || []]\n\tconst or = [...a.or || [], ...b.or || []]\n\n\t/** @type {Param} */\n\tconst result = {};\n\tif (values?.length) {\n\t\tresult.values = values;\n\t}\n\tif (limit && limit > 0) {\n\t\tresult.limit = limit;\n\t}\n\tif (a.total || b.total) {\n\t\tresult.total = true;\n\t}\n\tif (page && page > 0) {\n\t\tresult.page = page;\n\t}\n\tif (offset && offset > 0) {\n\t\tresult.offset = offset;\n\t}\n\tif (select?.length) {\n\t\tresult.select = select;\n\t}\n\tif (sort?.length) {\n\t\tresult.sort = sort;\n\t}\n\tif (where?.length) {\n\t\tresult.where = where;\n\t}\n\tif (orWhere?.length) {\n\t\tresult.orWhere = orWhere;\n\t}\n\tif (or?.length) {\n\t\tresult.or = or;\n\t}\n\n\treturn result;\n}\n","/** @import { RecursiveArray } from '../types/types.mjs' */\n/** @import { Children, Field, FieldValue, Match, Or, Param } from './types.mjs' */\n\n/** @param {string} v */\nconst encodeValue = v => encodeURIComponent(v).replaceAll('%20', '+');\n\n/**\n * \n * @param {string | boolean | number | RecursiveArray<string> | FieldValue} value \n */\nfunction stringifyValue(value) {\n\tif (Array.isArray(value)) {\n\t\t/**\n\t\t * \n\t\t * @param {string | RecursiveArray<string>} v \n\t\t * @returns {string}\n\t\t */\n\t\tfunction s(v) {\n\t\t\tif (Array.isArray(v)) {\n\t\t\t\treturn `(${v.map(s).join(',')})`;\n\t\t\t}\n\t\t\treturn encodeValue(v);\n\t\t}\n\t\tconst val = value.map(s).join(',');\n\t\tif (value.length > 1) { return val; }\n\t\treturn `(${val})`;\n\t}\n\tif (typeof value === 'number') {\n\t\treturn `${value}`;\n\t}\n\tif (typeof value === 'boolean') {\n\t\treturn value ? '1' : 0\n\t}\n\tif (typeof value !== 'object') {\n\t\treturn encodeValue(value);\n\t}\n\tconst { field, placeholder } = value;\n\tif (placeholder) {\n\t\treturn `?${encodeValue(placeholder)}`;\n\t}\n\tif (field) {\n\t\treturn `:${encodeValue(field)}`;\n\t}\n\t// TODO:\n\treturn '';\n}\n\n/**\n * \n * @param {Field[]} fields \n */\nfunction stringifyFields(fields) {\n\treturn fields.map(item => {\n\t\tconst [field, ...sub] = typeof item === 'string' ? [item] : item;\n\t\t\treturn `${encodeValue(field)}${sub.map(() => `[k]`).join('')}`;\n\t\t}\n\t).join('.');\n}\n/**\n * \n * @param {Match} define \n */\nfunction stringifyDefine([fields, value, operator, sign]) {\n\tconst key = operator\n\t\t? `${stringifyFields(fields)}:${encodeValue(operator)}${sign || ''}`\n\t\t: `${stringifyFields(fields)}${sign || ''}`;\n\tif (operator === null) { return key; }\n\tif (value === null) { return ''; }\n\tif (typeof value === 'function') { return''; }\n\treturn `${key}=${stringifyValue(value)}`;\n}\n/**\n * \n * @param {(Match | Children)[]} list \n * @returns {string[]}\n */\nfunction stringifyAnd(list) {\n\tlet index = 0;\n\treturn list.flatMap(v => {\n\t\tif (v.length !== 2) {\n\t\t\treturn stringifyDefine(v);\n\t\t}\n\t\tconst list = stringifyAnd(v[1]);\n\t\tif (!list.length) { return []; }\n\t\tlet key = stringifyFields(v[0]);\n\t\tif (list.length > 1) {\n\t\t\tkey += `?${(index++).toString(36)}`;\n\t\t}\n\t\treturn list.map(v => `${key}.${v}`);\n\t}).filter(Boolean);\n}\n\n/**\n * \n * @param {(Match | Children | Or)[]} list \n * @returns {string[]}\n */\nfunction stringifyOr(list) {\n\tlet index = 0;\n\treturn list.map(v => {\n\t\tif (Array.isArray(v)) {\n\t\t\treturn stringifyAnd([v]);\n\n\t\t}\n\t\treturn [\n\t\t\t...stringifyAnd(v.and || []),\n\t\t\t...stringifyOr(v.or || []),\n\t\t];\n\t}).flatMap(list => {\n\t\tif (!list) { return []; }\n\t\tconst key = list.length === 1 ? `~` : `${(index++).toString(36)}~`;\n\t\treturn list.map(v => `${key}${v}`);\n\t});\n}\n/**\n * \n * @param {Partial<Param>} query \n * @param {boolean} [usePage] \n */\nexport function stringify({\n\tvalues,\n\twhere,\n\torWhere,\n\tsort,\n\tselect,\n\tlimit, offset, page, total,\n\tplaceholders,\n}, usePage) {\n\t/** @type {string[]} */\n\tlet queries = [];\n\tfor (const v of values || []) {\n\t\tif (!v) { continue; }\n\t\tqueries.push(`=${encodeValue(v)}`);\n\t}\n\tif (limit && limit > 0) {\n\t\tqueries.push(`:limit=${limit}`);\n\t}\n\tif (total) {\n\t\tqueries.push(`:total=${total}`);\n\n\t}\n\tif (usePage) {\n\t\tif (page && page > 0) {\n\t\t\tqueries.push(`:page=${page}`);\n\t\t}\n\t} else {\n\t\tif (offset && offset > 0) {\n\t\t\tqueries.push(`:offset=${offset}`);\n\t\t}\n\t}\n\tif (select) {\n\t\tconst val = select.filter(Boolean).map(encodeValue).join(',');\n\t\tif (val) {\n\t\t\tqueries.push(`.select=${val}`);\n\t\t}\n\t}\n\tif (sort) {\n\t\tconst val = sort.filter(Boolean).map(v => {\n\t\t\tif (Array.isArray(v)) {\n\t\t\t\tconst [field, desc] = v;\n\t\t\t\tif (field) {\n\t\t\t\t\treturn `${desc ? '-' : ''}${encodeValue(field)}`;\n\t\t\t\t}\n\t\t\t} else if (v) {\n\t\t\t\treturn encodeValue(v);\n\t\t\t}\n\t\t\treturn '';\n\t\t}).filter(Boolean).join(',');\n\t\tif (val) {\n\t\t\tqueries.push(`.sort=${val}`);\n\t\t}\n\t}\n\tif (placeholders && typeof placeholders === 'object' && !Array.isArray(placeholders)) {\n\t\tfor (const [k, v] of Object.entries(placeholders)) {\n\t\t\tqueries.push(`?${encodeValue(k)}=${encodeValue(v)}`);\n\n\t\t}\n\t}\n\tfor (const v of stringifyAnd(where || [])) {\n\t\tqueries.push(v);\n\t}\n\tfor (const v of stringifyOr(orWhere || [])) {\n\t\tqueries.push(v);\n\t}\n\treturn queries.join('&');\n}\n","export * from './exec.mjs';\nexport * from './fill.mjs';\nexport { parse } from './parse.mjs';\nexport * from './merge.mjs';\nexport * from './stringify.mjs';\nexport * from './types.mjs';\nexport * from './util.mjs';\nexport * from './WhereLike.mjs';\n","/**\n * @template T\n * @typedef {T | readonly T[]} Hook.MaybeArray\n */\n/**\n * @template T\n * @typedef {T extends readonly any[] ? Readonly<T>\n * : T extends Record<string, any> ? Hook.MaybeArray<Hook.Define<T> | T>\n * : T extends object ? Hook.MaybeArray<Hook.Define<T> | T>\n * : Hook.MaybeArray<T>\n * } Hook.Item\n */\n/**\n * @template T\n * @typedef {T extends Record<string, any> ? { [k in keyof T]?: Hook.Item<T[k]> } : T} Hook.Define\n*/\n\n\n\n\n/** @type {*} */\nconst noopFilter = () => true;\n\n\n\n\n/**\n * \n * @param {Record<string, any>} plugin \n * @param {string[]} name \n * @returns {*[]}\n */\nfunction findHook(plugin, name) {\n\tlet list = [plugin].flat();\n\tfor (const k of name.filter(Boolean)) {\n\t\tconst values = [];\n\t\tfor (const it of list) {\n\t\t\tif (!it || typeof it !== 'object') { continue; }\n\t\t\tif (!Object.hasOwn(it, k)) { continue; }\n\t\t\tvalues.push(it[k]);\n\t\t}\n\t\tif (!values.length) { return []; }\n\t\tlist = values.flat();\n\t}\n\treturn list;\n}\n\n/**\n * \n * @template T\n * @param {any} plugin \n * @param {string[]} names \n * @returns {T | void}\n */\nfunction first(plugin, names) {\n\tif (!names.length) { return plugin; }\n\tif (!plugin || typeof plugin !== 'object') { return; }\n\tconst [name, ...keys] = names;\n\tfor (const v of [plugin].flat()) {\n\t\tconst val = first(v[name], keys);\n\t\tif (val !== undefined) { return val; }\n\t}\n}\n\n/**\n * \n * @template T\n * @param {Record<string, any>} hooks \n * @param {string[]} name \n * @returns {IterableIterator<T>}\n */\nfunction* values(hooks, name) {\n\tfor (const it of Object.values(hooks)) {\n\t\tfor (const value of findHook(it, name)) {\n\t\t\tyield value;\n\t\t}\n\t}\n}\n\n\n\n\n/**\n * @template T\n */\nexport class Hook {\n\t/**\n\t * @template {object} T\n\t * @param {Record<string, Hook.Define<T>> | (() => Record<string, Hook.Define<T>>)} [options]\n\t * @return {Hook<T>}\n\t */\n\tstatic build(options) {\n\t\tconst hook = new Hook();\n\t\treturn Hook.update(hook, options);\n\t}\n\t/**\n\t * \n\t * @template T\n\t * @param {Hook<T>} hook\n\t * @param {Record<string, Hook.Define<T>> | (() => Record<string, Hook.Define<T>>)} [options]\n\t */\n\tstatic update(hook, options) {\n\t\tlet updated = false;\n\t\tif (typeof options === 'function') {\n\t\t\tObject.defineProperty(hook.#config, 'hooks', {\n\t\t\t\tconfigurable: true,\n\t\t\t\tget() {\n\t\t\t\t\tconst r = options();\n\t\t\t\t\treturn typeof r === 'object' && r || {};\n\t\t\t\t},\n\t\t\t});\n\t\t\tupdated = true;\n\t\t} else {\n\t\t\tif (options && typeof options === 'object') {\n\t\t\t\tObject.defineProperty(hook.#config, 'hooks', {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tvalue: options,\n\t\t\t\t});\n\t\t\t\tupdated = true;\n\t\t\t}\n\t\t}\n\t\tif (updated) {\n\t\t\tHook.reset(hook);\n\t\t}\n\t\treturn hook;\n\t}\n\t/**\n\t * \n\t * @template T\n\t * @param {Hook<T>} hook\n\t */\n\tstatic reset(hook) {\n\t\tconst hooks = hook.#hooks;\n\t\tconst resetFn = hook.#config.resetFn;\n\t\tresetFn.sort(([, a], [, b]) => a - b);\n\t\tconst before = resetFn.filter(([, p]) => p <= 0);\n\t\tconst after = resetFn.filter(([, p]) => p > 0);\n\t\tfor (const [fn] of before) { fn(); }\n\t\tfor (const fn of values(hooks, ['reset'])) {\n\t\t\tif (typeof fn !== 'function') { continue; }\n\t\t\tfn();\n\t\t}\n\t\tfor (const [fn] of after) { fn(); }\n\t}\n\n\t/** @type {{hooks: any; resetFn: [fn: () => void, hysteresis: number][]}} */\n\t#config = { hooks: Object.create(null), resetFn: [] };\n\t/** @type {string[]} */\n\t#keys = [];\n\t#stringTag = 'Hook';\n\t[Symbol.iterator]() { return this.entries(); }\n\t[Symbol.toStringTag]() { return this.#stringTag; }\n\t/** @param {string} hint */\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === 'number') { return NaN; }\n\t\treturn `[${this[Symbol.toStringTag]()}]`;\n\t}\n\n\tget #hooks() { return this.#config.hooks; };\n\t/**\n\t * @template {T extends readonly any[] ? never : T extends object ? string & keyof T : never} K\n\t * @param {K} key \n\t * @returns {Hook<Exclude<T extends readonly any[] ? never : T extends object ? T[K] :never, void | undefined>>}\n\t */\n\tget(key) {\n\t\tconst keys = [...this.#keys, key];\n\t\tconst hook = new Hook();\n\t\thook.#config = this.#config;\n\t\thook.#keys = keys;\n\t\thook.#stringTag = `Hook(${keys.join('.')})`;\n\t\treturn hook;\n\t}\n\t/**\n\t * @param {T extends (...args: infer A) => any ? A : []} args \n\t * @returns \n\t */\n\tcall(...args) {\n\t\tfor (const fn of this.values()) {\n\t\t\tif (typeof fn !== 'function') { continue; }\n\t\t\tfn(...args);\n\t\t}\n\t}\n\t/**\n\t * \n\t * @param {string} plugin \n\t * @returns {T | void}\n\t */\n\tfirst(plugin) {\n\t\tconst hooks = this.#hooks;\n\t\tif (!Object.hasOwn(hooks, plugin)) { return; }\n\t\treturn first(hooks[plugin], this.#keys.filter(Boolean));\n\t}\n\n\t/**\n\t * \n\t * @param {string} plugin \n\t * @returns {IterableIterator<T extends readonly (infer V)[] ? V : T>}\n\t */\n\t*plugin(plugin) {\n\t\tconst hooks = this.#hooks;\n\t\tif (!Object.hasOwn(hooks, plugin)) { return; }\n\t\tyield* findHook(hooks[plugin], this.#keys.filter(Boolean));\n\t}\n\n\t/**\n\t * \n\t * @returns {IterableIterator<T extends readonly (infer V)[] ? V : T>}\n\t */\n\tvalues() { return values(this.#hooks, this.#keys); }\n\n\t/**\n\t * \n\t * @returns {IterableIterator<[string, T extends readonly (infer V)[] ? V : T]>}\n\t */\n\t*entries() {\n\t\tconst hooks = this.#hooks;\n\t\tconst name = this.#keys;\n\t\tfor (const [plugin, it] of Object.entries(hooks)) {\n\t\t\tfor (const value of findHook(it, name)) {\n\t\t\t\tyield [plugin, value];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * \n\t * @template [TX=(T extends Record<string, infer TT>? TT extends readonly (infer V)[] ? V : TT : never)]\n\t * @param {(v: *)=>v is TX} filter \n\t * @returns {IterableIterator<[plugin: string, key: string, value: TX]>}\n\t */\n\t*entriesObject(filter = noopFilter) {\n\t\tfor (const [plugin, hooksMap] of this.entries()) {\n\t\t\tif (!hooksMap || typeof hooksMap !== 'object') { continue; }\n\t\t\tfor (const [k, v] of Object.entries(hooksMap)) {\n\t\t\t\tif (!filter(v)) { continue; }\n\t\t\t\tyield [plugin, k, v];\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\t/**\n\t * @template [TT=(T extends Record<string, infer TT> ? TT : never)]\n\t * @param {(v: *)=>v is TT} [filter] \n\t * @returns {Record<string, TT>}\n\t */\n\tnamed(filter = noopFilter) {\n\t\t/** @type {Record<string, TT>} */\n\t\tconst result = Object.create(null);\n\t\tfor (const hooksMap of this.values()) {\n\t\t\tif (!hooksMap || typeof hooksMap !== 'object') { continue; }\n\t\t\tfor (const [k, v] of Object.entries(hooksMap)) {\n\t\t\t\tif (!filter(v)) { continue; }\n\t\t\t\tresult[k] = v;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * \n\t * @param {() => void} fn \n\t * @param {number} [hysteresis] \n\t * @returns \n\t */\n\tlisten(fn, hysteresis) {\n\t\tif (typeof fn !== 'function') { return () => { }; }\n\t\tconst resetFn = this.#config.resetFn;\n\t\t/** @type {[() => void, number]} */\n\t\tconst it = [fn, Number.isFinite(hysteresis) && hysteresis || 0];\n\t\tresetFn.push(it);\n\t\tresetFn.sort(([, a], [, b]) => b - a);\n\t\treturn () => {\n\t\t\tconst index = resetFn.findIndex(v => v === it);\n\t\t\tif (index >= 0) {\n\t\t\t\tresetFn.splice(index, 1);\n\t\t\t}\n\t\t};\n\t}\n}\n","const regex = /\\{([^}{}]+)\\}/g\n/**\n * \n * @param {string?} [pattern] \n */\nexport function getPatternFields(pattern) {\n\tif (!pattern || typeof pattern !== 'string') { return []; }\n\t/** @type {string[]} */\n\tconst fields = [];\n\tfor(let result = regex.exec(pattern); result; result = regex.exec(pattern)) {\n\t\tfields.push(result[1]);\n\t}\n\treturn fields;\n}\n\n/**\n * \n * @param {string?} [pattern] \n * @param {Record<string, any>?} [document] \n * @returns \n */\nexport function runPattern(pattern, document) {\n\tif (!pattern || typeof pattern !== 'string') { return ''; }\n\tconst doc = typeof document === 'object' && document || {};\n\treturn pattern.replace(regex, (_, v) => {\n\t\tif (Object.hasOwn(doc, v)) { return doc[v] ?? ''; }\n\t\treturn `{${v}}`;\n\t});\n}\n","/** @import { Permission } from '@yongdall/types' */\n\n\n\n\n\n/**\n *\n * @param {Permission} permission\n * @returns {Iterable<string>}\n */\nexport default function* yieldPermissionConstraintFields({ constraints, organizationField }) {\n\tif (organizationField) { yield organizationField; }\n\tif (!constraints) { return; }\n\tfor (const [field, constraint] of Object.entries(constraints)) {\n\t\tif (!constraint) { continue; }\n\t\tconst { value, values, user } = constraint;\n\t\tif (value !== undefined) {\n\t\t\tyield field;\n\t\t} else if (Array.isArray(values) && values.length) {\n\t\t\tyield field;\n\t\t} else if (values instanceof Set && values.size) {\n\t\t\tyield field;\n\t\t} else if (user) {\n\t\t\tyield field;\n\t\t}\n\t}\n}\n","export * as Search from './Search/index.mjs';\nexport { Hook } from './Hook.mjs';\nexport * from './model.mjs';\nexport { default as yieldPermissionConstraintFields } from './yieldPermissionConstraintFields.mjs';\n\n\nexport const pluginIdRegex = /^(?:(?<scope>@[a-zA-Z\\d_.-]+)\\/)?(?<name>[a-zA-Z\\d_.-]+)$/;\nexport const findPluginIdRegex = /^(?<pluginId>(?:(?<scope>@[a-zA-Z\\d_.-]+)\\/)?(?<name>[a-zA-Z\\d_.-]+))(?:\\/(?<path>[^#]*))?(?:#(?<hash>.*))?$/;\n\n/**\n * @typedef {object} Plugin\n * @property {string} [version]\n * @property {Record<string, string>} [assets]\n * @property {string} [hooks]\n * @property {string[]} [styles]\n */\n/**\n * @typedef {object} BootConfiguration\n * @property {string} [route] 路由管理器\n * @property {string} [theme] 界面主题\n * @property {string} [authenticator] 登陆器\n * @property {boolean} [authRequired] 是否强制登陆\n * @property {string} [skin]\n * @property {boolean} [multiUser] \n * @property {string} [application] \n * @property {string} [domain] \n * @property {string | number} [port] \n * @property {string} [path] \n * @property {Record<string, string>} [pages]\n * @property {Record<string, string>} [configurationPages]\n * \n * \n * @property {string} [logo] \n * @property {string} [title] \n * @property {string} [company] \n * @property {string} [type] \n * @property {string} [help] 帮助链接\n * @property {any[]} [userMenus]\n */\n/**\n * @typedef {object} Importmap\n * @property {Record<string, string>} imports\n * @property {Record<string, Record<string, string>>} scopes\n */\n/**\n * @typedef {object} Indicator\n * @property {string} color\n * @property {string} label\n * @property {unknown} [filters]\n */\n\n/**\n *\n * @param {*} v\n * @returns {v is (...p: any[]) => any}\n */\nexport function isFunction(v) {\n\treturn typeof v === 'function';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAgB,aAAa,WAAW,KAAK,KAAK;;CAEjD,IAAI,QAAQ;AACZ,UAAU;EACT,MAAM,SAAS,UAAU,KAAK,MAAM;AACpC,MAAI,OAAO,KACV,QAAO,OAAO;AAEf,UAAQ,IAAI,OAAO,MAAM;;;;;;;;;;;AAW3B,eAAsB,kBAAkB,WAAW,KAAK,KAAK;;CAE5D,IAAI,QAAQ;AACZ,UAAU;EACT,MAAM,SAAS,UAAU,KAAK,MAAM;AACpC,MAAI,OAAO,KACV,QAAO,OAAO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I,CAAC,YAAe;AACpB,MAAK,MAAM,CAAC,OAAO,eAAe,OAAO,QAAQ,YAAY,EAAE;AAC9D,MAAI,CAAC,WAAc;EACnB,MAAM,EAAE,OAAO,QAAQ,SAAS;AAChC,MAAI,UAAU,OACb,OAAM;WACI,MAAM,QAAQ,OAAO,IAAI,OAAO,OAC1C,OAAM;WACI,kBAAkB,OAAO,OAAO,KAC1C,OAAM;WACI,KACV,OAAM;;;;;;AClBT,MAAa,gBAAgB;AAC7B,MAAa,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDjC,SAAgB,WAAW,GAAG;AAC7B,QAAO,OAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["#config","#hooks","#stringTag","#keys"],"sources":["../../packages/common/Search/util.mjs","../../packages/common/Search/exec.mjs","../../packages/common/Search/fill.mjs","../../packages/common/Search/parse.mjs","../../packages/common/Search/merge.mjs","../../packages/common/Search/stringify.mjs","../../packages/common/Search/toWhere.mjs","../../packages/common/Search/index.mjs","../../packages/common/transformError.mjs","../../packages/common/Hook.mjs","../../packages/common/model.mjs","../../packages/common/yieldPermissionConstraintFields.mjs","../../packages/common/index.mjs"],"sourcesContent":["\n/**\n * @template T\n * @template TReturn\n * @template TNext\n * @param {Generator<T, TReturn, TNext>} generator \n * @param {(value: T) => TNext} run \n * @param {TNext} def \n */\nexport function runGenerator(generator, run, def) {\n\t/** @type {TNext} */\n\tlet value = def;\n\tfor (; ;) {\n\t\tconst result = generator.next(value);\n\t\tif (result.done) {\n\t\t\treturn result.value;\n\t\t}\n\t\tvalue = run(result.value);\n\t}\n}\n/**\n * @template T\n * @template TReturn\n * @template TNext\n * @param {Generator<T, TReturn, TNext>} generator \n * @param {(value: T) => PromiseLike<TNext> | TNext} run \n * @param {TNext} def \n */\nexport async function asyncRunGenerator(generator, run, def) {\n\t/** @type {TNext} */\n\tlet value = def;\n\tfor (; ;) {\n\t\tconst result = generator.next(value);\n\t\tif (result.done) {\n\t\t\treturn result.value;\n\t\t}\n\t\tvalue = await run(result.value);\n\t}\n}\n","/** @import { Children, Field, Match, Or } from './types.mjs' */\nimport { asyncRunGenerator, runGenerator } from './util.mjs';\n\n\n/**\n * \n * @param {Record<string, any>[]} data \n * @param {Field[]} fields \n * @returns {any[]}\n */\nfunction select(data, fields) {\n\tlet list = data;\n\tfor (let item of fields) {\n\t\tconst [field, ...sub] = typeof item === 'string' ? [item] : item;\n\n\t\tif (!list.length) { continue; }\n\t\t/** @type {any[]} */\n\t\tconst subList = [];\n\t\tit: for (const item of list) {\n\t\t\tif (!item || typeof item !== 'object') { continue; }\n\t\t\tif (!Object.hasOwn(item, field)) { continue; }\n\t\t\tlet value = item[field];\n\t\t\tfor (const index of sub) {\n\t\t\t\tif (!Array.isArray(value)) { continue it; }\n\t\t\t\tvalue = value[index];\n\t\t\t}\n\t\t\tsubList.push(value);\n\t\t}\n\t\tlist = subList.flat(Infinity).filter(v => v && typeof v === 'object');\n\t}\n\treturn list;\n\n}\n\n/**\n * \n * @param {Record<string, any>[]} list \n * @param {string} field \n * @returns {any[]}\n */\nfunction selectValue(list, field) {\n\t/** @type {any[]} */\n\tconst subList = [];\n\tfor (const item of list) {\n\t\tif (!item || typeof item !== 'object') { continue; }\n\t\tif (!Object.hasOwn(item, field)) { continue; }\n\t\tsubList.push(item[field]);\n\t}\n\treturn subList;\n\n}\n/**\n * @typedef {object} ExecParam\n * @property {Field[]} fields\n * @property {string} operator\n * @property {string?} [sign]\n * @property {any} value\n * @property {any[]} values\n * @property {string} [field]\n */\n/**\n * \n * @param {Record<string, any>[]} data \n * @param {Field[]} parentFields \n * @param {Match} match \n * @returns {Generator<ExecParam, boolean?, boolean?>}\n */\nfunction* execMatch(data, parentFields, match) {\n\tconst fields = [...match[0]];\n\tconst currentFields = [...parentFields, ...fields];\n\tconst last = fields.pop();\n\tif (!last) { return null; }\n\tconst lastField = typeof last === 'string' ? last : last[0];\n\tconst records = select(data, fields);\n\tif (!records.length) { return false; }\n\tconst [, value, operator, sign] = match;\n\tif (operator === null) {\n\t\tconst values = selectValue(records, lastField);\n\t\treturn sign ? values.find(v => v === null) : values.find(v => v !== null);\n\t}\n\tif (typeof value !== 'object' || !value || Array.isArray(value)) {\n\n\t\tconst values = selectValue(records, lastField);\n\t\tif (!values.length) { return false; }\n\n\t\treturn yield ({ fields: currentFields, operator, sign, value, values });\n\t}\n\n\tif (value.filter || value.table || value.placeholder) { return null; }\n\tconst field = value.field;\n\tif (!field) { return null; }\n\n\t/** @type {boolean?} */\n\tlet defResult = false;\n\tfor (const item of records) {\n\t\tif (!item || typeof item !== 'object') { continue; }\n\t\tif (!Object.hasOwn(item, field)) { continue; }\n\t\tif (!Object.hasOwn(item, lastField)) { continue; }\n\t\tdefResult = null;\n\t\tconst result = yield ({ fields: currentFields, operator, sign, value: item[field], field, values: [item[lastField]] });\n\t\tif (result === null) { continue; }\n\t\treturn result;\n\t}\n\treturn defResult;\n\n}\n/**\n * \n * @param {Record<string, any>[]} data \n * @param {Field[]} parentFields \n * @param {Match | Children | Or} match \n * @returns {Generator<ExecParam, boolean?, boolean?>}\n */\nfunction* execItem(data, parentFields, match) {\n\tif (!Array.isArray(match)) {\n\t\tconst { and, or } = match;\n\t\treturn yield* execOr(data, parentFields, and, or);\n\t}\n\tif (match.length !== 2) {\n\t\treturn yield* execMatch(data, parentFields, match);\n\n\t}\n\t/** @type {boolean?} */\n\tlet defResult = null;\n\tconst values = select(data, match[0]);\n\tif (!values.length) { return false; }\n\tconst fields = [...parentFields, ...match[0]];\n\tfor (const item of match[1]) {\n\t\tconst result = yield* execItem(values, fields, item);\n\t\tif (result === null) { continue; }\n\t\tif (!result) { return false; }\n\t\tdefResult = true;\n\t}\n\treturn defResult;\n}\n/**\n * \n * @param {Record<string, any>[]} list \n * @param {Field[]} parentFields \n * @param {(Match | Children)[]} [and] \n * @param {(Match | Children | Or)[]} [or] \n * @returns {Generator<ExecParam, boolean?, boolean?>}\n */\nfunction* execOr(list, parentFields, and, or) {\n\t/** @type {boolean?} */\n\tlet defResult = null;\n\tif (Array.isArray(and)) {\n\t\tfor (const item of and) {\n\t\t\tconst result = yield* execItem(list, parentFields, item);\n\t\t\tif (result === null) { continue; }\n\t\t\tif (!result) { return false; }\n\t\t\tdefResult = true;\n\t\t}\n\t}\n\tif (Array.isArray(or)) {\n\t\tfor (const item of or) {\n\t\t\tconst result = yield* execItem(list, parentFields, item);\n\t\t\tif (result === null) { continue; }\n\t\t\tif (result) { return true; }\n\t\t\tdefResult = true;\n\t\t}\n\t}\n\treturn defResult;\n\n}\n\n/**\n * \n * @param {Record<string, any>} data \n * @param {(value: ExecParam) => boolean?} exec \n * @param {(Match | Children)[]} [and] \n * @param {(Match | Children | Or)[]} [or] \n */\nexport function exec(data, exec, and, or) {\n\treturn runGenerator(execOr([data].flat(), [], and, or), exec, null);\n}\n\n/**\n * \n * @param {Record<string, any>} data \n * @param {(value: ExecParam) => PromiseLike<boolean?> | boolean?} exec \n * @param {(Match | Children)[]} [and] \n * @param {(Match | Children | Or)[]} [or] \n */\nexport async function asyncExec(data, exec, and, or) {\n\treturn asyncRunGenerator(execOr([data].flat(), [], and, or), exec, null);\n}\n","/** @import { Value } from './types.mjs' */\n/** @import { Children, Field, FieldValue, Match, Or } from './types.mjs' */\n\nimport { runGenerator } from './util.mjs';\n\n\n\n\n\n\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T[]} match \n * @returns {Generator<Value, T[]?, Value | null>}\n */\nfunction* fillList(match) {\n\t/** @type {T[]} */\n\tlet list = [];\n\tlet has = false;\n\tfor (const child of match) {\n\t\tconst val = yield* fillMatch(child);\n\t\tlist.push(val || child);\n\t\tif (val) { has = true; }\n\t}\n\treturn has ? list : null;\n\n}\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T} match \n * @returns {Generator<Value, T?, Value | null>}\n */\nfunction* fillMatch(match) {\n\tif (!Array.isArray(match)) {\n\t\tconst and = match.and && (yield* fillMatches(match.and));\n\t\tconst or = match.or && (yield* fillMatches(match.or));\n\t\tif (!and && !or) { return null; }\n\t\t/** @type {Or} */\n\t\tconst item = { and: and || match.and, or: or || match.or };\n\t\treturn /** @type {T} */(item);\n\t}\n\tif (match.length === 2) {\n\t\tlet children = yield* fillMatches(match[1]);\n\t\tif (!children) { return null; }\n\t\t/** @type {Children} */\n\t\tconst item = [match[0], match[1]];\n\t\treturn /** @type {T} */(item);\n\t}\n\tconst value = yield match[1];\n\tif (value === null) { return null; }\n\t/** @type {Match} */\n\tconst item = [match[0], value, match[2], match[3]];\n\treturn /** @type {T} */(item);\n\n}\n\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T[]} match \n * @returns {Generator<Value, T[]?, Value | null>}\n */\nexport function* fillMatches(match) {\n\t/** @type {T[]} */\n\tconst list = [];\n\tlet has = false;\n\tfor (const child of match) {\n\t\tconst val = yield* fillMatch(child);\n\t\tlist.push(val || child);\n\t\tif (val) { has = true; }\n\t}\n\treturn has ? list : null;\n\n}\n\n/**\n * \n * @template {Match | Children | Or} T \n * @param {T[] | null | undefined} match \n * @param {(placeholder: string) => Value | null} getPlaceholder \n * @returns {T[]}\n */\nexport function fill(match, getPlaceholder) {\n\tif (!match) { return []; }\n\t/**\n\t * \n\t * @template {Value} T \n\t * @param {T} match \n\t * @returns {Value | null}\n\t */\n\tfunction fillValue(match) {\n\t\tif (!match || typeof match !== 'object') { return null; }\n\t\tif (Array.isArray(match)) { return null; }\n\t\tconst placeholder = match.placeholder;\n\t\tif (!placeholder || typeof placeholder !== 'string') { return null; }\n\t\treturn getPlaceholder(placeholder);\n\t}\n\treturn runGenerator(fillList(match), fillValue, null) || match;\n}\n","/** @import { RecursiveArray } from '../types/types.mjs' */\n/** @import { Children, Field, Match, Or, Param, Value } from './types.mjs' */\n\n\n\n/**\n * @typedef {object} Parse.Field\n * @property {string} field\n * @property {string?} [group]\n * @property {number[]} sub\n */\n/**\n * @typedef {object} Parse.Match\n * @property {null} [children]\n * @property {Parse.Field[]} fields\n * @property {string?} operator\n * @property {string} [sign]\n * @property {Value} value\n */\n\n\n/**\n * @typedef {object} Parse.Children\n * @property {Parse.Field[]} fields\n * @property {(Parse.Match | Parse.Children)[]} children\n */\n\n/**\n * \n * @param {Parse.Field[]} fields \n * @returns {Field[]}\n */\nfunction compressFields(fields) {\n\treturn fields.map(\n\t\t({ field, sub }) => sub.length ? [field, ...sub] : field\n\t);\n}\n\n/**\n * \n * @param {Parse.Match | Parse.Children} v \n * @returns {Match | Children}\n */\nfunction compressAndItem(v) {\n\tif (v.children) {\n\treturn [compressFields(v.fields), v.children.map(compressAndItem)];\n\n\t}\n\tconst { fields, operator, value, sign } = v;\n\treturn [compressFields(fields), value, operator, sign];\n}\n\nconst fieldParserRegex = /^([-_\\d\\p{L}]+)((?:\\[-?\\d+\\])*)$/u;\n/**\n * \n * @param {string} l \n */\nfunction parseFields(l) {\n\t/** @type {Parse.Field[]} */\n\tconst fields = [];\n\tfor (const v of l.split('.')) {\n\t\tif (!v || v[0] === '?') { return null; }\n\t\tconst index = v.indexOf('?');\n\t\tconst r = fieldParserRegex.exec(index > 0 ? v.slice(0, index) : v);\n\t\tif (!r) { return null; }\n\t\tconst sub = r[2]?.split(/\\[|\\]/).filter(Boolean).map(v => parseInt(v) || 0) || [];\n\t\tconst group = index > 0 ? v.slice(index) : undefined;\n\t\tfields.push({ field: r[1], group, sub });\n\t}\n\treturn fields;\n\n}\n\n\n/** @param {string} v */\nconst decodeValue = v => decodeURIComponent(v.replaceAll('+', ' '));\n/**\n * \n * @param {string} s \n * @returns {string | RecursiveArray<string>?}\n */\nfunction parseArrayValue(s) {\n\t/** @type {(string | RecursiveArray<string>)[]} */\n\tconst root = [];\n\t/** @type {(string | RecursiveArray<string>)[][]} */\n\tconst stack = [];\n\tlet current = root;\n\t/** @type {string[]} */\n\tlet strings = [];\n\tlet end = false;\n\tlet must = true;\n\tfunction add() {\n\t\tcurrent.push(decodeValue(strings.join()));\n\t\tstrings = [];\n\t}\n\n\tfor (const c of s) {\n\t\tif (c === ',') {\n\t\t\tif (end) {\n\t\t\t\tend = false;\n\t\t\t} else {\n\t\t\t\tadd();\n\t\t\t}\n\t\t\tmust = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (c === ')') {\n\t\t\tif (must || strings.length) {\n\t\t\t\tadd();\n\t\t\t\tmust = false;\n\t\t\t}\n\t\t\tconst last = stack.pop();\n\t\t\tif (!last) { return null; }\n\t\t\tlast.push(current);\n\t\t\tcurrent = last;\n\t\t\tend = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (end) { return null; }\n\t\tmust = false;\n\t\tif (c !== '(') {\n\t\t\tstrings.push(c);\n\t\t\tcontinue;\n\t\t}\n\t\tif (strings.length) { return null; }\n\t\tstack.push(current);\n\t\tcurrent = [];\n\t}\n\tif (must || strings.length) {\n\t\tadd();\n\t}\n\tif (stack.length) { return null; }\n\treturn root.length === 1 ? root[0] : root;\n}\n\nconst valueQRegex = /^([-_\\d\\p{L}]+)@([-_\\d\\p{L}]+)/u;\n\n\n/**\n * \n * @param {string?} v \n * @returns {Value | true}\n */\nfunction parseValue(v) {\n\tif (v === null) { return true; }\n\tif (v[0] === '?') {\n\t\treturn { placeholder: decodeValue(v.slice(1)) };\n\t}\n\tif (v[0] === ':') {\n\t\treturn { field: decodeValue(v.slice(1)) };\n\t}\n\tif (v[0] === '@') {\n\t\t// TODO: \n\t\treturn null;\n\t}\n\tconst vq = valueQRegex.test(v);\n\tif (vq) {\n\t\t// TODO: \n\t\treturn null;\n\t}\n\tif (v.includes('(') || v.includes(')')) {\n\t\tconst list = parseArrayValue(v);\n\t\tif (list) { return list; }\n\t}\n\tif (v.includes(',')) {\n\t\treturn v.split(',').map(v => decodeValue(v.replaceAll('+', ' ')));\n\t}\n\treturn decodeValue(v);\n}\n/**\n * \n * @param {(Parse.Match | Parse.Children)[]} list \n * @returns {Iterable<Match | Children>}\n */\nfunction* toAnd(list) {\n\t/** @type {[(Parse.Match | Parse.Children), Parse.Field[], Parse.Field[]][]} */\n\tconst values = list.map(v => {\n\t\tconst fields = v.fields;\n\t\tconst index = fields.findLastIndex(v => v.group);\n\t\tif (index < 0 || index >= fields.length - 1) {\n\t\t\treturn [v, [], []];\n\t\t}\n\t\tconst field = fields[index];\n\t\tif (!field) { return [v, [], []]; }\n\t\treturn [{ ...v, fields: fields.slice(index + 1) }, fields.slice(0, index + 1), [...fields.slice(0, index), { ...field, group: undefined }]];\n\t});\n\tconst map = Object.groupBy(values, v => JSON.stringify(v[1]));\n\tyield* map['[]']?.map(v => compressAndItem(v[0])) || [];\n\tdelete map['[]'];\n\t/** @type {Parse.Children[]} */\n\tconst result = Object.values(map).filter(Boolean).map((list = []) => {\n\t\tif (!list?.length) { return { fields: [], children: [] }; }\n\t\treturn { fields: list[0][2] || [], children: list.map(v => v[0]) };\n\t}).filter(v => v.fields.length);\n\tif (!result.length) { return; }\n\n\tyield* toAnd(result);\n}\n\n/**\n * \n * @param {(Parse.Match & {groups: string[]})[]} list \n * @returns {Or}\n */\nfunction toOr(list) {\n\tconst map = Map.groupBy(list, v => v.groups.shift() ?? null);\n\tconst and = map.get(null) || [];\n\tconst baseOr = map.get('') || [];\n\tmap.delete(null);\n\tmap.delete('');\n\n\treturn {\n\t\tor: [\n\t\t\t...baseOr.map(v => compressAndItem(v)),\n\t\t\t...[...map.values()].map(v => toOr(v)),\n\t\t],\n\t\tand: [...toAnd(and)],\n\t};\n}\n/**\n * \n * @param {string} search \n * @returns {Param}\n */\nexport function parse(search, split = '&') {\n\t/** @type {string[]} */\n\tconst values = [];\n\t/** @type {string[]} */\n\tconst select = [];\n\t/** @type {[field: string, desc?: boolean][]} */\n\tconst sorts = [];\n\tlet limit = 0;\n\tlet offset = 0;\n\tlet page = 0;\n\tlet total = false;\n\t/** @type {Record<string, string>} */\n\tconst placeholders = {};\n\n\n\t/** @type {(Parse.Match & {groups: string[]})[]} */\n\tconst allMatches = [];\n\n\tfor (const s of typeof search === 'string' ? search.split(split) : []) {\n\t\tif (s[0] === '=') {\n\t\t\tvalues.push(s.slice(1));\n\t\t\tcontinue;\n\t\t}\n\t\tconst index = s.indexOf('=');\n\t\tconst key = index < 0 ? s : s.slice(0, index);\n\t\tconst val = index < 0 ? null : s.slice(index + 1);\n\t\tif (index <= 0) { continue; }\n\t\tif (`.!@^*<>{}[]()+|;,\"'\\`\\\\/`.includes(key[0])) { continue; }\n\t\tif (key[0] === '?') {\n\t\t\tplaceholders[decodeValue(key.slice(1))] = decodeValue(val || '');\n\t\t\tcontinue;\n\t\t}\n\t\tif (key[0] === ':') {\n\t\t\tconst name = key.slice(1);\n\t\t\tif (!val) { continue; }\n\t\t\tif (name === 'sort') {\n\t\t\t\tsorts.push(...val.split(',').filter(Boolean).map(v => {\n\t\t\t\t\tconst desc = v[0] === '-';\n\t\t\t\t\tconst name = desc ? v.slice(1) : v;\n\t\t\t\t\treturn /** @type {[field: string, desc?: boolean]} */([decodeValue(name), desc]);\n\t\t\t\t}).filter(Boolean));\n\t\t\t} else if (name === 'select') {\n\t\t\t\tselect.push(...val.split(',').map(decodeValue).filter(Boolean));\n\t\t\t} else if (name === 'limit') {\n\t\t\t\tif (val && /^\\d+$/.test(val)) { limit = parseInt(val); }\n\t\t\t} else if (name === 'offset') {\n\t\t\t\tif (val && /^\\d+$/.test(val)) { offset = parseInt(val); }\n\t\t\t} else if (name === 'page') {\n\t\t\t\tif (val && /^\\d+$/.test(val)) { page = parseInt(val); }\n\t\t\t} else if (name === 'total') {\n\t\t\t\tif (val) { total = true; }\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tconst sg = key.split('~');\n\t\tlet field = sg.pop() || '';\n\t\tlet sign = '';\n\t\tif ('!'.includes(field[field.length - 1])) {\n\t\t\tsign = '!';\n\t\t\tfield = field.slice(0, -1);\n\t\t}\n\n\t\tconst l = field.split(':', 3);\n\t\tif (l.length > 2) { continue; }\n\t\tconst fields = parseFields(l[0]);\n\t\tif (!fields) { continue; }\n\t\tconst value = parseValue(val);\n\t\tif (value === null) { continue; }\n\n\t\tconst operator = decodeValue(l[1] || '');\n\t\tconst groupIndex = sg.indexOf('');\n\t\tconst groups = groupIndex < 0 ? sg : sg.slice(0, groupIndex + 1);\n\t\tallMatches.push({\n\t\t\tgroups,\n\t\t\tfields,\n\t\t\toperator: !operator && value === true ? null : operator,\n\t\t\tsign,\n\t\t\tvalue: value === true ? null : value\n\t\t});\n\t}\n\n\tconst { and, or } = toOr(allMatches);\n\n\t/** @type {Param} */\n\tconst result = {};\n\tif (values?.length) {\n\t\tresult.values = values;\n\t}\n\tif (total) {\n\t\tresult.total = total;\n\t}\n\tif (limit && limit > 0) {\n\t\tresult.limit = limit;\n\t}\n\tif (page && page > 0) {\n\t\tresult.page = page;\n\t}\n\tif (offset && offset > 0) {\n\t\tresult.offset = offset;\n\t}\n\tif (select?.length) {\n\t\tresult.select = select;\n\t}\n\tif (sorts?.length) {\n\t\tresult.sort = sorts;\n\t}\n\tconst where = and;\n\tif (where?.length) {\n\t\tresult.where = where;\n\t}\n\tconst orWhere = or;\n\tif (orWhere?.length) {\n\t\tresult.orWhere = orWhere;\n\t}\n\tif (Array.isArray(placeholders) && placeholders.length) {\n\t\tresult.placeholders = placeholders;\n\t}\n\n\n\treturn result\n}\n","/** @import { Param } from './types.mjs' */\n\n/**\n * \n * @param {Partial<Param>} a \n * @param {Partial<Param>} b \n * @returns {Param}\n */\nexport function merge(a, b) {\n\tconst limit = b.limit || a.limit || 10;\n\tconst page = b.page ?? a.page;\n\tconst offset = \n\tb.offset ?? (b.limit && (b.page || b.page === 0) ? (Math.floor(Math.max(b.page || 0, 1)) - 1) * b.limit : null)\n\t?? a.offset ?? (a.limit && (a.page || a.page === 0) ? (Math.floor(Math.max(a.page || 0, 1)) - 1) * a.limit : null)\n\t?? (Math.floor(Math.max(page || 0, 1)) - 1) * limit;\n\n\tconst values = [...a.values || [], ...b.values || []]\n\tconst sort = [...a.sort || [], ...b.sort || []]\n\tconst select = [...a.select || [], ...b.select || []]\n\tconst where = [...a.where || [], ...b.where || []]\n\tconst orWhere = [...a.orWhere || [], ...b.orWhere || []]\n\tconst or = [...a.or || [], ...b.or || []]\n\n\t/** @type {Param} */\n\tconst result = {};\n\tif (values?.length) {\n\t\tresult.values = values;\n\t}\n\tif (limit && limit > 0) {\n\t\tresult.limit = limit;\n\t}\n\tif (a.total || b.total) {\n\t\tresult.total = true;\n\t}\n\tif (page && page > 0) {\n\t\tresult.page = page;\n\t}\n\tif (offset && offset > 0) {\n\t\tresult.offset = offset;\n\t}\n\tif (select?.length) {\n\t\tresult.select = select;\n\t}\n\tif (sort?.length) {\n\t\tresult.sort = sort;\n\t}\n\tif (where?.length) {\n\t\tresult.where = where;\n\t}\n\tif (orWhere?.length) {\n\t\tresult.orWhere = orWhere;\n\t}\n\tif (or?.length) {\n\t\tresult.or = or;\n\t}\n\n\treturn result;\n}\n","/** @import { RecursiveArray } from '../types/types.mjs' */\n/** @import { Children, Field, FieldValue, Match, Or, Param } from './types.mjs' */\n\n/** @param {string} v */\nconst encodeValue = v => encodeURIComponent(v).replaceAll('%20', '+');\n\n/**\n * \n * @param {string | boolean | number | RecursiveArray<string> | FieldValue} value \n */\nfunction stringifyValue(value) {\n\tif (Array.isArray(value)) {\n\t\t/**\n\t\t * \n\t\t * @param {string | RecursiveArray<string>} v \n\t\t * @returns {string}\n\t\t */\n\t\tfunction s(v) {\n\t\t\tif (Array.isArray(v)) {\n\t\t\t\treturn `(${v.map(s).join(',')})`;\n\t\t\t}\n\t\t\treturn encodeValue(v);\n\t\t}\n\t\tconst val = value.map(s).join(',');\n\t\tif (value.length > 1) { return val; }\n\t\treturn `(${val})`;\n\t}\n\tif (typeof value === 'number') {\n\t\treturn `${value}`;\n\t}\n\tif (typeof value === 'boolean') {\n\t\treturn value ? '1' : 0\n\t}\n\tif (typeof value !== 'object') {\n\t\treturn encodeValue(value);\n\t}\n\tconst { field, placeholder } = value;\n\tif (placeholder) {\n\t\treturn `?${encodeValue(placeholder)}`;\n\t}\n\tif (field) {\n\t\treturn `:${encodeValue(field)}`;\n\t}\n\t// TODO:\n\treturn '';\n}\n\n/**\n * \n * @param {Field[]} fields \n */\nfunction stringifyFields(fields) {\n\treturn fields.map(item => {\n\t\tconst [field, ...sub] = typeof item === 'string' ? [item] : item;\n\t\t\treturn `${encodeValue(field)}${sub.map(() => `[k]`).join('')}`;\n\t\t}\n\t).join('.');\n}\n/**\n * \n * @param {Match} define \n */\nfunction stringifyDefine([fields, value, operator, sign]) {\n\tconst key = operator\n\t\t? `${stringifyFields(fields)}:${encodeValue(operator)}${sign || ''}`\n\t\t: `${stringifyFields(fields)}${sign || ''}`;\n\tif (operator === null) { return key; }\n\tif (value === null) { return ''; }\n\tif (typeof value === 'function') { return''; }\n\treturn `${key}=${stringifyValue(value)}`;\n}\n/**\n * \n * @param {(Match | Children)[]} list \n * @returns {string[]}\n */\nfunction stringifyAnd(list) {\n\tlet index = 0;\n\treturn list.flatMap(v => {\n\t\tif (v.length !== 2) {\n\t\t\treturn stringifyDefine(v);\n\t\t}\n\t\tconst list = stringifyAnd(v[1]);\n\t\tif (!list.length) { return []; }\n\t\tlet key = stringifyFields(v[0]);\n\t\tif (list.length > 1) {\n\t\t\tkey += `?${(index++).toString(36)}`;\n\t\t}\n\t\treturn list.map(v => `${key}.${v}`);\n\t}).filter(Boolean);\n}\n\n/**\n * \n * @param {(Match | Children | Or)[]} list \n * @returns {string[]}\n */\nfunction stringifyOr(list) {\n\tlet index = 0;\n\treturn list.map(v => {\n\t\tif (Array.isArray(v)) {\n\t\t\treturn stringifyAnd([v]);\n\n\t\t}\n\t\treturn [\n\t\t\t...stringifyAnd(v.and || []),\n\t\t\t...stringifyOr(v.or || []),\n\t\t];\n\t}).flatMap(list => {\n\t\tif (!list) { return []; }\n\t\tconst key = list.length === 1 ? `~` : `${(index++).toString(36)}~`;\n\t\treturn list.map(v => `${key}${v}`);\n\t});\n}\n/**\n * \n * @param {Partial<Param>} query \n * @param {boolean} [usePage] \n */\nexport function stringify({\n\tvalues,\n\twhere,\n\torWhere,\n\tsort,\n\tselect,\n\tlimit, offset, page, total,\n\tplaceholders,\n}, usePage) {\n\t/** @type {string[]} */\n\tlet queries = [];\n\tfor (const v of values || []) {\n\t\tif (!v) { continue; }\n\t\tqueries.push(`=${encodeValue(v)}`);\n\t}\n\tif (limit && limit > 0) {\n\t\tqueries.push(`:limit=${limit}`);\n\t}\n\tif (total) {\n\t\tqueries.push(`:total=${total}`);\n\n\t}\n\tif (usePage) {\n\t\tif (page && page > 0) {\n\t\t\tqueries.push(`:page=${page}`);\n\t\t}\n\t} else {\n\t\tif (offset && offset > 0) {\n\t\t\tqueries.push(`:offset=${offset}`);\n\t\t}\n\t}\n\tif (select) {\n\t\tconst val = select.filter(Boolean).map(encodeValue).join(',');\n\t\tif (val) {\n\t\t\tqueries.push(`.select=${val}`);\n\t\t}\n\t}\n\tif (sort) {\n\t\tconst val = sort.filter(Boolean).map(v => {\n\t\t\tif (Array.isArray(v)) {\n\t\t\t\tconst [field, desc] = v;\n\t\t\t\tif (field) {\n\t\t\t\t\treturn `${desc ? '-' : ''}${encodeValue(field)}`;\n\t\t\t\t}\n\t\t\t} else if (v) {\n\t\t\t\treturn encodeValue(v);\n\t\t\t}\n\t\t\treturn '';\n\t\t}).filter(Boolean).join(',');\n\t\tif (val) {\n\t\t\tqueries.push(`.sort=${val}`);\n\t\t}\n\t}\n\tif (placeholders && typeof placeholders === 'object' && !Array.isArray(placeholders)) {\n\t\tfor (const [k, v] of Object.entries(placeholders)) {\n\t\t\tqueries.push(`?${encodeValue(k)}=${encodeValue(v)}`);\n\n\t\t}\n\t}\n\tfor (const v of stringifyAnd(where || [])) {\n\t\tqueries.push(v);\n\t}\n\tfor (const v of stringifyOr(orWhere || [])) {\n\t\tqueries.push(v);\n\t}\n\treturn queries.join('&');\n}\n","import { Search } from '@yongdall/common';\n\n/**\n * \n * @template TField\n * @template TParam\n * @template TWhere\n * @typedef {object} Where\n * @property {(where: TWhere) => boolean?} [value]\n * @property {(list: TWhere[]) => TWhere?} or\n * @property {(list: TWhere[]) => TWhere?} and\n * @property {ItemToWhere<TField, TParam, TWhere>} build\n */\n\n/**\n * \n * @template TField\n * @template TParam\n * @template TWhere\n * @callback ToWhere\n * @param {TField} fields \n * @param {Search.AndList} [and] \n * @param {...Search.OrList | null | undefined} orList\n * @returns {Generator<TParam, TWhere?, TWhere?>}\n */\n\n/**\n * \n * @template TField\n * @template TParam\n * @template TWhere\n * @callback ItemToWhere\n * @param {ToWhere<TField, TParam, TWhere>} toWhere \n * @param {TField} fields \n * @param {Search.Match | Search.Children} and\n * @returns {Generator<TParam, TWhere?, TWhere?>}\n */\n\n\n\n\n/**\n * \n * @template TField\n * @template TParam\n * @template TWhere\n * @param {Where<TField, TParam, TWhere>} where \n * @param {TField} fields \n * @param {Search.AndList} [and] \n * @param {...Search.OrList | null | undefined} orList\n * @returns {Generator<TParam, TWhere?, TWhere?>}\n */\nexport function toWhere(where, fields, and, ...orList) {\n\t/**\n\t * \n\t * @param {TField} fields \n\t * @param {Search.AndList} [and] \n\t * @param {...Search.OrList | null | undefined} orList\n\t * @returns {Generator<TParam, TWhere?, TWhere?>}\n\t */\n\tfunction* toWhere(fields, and, ...orList) {\n\n\t\t/** @type {TWhere[]} */\n\t\tconst list = [];\n\t\tif (and) {\n\t\t\tfor (const item of and) {\n\t\t\t\tconst w = yield* where.build(toWhere, fields, item);\n\t\t\t\tif (w == null) { continue; }\n\t\t\t\tif (where.value?.(w) === false) { return w; }\n\t\t\t\tlist.push(w);\n\t\t\t}\n\t\t}\n\t\torFor: for (const or of orList) {\n\t\t\tif (!or) { continue; }\n\t\t\t/** @type {TWhere[]} */\n\t\t\tconst orList = [];\n\t\t\tfor (const item of or) {\n\t\t\t\tconst w = Array.isArray(item)\n\t\t\t\t\t? yield* where.build(toWhere, fields, item)\n\t\t\t\t\t: yield* toWhere(fields, item.and, item.or);\n\t\t\t\tif (w == null) { continue; }\n\t\t\t\tif (where.value?.(w) === true) {\n\t\t\t\t\tlist.push(w);\n\t\t\t\t\tcontinue orFor;\n\t\t\t\t}\n\t\t\t\torList.push(w);\n\t\t\t}\n\t\t\tconst w = orList.length ? where.or(orList) : null;\n\t\t\tif (w == null) { continue; }\n\t\t\tif (where.value?.(w) === false) { return w; }\n\t\t\tlist.push(w);\n\t\t}\n\t\tif (!list.length) { return null; }\n\t\treturn where.and(list);\n\t}\n\treturn toWhere(fields, and, ...orList);\n}\n","export * from './exec.mjs';\nexport * from './fill.mjs';\nexport { parse } from './parse.mjs';\nexport * from './merge.mjs';\nexport * from './stringify.mjs';\nexport * from './types.mjs';\nexport * from './util.mjs';\nexport * from './toWhere.mjs';\n","\nconst prototype = Error.prototype;\n/**\n * @template T\n * @template {Error} E\n * @param {Map<any, (error: E) => T>} transforms \n * @param {E} error \n */\nexport function transformError(transforms, error) {\n\tif (!(error instanceof Error)) { throw error; }\n\tfor (let p = Object.getPrototypeOf(error); p; p = Object.getPrototypeOf(p)) {\n\t\tconst fn = transforms.get(p);\n\t\tif (typeof fn === 'function') { return fn(error); }\n\t\tif (p === prototype) { break; }\n\t}\n\tthrow error;\n}\n","/**\n * @template T\n * @typedef {T | readonly T[]} Hook.MaybeArray\n */\n/**\n * @template T\n * @typedef {T extends readonly any[] ? Readonly<T>\n * : T extends Record<string, any> ? Hook.MaybeArray<Hook.Define<T> | T>\n * : T extends object ? Hook.MaybeArray<Hook.Define<T> | T>\n * : Hook.MaybeArray<T>\n * } Hook.Item\n */\n/**\n * @template T\n * @typedef {T extends Record<string, any> ? { [k in keyof T]?: Hook.Item<T[k]> } : T} Hook.Define\n*/\n\n\n\n\n/** @type {*} */\nconst noopFilter = () => true;\n\n\n\n\n/**\n * \n * @param {Record<string, any>} plugin \n * @param {string[]} name \n * @returns {*[]}\n */\nfunction findHook(plugin, name) {\n\tlet list = [plugin].flat();\n\tfor (const k of name.filter(Boolean)) {\n\t\tconst values = [];\n\t\tfor (const it of list) {\n\t\t\tif (!it || typeof it !== 'object') { continue; }\n\t\t\tif (!Object.hasOwn(it, k)) { continue; }\n\t\t\tvalues.push(it[k]);\n\t\t}\n\t\tif (!values.length) { return []; }\n\t\tlist = values.flat();\n\t}\n\treturn list;\n}\n\n/**\n * \n * @template T\n * @param {any} plugin \n * @param {string[]} names \n * @returns {T | void}\n */\nfunction first(plugin, names) {\n\tif (!names.length) { return plugin; }\n\tif (!plugin || typeof plugin !== 'object') { return; }\n\tconst [name, ...keys] = names;\n\tfor (const v of [plugin].flat()) {\n\t\tconst val = first(v[name], keys);\n\t\tif (val !== undefined) { return val; }\n\t}\n}\n\n/**\n * \n * @template T\n * @param {Record<string, any>} hooks \n * @param {string[]} name \n * @returns {IterableIterator<T>}\n */\nfunction* values(hooks, name) {\n\tfor (const it of Object.values(hooks)) {\n\t\tfor (const value of findHook(it, name)) {\n\t\t\tyield value;\n\t\t}\n\t}\n}\n\n\n\n\n/**\n * @template T\n */\nexport class Hook {\n\t/**\n\t * @template {object} T\n\t * @param {Record<string, Hook.Define<T>> | (() => Record<string, Hook.Define<T>>)} [options]\n\t * @return {Hook<T>}\n\t */\n\tstatic build(options) {\n\t\tconst hook = new Hook();\n\t\treturn Hook.update(hook, options);\n\t}\n\t/**\n\t * \n\t * @template T\n\t * @param {Hook<T>} hook\n\t * @param {Record<string, Hook.Define<T>> | (() => Record<string, Hook.Define<T>>)} [options]\n\t */\n\tstatic update(hook, options) {\n\t\tlet updated = false;\n\t\tif (typeof options === 'function') {\n\t\t\tObject.defineProperty(hook.#config, 'hooks', {\n\t\t\t\tconfigurable: true,\n\t\t\t\tget() {\n\t\t\t\t\tconst r = options();\n\t\t\t\t\treturn typeof r === 'object' && r || {};\n\t\t\t\t},\n\t\t\t});\n\t\t\tupdated = true;\n\t\t} else {\n\t\t\tif (options && typeof options === 'object') {\n\t\t\t\tObject.defineProperty(hook.#config, 'hooks', {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tvalue: options,\n\t\t\t\t});\n\t\t\t\tupdated = true;\n\t\t\t}\n\t\t}\n\t\tif (updated) {\n\t\t\tHook.reset(hook);\n\t\t}\n\t\treturn hook;\n\t}\n\t/**\n\t * \n\t * @template T\n\t * @param {Hook<T>} hook\n\t */\n\tstatic reset(hook) {\n\t\tconst hooks = hook.#hooks;\n\t\tconst resetFn = hook.#config.resetFn;\n\t\tresetFn.sort(([, a], [, b]) => a - b);\n\t\tconst before = resetFn.filter(([, p]) => p <= 0);\n\t\tconst after = resetFn.filter(([, p]) => p > 0);\n\t\tfor (const [fn] of before) { fn(); }\n\t\tfor (const fn of values(hooks, ['reset'])) {\n\t\t\tif (typeof fn !== 'function') { continue; }\n\t\t\tfn();\n\t\t}\n\t\tfor (const [fn] of after) { fn(); }\n\t}\n\n\t/** @type {{hooks: any; resetFn: [fn: () => void, hysteresis: number][]}} */\n\t#config = { hooks: Object.create(null), resetFn: [] };\n\t/** @type {string[]} */\n\t#keys = [];\n\t#stringTag = 'Hook';\n\t[Symbol.iterator]() { return this.entries(); }\n\t[Symbol.toStringTag]() { return this.#stringTag; }\n\t/** @param {string} hint */\n\t[Symbol.toPrimitive](hint) {\n\t\tif (hint === 'number') { return NaN; }\n\t\treturn `[${this[Symbol.toStringTag]()}]`;\n\t}\n\n\tget #hooks() { return this.#config.hooks; };\n\t/**\n\t * @template {T extends readonly any[] ? never : T extends object ? string & keyof T : never} K\n\t * @param {K} key \n\t * @returns {Hook<Exclude<T extends readonly any[] ? never : T extends object ? T[K] :never, void | undefined>>}\n\t */\n\tget(key) {\n\t\tconst keys = [...this.#keys, key];\n\t\tconst hook = new Hook();\n\t\thook.#config = this.#config;\n\t\thook.#keys = keys;\n\t\thook.#stringTag = `Hook(${keys.join('.')})`;\n\t\treturn hook;\n\t}\n\t/**\n\t * @param {T extends (...args: infer A) => any ? A : []} args \n\t * @returns \n\t */\n\tcall(...args) {\n\t\tfor (const fn of this.values()) {\n\t\t\tif (typeof fn !== 'function') { continue; }\n\t\t\tfn(...args);\n\t\t}\n\t}\n\t/**\n\t * \n\t * @param {string} plugin \n\t * @returns {T | void}\n\t */\n\tfirst(plugin) {\n\t\tconst hooks = this.#hooks;\n\t\tif (!Object.hasOwn(hooks, plugin)) { return; }\n\t\treturn first(hooks[plugin], this.#keys.filter(Boolean));\n\t}\n\n\t/**\n\t * \n\t * @param {string} plugin \n\t * @returns {IterableIterator<T extends readonly (infer V)[] ? V : T>}\n\t */\n\t*plugin(plugin) {\n\t\tconst hooks = this.#hooks;\n\t\tif (!Object.hasOwn(hooks, plugin)) { return; }\n\t\tyield* findHook(hooks[plugin], this.#keys.filter(Boolean));\n\t}\n\n\t/**\n\t * \n\t * @returns {IterableIterator<T extends readonly (infer V)[] ? V : T>}\n\t */\n\tvalues() { return values(this.#hooks, this.#keys); }\n\n\t/**\n\t * \n\t * @returns {IterableIterator<[string, T extends readonly (infer V)[] ? V : T]>}\n\t */\n\t*entries() {\n\t\tconst hooks = this.#hooks;\n\t\tconst name = this.#keys;\n\t\tfor (const [plugin, it] of Object.entries(hooks)) {\n\t\t\tfor (const value of findHook(it, name)) {\n\t\t\t\tyield [plugin, value];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * \n\t * @template [TX=(T extends Record<string, infer TT>? TT extends readonly (infer V)[] ? V : TT : never)]\n\t * @param {(v: *)=>v is TX} filter \n\t * @returns {IterableIterator<[plugin: string, key: string, value: TX]>}\n\t */\n\t*entriesObject(filter = noopFilter) {\n\t\tfor (const [plugin, hooksMap] of this.entries()) {\n\t\t\tif (!hooksMap || typeof hooksMap !== 'object') { continue; }\n\t\t\tfor (const [k, v] of Object.entries(hooksMap)) {\n\t\t\t\tif (!filter(v)) { continue; }\n\t\t\t\tyield [plugin, k, v];\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\t/**\n\t * @template [TT=(T extends Record<string, infer TT> ? TT : never)]\n\t * @param {(v: *)=>v is TT} [filter] \n\t * @returns {Record<string, TT>}\n\t */\n\tnamed(filter = noopFilter) {\n\t\t/** @type {Record<string, TT>} */\n\t\tconst result = Object.create(null);\n\t\tfor (const hooksMap of this.values()) {\n\t\t\tif (!hooksMap || typeof hooksMap !== 'object') { continue; }\n\t\t\tfor (const [k, v] of Object.entries(hooksMap)) {\n\t\t\t\tif (!filter(v)) { continue; }\n\t\t\t\tresult[k] = v;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * \n\t * @param {() => void} fn \n\t * @param {number} [hysteresis] \n\t * @returns \n\t */\n\tlisten(fn, hysteresis) {\n\t\tif (typeof fn !== 'function') { return () => { }; }\n\t\tconst resetFn = this.#config.resetFn;\n\t\t/** @type {[() => void, number]} */\n\t\tconst it = [fn, Number.isFinite(hysteresis) && hysteresis || 0];\n\t\tresetFn.push(it);\n\t\tresetFn.sort(([, a], [, b]) => b - a);\n\t\treturn () => {\n\t\t\tconst index = resetFn.findIndex(v => v === it);\n\t\t\tif (index >= 0) {\n\t\t\t\tresetFn.splice(index, 1);\n\t\t\t}\n\t\t};\n\t}\n}\n","const regex = /\\{([^}{}]+)\\}/g\n/**\n * \n * @param {string?} [pattern] \n */\nexport function getPatternFields(pattern) {\n\tif (!pattern || typeof pattern !== 'string') { return []; }\n\t/** @type {string[]} */\n\tconst fields = [];\n\tfor(let result = regex.exec(pattern); result; result = regex.exec(pattern)) {\n\t\tfields.push(result[1]);\n\t}\n\treturn fields;\n}\n\n/**\n * \n * @param {string?} [pattern] \n * @param {Record<string, any>?} [document] \n * @returns \n */\nexport function runPattern(pattern, document) {\n\tif (!pattern || typeof pattern !== 'string') { return ''; }\n\tconst doc = typeof document === 'object' && document || {};\n\treturn pattern.replace(regex, (_, v) => {\n\t\tif (Object.hasOwn(doc, v)) { return doc[v] ?? ''; }\n\t\treturn `${v}`;\n\t});\n}\n","/** @import { Permission } from '@yongdall/types' */\n\n\n\n\n\n/**\n *\n * @param {Permission} permission\n * @returns {Iterable<string>}\n */\nexport default function* yieldPermissionConstraintFields({ constraints, organizationField }) {\n\tif (organizationField) { yield organizationField; }\n\tif (!constraints) { return; }\n\tfor (const [field, constraint] of Object.entries(constraints)) {\n\t\tif (!constraint) { continue; }\n\t\tconst { value, values, user } = constraint;\n\t\tif (value !== undefined) {\n\t\t\tyield field;\n\t\t} else if (Array.isArray(values) && values.length) {\n\t\t\tyield field;\n\t\t} else if (values instanceof Set && values.size) {\n\t\t\tyield field;\n\t\t} else if (user) {\n\t\t\tyield field;\n\t\t}\n\t}\n}\n","export * as Search from './Search/index.mjs';\nexport { transformError } from './transformError.mjs';\nexport { Hook } from './Hook.mjs';\nexport * from './model.mjs';\nexport { default as yieldPermissionConstraintFields } from './yieldPermissionConstraintFields.mjs';\n\n\nexport const pluginIdRegex = /^(?:(?<scope>@[a-zA-Z\\d_.-]+)\\/)?(?<name>[a-zA-Z\\d_.-]+)$/;\nexport const findPluginIdRegex = /^(?<pluginId>(?:(?<scope>@[a-zA-Z\\d_.-]+)\\/)?(?<name>[a-zA-Z\\d_.-]+))(?:\\/(?<path>[^#]*))?(?:#(?<hash>.*))?$/;\n\n/**\n * @typedef {object} Plugin\n * @property {string} [version]\n * @property {Record<string, string>} [assets]\n * @property {string} [hooks]\n * @property {string[]} [styles]\n */\n/**\n * @typedef {object} BootConfiguration\n * @property {string} [id] \n * @property {string} [route] 路由管理器\n * @property {string} [theme] 界面主题\n * @property {string} [authenticator] 登陆器\n * @property {boolean} [authRequired] 是否强制登陆\n * @property {string} [skin]\n * @property {boolean} [multiUser] \n * @property {string} [domain] \n * @property {string | number} [port] \n * @property {string} [path] \n * @property {Record<string, string>} [pages]\n * @property {Record<string, string>} [configurationPages]\n * \n * \n * @property {string} [logo] \n * @property {string} [title] \n * @property {string} [company] \n * @property {string} [type] \n * @property {string} [help] 帮助链接\n * @property {any[]} [userMenus]\n * @property {any[]} [menus]\n */\n/**\n * @typedef {object} Importmap\n * @property {Record<string, string>} imports\n * @property {Record<string, Record<string, string>>} scopes\n */\n/**\n * @typedef {object} Indicator\n * @property {string} color\n * @property {string} label\n * @property {unknown} [filters]\n */\n\n/**\n *\n * @param {*} v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