@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.
Files changed (49) hide show
  1. package/dist/entities/FileLarge.d.ts +339 -0
  2. package/dist/entities/FileLarge.js +77 -0
  3. package/dist/entities/FileNode.d.ts +335 -0
  4. package/dist/entities/FileNode.js +77 -0
  5. package/dist/entities/MenuLarge.d.ts +294 -0
  6. package/dist/entities/MenuLarge.js +41 -0
  7. package/dist/entities/MenuSimple.d.ts +290 -0
  8. package/dist/entities/MenuSimple.js +41 -0
  9. package/dist/entities/Todo.d.ts +165 -0
  10. package/dist/entities/Todo.js +34 -0
  11. package/dist/entities/TypeDemo.d.ts +264 -0
  12. package/dist/entities/TypeDemo.js +101 -0
  13. package/dist/entities/index.d.ts +14 -1655
  14. package/dist/entities/index.js +6 -360
  15. package/dist/graph/index.d.ts +1 -2
  16. package/dist/graph/index.js +1 -1
  17. package/dist/shop/Attribute.d.ts +359 -0
  18. package/dist/shop/Attribute.js +50 -0
  19. package/dist/shop/AttributeValue.d.ts +366 -0
  20. package/dist/shop/AttributeValue.js +51 -0
  21. package/dist/shop/Category.d.ts +280 -0
  22. package/dist/shop/Category.js +41 -0
  23. package/dist/shop/IdCard.d.ts +237 -0
  24. package/dist/shop/IdCard.js +43 -0
  25. package/dist/shop/Order.d.ts +270 -0
  26. package/dist/shop/Order.js +58 -0
  27. package/dist/shop/OrderItem.d.ts +293 -0
  28. package/dist/shop/OrderItem.js +64 -0
  29. package/dist/shop/Product.d.ts +321 -0
  30. package/dist/shop/Product.js +47 -0
  31. package/dist/shop/SKU.d.ts +343 -0
  32. package/dist/shop/SKU.js +63 -0
  33. package/dist/shop/SKUAttributes.d.ts +306 -0
  34. package/dist/shop/SKUAttributes.js +56 -0
  35. package/dist/shop/User.d.ts +269 -0
  36. package/dist/shop/User.js +74 -0
  37. package/dist/shop/index.d.ts +22 -2980
  38. package/dist/shop/index.js +10 -528
  39. package/dist/system/RxDBBranch.d.ts +396 -0
  40. package/dist/system/RxDBBranch.js +106 -0
  41. package/dist/system/RxDBChange.d.ts +361 -0
  42. package/dist/system/RxDBChange.js +123 -0
  43. package/dist/system/RxDBMigration.d.ts +167 -0
  44. package/dist/system/RxDBMigration.js +40 -0
  45. package/dist/system/RxDBSync.d.ts +339 -0
  46. package/dist/system/RxDBSync.js +122 -0
  47. package/dist/system/index.d.ts +9 -1240
  48. package/dist/system/index.js +4 -384
  49. package/package.json +3 -3
