@aiao/rxdb-test 0.0.2
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 +1 -0
- package/entities/index.d.ts +251 -0
- package/entities/index.js +55 -0
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/package.json +27 -0
- package/shop/index.d.ts +1343 -0
- package/shop/index.js +411 -0
package/shop/index.js
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { Entity, EntityBase, PropertyType, RelationKind, __decorateClass } from '@aiao/rxdb';
|
|
2
|
+
let User = class extends EntityBase {};
|
|
3
|
+
User = __decorateClass(
|
|
4
|
+
[
|
|
5
|
+
Entity({
|
|
6
|
+
name: "User",
|
|
7
|
+
displayName: "用户表",
|
|
8
|
+
properties: [
|
|
9
|
+
{
|
|
10
|
+
type: PropertyType.string,
|
|
11
|
+
name: "name",
|
|
12
|
+
displayName: "姓名"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: PropertyType.boolean,
|
|
16
|
+
name: "married",
|
|
17
|
+
displayName: "已婚",
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: PropertyType.number,
|
|
22
|
+
name: "age",
|
|
23
|
+
displayName: "年龄",
|
|
24
|
+
default: 25
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: PropertyType.string,
|
|
28
|
+
name: "gender",
|
|
29
|
+
displayName: "性别",
|
|
30
|
+
default: "男",
|
|
31
|
+
nullable: true
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
relations: [
|
|
35
|
+
{
|
|
36
|
+
name: "idCard",
|
|
37
|
+
kind: RelationKind.ONE_TO_ONE,
|
|
38
|
+
mappedEntity: "IdCard",
|
|
39
|
+
nullable: true,
|
|
40
|
+
mappedNamespace: "public"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "orders",
|
|
44
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
45
|
+
mappedEntity: "Order",
|
|
46
|
+
mappedProperty: "owner",
|
|
47
|
+
mappedNamespace: "public"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
repository: "Repository",
|
|
51
|
+
namespace: "public",
|
|
52
|
+
indexes: [],
|
|
53
|
+
extends: [
|
|
54
|
+
"EntityBase"
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
],
|
|
58
|
+
User
|
|
59
|
+
);
|
|
60
|
+
let SKUAttributes = class extends EntityBase {};
|
|
61
|
+
SKUAttributes = __decorateClass(
|
|
62
|
+
[
|
|
63
|
+
Entity({
|
|
64
|
+
name: "SKUAttributes",
|
|
65
|
+
relations: [
|
|
66
|
+
{
|
|
67
|
+
name: "sku",
|
|
68
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
69
|
+
mappedEntity: "SKU",
|
|
70
|
+
mappedNamespace: "public"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "attribute",
|
|
74
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
75
|
+
mappedEntity: "Attribute",
|
|
76
|
+
mappedNamespace: "public"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "value",
|
|
80
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
81
|
+
mappedEntity: "AttributeValue",
|
|
82
|
+
mappedNamespace: "public"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
repository: "Repository",
|
|
86
|
+
namespace: "public",
|
|
87
|
+
properties: [],
|
|
88
|
+
indexes: [],
|
|
89
|
+
extends: [
|
|
90
|
+
"EntityBase"
|
|
91
|
+
],
|
|
92
|
+
displayName: "SkuAttributes"
|
|
93
|
+
})
|
|
94
|
+
],
|
|
95
|
+
SKUAttributes
|
|
96
|
+
);
|
|
97
|
+
let SKU = class extends EntityBase {};
|
|
98
|
+
SKU = __decorateClass(
|
|
99
|
+
[
|
|
100
|
+
Entity({
|
|
101
|
+
name: "SKU",
|
|
102
|
+
properties: [
|
|
103
|
+
{
|
|
104
|
+
name: "code",
|
|
105
|
+
type: PropertyType.string
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "price",
|
|
109
|
+
type: PropertyType.integer
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "stock",
|
|
113
|
+
type: PropertyType.integer
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
relations: [
|
|
117
|
+
{
|
|
118
|
+
name: "attributes",
|
|
119
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
120
|
+
mappedEntity: "SKUAttributes",
|
|
121
|
+
mappedProperty: "sku",
|
|
122
|
+
mappedNamespace: "public"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "product",
|
|
126
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
127
|
+
mappedEntity: "Product",
|
|
128
|
+
mappedNamespace: "public"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
repository: "Repository",
|
|
132
|
+
namespace: "public",
|
|
133
|
+
indexes: [],
|
|
134
|
+
extends: [
|
|
135
|
+
"EntityBase"
|
|
136
|
+
],
|
|
137
|
+
displayName: "Sku"
|
|
138
|
+
})
|
|
139
|
+
],
|
|
140
|
+
SKU
|
|
141
|
+
);
|
|
142
|
+
let Product = class extends EntityBase {};
|
|
143
|
+
Product = __decorateClass(
|
|
144
|
+
[
|
|
145
|
+
Entity({
|
|
146
|
+
name: "Product",
|
|
147
|
+
properties: [
|
|
148
|
+
{
|
|
149
|
+
name: "name",
|
|
150
|
+
type: PropertyType.string
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "description",
|
|
154
|
+
type: PropertyType.string,
|
|
155
|
+
nullable: true
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
relations: [
|
|
159
|
+
{
|
|
160
|
+
name: "skus",
|
|
161
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
162
|
+
mappedEntity: "SKU",
|
|
163
|
+
mappedProperty: "product",
|
|
164
|
+
mappedNamespace: "public"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
repository: "Repository",
|
|
168
|
+
namespace: "public",
|
|
169
|
+
indexes: [],
|
|
170
|
+
extends: [
|
|
171
|
+
"EntityBase"
|
|
172
|
+
],
|
|
173
|
+
displayName: "Product"
|
|
174
|
+
})
|
|
175
|
+
],
|
|
176
|
+
Product
|
|
177
|
+
);
|
|
178
|
+
let OrderItem = class extends EntityBase {};
|
|
179
|
+
OrderItem = __decorateClass(
|
|
180
|
+
[
|
|
181
|
+
Entity({
|
|
182
|
+
name: "OrderItem",
|
|
183
|
+
displayName: "订单项目",
|
|
184
|
+
properties: [
|
|
185
|
+
{
|
|
186
|
+
name: "productName",
|
|
187
|
+
type: PropertyType.string,
|
|
188
|
+
displayName: "商品名称"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "quantity",
|
|
192
|
+
type: PropertyType.number,
|
|
193
|
+
displayName: "数量"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "price",
|
|
197
|
+
type: PropertyType.number,
|
|
198
|
+
displayName: "单价"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
relations: [
|
|
202
|
+
{
|
|
203
|
+
name: "order",
|
|
204
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
205
|
+
mappedEntity: "Order",
|
|
206
|
+
mappedNamespace: "public"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "categories",
|
|
210
|
+
kind: RelationKind.MANY_TO_MANY,
|
|
211
|
+
mappedEntity: "Category",
|
|
212
|
+
mappedProperty: "orderItems",
|
|
213
|
+
mappedNamespace: "public"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
repository: "Repository",
|
|
217
|
+
namespace: "public",
|
|
218
|
+
indexes: [],
|
|
219
|
+
extends: [
|
|
220
|
+
"EntityBase"
|
|
221
|
+
]
|
|
222
|
+
})
|
|
223
|
+
],
|
|
224
|
+
OrderItem
|
|
225
|
+
);
|
|
226
|
+
let Order = class extends EntityBase {};
|
|
227
|
+
Order = __decorateClass(
|
|
228
|
+
[
|
|
229
|
+
Entity({
|
|
230
|
+
name: "Order",
|
|
231
|
+
displayName: "订单",
|
|
232
|
+
properties: [
|
|
233
|
+
{
|
|
234
|
+
name: "number",
|
|
235
|
+
type: PropertyType.string,
|
|
236
|
+
unique: true,
|
|
237
|
+
displayName: "订单号"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "amount",
|
|
241
|
+
type: PropertyType.number,
|
|
242
|
+
displayName: "订单总金额"
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
relations: [
|
|
246
|
+
{
|
|
247
|
+
name: "owner",
|
|
248
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
249
|
+
mappedEntity: "User",
|
|
250
|
+
mappedNamespace: "public"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "items",
|
|
254
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
255
|
+
mappedEntity: "OrderItem",
|
|
256
|
+
mappedProperty: "order",
|
|
257
|
+
mappedNamespace: "public"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
repository: "Repository",
|
|
261
|
+
namespace: "public",
|
|
262
|
+
indexes: [],
|
|
263
|
+
extends: [
|
|
264
|
+
"EntityBase"
|
|
265
|
+
]
|
|
266
|
+
})
|
|
267
|
+
],
|
|
268
|
+
Order
|
|
269
|
+
);
|
|
270
|
+
let IdCard = class extends EntityBase {};
|
|
271
|
+
IdCard = __decorateClass(
|
|
272
|
+
[
|
|
273
|
+
Entity({
|
|
274
|
+
name: "IdCard",
|
|
275
|
+
displayName: "身份证",
|
|
276
|
+
properties: [
|
|
277
|
+
{
|
|
278
|
+
name: "code",
|
|
279
|
+
type: PropertyType.string,
|
|
280
|
+
displayName: "身份证号码",
|
|
281
|
+
unique: true
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
relations: [
|
|
285
|
+
{
|
|
286
|
+
name: "owner",
|
|
287
|
+
kind: RelationKind.ONE_TO_ONE,
|
|
288
|
+
mappedEntity: "User",
|
|
289
|
+
nullable: false,
|
|
290
|
+
mappedNamespace: "public"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
repository: "Repository",
|
|
294
|
+
namespace: "public",
|
|
295
|
+
indexes: [],
|
|
296
|
+
extends: [
|
|
297
|
+
"EntityBase"
|
|
298
|
+
]
|
|
299
|
+
})
|
|
300
|
+
],
|
|
301
|
+
IdCard
|
|
302
|
+
);
|
|
303
|
+
let Category = class extends EntityBase {};
|
|
304
|
+
Category = __decorateClass(
|
|
305
|
+
[
|
|
306
|
+
Entity({
|
|
307
|
+
name: "Category",
|
|
308
|
+
displayName: "产品分类",
|
|
309
|
+
properties: [
|
|
310
|
+
{
|
|
311
|
+
name: "name",
|
|
312
|
+
type: PropertyType.string,
|
|
313
|
+
displayName: "分类名称"
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
relations: [
|
|
317
|
+
{
|
|
318
|
+
name: "orderItems",
|
|
319
|
+
kind: RelationKind.MANY_TO_MANY,
|
|
320
|
+
mappedEntity: "OrderItem",
|
|
321
|
+
mappedProperty: "categories",
|
|
322
|
+
mappedNamespace: "public"
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
repository: "Repository",
|
|
326
|
+
namespace: "public",
|
|
327
|
+
indexes: [],
|
|
328
|
+
extends: [
|
|
329
|
+
"EntityBase"
|
|
330
|
+
]
|
|
331
|
+
})
|
|
332
|
+
],
|
|
333
|
+
Category
|
|
334
|
+
);
|
|
335
|
+
let AttributeValue = class extends EntityBase {};
|
|
336
|
+
AttributeValue = __decorateClass(
|
|
337
|
+
[
|
|
338
|
+
Entity({
|
|
339
|
+
name: "AttributeValue",
|
|
340
|
+
properties: [
|
|
341
|
+
{
|
|
342
|
+
name: "name",
|
|
343
|
+
type: PropertyType.string
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
relations: [
|
|
347
|
+
{
|
|
348
|
+
name: "attribute",
|
|
349
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
350
|
+
mappedEntity: "Attribute",
|
|
351
|
+
mappedNamespace: "public"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "skuAttributeValues",
|
|
355
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
356
|
+
mappedEntity: "SKUAttributes",
|
|
357
|
+
mappedProperty: "value",
|
|
358
|
+
mappedNamespace: "public"
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
repository: "Repository",
|
|
362
|
+
namespace: "public",
|
|
363
|
+
indexes: [],
|
|
364
|
+
extends: [
|
|
365
|
+
"EntityBase"
|
|
366
|
+
],
|
|
367
|
+
displayName: "AttributeValue"
|
|
368
|
+
})
|
|
369
|
+
],
|
|
370
|
+
AttributeValue
|
|
371
|
+
);
|
|
372
|
+
let Attribute = class extends EntityBase {};
|
|
373
|
+
Attribute = __decorateClass(
|
|
374
|
+
[
|
|
375
|
+
Entity({
|
|
376
|
+
name: "Attribute",
|
|
377
|
+
properties: [
|
|
378
|
+
{
|
|
379
|
+
name: "name",
|
|
380
|
+
type: PropertyType.string
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
relations: [
|
|
384
|
+
{
|
|
385
|
+
name: "values",
|
|
386
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
387
|
+
mappedEntity: "AttributeValue",
|
|
388
|
+
mappedProperty: "attribute",
|
|
389
|
+
mappedNamespace: "public"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: "skuAttributes",
|
|
393
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
394
|
+
mappedEntity: "SKUAttributes",
|
|
395
|
+
mappedProperty: "attribute",
|
|
396
|
+
mappedNamespace: "public"
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
repository: "Repository",
|
|
400
|
+
namespace: "public",
|
|
401
|
+
indexes: [],
|
|
402
|
+
extends: [
|
|
403
|
+
"EntityBase"
|
|
404
|
+
],
|
|
405
|
+
displayName: "Attribute"
|
|
406
|
+
})
|
|
407
|
+
],
|
|
408
|
+
Attribute
|
|
409
|
+
);
|
|
410
|
+
const ENTITIES = [ Attribute, AttributeValue, Category, IdCard, Order, OrderItem, Product, SKU, SKUAttributes, User ];
|
|
411
|
+
export { ENTITIES, Attribute, AttributeValue, Category, IdCard, Order, OrderItem, Product, SKU, SKUAttributes, User };
|