@aiao/rxdb-test 0.0.15 → 0.0.17
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/README.md +30 -1
- package/dist/entities/FileLarge.d.ts +339 -0
- package/dist/entities/FileLarge.js +77 -0
- package/dist/entities/FileNode.d.ts +335 -0
- package/dist/entities/FileNode.js +77 -0
- package/dist/entities/MenuLarge.d.ts +294 -0
- package/dist/entities/MenuLarge.js +41 -0
- package/dist/entities/MenuSimple.d.ts +290 -0
- package/dist/entities/MenuSimple.js +41 -0
- package/dist/entities/Todo.d.ts +165 -0
- package/dist/entities/Todo.js +34 -0
- package/dist/entities/TypeDemo.d.ts +289 -0
- package/dist/entities/TypeDemo.js +137 -0
- package/dist/entities/index.d.ts +14 -1655
- package/dist/entities/index.js +6 -360
- package/dist/graph/index.d.ts +1 -2
- package/dist/graph/index.js +1 -1
- package/dist/shop/Attribute.d.ts +992 -0
- package/dist/shop/Attribute.js +50 -0
- package/dist/shop/AttributeValue.d.ts +999 -0
- package/dist/shop/AttributeValue.js +51 -0
- package/dist/shop/Category.d.ts +772 -0
- package/dist/shop/Category.js +52 -0
- package/dist/shop/IdCard.d.ts +647 -0
- package/dist/shop/IdCard.js +43 -0
- package/dist/shop/Order.d.ts +690 -0
- package/dist/shop/Order.js +66 -0
- package/dist/shop/OrderItem.d.ts +665 -0
- package/dist/shop/OrderItem.js +76 -0
- package/dist/shop/Product.d.ts +761 -0
- package/dist/shop/Product.js +58 -0
- package/dist/shop/SKU.d.ts +634 -0
- package/dist/shop/SKU.js +74 -0
- package/dist/shop/SKUAttributes.d.ts +625 -0
- package/dist/shop/SKUAttributes.js +56 -0
- package/dist/shop/User.d.ts +679 -0
- package/dist/shop/User.js +74 -0
- package/dist/shop/index.d.ts +52 -2990
- package/dist/shop/index.js +10 -528
- package/dist/system/RxDBBranch.d.ts +396 -0
- package/dist/system/RxDBBranch.js +106 -0
- package/dist/system/RxDBChange.d.ts +361 -0
- package/dist/system/RxDBChange.js +123 -0
- package/dist/system/RxDBMigration.d.ts +167 -0
- package/dist/system/RxDBMigration.js +40 -0
- package/dist/system/RxDBSync.d.ts +339 -0
- package/dist/system/RxDBSync.js +122 -0
- package/dist/system/index.d.ts +9 -1240
- package/dist/system/index.js +4 -384
- package/package.json +3 -3
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, FindTreeOptions, IEntity, ITreeEntity, NumberRules, RelationDateRules, RelationEntitiesObservable, RelationEntityObservable, RelationExistsRules, RelationNumberRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, TreeAdjacencyListEntityBase, UUID, UUIDRules } from '@aiao/rxdb';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* rule
|
|
6
|
+
*/
|
|
7
|
+
declare type FileNodeRule = UUIDRules<FileNode, 'id'>
|
|
8
|
+
| DateRules<FileNode, 'createdAt'>
|
|
9
|
+
| DateRules<FileNode, 'updatedAt'>
|
|
10
|
+
| StringRules<FileNode, 'createdBy'>
|
|
11
|
+
| StringRules<FileNode, 'updatedBy'>
|
|
12
|
+
| StringRules<FileNode, 'name'>
|
|
13
|
+
| StringRules<FileNode, 'type'>
|
|
14
|
+
| StringRules<FileNode, 'sortOrder'>
|
|
15
|
+
| StringRules<FileNode, 'extension'>
|
|
16
|
+
| NumberRules<FileNode, 'size'>
|
|
17
|
+
| UUIDRules<FileNode, 'parentId'>
|
|
18
|
+
| RelationExistsRules<'children', FileNodeRuleGroup>
|
|
19
|
+
| RelationUUIDRules<'children.id', UUID>
|
|
20
|
+
| RelationDateRules<'children.createdAt', Date>
|
|
21
|
+
| RelationDateRules<'children.updatedAt', Date>
|
|
22
|
+
| RelationStringRules<'children.createdBy', string | null>
|
|
23
|
+
| RelationStringRules<'children.updatedBy', string | null>
|
|
24
|
+
| RelationStringRules<'children.name', string>
|
|
25
|
+
| RelationStringRules<'children.type', string>
|
|
26
|
+
| RelationStringRules<'children.sortOrder', string | null>
|
|
27
|
+
| RelationStringRules<'children.extension', string | null>
|
|
28
|
+
| RelationNumberRules<'children.size', number | null>
|
|
29
|
+
| RelationExistsRules<'parent', FileNodeRuleGroup>
|
|
30
|
+
| RelationUUIDRules<'parent.id', UUID>
|
|
31
|
+
| RelationDateRules<'parent.createdAt', Date>
|
|
32
|
+
| RelationDateRules<'parent.updatedAt', Date>
|
|
33
|
+
| RelationStringRules<'parent.createdBy', string | null>
|
|
34
|
+
| RelationStringRules<'parent.updatedBy', string | null>
|
|
35
|
+
| RelationStringRules<'parent.name', string>
|
|
36
|
+
| RelationStringRules<'parent.type', string>
|
|
37
|
+
| RelationStringRules<'parent.sortOrder', string | null>
|
|
38
|
+
| RelationStringRules<'parent.extension', string | null>
|
|
39
|
+
| RelationNumberRules<'parent.size', number | null>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* RuleGroupBase
|
|
43
|
+
*/
|
|
44
|
+
export declare type FileNodeRuleGroup = RuleGroupBase<typeof FileNode,
|
|
45
|
+
|'id'
|
|
46
|
+
|'createdAt'
|
|
47
|
+
|'updatedAt'
|
|
48
|
+
|'createdBy'
|
|
49
|
+
|'updatedBy'
|
|
50
|
+
|'name'
|
|
51
|
+
|'type'
|
|
52
|
+
|'sortOrder'
|
|
53
|
+
|'extension'
|
|
54
|
+
|'size'
|
|
55
|
+
|'parentId'
|
|
56
|
+
|'children'
|
|
57
|
+
|'children.id'
|
|
58
|
+
|'children.createdAt'
|
|
59
|
+
|'children.updatedAt'
|
|
60
|
+
|'children.createdBy'
|
|
61
|
+
|'children.updatedBy'
|
|
62
|
+
|'children.name'
|
|
63
|
+
|'children.type'
|
|
64
|
+
|'children.sortOrder'
|
|
65
|
+
|'children.extension'
|
|
66
|
+
|'children.size'
|
|
67
|
+
|'parentId'
|
|
68
|
+
|'parent'
|
|
69
|
+
|'parent.id'
|
|
70
|
+
|'parent.createdAt'
|
|
71
|
+
|'parent.updatedAt'
|
|
72
|
+
|'parent.createdBy'
|
|
73
|
+
|'parent.updatedBy'
|
|
74
|
+
|'parent.name'
|
|
75
|
+
|'parent.type'
|
|
76
|
+
|'parent.sortOrder'
|
|
77
|
+
|'parent.extension'
|
|
78
|
+
|'parent.size'
|
|
79
|
+
|'parentId',
|
|
80
|
+
FileNodeRule>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* OrderByField
|
|
84
|
+
*/
|
|
85
|
+
declare type FileNodeOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "name" | "type" | "sortOrder" | "extension" | "size";
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* TreeRule
|
|
89
|
+
*/
|
|
90
|
+
declare type FileNodeTreeRule = RelationDateRules<'children.createdAt', Date>
|
|
91
|
+
| RelationDateRules<'children.updatedAt', Date>
|
|
92
|
+
| RelationStringRules<'children.createdBy', string | null>
|
|
93
|
+
| RelationStringRules<'children.updatedBy', string | null>
|
|
94
|
+
| RelationStringRules<'children.name', string>
|
|
95
|
+
| RelationStringRules<'children.type', string>
|
|
96
|
+
| RelationStringRules<'children.sortOrder', string | null>
|
|
97
|
+
| RelationStringRules<'children.extension', string | null>
|
|
98
|
+
| RelationNumberRules<'children.size', number | null>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* TreeRuleGroup
|
|
102
|
+
*/
|
|
103
|
+
export declare type FileNodeTreeRuleGroup = RuleGroupBase<typeof FileNode, 'children.createdAt' | 'children.updatedAt' | 'children.createdBy' | 'children.updatedBy' | 'children.name' | 'children.type' | 'children.sortOrder' | 'children.extension' | 'children.size', FileNodeTreeRule>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 静态类型
|
|
107
|
+
*/
|
|
108
|
+
export interface FileNodeStaticTypes {
|
|
109
|
+
/**
|
|
110
|
+
* id 类型
|
|
111
|
+
*/
|
|
112
|
+
idType: UUID;
|
|
113
|
+
/**
|
|
114
|
+
* 查询选项
|
|
115
|
+
*/
|
|
116
|
+
getOptions: UUID;
|
|
117
|
+
/**
|
|
118
|
+
* 查询选项
|
|
119
|
+
*/
|
|
120
|
+
findOneOrFailOptions: FindOneOrFailOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>;
|
|
121
|
+
/**
|
|
122
|
+
* 查询选项
|
|
123
|
+
*/
|
|
124
|
+
findOptions: FindOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>;
|
|
125
|
+
/**
|
|
126
|
+
* 查询选项
|
|
127
|
+
*/
|
|
128
|
+
findOneOptions: FindOneOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>;
|
|
129
|
+
/**
|
|
130
|
+
* 查询选项
|
|
131
|
+
*/
|
|
132
|
+
findAllOptions: FindAllOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>;
|
|
133
|
+
/**
|
|
134
|
+
* 查询选项
|
|
135
|
+
*/
|
|
136
|
+
findByCursorOptions: FindByCursorOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>;
|
|
137
|
+
/**
|
|
138
|
+
* 查询选项
|
|
139
|
+
*/
|
|
140
|
+
countOptions: CountOptions<typeof FileNode,FileNodeRuleGroup>;
|
|
141
|
+
/**
|
|
142
|
+
* 查询的实体
|
|
143
|
+
*/
|
|
144
|
+
entity: FileNode;
|
|
145
|
+
/**
|
|
146
|
+
* 查询选项
|
|
147
|
+
*/
|
|
148
|
+
findDescendantsOptions: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>;
|
|
149
|
+
/**
|
|
150
|
+
* 查询选项
|
|
151
|
+
*/
|
|
152
|
+
countDescendantsOptions: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>;
|
|
153
|
+
/**
|
|
154
|
+
* 查询选项
|
|
155
|
+
*/
|
|
156
|
+
findAncestorsOptions: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>;
|
|
157
|
+
/**
|
|
158
|
+
* 查询选项
|
|
159
|
+
*/
|
|
160
|
+
countAncestorsOptions: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 初始化数据
|
|
165
|
+
*/
|
|
166
|
+
export interface FileNodeInitData {
|
|
167
|
+
/**
|
|
168
|
+
* name
|
|
169
|
+
*/
|
|
170
|
+
name?: string;
|
|
171
|
+
/**
|
|
172
|
+
* type
|
|
173
|
+
*/
|
|
174
|
+
type?: string;
|
|
175
|
+
/**
|
|
176
|
+
* sortOrder
|
|
177
|
+
*/
|
|
178
|
+
sortOrder?: string | null;
|
|
179
|
+
/**
|
|
180
|
+
* extension
|
|
181
|
+
*/
|
|
182
|
+
extension?: string | null;
|
|
183
|
+
/**
|
|
184
|
+
* size
|
|
185
|
+
*/
|
|
186
|
+
size?: number | null;
|
|
187
|
+
/**
|
|
188
|
+
* 父节点 id
|
|
189
|
+
*/
|
|
190
|
+
parentId?: UUID | null;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* FileNode
|
|
195
|
+
*/
|
|
196
|
+
export declare class FileNode extends TreeAdjacencyListEntityBase implements ITreeEntity {
|
|
197
|
+
static [ENTITY_STATIC_TYPES]: FileNodeStaticTypes;
|
|
198
|
+
/**
|
|
199
|
+
* 子节点
|
|
200
|
+
*/
|
|
201
|
+
readonly children$: RelationEntitiesObservable<FileNode>;
|
|
202
|
+
/**
|
|
203
|
+
* 父节点
|
|
204
|
+
*/
|
|
205
|
+
readonly parent$: RelationEntityObservable<typeof FileNode>;
|
|
206
|
+
/**
|
|
207
|
+
* extension
|
|
208
|
+
*/
|
|
209
|
+
extension?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* name
|
|
212
|
+
*/
|
|
213
|
+
name: string;
|
|
214
|
+
/**
|
|
215
|
+
* 父节点 id
|
|
216
|
+
*/
|
|
217
|
+
parentId?: UUID | null;
|
|
218
|
+
/**
|
|
219
|
+
* size
|
|
220
|
+
*/
|
|
221
|
+
size?: number | null;
|
|
222
|
+
/**
|
|
223
|
+
* sortOrder
|
|
224
|
+
*/
|
|
225
|
+
sortOrder?: string | null;
|
|
226
|
+
/**
|
|
227
|
+
* type
|
|
228
|
+
*/
|
|
229
|
+
type: string;
|
|
230
|
+
/**
|
|
231
|
+
* 初始化数据
|
|
232
|
+
* @param initData 初始化数据
|
|
233
|
+
*/
|
|
234
|
+
constructor(initData?: FileNodeInitData);
|
|
235
|
+
/**
|
|
236
|
+
* 统计实体数量
|
|
237
|
+
* @param options 查询选项
|
|
238
|
+
* @example
|
|
239
|
+
* FileNode.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
|
|
240
|
+
*/
|
|
241
|
+
static count(options: CountOptions<typeof FileNode,FileNodeRuleGroup>): Observable<number>;
|
|
242
|
+
/**
|
|
243
|
+
* 统计祖先实体数量(不包含自身)
|
|
244
|
+
* @param options 查询选项
|
|
245
|
+
* @example
|
|
246
|
+
* // 统计某节点的祖先层级深度
|
|
247
|
+
FileNode.countAncestors({ entityId: grand.id }).subscribe(depth => console.log(depth));
|
|
248
|
+
*/
|
|
249
|
+
static countAncestors(options?: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>): Observable<number>;
|
|
250
|
+
/**
|
|
251
|
+
* 统计子孙实体数量(不包含自身)
|
|
252
|
+
* @param options 查询选项
|
|
253
|
+
* @example
|
|
254
|
+
* // 统计某节点下的后代数量
|
|
255
|
+
FileNode.countDescendants({ entityId: root.id }).subscribe(count => console.log(count));
|
|
256
|
+
*/
|
|
257
|
+
static countDescendants(options?: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>): Observable<number>;
|
|
258
|
+
/**
|
|
259
|
+
* 查询多个实体
|
|
260
|
+
* @param options 查询选项
|
|
261
|
+
* @example
|
|
262
|
+
* FileNode.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
|
|
263
|
+
*/
|
|
264
|
+
static find(options: FindOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>): Observable<FileNode[]>;
|
|
265
|
+
/**
|
|
266
|
+
* 查询所有实体
|
|
267
|
+
* @param options 查询选项
|
|
268
|
+
* @example
|
|
269
|
+
* FileNode.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
270
|
+
*/
|
|
271
|
+
static findAll(options: FindAllOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>): Observable<FileNode[]>;
|
|
272
|
+
/**
|
|
273
|
+
* 查询祖先实体(包含自身)
|
|
274
|
+
* @param options 查询选项
|
|
275
|
+
* @example
|
|
276
|
+
* // 查询某节点的所有祖先(面包屑导航)
|
|
277
|
+
FileNode.findAncestors({ entityId: grand.id }).subscribe(ancestors => console.log(ancestors));
|
|
278
|
+
|
|
279
|
+
// 仅查询直接父节点(level 1)
|
|
280
|
+
FileNode.findAncestors({ entityId: grand.id, level: 1 }).subscribe(parents => console.log(parents));
|
|
281
|
+
*/
|
|
282
|
+
static findAncestors(options?: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>): Observable<FileNode[]>;
|
|
283
|
+
/**
|
|
284
|
+
* 游标分页查询
|
|
285
|
+
* @param options 查询选项
|
|
286
|
+
* @example
|
|
287
|
+
* FileNode.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
288
|
+
*/
|
|
289
|
+
static findByCursor(options: FindByCursorOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>): Observable<FileNode[]>;
|
|
290
|
+
/**
|
|
291
|
+
* 查询子孙实体(包含自身)
|
|
292
|
+
* @param options 查询选项
|
|
293
|
+
* @example
|
|
294
|
+
* // 查询某节点的所有后代
|
|
295
|
+
FileNode.findDescendants({ entityId: root.id }).subscribe(list => console.log(list));
|
|
296
|
+
|
|
297
|
+
// 仅查询直接子节点(level 1)
|
|
298
|
+
FileNode.findDescendants({ entityId: root.id, level: 1 }).subscribe(children => console.log(children));
|
|
299
|
+
*/
|
|
300
|
+
static findDescendants(options?: FindTreeOptions<typeof FileNode,FileNodeTreeRuleGroup>): Observable<FileNode[]>;
|
|
301
|
+
/**
|
|
302
|
+
* 查询单个实体,未找到时返回 undefined
|
|
303
|
+
* @param options 查询选项
|
|
304
|
+
* @example
|
|
305
|
+
* FileNode.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
306
|
+
*/
|
|
307
|
+
static findOne(options: FindOneOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>): Observable<FileNode | undefined>;
|
|
308
|
+
/**
|
|
309
|
+
* 查询单个实体,未找到时抛出错误
|
|
310
|
+
* @param options 查询选项
|
|
311
|
+
* @example
|
|
312
|
+
* FileNode.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
313
|
+
*/
|
|
314
|
+
static findOneOrFail(options: FindOneOrFailOptions<typeof FileNode,FileNodeRuleGroup,FileNodeOrderByField>): Observable<FileNode>;
|
|
315
|
+
/**
|
|
316
|
+
* 根据 ID 获取单个实体
|
|
317
|
+
* @param options 查询选项
|
|
318
|
+
* @example
|
|
319
|
+
* FileNode.get('123').subscribe(entity => console.log(entity));
|
|
320
|
+
*/
|
|
321
|
+
static get(options: UUID): Observable<FileNode>;
|
|
322
|
+
/**
|
|
323
|
+
* 删除
|
|
324
|
+
*/
|
|
325
|
+
remove(): Promise<FileNode>;
|
|
326
|
+
/**
|
|
327
|
+
* 重置数据
|
|
328
|
+
*/
|
|
329
|
+
reset(): void;
|
|
330
|
+
/**
|
|
331
|
+
* 保存
|
|
332
|
+
*/
|
|
333
|
+
save(): Promise<FileNode>;
|
|
334
|
+
}
|
|
335
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Entity, PropertyType, TreeAdjacencyListEntityBase, __decorateClass } from '@aiao/rxdb';
|
|
2
|
+
let FileNode = class extends TreeAdjacencyListEntityBase {};
|
|
3
|
+
FileNode = __decorateClass(
|
|
4
|
+
[
|
|
5
|
+
Entity({
|
|
6
|
+
name: "FileNode",
|
|
7
|
+
tableName: "file_node",
|
|
8
|
+
properties: [
|
|
9
|
+
{
|
|
10
|
+
name: "name",
|
|
11
|
+
type: PropertyType.string,
|
|
12
|
+
nullable: false,
|
|
13
|
+
columnName: "name"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "type",
|
|
17
|
+
type: PropertyType.string,
|
|
18
|
+
nullable: false,
|
|
19
|
+
columnName: "type"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "sortOrder",
|
|
23
|
+
columnName: "sort_order",
|
|
24
|
+
type: PropertyType.string,
|
|
25
|
+
nullable: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "extension",
|
|
29
|
+
type: PropertyType.string,
|
|
30
|
+
nullable: true,
|
|
31
|
+
columnName: "extension"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "size",
|
|
35
|
+
type: PropertyType.number,
|
|
36
|
+
nullable: true,
|
|
37
|
+
columnName: "size"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
features: {
|
|
41
|
+
tree: {
|
|
42
|
+
type: "adjacency-list",
|
|
43
|
+
hasChildren: false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
indexes: [
|
|
47
|
+
{
|
|
48
|
+
name: "parent_sort",
|
|
49
|
+
properties: [
|
|
50
|
+
"parentId",
|
|
51
|
+
"sortOrder"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "parent_fullname",
|
|
56
|
+
properties: [
|
|
57
|
+
"parentId",
|
|
58
|
+
"name",
|
|
59
|
+
"extension"
|
|
60
|
+
],
|
|
61
|
+
unique: true
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
repository: "TreeRepository",
|
|
65
|
+
namespace: "public",
|
|
66
|
+
relations: [],
|
|
67
|
+
computedProperties: [],
|
|
68
|
+
extends: [
|
|
69
|
+
"TreeAdjacencyListEntityBase",
|
|
70
|
+
"EntityBase"
|
|
71
|
+
],
|
|
72
|
+
displayName: "FileNode"
|
|
73
|
+
})
|
|
74
|
+
],
|
|
75
|
+
FileNode
|
|
76
|
+
);
|
|
77
|
+
export { FileNode };
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, FindTreeOptions, IEntity, ITreeEntity, RelationDateRules, RelationEntitiesObservable, RelationEntityObservable, RelationExistsRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, TreeAdjacencyListEntityBase, UUID, UUIDRules } from '@aiao/rxdb';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* rule
|
|
6
|
+
*/
|
|
7
|
+
declare type MenuLargeRule = UUIDRules<MenuLarge, 'id'>
|
|
8
|
+
| DateRules<MenuLarge, 'createdAt'>
|
|
9
|
+
| DateRules<MenuLarge, 'updatedAt'>
|
|
10
|
+
| StringRules<MenuLarge, 'createdBy'>
|
|
11
|
+
| StringRules<MenuLarge, 'updatedBy'>
|
|
12
|
+
| StringRules<MenuLarge, 'title'>
|
|
13
|
+
| StringRules<MenuLarge, 'sortOrder'>
|
|
14
|
+
| UUIDRules<MenuLarge, 'parentId'>
|
|
15
|
+
| RelationExistsRules<'children', MenuLargeRuleGroup>
|
|
16
|
+
| RelationUUIDRules<'children.id', UUID>
|
|
17
|
+
| RelationDateRules<'children.createdAt', Date>
|
|
18
|
+
| RelationDateRules<'children.updatedAt', Date>
|
|
19
|
+
| RelationStringRules<'children.createdBy', string | null>
|
|
20
|
+
| RelationStringRules<'children.updatedBy', string | null>
|
|
21
|
+
| RelationStringRules<'children.title', string>
|
|
22
|
+
| RelationStringRules<'children.sortOrder', string | null>
|
|
23
|
+
| RelationExistsRules<'parent', MenuLargeRuleGroup>
|
|
24
|
+
| RelationUUIDRules<'parent.id', UUID>
|
|
25
|
+
| RelationDateRules<'parent.createdAt', Date>
|
|
26
|
+
| RelationDateRules<'parent.updatedAt', Date>
|
|
27
|
+
| RelationStringRules<'parent.createdBy', string | null>
|
|
28
|
+
| RelationStringRules<'parent.updatedBy', string | null>
|
|
29
|
+
| RelationStringRules<'parent.title', string>
|
|
30
|
+
| RelationStringRules<'parent.sortOrder', string | null>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* RuleGroupBase
|
|
34
|
+
*/
|
|
35
|
+
export declare type MenuLargeRuleGroup = RuleGroupBase<typeof MenuLarge,
|
|
36
|
+
|'id'
|
|
37
|
+
|'createdAt'
|
|
38
|
+
|'updatedAt'
|
|
39
|
+
|'createdBy'
|
|
40
|
+
|'updatedBy'
|
|
41
|
+
|'title'
|
|
42
|
+
|'sortOrder'
|
|
43
|
+
|'parentId'
|
|
44
|
+
|'children'
|
|
45
|
+
|'children.id'
|
|
46
|
+
|'children.createdAt'
|
|
47
|
+
|'children.updatedAt'
|
|
48
|
+
|'children.createdBy'
|
|
49
|
+
|'children.updatedBy'
|
|
50
|
+
|'children.title'
|
|
51
|
+
|'children.sortOrder'
|
|
52
|
+
|'parentId'
|
|
53
|
+
|'parent'
|
|
54
|
+
|'parent.id'
|
|
55
|
+
|'parent.createdAt'
|
|
56
|
+
|'parent.updatedAt'
|
|
57
|
+
|'parent.createdBy'
|
|
58
|
+
|'parent.updatedBy'
|
|
59
|
+
|'parent.title'
|
|
60
|
+
|'parent.sortOrder'
|
|
61
|
+
|'parentId',
|
|
62
|
+
MenuLargeRule>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* OrderByField
|
|
66
|
+
*/
|
|
67
|
+
declare type MenuLargeOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "title" | "sortOrder";
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* TreeRule
|
|
71
|
+
*/
|
|
72
|
+
declare type MenuLargeTreeRule = RelationDateRules<'children.createdAt', Date>
|
|
73
|
+
| RelationDateRules<'children.updatedAt', Date>
|
|
74
|
+
| RelationStringRules<'children.createdBy', string | null>
|
|
75
|
+
| RelationStringRules<'children.updatedBy', string | null>
|
|
76
|
+
| RelationStringRules<'children.title', string>
|
|
77
|
+
| RelationStringRules<'children.sortOrder', string | null>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* TreeRuleGroup
|
|
81
|
+
*/
|
|
82
|
+
export declare type MenuLargeTreeRuleGroup = RuleGroupBase<typeof MenuLarge, 'children.createdAt' | 'children.updatedAt' | 'children.createdBy' | 'children.updatedBy' | 'children.title' | 'children.sortOrder', MenuLargeTreeRule>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 静态类型
|
|
86
|
+
*/
|
|
87
|
+
export interface MenuLargeStaticTypes {
|
|
88
|
+
/**
|
|
89
|
+
* id 类型
|
|
90
|
+
*/
|
|
91
|
+
idType: UUID;
|
|
92
|
+
/**
|
|
93
|
+
* 查询选项
|
|
94
|
+
*/
|
|
95
|
+
getOptions: UUID;
|
|
96
|
+
/**
|
|
97
|
+
* 查询选项
|
|
98
|
+
*/
|
|
99
|
+
findOneOrFailOptions: FindOneOrFailOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>;
|
|
100
|
+
/**
|
|
101
|
+
* 查询选项
|
|
102
|
+
*/
|
|
103
|
+
findOptions: FindOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>;
|
|
104
|
+
/**
|
|
105
|
+
* 查询选项
|
|
106
|
+
*/
|
|
107
|
+
findOneOptions: FindOneOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>;
|
|
108
|
+
/**
|
|
109
|
+
* 查询选项
|
|
110
|
+
*/
|
|
111
|
+
findAllOptions: FindAllOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>;
|
|
112
|
+
/**
|
|
113
|
+
* 查询选项
|
|
114
|
+
*/
|
|
115
|
+
findByCursorOptions: FindByCursorOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>;
|
|
116
|
+
/**
|
|
117
|
+
* 查询选项
|
|
118
|
+
*/
|
|
119
|
+
countOptions: CountOptions<typeof MenuLarge,MenuLargeRuleGroup>;
|
|
120
|
+
/**
|
|
121
|
+
* 查询的实体
|
|
122
|
+
*/
|
|
123
|
+
entity: MenuLarge;
|
|
124
|
+
/**
|
|
125
|
+
* 查询选项
|
|
126
|
+
*/
|
|
127
|
+
findDescendantsOptions: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>;
|
|
128
|
+
/**
|
|
129
|
+
* 查询选项
|
|
130
|
+
*/
|
|
131
|
+
countDescendantsOptions: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>;
|
|
132
|
+
/**
|
|
133
|
+
* 查询选项
|
|
134
|
+
*/
|
|
135
|
+
findAncestorsOptions: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>;
|
|
136
|
+
/**
|
|
137
|
+
* 查询选项
|
|
138
|
+
*/
|
|
139
|
+
countAncestorsOptions: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 初始化数据
|
|
144
|
+
*/
|
|
145
|
+
export interface MenuLargeInitData {
|
|
146
|
+
/**
|
|
147
|
+
* title
|
|
148
|
+
*/
|
|
149
|
+
title?: string;
|
|
150
|
+
/**
|
|
151
|
+
* sortOrder
|
|
152
|
+
*/
|
|
153
|
+
sortOrder?: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* 父节点 id
|
|
156
|
+
*/
|
|
157
|
+
parentId?: UUID | null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* MenuLarge
|
|
162
|
+
*/
|
|
163
|
+
export declare class MenuLarge extends TreeAdjacencyListEntityBase implements ITreeEntity {
|
|
164
|
+
static [ENTITY_STATIC_TYPES]: MenuLargeStaticTypes;
|
|
165
|
+
/**
|
|
166
|
+
* 子节点
|
|
167
|
+
*/
|
|
168
|
+
readonly children$: RelationEntitiesObservable<MenuLarge>;
|
|
169
|
+
/**
|
|
170
|
+
* 是否有子节点
|
|
171
|
+
*/
|
|
172
|
+
readonly hasChildren?: boolean | null;
|
|
173
|
+
/**
|
|
174
|
+
* 父节点
|
|
175
|
+
*/
|
|
176
|
+
readonly parent$: RelationEntityObservable<typeof MenuLarge>;
|
|
177
|
+
/**
|
|
178
|
+
* 父节点 id
|
|
179
|
+
*/
|
|
180
|
+
parentId?: UUID | null;
|
|
181
|
+
/**
|
|
182
|
+
* sortOrder
|
|
183
|
+
*/
|
|
184
|
+
sortOrder?: string | null;
|
|
185
|
+
/**
|
|
186
|
+
* title
|
|
187
|
+
*/
|
|
188
|
+
title: string;
|
|
189
|
+
/**
|
|
190
|
+
* 初始化数据
|
|
191
|
+
* @param initData 初始化数据
|
|
192
|
+
*/
|
|
193
|
+
constructor(initData?: MenuLargeInitData);
|
|
194
|
+
/**
|
|
195
|
+
* 统计实体数量
|
|
196
|
+
* @param options 查询选项
|
|
197
|
+
* @example
|
|
198
|
+
* MenuLarge.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
|
|
199
|
+
*/
|
|
200
|
+
static count(options: CountOptions<typeof MenuLarge,MenuLargeRuleGroup>): Observable<number>;
|
|
201
|
+
/**
|
|
202
|
+
* 统计祖先实体数量(不包含自身)
|
|
203
|
+
* @param options 查询选项
|
|
204
|
+
* @example
|
|
205
|
+
* // 统计某节点的祖先层级深度
|
|
206
|
+
MenuLarge.countAncestors({ entityId: grand.id }).subscribe(depth => console.log(depth));
|
|
207
|
+
*/
|
|
208
|
+
static countAncestors(options?: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>): Observable<number>;
|
|
209
|
+
/**
|
|
210
|
+
* 统计子孙实体数量(不包含自身)
|
|
211
|
+
* @param options 查询选项
|
|
212
|
+
* @example
|
|
213
|
+
* // 统计某节点下的后代数量
|
|
214
|
+
MenuLarge.countDescendants({ entityId: root.id }).subscribe(count => console.log(count));
|
|
215
|
+
*/
|
|
216
|
+
static countDescendants(options?: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>): Observable<number>;
|
|
217
|
+
/**
|
|
218
|
+
* 查询多个实体
|
|
219
|
+
* @param options 查询选项
|
|
220
|
+
* @example
|
|
221
|
+
* MenuLarge.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
|
|
222
|
+
*/
|
|
223
|
+
static find(options: FindOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>): Observable<MenuLarge[]>;
|
|
224
|
+
/**
|
|
225
|
+
* 查询所有实体
|
|
226
|
+
* @param options 查询选项
|
|
227
|
+
* @example
|
|
228
|
+
* MenuLarge.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
229
|
+
*/
|
|
230
|
+
static findAll(options: FindAllOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>): Observable<MenuLarge[]>;
|
|
231
|
+
/**
|
|
232
|
+
* 查询祖先实体(包含自身)
|
|
233
|
+
* @param options 查询选项
|
|
234
|
+
* @example
|
|
235
|
+
* // 查询某节点的所有祖先(面包屑导航)
|
|
236
|
+
MenuLarge.findAncestors({ entityId: grand.id }).subscribe(ancestors => console.log(ancestors));
|
|
237
|
+
|
|
238
|
+
// 仅查询直接父节点(level 1)
|
|
239
|
+
MenuLarge.findAncestors({ entityId: grand.id, level: 1 }).subscribe(parents => console.log(parents));
|
|
240
|
+
*/
|
|
241
|
+
static findAncestors(options?: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>): Observable<MenuLarge[]>;
|
|
242
|
+
/**
|
|
243
|
+
* 游标分页查询
|
|
244
|
+
* @param options 查询选项
|
|
245
|
+
* @example
|
|
246
|
+
* MenuLarge.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
247
|
+
*/
|
|
248
|
+
static findByCursor(options: FindByCursorOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>): Observable<MenuLarge[]>;
|
|
249
|
+
/**
|
|
250
|
+
* 查询子孙实体(包含自身)
|
|
251
|
+
* @param options 查询选项
|
|
252
|
+
* @example
|
|
253
|
+
* // 查询某节点的所有后代
|
|
254
|
+
MenuLarge.findDescendants({ entityId: root.id }).subscribe(list => console.log(list));
|
|
255
|
+
|
|
256
|
+
// 仅查询直接子节点(level 1)
|
|
257
|
+
MenuLarge.findDescendants({ entityId: root.id, level: 1 }).subscribe(children => console.log(children));
|
|
258
|
+
*/
|
|
259
|
+
static findDescendants(options?: FindTreeOptions<typeof MenuLarge,MenuLargeTreeRuleGroup>): Observable<MenuLarge[]>;
|
|
260
|
+
/**
|
|
261
|
+
* 查询单个实体,未找到时返回 undefined
|
|
262
|
+
* @param options 查询选项
|
|
263
|
+
* @example
|
|
264
|
+
* MenuLarge.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
265
|
+
*/
|
|
266
|
+
static findOne(options: FindOneOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>): Observable<MenuLarge | undefined>;
|
|
267
|
+
/**
|
|
268
|
+
* 查询单个实体,未找到时抛出错误
|
|
269
|
+
* @param options 查询选项
|
|
270
|
+
* @example
|
|
271
|
+
* MenuLarge.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
272
|
+
*/
|
|
273
|
+
static findOneOrFail(options: FindOneOrFailOptions<typeof MenuLarge,MenuLargeRuleGroup,MenuLargeOrderByField>): Observable<MenuLarge>;
|
|
274
|
+
/**
|
|
275
|
+
* 根据 ID 获取单个实体
|
|
276
|
+
* @param options 查询选项
|
|
277
|
+
* @example
|
|
278
|
+
* MenuLarge.get('123').subscribe(entity => console.log(entity));
|
|
279
|
+
*/
|
|
280
|
+
static get(options: UUID): Observable<MenuLarge>;
|
|
281
|
+
/**
|
|
282
|
+
* 删除
|
|
283
|
+
*/
|
|
284
|
+
remove(): Promise<MenuLarge>;
|
|
285
|
+
/**
|
|
286
|
+
* 重置数据
|
|
287
|
+
*/
|
|
288
|
+
reset(): void;
|
|
289
|
+
/**
|
|
290
|
+
* 保存
|
|
291
|
+
*/
|
|
292
|
+
save(): Promise<MenuLarge>;
|
|
293
|
+
}
|
|
294
|
+
|