@aiao/rxdb-test 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +264 -0
- package/dist/entities/TypeDemo.js +101 -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 +359 -0
- package/dist/shop/Attribute.js +50 -0
- package/dist/shop/AttributeValue.d.ts +366 -0
- package/dist/shop/AttributeValue.js +51 -0
- package/dist/shop/Category.d.ts +280 -0
- package/dist/shop/Category.js +41 -0
- package/dist/shop/IdCard.d.ts +237 -0
- package/dist/shop/IdCard.js +43 -0
- package/dist/shop/Order.d.ts +270 -0
- package/dist/shop/Order.js +58 -0
- package/dist/shop/OrderItem.d.ts +293 -0
- package/dist/shop/OrderItem.js +64 -0
- package/dist/shop/Product.d.ts +321 -0
- package/dist/shop/Product.js +47 -0
- package/dist/shop/SKU.d.ts +343 -0
- package/dist/shop/SKU.js +63 -0
- package/dist/shop/SKUAttributes.d.ts +306 -0
- package/dist/shop/SKUAttributes.js +56 -0
- package/dist/shop/User.d.ts +269 -0
- package/dist/shop/User.js +74 -0
- package/dist/shop/index.d.ts +22 -2980
- 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,280 @@
|
|
|
1
|
+
import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityBase, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, IEntity, ITreeEntity, NumberRules, RelationBooleanRules, RelationDateRules, RelationEntitiesObservable, RelationExistsRules, RelationNumberRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* rule
|
|
6
|
+
*/
|
|
7
|
+
declare type CategoryRule = UUIDRules<Category, 'id'>
|
|
8
|
+
| DateRules<Category, 'createdAt'>
|
|
9
|
+
| DateRules<Category, 'updatedAt'>
|
|
10
|
+
| StringRules<Category, 'createdBy'>
|
|
11
|
+
| StringRules<Category, 'updatedBy'>
|
|
12
|
+
| StringRules<Category, 'name'>
|
|
13
|
+
| RelationExistsRules<'orderItems', OrderItemRuleGroup>
|
|
14
|
+
| RelationUUIDRules<'orderItems.id', UUID>
|
|
15
|
+
| RelationDateRules<'orderItems.createdAt', Date>
|
|
16
|
+
| RelationDateRules<'orderItems.updatedAt', Date>
|
|
17
|
+
| RelationStringRules<'orderItems.createdBy', string | null>
|
|
18
|
+
| RelationStringRules<'orderItems.updatedBy', string | null>
|
|
19
|
+
| RelationStringRules<'orderItems.productName', string>
|
|
20
|
+
| RelationNumberRules<'orderItems.quantity', number>
|
|
21
|
+
| RelationNumberRules<'orderItems.price', number>
|
|
22
|
+
| UUIDRules<OrderItem, 'orderId'>
|
|
23
|
+
| RelationUUIDRules<'orderItems.order.id', UUID>
|
|
24
|
+
| RelationDateRules<'orderItems.order.createdAt', Date>
|
|
25
|
+
| RelationDateRules<'orderItems.order.updatedAt', Date>
|
|
26
|
+
| RelationStringRules<'orderItems.order.createdBy', string | null>
|
|
27
|
+
| RelationStringRules<'orderItems.order.updatedBy', string | null>
|
|
28
|
+
| RelationStringRules<'orderItems.order.number', string>
|
|
29
|
+
| RelationNumberRules<'orderItems.order.amount', number>
|
|
30
|
+
| UUIDRules<Order, 'ownerId'>
|
|
31
|
+
| RelationUUIDRules<'orderItems.order.owner.id', UUID>
|
|
32
|
+
| RelationDateRules<'orderItems.order.owner.createdAt', Date>
|
|
33
|
+
| RelationDateRules<'orderItems.order.owner.updatedAt', Date>
|
|
34
|
+
| RelationStringRules<'orderItems.order.owner.createdBy', string | null>
|
|
35
|
+
| RelationStringRules<'orderItems.order.owner.updatedBy', string | null>
|
|
36
|
+
| RelationStringRules<'orderItems.order.owner.name', string>
|
|
37
|
+
| RelationBooleanRules<'orderItems.order.owner.married', boolean>
|
|
38
|
+
| RelationNumberRules<'orderItems.order.owner.age', number>
|
|
39
|
+
| RelationStringRules<'orderItems.order.owner.gender', string | null>
|
|
40
|
+
| UUIDRules<User, 'idCardId'>
|
|
41
|
+
| RelationUUIDRules<'orderItems.order.owner.idCard.id', UUID>
|
|
42
|
+
| RelationDateRules<'orderItems.order.owner.idCard.createdAt', Date>
|
|
43
|
+
| RelationDateRules<'orderItems.order.owner.idCard.updatedAt', Date>
|
|
44
|
+
| RelationStringRules<'orderItems.order.owner.idCard.createdBy', string | null>
|
|
45
|
+
| RelationStringRules<'orderItems.order.owner.idCard.updatedBy', string | null>
|
|
46
|
+
| RelationStringRules<'orderItems.order.owner.idCard.code', string>
|
|
47
|
+
| UUIDRules<IdCard, 'ownerId'>
|
|
48
|
+
| RelationUUIDRules<'orderItems.order.owner.idCard.owner.id', UUID>
|
|
49
|
+
| RelationDateRules<'orderItems.order.owner.idCard.owner.createdAt', Date>
|
|
50
|
+
| RelationDateRules<'orderItems.order.owner.idCard.owner.updatedAt', Date>
|
|
51
|
+
| RelationStringRules<'orderItems.order.owner.idCard.owner.createdBy', string | null>
|
|
52
|
+
| RelationStringRules<'orderItems.order.owner.idCard.owner.updatedBy', string | null>
|
|
53
|
+
| RelationStringRules<'orderItems.order.owner.idCard.owner.name', string>
|
|
54
|
+
| RelationBooleanRules<'orderItems.order.owner.idCard.owner.married', boolean>
|
|
55
|
+
| RelationNumberRules<'orderItems.order.owner.idCard.owner.age', number>
|
|
56
|
+
| RelationStringRules<'orderItems.order.owner.idCard.owner.gender', string | null>
|
|
57
|
+
| RelationUUIDRules<'orderItems.order.owner.orders.id', UUID>
|
|
58
|
+
| RelationDateRules<'orderItems.order.owner.orders.createdAt', Date>
|
|
59
|
+
| RelationDateRules<'orderItems.order.owner.orders.updatedAt', Date>
|
|
60
|
+
| RelationStringRules<'orderItems.order.owner.orders.createdBy', string | null>
|
|
61
|
+
| RelationStringRules<'orderItems.order.owner.orders.updatedBy', string | null>
|
|
62
|
+
| RelationStringRules<'orderItems.order.owner.orders.number', string>
|
|
63
|
+
| RelationNumberRules<'orderItems.order.owner.orders.amount', number>
|
|
64
|
+
| RelationUUIDRules<'orderItems.order.items.id', UUID>
|
|
65
|
+
| RelationDateRules<'orderItems.order.items.createdAt', Date>
|
|
66
|
+
| RelationDateRules<'orderItems.order.items.updatedAt', Date>
|
|
67
|
+
| RelationStringRules<'orderItems.order.items.createdBy', string | null>
|
|
68
|
+
| RelationStringRules<'orderItems.order.items.updatedBy', string | null>
|
|
69
|
+
| RelationStringRules<'orderItems.order.items.productName', string>
|
|
70
|
+
| RelationNumberRules<'orderItems.order.items.quantity', number>
|
|
71
|
+
| RelationNumberRules<'orderItems.order.items.price', number>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* RuleGroupBase
|
|
75
|
+
*/
|
|
76
|
+
export declare type CategoryRuleGroup = RuleGroupBase<typeof Category,
|
|
77
|
+
|'id'
|
|
78
|
+
|'createdAt'
|
|
79
|
+
|'updatedAt'
|
|
80
|
+
|'createdBy'
|
|
81
|
+
|'updatedBy'
|
|
82
|
+
|'name'
|
|
83
|
+
|'orderItems'
|
|
84
|
+
|'orderItems.id'
|
|
85
|
+
|'orderItems.createdAt'
|
|
86
|
+
|'orderItems.updatedAt'
|
|
87
|
+
|'orderItems.createdBy'
|
|
88
|
+
|'orderItems.updatedBy'
|
|
89
|
+
|'orderItems.productName'
|
|
90
|
+
|'orderItems.quantity'
|
|
91
|
+
|'orderItems.price'
|
|
92
|
+
|'orderId'
|
|
93
|
+
|'orderItems.order.id'
|
|
94
|
+
|'orderItems.order.createdAt'
|
|
95
|
+
|'orderItems.order.updatedAt'
|
|
96
|
+
|'orderItems.order.createdBy'
|
|
97
|
+
|'orderItems.order.updatedBy'
|
|
98
|
+
|'orderItems.order.number'
|
|
99
|
+
|'orderItems.order.amount'
|
|
100
|
+
|'ownerId'
|
|
101
|
+
|'orderItems.order.owner.id'
|
|
102
|
+
|'orderItems.order.owner.createdAt'
|
|
103
|
+
|'orderItems.order.owner.updatedAt'
|
|
104
|
+
|'orderItems.order.owner.createdBy'
|
|
105
|
+
|'orderItems.order.owner.updatedBy'
|
|
106
|
+
|'orderItems.order.owner.name'
|
|
107
|
+
|'orderItems.order.owner.married'
|
|
108
|
+
|'orderItems.order.owner.age'
|
|
109
|
+
|'orderItems.order.owner.gender'
|
|
110
|
+
|'idCardId'
|
|
111
|
+
|'orderItems.order.owner.idCard.id'
|
|
112
|
+
|'orderItems.order.owner.idCard.createdAt'
|
|
113
|
+
|'orderItems.order.owner.idCard.updatedAt'
|
|
114
|
+
|'orderItems.order.owner.idCard.createdBy'
|
|
115
|
+
|'orderItems.order.owner.idCard.updatedBy'
|
|
116
|
+
|'orderItems.order.owner.idCard.code'
|
|
117
|
+
|'ownerId'
|
|
118
|
+
|'orderItems.order.owner.idCard.owner.id'
|
|
119
|
+
|'orderItems.order.owner.idCard.owner.createdAt'
|
|
120
|
+
|'orderItems.order.owner.idCard.owner.updatedAt'
|
|
121
|
+
|'orderItems.order.owner.idCard.owner.createdBy'
|
|
122
|
+
|'orderItems.order.owner.idCard.owner.updatedBy'
|
|
123
|
+
|'orderItems.order.owner.idCard.owner.name'
|
|
124
|
+
|'orderItems.order.owner.idCard.owner.married'
|
|
125
|
+
|'orderItems.order.owner.idCard.owner.age'
|
|
126
|
+
|'orderItems.order.owner.idCard.owner.gender'
|
|
127
|
+
|'idCardId'
|
|
128
|
+
|'orderItems.order.owner.orders.id'
|
|
129
|
+
|'orderItems.order.owner.orders.createdAt'
|
|
130
|
+
|'orderItems.order.owner.orders.updatedAt'
|
|
131
|
+
|'orderItems.order.owner.orders.createdBy'
|
|
132
|
+
|'orderItems.order.owner.orders.updatedBy'
|
|
133
|
+
|'orderItems.order.owner.orders.number'
|
|
134
|
+
|'orderItems.order.owner.orders.amount'
|
|
135
|
+
|'ownerId'
|
|
136
|
+
|'orderItems.order.items.id'
|
|
137
|
+
|'orderItems.order.items.createdAt'
|
|
138
|
+
|'orderItems.order.items.updatedAt'
|
|
139
|
+
|'orderItems.order.items.createdBy'
|
|
140
|
+
|'orderItems.order.items.updatedBy'
|
|
141
|
+
|'orderItems.order.items.productName'
|
|
142
|
+
|'orderItems.order.items.quantity'
|
|
143
|
+
|'orderItems.order.items.price'
|
|
144
|
+
|'orderId',
|
|
145
|
+
CategoryRule>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* OrderByField
|
|
149
|
+
*/
|
|
150
|
+
declare type CategoryOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "name";
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* 静态类型
|
|
154
|
+
*/
|
|
155
|
+
export interface CategoryStaticTypes {
|
|
156
|
+
/**
|
|
157
|
+
* id 类型
|
|
158
|
+
*/
|
|
159
|
+
idType: UUID;
|
|
160
|
+
/**
|
|
161
|
+
* 查询选项
|
|
162
|
+
*/
|
|
163
|
+
getOptions: UUID;
|
|
164
|
+
/**
|
|
165
|
+
* 查询选项
|
|
166
|
+
*/
|
|
167
|
+
findOneOrFailOptions: FindOneOrFailOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>;
|
|
168
|
+
/**
|
|
169
|
+
* 查询选项
|
|
170
|
+
*/
|
|
171
|
+
findOptions: FindOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>;
|
|
172
|
+
/**
|
|
173
|
+
* 查询选项
|
|
174
|
+
*/
|
|
175
|
+
findOneOptions: FindOneOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>;
|
|
176
|
+
/**
|
|
177
|
+
* 查询选项
|
|
178
|
+
*/
|
|
179
|
+
findAllOptions: FindAllOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>;
|
|
180
|
+
/**
|
|
181
|
+
* 查询选项
|
|
182
|
+
*/
|
|
183
|
+
findByCursorOptions: FindByCursorOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>;
|
|
184
|
+
/**
|
|
185
|
+
* 查询选项
|
|
186
|
+
*/
|
|
187
|
+
countOptions: CountOptions<typeof Category,CategoryRuleGroup>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* 初始化数据
|
|
192
|
+
*/
|
|
193
|
+
export interface CategoryInitData {
|
|
194
|
+
/**
|
|
195
|
+
* 分类名称
|
|
196
|
+
*/
|
|
197
|
+
name?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 产品分类
|
|
202
|
+
*/
|
|
203
|
+
export declare class Category extends EntityBase implements IEntity {
|
|
204
|
+
static [ENTITY_STATIC_TYPES]: CategoryStaticTypes;
|
|
205
|
+
/**
|
|
206
|
+
* 订单项
|
|
207
|
+
*/
|
|
208
|
+
readonly orderItems$: RelationEntitiesObservable<OrderItem>;
|
|
209
|
+
/**
|
|
210
|
+
* 分类名称
|
|
211
|
+
*/
|
|
212
|
+
name: string;
|
|
213
|
+
/**
|
|
214
|
+
* 初始化数据
|
|
215
|
+
* @param initData 初始化数据
|
|
216
|
+
*/
|
|
217
|
+
constructor(initData?: CategoryInitData);
|
|
218
|
+
/**
|
|
219
|
+
* 统计实体数量
|
|
220
|
+
* @param options 查询选项
|
|
221
|
+
* @example
|
|
222
|
+
* Category.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
|
|
223
|
+
*/
|
|
224
|
+
static count(options: CountOptions<typeof Category,CategoryRuleGroup>): Observable<number>;
|
|
225
|
+
/**
|
|
226
|
+
* 查询多个实体
|
|
227
|
+
* @param options 查询选项
|
|
228
|
+
* @example
|
|
229
|
+
* Category.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
|
|
230
|
+
*/
|
|
231
|
+
static find(options: FindOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>): Observable<Category[]>;
|
|
232
|
+
/**
|
|
233
|
+
* 查询所有实体
|
|
234
|
+
* @param options 查询选项
|
|
235
|
+
* @example
|
|
236
|
+
* Category.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
237
|
+
*/
|
|
238
|
+
static findAll(options: FindAllOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>): Observable<Category[]>;
|
|
239
|
+
/**
|
|
240
|
+
* 游标分页查询
|
|
241
|
+
* @param options 查询选项
|
|
242
|
+
* @example
|
|
243
|
+
* Category.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
244
|
+
*/
|
|
245
|
+
static findByCursor(options: FindByCursorOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>): Observable<Category[]>;
|
|
246
|
+
/**
|
|
247
|
+
* 查询单个实体,未找到时返回 undefined
|
|
248
|
+
* @param options 查询选项
|
|
249
|
+
* @example
|
|
250
|
+
* Category.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
251
|
+
*/
|
|
252
|
+
static findOne(options: FindOneOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>): Observable<Category | undefined>;
|
|
253
|
+
/**
|
|
254
|
+
* 查询单个实体,未找到时抛出错误
|
|
255
|
+
* @param options 查询选项
|
|
256
|
+
* @example
|
|
257
|
+
* Category.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
258
|
+
*/
|
|
259
|
+
static findOneOrFail(options: FindOneOrFailOptions<typeof Category,CategoryRuleGroup,CategoryOrderByField>): Observable<Category>;
|
|
260
|
+
/**
|
|
261
|
+
* 根据 ID 获取单个实体
|
|
262
|
+
* @param options 查询选项
|
|
263
|
+
* @example
|
|
264
|
+
* Category.get('123').subscribe(entity => console.log(entity));
|
|
265
|
+
*/
|
|
266
|
+
static get(options: UUID): Observable<Category>;
|
|
267
|
+
/**
|
|
268
|
+
* 删除
|
|
269
|
+
*/
|
|
270
|
+
remove(): Promise<Category>;
|
|
271
|
+
/**
|
|
272
|
+
* 重置数据
|
|
273
|
+
*/
|
|
274
|
+
reset(): void;
|
|
275
|
+
/**
|
|
276
|
+
* 保存
|
|
277
|
+
*/
|
|
278
|
+
save(): Promise<Category>;
|
|
279
|
+
}
|
|
280
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Entity, EntityBase, PropertyType, RelationKind, __decorateClass } from '@aiao/rxdb';
|
|
2
|
+
let Category = class extends EntityBase {};
|
|
3
|
+
Category = __decorateClass(
|
|
4
|
+
[
|
|
5
|
+
Entity({
|
|
6
|
+
name: "Category",
|
|
7
|
+
tableName: "category",
|
|
8
|
+
displayName: "产品分类",
|
|
9
|
+
properties: [
|
|
10
|
+
{
|
|
11
|
+
name: "name",
|
|
12
|
+
type: PropertyType.string,
|
|
13
|
+
displayName: "分类名称",
|
|
14
|
+
columnName: "name"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
relations: [
|
|
18
|
+
{
|
|
19
|
+
name: "orderItems",
|
|
20
|
+
displayName: "订单项",
|
|
21
|
+
kind: RelationKind.MANY_TO_MANY,
|
|
22
|
+
mappedEntity: "OrderItem",
|
|
23
|
+
mappedProperty: "categories",
|
|
24
|
+
mappedNamespace: "public",
|
|
25
|
+
onDelete: "RESTRICT",
|
|
26
|
+
onUpdate: "RESTRICT",
|
|
27
|
+
columnName: "orderItemsId"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
repository: "Repository",
|
|
31
|
+
namespace: "public",
|
|
32
|
+
indexes: [],
|
|
33
|
+
computedProperties: [],
|
|
34
|
+
extends: [
|
|
35
|
+
"EntityBase"
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
],
|
|
39
|
+
Category
|
|
40
|
+
);
|
|
41
|
+
export { Category };
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityBase, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, IEntity, ITreeEntity, NumberRules, RelationBooleanRules, RelationDateRules, RelationEntityObservable, RelationExistsRules, RelationNumberRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* rule
|
|
6
|
+
*/
|
|
7
|
+
declare type IdCardRule = UUIDRules<IdCard, 'id'>
|
|
8
|
+
| DateRules<IdCard, 'createdAt'>
|
|
9
|
+
| DateRules<IdCard, 'updatedAt'>
|
|
10
|
+
| StringRules<IdCard, 'createdBy'>
|
|
11
|
+
| StringRules<IdCard, 'updatedBy'>
|
|
12
|
+
| StringRules<IdCard, 'code'>
|
|
13
|
+
| UUIDRules<IdCard, 'ownerId'>
|
|
14
|
+
| RelationExistsRules<'owner', UserRuleGroup>
|
|
15
|
+
| RelationUUIDRules<'owner.id', UUID>
|
|
16
|
+
| RelationDateRules<'owner.createdAt', Date>
|
|
17
|
+
| RelationDateRules<'owner.updatedAt', Date>
|
|
18
|
+
| RelationStringRules<'owner.createdBy', string | null>
|
|
19
|
+
| RelationStringRules<'owner.updatedBy', string | null>
|
|
20
|
+
| RelationStringRules<'owner.name', string>
|
|
21
|
+
| RelationBooleanRules<'owner.married', boolean>
|
|
22
|
+
| RelationNumberRules<'owner.age', number>
|
|
23
|
+
| RelationStringRules<'owner.gender', string | null>
|
|
24
|
+
| UUIDRules<User, 'idCardId'>
|
|
25
|
+
| RelationUUIDRules<'owner.orders.id', UUID>
|
|
26
|
+
| RelationDateRules<'owner.orders.createdAt', Date>
|
|
27
|
+
| RelationDateRules<'owner.orders.updatedAt', Date>
|
|
28
|
+
| RelationStringRules<'owner.orders.createdBy', string | null>
|
|
29
|
+
| RelationStringRules<'owner.orders.updatedBy', string | null>
|
|
30
|
+
| RelationStringRules<'owner.orders.number', string>
|
|
31
|
+
| RelationNumberRules<'owner.orders.amount', number>
|
|
32
|
+
| UUIDRules<Order, 'ownerId'>
|
|
33
|
+
| RelationUUIDRules<'owner.orders.items.id', UUID>
|
|
34
|
+
| RelationDateRules<'owner.orders.items.createdAt', Date>
|
|
35
|
+
| RelationDateRules<'owner.orders.items.updatedAt', Date>
|
|
36
|
+
| RelationStringRules<'owner.orders.items.createdBy', string | null>
|
|
37
|
+
| RelationStringRules<'owner.orders.items.updatedBy', string | null>
|
|
38
|
+
| RelationStringRules<'owner.orders.items.productName', string>
|
|
39
|
+
| RelationNumberRules<'owner.orders.items.quantity', number>
|
|
40
|
+
| RelationNumberRules<'owner.orders.items.price', number>
|
|
41
|
+
| UUIDRules<OrderItem, 'orderId'>
|
|
42
|
+
| RelationUUIDRules<'owner.orders.items.categories.id', UUID>
|
|
43
|
+
| RelationDateRules<'owner.orders.items.categories.createdAt', Date>
|
|
44
|
+
| RelationDateRules<'owner.orders.items.categories.updatedAt', Date>
|
|
45
|
+
| RelationStringRules<'owner.orders.items.categories.createdBy', string | null>
|
|
46
|
+
| RelationStringRules<'owner.orders.items.categories.updatedBy', string | null>
|
|
47
|
+
| RelationStringRules<'owner.orders.items.categories.name', string>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* RuleGroupBase
|
|
51
|
+
*/
|
|
52
|
+
export declare type IdCardRuleGroup = RuleGroupBase<typeof IdCard,
|
|
53
|
+
|'id'
|
|
54
|
+
|'createdAt'
|
|
55
|
+
|'updatedAt'
|
|
56
|
+
|'createdBy'
|
|
57
|
+
|'updatedBy'
|
|
58
|
+
|'code'
|
|
59
|
+
|'ownerId'
|
|
60
|
+
|'owner'
|
|
61
|
+
|'owner.id'
|
|
62
|
+
|'owner.createdAt'
|
|
63
|
+
|'owner.updatedAt'
|
|
64
|
+
|'owner.createdBy'
|
|
65
|
+
|'owner.updatedBy'
|
|
66
|
+
|'owner.name'
|
|
67
|
+
|'owner.married'
|
|
68
|
+
|'owner.age'
|
|
69
|
+
|'owner.gender'
|
|
70
|
+
|'idCardId'
|
|
71
|
+
|'owner.orders.id'
|
|
72
|
+
|'owner.orders.createdAt'
|
|
73
|
+
|'owner.orders.updatedAt'
|
|
74
|
+
|'owner.orders.createdBy'
|
|
75
|
+
|'owner.orders.updatedBy'
|
|
76
|
+
|'owner.orders.number'
|
|
77
|
+
|'owner.orders.amount'
|
|
78
|
+
|'ownerId'
|
|
79
|
+
|'owner.orders.items.id'
|
|
80
|
+
|'owner.orders.items.createdAt'
|
|
81
|
+
|'owner.orders.items.updatedAt'
|
|
82
|
+
|'owner.orders.items.createdBy'
|
|
83
|
+
|'owner.orders.items.updatedBy'
|
|
84
|
+
|'owner.orders.items.productName'
|
|
85
|
+
|'owner.orders.items.quantity'
|
|
86
|
+
|'owner.orders.items.price'
|
|
87
|
+
|'orderId'
|
|
88
|
+
|'owner.orders.items.categories.id'
|
|
89
|
+
|'owner.orders.items.categories.createdAt'
|
|
90
|
+
|'owner.orders.items.categories.updatedAt'
|
|
91
|
+
|'owner.orders.items.categories.createdBy'
|
|
92
|
+
|'owner.orders.items.categories.updatedBy'
|
|
93
|
+
|'owner.orders.items.categories.name',
|
|
94
|
+
IdCardRule>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* OrderByField
|
|
98
|
+
*/
|
|
99
|
+
declare type IdCardOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "code";
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 静态类型
|
|
103
|
+
*/
|
|
104
|
+
export interface IdCardStaticTypes {
|
|
105
|
+
/**
|
|
106
|
+
* id 类型
|
|
107
|
+
*/
|
|
108
|
+
idType: UUID;
|
|
109
|
+
/**
|
|
110
|
+
* 查询选项
|
|
111
|
+
*/
|
|
112
|
+
getOptions: UUID;
|
|
113
|
+
/**
|
|
114
|
+
* 查询选项
|
|
115
|
+
*/
|
|
116
|
+
findOneOrFailOptions: FindOneOrFailOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>;
|
|
117
|
+
/**
|
|
118
|
+
* 查询选项
|
|
119
|
+
*/
|
|
120
|
+
findOptions: FindOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>;
|
|
121
|
+
/**
|
|
122
|
+
* 查询选项
|
|
123
|
+
*/
|
|
124
|
+
findOneOptions: FindOneOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>;
|
|
125
|
+
/**
|
|
126
|
+
* 查询选项
|
|
127
|
+
*/
|
|
128
|
+
findAllOptions: FindAllOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>;
|
|
129
|
+
/**
|
|
130
|
+
* 查询选项
|
|
131
|
+
*/
|
|
132
|
+
findByCursorOptions: FindByCursorOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>;
|
|
133
|
+
/**
|
|
134
|
+
* 查询选项
|
|
135
|
+
*/
|
|
136
|
+
countOptions: CountOptions<typeof IdCard,IdCardRuleGroup>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 初始化数据
|
|
141
|
+
*/
|
|
142
|
+
export interface IdCardInitData {
|
|
143
|
+
/**
|
|
144
|
+
* 身份证号码
|
|
145
|
+
*/
|
|
146
|
+
code?: string;
|
|
147
|
+
/**
|
|
148
|
+
* 持有人 id
|
|
149
|
+
*/
|
|
150
|
+
ownerId?: UUID;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* 身份证
|
|
155
|
+
*/
|
|
156
|
+
export declare class IdCard extends EntityBase implements IEntity {
|
|
157
|
+
static [ENTITY_STATIC_TYPES]: IdCardStaticTypes;
|
|
158
|
+
/**
|
|
159
|
+
* 持有人
|
|
160
|
+
*/
|
|
161
|
+
readonly owner$: RelationEntityObservable<typeof User>;
|
|
162
|
+
/**
|
|
163
|
+
* 身份证号码
|
|
164
|
+
*/
|
|
165
|
+
code: string;
|
|
166
|
+
/**
|
|
167
|
+
* 持有人 id
|
|
168
|
+
*/
|
|
169
|
+
ownerId: UUID;
|
|
170
|
+
/**
|
|
171
|
+
* 初始化数据
|
|
172
|
+
* @param initData 初始化数据
|
|
173
|
+
*/
|
|
174
|
+
constructor(initData?: IdCardInitData);
|
|
175
|
+
/**
|
|
176
|
+
* 统计实体数量
|
|
177
|
+
* @param options 查询选项
|
|
178
|
+
* @example
|
|
179
|
+
* IdCard.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
|
|
180
|
+
*/
|
|
181
|
+
static count(options: CountOptions<typeof IdCard,IdCardRuleGroup>): Observable<number>;
|
|
182
|
+
/**
|
|
183
|
+
* 查询多个实体
|
|
184
|
+
* @param options 查询选项
|
|
185
|
+
* @example
|
|
186
|
+
* IdCard.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
|
|
187
|
+
*/
|
|
188
|
+
static find(options: FindOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>): Observable<IdCard[]>;
|
|
189
|
+
/**
|
|
190
|
+
* 查询所有实体
|
|
191
|
+
* @param options 查询选项
|
|
192
|
+
* @example
|
|
193
|
+
* IdCard.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
194
|
+
*/
|
|
195
|
+
static findAll(options: FindAllOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>): Observable<IdCard[]>;
|
|
196
|
+
/**
|
|
197
|
+
* 游标分页查询
|
|
198
|
+
* @param options 查询选项
|
|
199
|
+
* @example
|
|
200
|
+
* IdCard.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
201
|
+
*/
|
|
202
|
+
static findByCursor(options: FindByCursorOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>): Observable<IdCard[]>;
|
|
203
|
+
/**
|
|
204
|
+
* 查询单个实体,未找到时返回 undefined
|
|
205
|
+
* @param options 查询选项
|
|
206
|
+
* @example
|
|
207
|
+
* IdCard.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
208
|
+
*/
|
|
209
|
+
static findOne(options: FindOneOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>): Observable<IdCard | undefined>;
|
|
210
|
+
/**
|
|
211
|
+
* 查询单个实体,未找到时抛出错误
|
|
212
|
+
* @param options 查询选项
|
|
213
|
+
* @example
|
|
214
|
+
* IdCard.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
215
|
+
*/
|
|
216
|
+
static findOneOrFail(options: FindOneOrFailOptions<typeof IdCard,IdCardRuleGroup,IdCardOrderByField>): Observable<IdCard>;
|
|
217
|
+
/**
|
|
218
|
+
* 根据 ID 获取单个实体
|
|
219
|
+
* @param options 查询选项
|
|
220
|
+
* @example
|
|
221
|
+
* IdCard.get('123').subscribe(entity => console.log(entity));
|
|
222
|
+
*/
|
|
223
|
+
static get(options: UUID): Observable<IdCard>;
|
|
224
|
+
/**
|
|
225
|
+
* 删除
|
|
226
|
+
*/
|
|
227
|
+
remove(): Promise<IdCard>;
|
|
228
|
+
/**
|
|
229
|
+
* 重置数据
|
|
230
|
+
*/
|
|
231
|
+
reset(): void;
|
|
232
|
+
/**
|
|
233
|
+
* 保存
|
|
234
|
+
*/
|
|
235
|
+
save(): Promise<IdCard>;
|
|
236
|
+
}
|
|
237
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Entity, EntityBase, PropertyType, RelationKind, __decorateClass } from '@aiao/rxdb';
|
|
2
|
+
let IdCard = class extends EntityBase {};
|
|
3
|
+
IdCard = __decorateClass(
|
|
4
|
+
[
|
|
5
|
+
Entity({
|
|
6
|
+
name: "IdCard",
|
|
7
|
+
tableName: "id_card",
|
|
8
|
+
displayName: "身份证",
|
|
9
|
+
properties: [
|
|
10
|
+
{
|
|
11
|
+
name: "code",
|
|
12
|
+
type: PropertyType.string,
|
|
13
|
+
displayName: "身份证号码",
|
|
14
|
+
unique: true,
|
|
15
|
+
columnName: "code"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
relations: [
|
|
19
|
+
{
|
|
20
|
+
name: "owner",
|
|
21
|
+
displayName: "持有人",
|
|
22
|
+
kind: RelationKind.ONE_TO_ONE,
|
|
23
|
+
mappedEntity: "User",
|
|
24
|
+
mappedProperty: "idCard",
|
|
25
|
+
nullable: false,
|
|
26
|
+
mappedNamespace: "public",
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
onUpdate: "RESTRICT",
|
|
29
|
+
columnName: "ownerId"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
repository: "Repository",
|
|
33
|
+
namespace: "public",
|
|
34
|
+
indexes: [],
|
|
35
|
+
computedProperties: [],
|
|
36
|
+
extends: [
|
|
37
|
+
"EntityBase"
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
],
|
|
41
|
+
IdCard
|
|
42
|
+
);
|
|
43
|
+
export { IdCard };
|