@@ -0,0 +1,321 @@
1
+ import { CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityBase, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, IEntity, ITreeEntity, NumberRules, 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 ProductRule = UUIDRules<Product, 'id'>
8
+ | DateRules<Product, 'createdAt'>
9
+ | DateRules<Product, 'updatedAt'>
10
+ | StringRules<Product, 'createdBy'>
11
+ | StringRules<Product, 'updatedBy'>
12
+ | StringRules<Product, 'name'>
13
+ | StringRules<Product, 'description'>
14
+ | RelationExistsRules<'skus', SKURuleGroup>
15
+ | RelationUUIDRules<'skus.id', UUID>
16
+ | RelationDateRules<'skus.createdAt', Date>
17
+ | RelationDateRules<'skus.updatedAt', Date>
18
+ | RelationStringRules<'skus.createdBy', string | null>
19
+ | RelationStringRules<'skus.updatedBy', string | null>
20
+ | RelationStringRules<'skus.code', string>
21
+ | RelationNumberRules<'skus.price', number>
22
+ | RelationNumberRules<'skus.stock', number>
23
+ | UUIDRules<SKU, 'productId'>
24
+ | RelationUUIDRules<'skus.attributes.id', UUID>
25
+ | RelationDateRules<'skus.attributes.createdAt', Date>
26
+ | RelationDateRules<'skus.attributes.updatedAt', Date>
27
+ | RelationStringRules<'skus.attributes.createdBy', string | null>
28
+ | RelationStringRules<'skus.attributes.updatedBy', string | null>
29
+ | UUIDRules<SKUAttributes, 'skuId'>
30
+ | UUIDRules<SKUAttributes, 'attributeId'>
31
+ | UUIDRules<SKUAttributes, 'valueId'>
32
+ | RelationUUIDRules<'skus.attributes.attribute.id', UUID>
33
+ | RelationDateRules<'skus.attributes.attribute.createdAt', Date>
34
+ | RelationDateRules<'skus.attributes.attribute.updatedAt', Date>
35
+ | RelationStringRules<'skus.attributes.attribute.createdBy', string | null>
36
+ | RelationStringRules<'skus.attributes.attribute.updatedBy', string | null>
37
+ | RelationStringRules<'skus.attributes.attribute.name', string>
38
+ | RelationUUIDRules<'skus.attributes.attribute.values.id', UUID>
39
+ | RelationDateRules<'skus.attributes.attribute.values.createdAt', Date>
40
+ | RelationDateRules<'skus.attributes.attribute.values.updatedAt', Date>
41
+ | RelationStringRules<'skus.attributes.attribute.values.createdBy', string | null>
42
+ | RelationStringRules<'skus.attributes.attribute.values.updatedBy', string | null>
43
+ | RelationStringRules<'skus.attributes.attribute.values.name', string>
44
+ | UUIDRules<AttributeValue, 'attributeId'>
45
+ | RelationUUIDRules<'skus.attributes.attribute.values.skuAttributeValues.id', UUID>
46
+ | RelationDateRules<'skus.attributes.attribute.values.skuAttributeValues.createdAt', Date>
47
+ | RelationDateRules<'skus.attributes.attribute.values.skuAttributeValues.updatedAt', Date>
48
+ | RelationStringRules<'skus.attributes.attribute.values.skuAttributeValues.createdBy', string | null>
49
+ | RelationStringRules<'skus.attributes.attribute.values.skuAttributeValues.updatedBy', string | null>
50
+ | RelationUUIDRules<'skus.attributes.attribute.skuAttributes.id', UUID>
51
+ | RelationDateRules<'skus.attributes.attribute.skuAttributes.createdAt', Date>
52
+ | RelationDateRules<'skus.attributes.attribute.skuAttributes.updatedAt', Date>
53
+ | RelationStringRules<'skus.attributes.attribute.skuAttributes.createdBy', string | null>
54
+ | RelationStringRules<'skus.attributes.attribute.skuAttributes.updatedBy', string | null>
55
+ | RelationUUIDRules<'skus.attributes.value.id', UUID>
56
+ | RelationDateRules<'skus.attributes.value.createdAt', Date>
57
+ | RelationDateRules<'skus.attributes.value.updatedAt', Date>
58
+ | RelationStringRules<'skus.attributes.value.createdBy', string | null>
59
+ | RelationStringRules<'skus.attributes.value.updatedBy', string | null>
60
+ | RelationStringRules<'skus.attributes.value.name', string>
61
+ | RelationUUIDRules<'skus.attributes.value.attribute.id', UUID>
62
+ | RelationDateRules<'skus.attributes.value.attribute.createdAt', Date>
63
+ | RelationDateRules<'skus.attributes.value.attribute.updatedAt', Date>
64
+ | RelationStringRules<'skus.attributes.value.attribute.createdBy', string | null>
65
+ | RelationStringRules<'skus.attributes.value.attribute.updatedBy', string | null>
66
+ | RelationStringRules<'skus.attributes.value.attribute.name', string>
67
+ | RelationUUIDRules<'skus.attributes.value.attribute.values.id', UUID>
68
+ | RelationDateRules<'skus.attributes.value.attribute.values.createdAt', Date>
69
+ | RelationDateRules<'skus.attributes.value.attribute.values.updatedAt', Date>
70
+ | RelationStringRules<'skus.attributes.value.attribute.values.createdBy', string | null>
71
+ | RelationStringRules<'skus.attributes.value.attribute.values.updatedBy', string | null>
72
+ | RelationStringRules<'skus.attributes.value.attribute.values.name', string>
73
+ | RelationUUIDRules<'skus.attributes.value.attribute.skuAttributes.id', UUID>
74
+ | RelationDateRules<'skus.attributes.value.attribute.skuAttributes.createdAt', Date>
75
+ | RelationDateRules<'skus.attributes.value.attribute.skuAttributes.updatedAt', Date>
76
+ | RelationStringRules<'skus.attributes.value.attribute.skuAttributes.createdBy', string | null>
77
+ | RelationStringRules<'skus.attributes.value.attribute.skuAttributes.updatedBy', string | null>
78
+ | RelationUUIDRules<'skus.attributes.value.skuAttributeValues.id', UUID>
79
+ | RelationDateRules<'skus.attributes.value.skuAttributeValues.createdAt', Date>
80
+ | RelationDateRules<'skus.attributes.value.skuAttributeValues.updatedAt', Date>
81
+ | RelationStringRules<'skus.attributes.value.skuAttributeValues.createdBy', string | null>
82
+ | RelationStringRules<'skus.attributes.value.skuAttributeValues.updatedBy', string | null>;
83
+
84
+ /**
85
+ * RuleGroupBase
86
+ */
87
+ export declare type ProductRuleGroup = RuleGroupBase<typeof Product,
88
+ |'id'
89
+ |'createdAt'
90
+ |'updatedAt'
91
+ |'createdBy'
92
+ |'updatedBy'
93
+ |'name'
94
+ |'description'
95
+ |'skus'
96
+ |'skus.id'
97
+ |'skus.createdAt'
98
+ |'skus.updatedAt'
99
+ |'skus.createdBy'
100
+ |'skus.updatedBy'
101
+ |'skus.code'
102
+ |'skus.price'
103
+ |'skus.stock'
104
+ |'productId'
105
+ |'skus.attributes.id'
106
+ |'skus.attributes.createdAt'
107
+ |'skus.attributes.updatedAt'
108
+ |'skus.attributes.createdBy'
109
+ |'skus.attributes.updatedBy'
110
+ |'skuId'
111
+ |'attributeId'
112
+ |'valueId'
113
+ |'skus.attributes.attribute.id'
114
+ |'skus.attributes.attribute.createdAt'
115
+ |'skus.attributes.attribute.updatedAt'
116
+ |'skus.attributes.attribute.createdBy'
117
+ |'skus.attributes.attribute.updatedBy'
118
+ |'skus.attributes.attribute.name'
119
+ |'skus.attributes.attribute.values.id'
120
+ |'skus.attributes.attribute.values.createdAt'
121
+ |'skus.attributes.attribute.values.updatedAt'
122
+ |'skus.attributes.attribute.values.createdBy'
123
+ |'skus.attributes.attribute.values.updatedBy'
124
+ |'skus.attributes.attribute.values.name'
125
+ |'attributeId'
126
+ |'skus.attributes.attribute.values.skuAttributeValues.id'
127
+ |'skus.attributes.attribute.values.skuAttributeValues.createdAt'
128
+ |'skus.attributes.attribute.values.skuAttributeValues.updatedAt'
129
+ |'skus.attributes.attribute.values.skuAttributeValues.createdBy'
130
+ |'skus.attributes.attribute.values.skuAttributeValues.updatedBy'
131
+ |'skuId'
132
+ |'attributeId'
133
+ |'valueId'
134
+ |'skus.attributes.attribute.skuAttributes.id'
135
+ |'skus.attributes.attribute.skuAttributes.createdAt'
136
+ |'skus.attributes.attribute.skuAttributes.updatedAt'
137
+ |'skus.attributes.attribute.skuAttributes.createdBy'
138
+ |'skus.attributes.attribute.skuAttributes.updatedBy'
139
+ |'skuId'
140
+ |'attributeId'
141
+ |'valueId'
142
+ |'skus.attributes.value.id'
143
+ |'skus.attributes.value.createdAt'
144
+ |'skus.attributes.value.updatedAt'
145
+ |'skus.attributes.value.createdBy'
146
+ |'skus.attributes.value.updatedBy'
147
+ |'skus.attributes.value.name'
148
+ |'attributeId'
149
+ |'skus.attributes.value.attribute.id'
150
+ |'skus.attributes.value.attribute.createdAt'
151
+ |'skus.attributes.value.attribute.updatedAt'
152
+ |'skus.attributes.value.attribute.createdBy'
153
+ |'skus.attributes.value.attribute.updatedBy'
154
+ |'skus.attributes.value.attribute.name'
155
+ |'skus.attributes.value.attribute.values.id'
156
+ |'skus.attributes.value.attribute.values.createdAt'
157
+ |'skus.attributes.value.attribute.values.updatedAt'
158
+ |'skus.attributes.value.attribute.values.createdBy'
159
+ |'skus.attributes.value.attribute.values.updatedBy'
160
+ |'skus.attributes.value.attribute.values.name'
161
+ |'attributeId'
162
+ |'skus.attributes.value.attribute.skuAttributes.id'
163
+ |'skus.attributes.value.attribute.skuAttributes.createdAt'
164
+ |'skus.attributes.value.attribute.skuAttributes.updatedAt'
165
+ |'skus.attributes.value.attribute.skuAttributes.createdBy'
166
+ |'skus.attributes.value.attribute.skuAttributes.updatedBy'
167
+ |'skuId'
168
+ |'attributeId'
169
+ |'valueId'
170
+ |'skus.attributes.value.skuAttributeValues.id'
171
+ |'skus.attributes.value.skuAttributeValues.createdAt'
172
+ |'skus.attributes.value.skuAttributeValues.updatedAt'
173
+ |'skus.attributes.value.skuAttributeValues.createdBy'
174
+ |'skus.attributes.value.skuAttributeValues.updatedBy'
175
+ |'skuId'
176
+ |'attributeId'
177
+ |'valueId',
178
+ ProductRule>;
179
+
180
+ /**
181
+ * OrderByField
182
+ */
183
+ declare type ProductOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "name" | "description";
184
+
185
+ /**
186
+ * 静态类型
187
+ */
188
+ export interface ProductStaticTypes {
189
+ /**
190
+ * id 类型
191
+ */
192
+ idType: UUID;
193
+ /**
194
+ * 查询选项
195
+ */
196
+ getOptions: UUID;
197
+ /**
198
+ * 查询选项
199
+ */
200
+ findOneOrFailOptions: FindOneOrFailOptions<typeof Product,ProductRuleGroup,ProductOrderByField>;
201
+ /**
202
+ * 查询选项
203
+ */
204
+ findOptions: FindOptions<typeof Product,ProductRuleGroup,ProductOrderByField>;
205
+ /**
206
+ * 查询选项
207
+ */
208
+ findOneOptions: FindOneOptions<typeof Product,ProductRuleGroup,ProductOrderByField>;
209
+ /**
210
+ * 查询选项
211
+ */
212
+ findAllOptions: FindAllOptions<typeof Product,ProductRuleGroup,ProductOrderByField>;
213
+ /**
214
+ * 查询选项
215
+ */
216
+ findByCursorOptions: FindByCursorOptions<typeof Product,ProductRuleGroup,ProductOrderByField>;
217
+ /**
218
+ * 查询选项
219
+ */
220
+ countOptions: CountOptions<typeof Product,ProductRuleGroup>;
221
+ }
222
+
223
+ /**
224
+ * 初始化数据
225
+ */
226
+ export interface ProductInitData {
227
+ /**
228
+ * 产品名称
229
+ */
230
+ name?: string;
231
+ /**
232
+ * 产品描述
233
+ */
234
+ description?: string | null;
235
+ }
236
+
237
+ /**
238
+ * 产品
239
+ */
240
+ export declare class Product extends EntityBase implements IEntity {
241
+ static [ENTITY_STATIC_TYPES]: ProductStaticTypes;
242
+ /**
243
+ * SKU列表
244
+ */
245
+ readonly skus$: RelationEntitiesObservable<SKU>;
246
+ /**
247
+ * 产品描述
248
+ */
249
+ description?: string | null;
250
+ /**
251
+ * 产品名称
252
+ */
253
+ name: string;
254
+ /**
255
+ * 初始化数据
256
+ * @param initData 初始化数据
257
+ */
258
+ constructor(initData?: ProductInitData);
259
+ /**
260
+ * 统计实体数量
261
+ * @param options 查询选项
262
+ * @example
263
+ * Product.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
264
+ */
265
+ static count(options: CountOptions<typeof Product,ProductRuleGroup>): Observable<number>;
266
+ /**
267
+ * 查询多个实体
268
+ * @param options 查询选项
269
+ * @example
270
+ * Product.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
271
+ */
272
+ static find(options: FindOptions<typeof Product,ProductRuleGroup,ProductOrderByField>): Observable<Product[]>;
273
+ /**
274
+ * 查询所有实体
275
+ * @param options 查询选项
276
+ * @example
277
+ * Product.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
278
+ */
279
+ static findAll(options: FindAllOptions<typeof Product,ProductRuleGroup,ProductOrderByField>): Observable<Product[]>;
280
+ /**
281
+ * 游标分页查询
282
+ * @param options 查询选项
283
+ * @example
284
+ * Product.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
285
+ */
286
+ static findByCursor(options: FindByCursorOptions<typeof Product,ProductRuleGroup,ProductOrderByField>): Observable<Product[]>;
287
+ /**
288
+ * 查询单个实体,未找到时返回 undefined
289
+ * @param options 查询选项
290
+ * @example
291
+ * Product.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
292
+ */
293
+ static findOne(options: FindOneOptions<typeof Product,ProductRuleGroup,ProductOrderByField>): Observable<Product | undefined>;
294
+ /**
295
+ * 查询单个实体,未找到时抛出错误
296
+ * @param options 查询选项
297
+ * @example
298
+ * Product.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
299
+ */
300
+ static findOneOrFail(options: FindOneOrFailOptions<typeof Product,ProductRuleGroup,ProductOrderByField>): Observable<Product>;
301
+ /**
302
+ * 根据 ID 获取单个实体
303
+ * @param options 查询选项
304
+ * @example
305
+ * Product.get('123').subscribe(entity => console.log(entity));
306
+ */
307
+ static get(options: UUID): Observable<Product>;
308
+ /**
309
+ * 删除
310
+ */
311
+ remove(): Promise<Product>;
312
+ /**
313
+ * 重置数据
314
+ */
315
+ reset(): void;
316
+ /**
317
+ * 保存
318
+ */
319
+ save(): Promise<Product>;
320
+ }
321
+
@@ -0,0 +1,47 @@
1
+ import { Entity, EntityBase, PropertyType, RelationKind, __decorateClass } from '@aiao/rxdb';
2
+ let Product = class extends EntityBase {};
3
+ Product = __decorateClass(
4
+ [
5
+ Entity({
6
+ name: "Product",
7
+ tableName: "product",
8
+ displayName: "产品",
9
+ properties: [
10
+ {
11
+ name: "name",
12
+ type: PropertyType.string,
13
+ displayName: "产品名称",
14
+ columnName: "name"
15
+ },
16
+ {
17
+ name: "description",
18
+ type: PropertyType.string,
19
+ displayName: "产品描述",
20
+ nullable: true,
21
+ columnName: "description"
22
+ }
23
+ ],
24
+ relations: [
25
+ {
26
+ name: "skus",
27
+ displayName: "SKU列表",
28
+ kind: RelationKind.ONE_TO_MANY,
29
+ mappedEntity: "SKU",
30
+ mappedProperty: "product",
31
+ mappedNamespace: "public",
32
+ onDelete: "CASCADE",
33
+ onUpdate: "RESTRICT"
34
+ }
35
+ ],
36
+ repository: "Repository",
37
+ namespace: "public",
38
+ indexes: [],
39
+ computedProperties: [],
40
+ extends: [
41
+ "EntityBase"
42
+ ]
43
+ })
44
+ ],
45
+ Product
46
+ );
47
+ export { Product };