@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.
Files changed (50) hide show
  1. package/README.md +30 -1
  2. package/dist/entities/FileLarge.d.ts +339 -0
  3. package/dist/entities/FileLarge.js +77 -0
  4. package/dist/entities/FileNode.d.ts +335 -0
  5. package/dist/entities/FileNode.js +77 -0
  6. package/dist/entities/MenuLarge.d.ts +294 -0
  7. package/dist/entities/MenuLarge.js +41 -0
  8. package/dist/entities/MenuSimple.d.ts +290 -0
  9. package/dist/entities/MenuSimple.js +41 -0
  10. package/dist/entities/Todo.d.ts +165 -0
  11. package/dist/entities/Todo.js +34 -0
  12. package/dist/entities/TypeDemo.d.ts +289 -0
  13. package/dist/entities/TypeDemo.js +137 -0
  14. package/dist/entities/index.d.ts +14 -1655
  15. package/dist/entities/index.js +6 -360
  16. package/dist/graph/index.d.ts +1 -2
  17. package/dist/graph/index.js +1 -1
  18. package/dist/shop/Attribute.d.ts +992 -0
  19. package/dist/shop/Attribute.js +50 -0
  20. package/dist/shop/AttributeValue.d.ts +999 -0
  21. package/dist/shop/AttributeValue.js +51 -0
  22. package/dist/shop/Category.d.ts +772 -0
  23. package/dist/shop/Category.js +52 -0
  24. package/dist/shop/IdCard.d.ts +647 -0
  25. package/dist/shop/IdCard.js +43 -0
  26. package/dist/shop/Order.d.ts +690 -0
  27. package/dist/shop/Order.js +66 -0
  28. package/dist/shop/OrderItem.d.ts +665 -0
  29. package/dist/shop/OrderItem.js +76 -0
  30. package/dist/shop/Product.d.ts +761 -0
  31. package/dist/shop/Product.js +58 -0
  32. package/dist/shop/SKU.d.ts +634 -0
  33. package/dist/shop/SKU.js +74 -0
  34. package/dist/shop/SKUAttributes.d.ts +625 -0
  35. package/dist/shop/SKUAttributes.js +56 -0
  36. package/dist/shop/User.d.ts +679 -0
  37. package/dist/shop/User.js +74 -0
  38. package/dist/shop/index.d.ts +52 -2990
  39. package/dist/shop/index.js +10 -528
  40. package/dist/system/RxDBBranch.d.ts +396 -0
  41. package/dist/system/RxDBBranch.js +106 -0
  42. package/dist/system/RxDBChange.d.ts +361 -0
  43. package/dist/system/RxDBChange.js +123 -0
  44. package/dist/system/RxDBMigration.d.ts +167 -0
  45. package/dist/system/RxDBMigration.js +40 -0
  46. package/dist/system/RxDBSync.d.ts +339 -0
  47. package/dist/system/RxDBSync.js +122 -0
  48. package/dist/system/index.d.ts +9 -1240
  49. package/dist/system/index.js +4 -384
  50. package/package.json +3 -3
@@ -0,0 +1,289 @@
1
+ import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityBase, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, IEntity, ITreeEntity, KeyValueRules, NumberArrayRules, NumberRules, RelationBooleanRules, RelationDateRules, RelationNumberRules, RelationStringRules, RuleGroupBase, StringArrayRules, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
2
+ import { Observable } from 'rxjs';
3
+
4
+ /**
5
+ * rule
6
+ */
7
+ declare type TypeDemoRule = UUIDRules<TypeDemo, 'id'>
8
+ | DateRules<TypeDemo, 'createdAt'>
9
+ | DateRules<TypeDemo, 'updatedAt'>
10
+ | StringRules<TypeDemo, 'createdBy'>
11
+ | StringRules<TypeDemo, 'updatedBy'>
12
+ | UUIDRules<TypeDemo, 'uuid'>
13
+ | StringRules<TypeDemo, 'string'>
14
+ | NumberRules<TypeDemo, 'number'>
15
+ | NumberRules<TypeDemo, 'integer'>
16
+ | BooleanRules<TypeDemo, 'boolean'>
17
+ | DateRules<TypeDemo, 'date'>
18
+ | StringRules<TypeDemo, 'enum'>
19
+ | StringArrayRules<TypeDemo, 'stringArray', string>
20
+ | NumberArrayRules<TypeDemo, 'numberArray', number>
21
+ | KeyValueRules<TypeDemo, 'keyValue', Partial<TypeDemoKeyValueKeyValue>>
22
+ | RelationStringRules<'keyValue.string', string | null>
23
+ | RelationNumberRules<'keyValue.number', number | null>
24
+ | RelationNumberRules<'keyValue.integer', number | null>
25
+ | RelationBooleanRules<'keyValue.boolean', boolean | null>
26
+ | RelationDateRules<'keyValue.date', Date | null>;
27
+
28
+ /**
29
+ * RuleGroupBase
30
+ */
31
+ export declare type TypeDemoRuleGroup = RuleGroupBase<typeof TypeDemo,
32
+ |'id'
33
+ |'createdAt'
34
+ |'updatedAt'
35
+ |'createdBy'
36
+ |'updatedBy'
37
+ |'uuid'
38
+ |'string'
39
+ |'number'
40
+ |'integer'
41
+ |'boolean'
42
+ |'date'
43
+ |'enum'
44
+ |'stringArray'
45
+ |'numberArray'
46
+ |'keyValue'
47
+ |'keyValue.string'
48
+ |'keyValue.number'
49
+ |'keyValue.integer'
50
+ |'keyValue.boolean'
51
+ |'keyValue.date',
52
+ TypeDemoRule>;
53
+
54
+ /**
55
+ * OrderByField
56
+ */
57
+ declare type TypeDemoOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "uuid" | "string" | "number" | "integer" | "boolean" | "date" | "enum" | "stringArray" | "numberArray" | "keyValue" | "json";
58
+
59
+ /**
60
+ * 静态类型
61
+ */
62
+ export interface TypeDemoStaticTypes {
63
+ /**
64
+ * id 类型
65
+ */
66
+ idType: UUID;
67
+ /**
68
+ * 查询选项
69
+ */
70
+ getOptions: UUID;
71
+ /**
72
+ * 查询选项
73
+ */
74
+ findOneOrFailOptions: FindOneOrFailOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
75
+ /**
76
+ * 查询选项
77
+ */
78
+ findOptions: FindOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
79
+ /**
80
+ * 查询选项
81
+ */
82
+ findOneOptions: FindOneOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
83
+ /**
84
+ * 查询选项
85
+ */
86
+ findAllOptions: FindAllOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
87
+ /**
88
+ * 查询选项
89
+ */
90
+ findByCursorOptions: FindByCursorOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
91
+ /**
92
+ * 查询选项
93
+ */
94
+ countOptions: CountOptions<typeof TypeDemo,TypeDemoRuleGroup>;
95
+ }
96
+
97
+ /**
98
+ * 初始化数据
99
+ */
100
+ export interface TypeDemoInitData {
101
+ /**
102
+ * UUID
103
+ */
104
+ uuid?: UUID | null;
105
+ /**
106
+ * 字符串
107
+ */
108
+ string?: string | null;
109
+ /**
110
+ * 数字
111
+ */
112
+ number?: number | null;
113
+ /**
114
+ * 整数
115
+ */
116
+ integer?: number | null;
117
+ /**
118
+ * 布尔值
119
+ */
120
+ boolean?: boolean | null;
121
+ /**
122
+ * 日期
123
+ */
124
+ date?: Date | null;
125
+ /**
126
+ * 枚举
127
+ */
128
+ enum?: 'active' | 'inactive' | 'pending' | null;
129
+ /**
130
+ * 字符串数组
131
+ */
132
+ stringArray?: string[] | null;
133
+ /**
134
+ * 数字数组
135
+ */
136
+ numberArray?: number[] | null;
137
+ /**
138
+ * 键值对
139
+ */
140
+ keyValue?: TypeDemoKeyValueKeyValue | null;
141
+ /**
142
+ * JSON
143
+ */
144
+ json?: Record<string, any> | null;
145
+ }
146
+
147
+ /**
148
+ * 键值对
149
+ */
150
+ export interface TypeDemoKeyValueKeyValue {
151
+ /**
152
+ * 字符串
153
+ */
154
+ string?: string | null;
155
+ /**
156
+ * 数字
157
+ */
158
+ number?: number | null;
159
+ /**
160
+ * 整数
161
+ */
162
+ integer?: number | null;
163
+ /**
164
+ * 布尔值
165
+ */
166
+ boolean?: boolean | null;
167
+ /**
168
+ * 日期
169
+ */
170
+ date?: Date | null;
171
+ }
172
+
173
+ /**
174
+ * TypeDemo
175
+ */
176
+ export declare class TypeDemo extends EntityBase implements IEntity {
177
+ static [ENTITY_STATIC_TYPES]: TypeDemoStaticTypes;
178
+ /**
179
+ * 布尔值
180
+ */
181
+ boolean?: boolean | null;
182
+ /**
183
+ * 日期
184
+ */
185
+ date?: Date | null;
186
+ /**
187
+ * 枚举
188
+ */
189
+ enum?: 'active' | 'inactive' | 'pending' | null;
190
+ /**
191
+ * 整数
192
+ */
193
+ integer?: number | null;
194
+ /**
195
+ * JSON
196
+ */
197
+ json?: Record<string, any> | null;
198
+ /**
199
+ * 键值对
200
+ */
201
+ keyValue?: TypeDemoKeyValueKeyValue | null;
202
+ /**
203
+ * 数字
204
+ */
205
+ number?: number | null;
206
+ /**
207
+ * 数字数组
208
+ */
209
+ numberArray?: number[] | null;
210
+ /**
211
+ * 字符串
212
+ */
213
+ string?: string | null;
214
+ /**
215
+ * 字符串数组
216
+ */
217
+ stringArray?: string[] | null;
218
+ /**
219
+ * UUID
220
+ */
221
+ uuid?: UUID | null;
222
+ /**
223
+ * 初始化数据
224
+ * @param initData 初始化数据
225
+ */
226
+ constructor(initData?: TypeDemoInitData);
227
+ /**
228
+ * 统计实体数量
229
+ * @param options 查询选项
230
+ * @example
231
+ * TypeDemo.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
232
+ */
233
+ static count(options: CountOptions<typeof TypeDemo,TypeDemoRuleGroup>): Observable<number>;
234
+ /**
235
+ * 查询多个实体
236
+ * @param options 查询选项
237
+ * @example
238
+ * TypeDemo.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
239
+ */
240
+ static find(options: FindOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo[]>;
241
+ /**
242
+ * 查询所有实体
243
+ * @param options 查询选项
244
+ * @example
245
+ * TypeDemo.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
246
+ */
247
+ static findAll(options: FindAllOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo[]>;
248
+ /**
249
+ * 游标分页查询
250
+ * @param options 查询选项
251
+ * @example
252
+ * TypeDemo.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
253
+ */
254
+ static findByCursor(options: FindByCursorOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo[]>;
255
+ /**
256
+ * 查询单个实体,未找到时返回 undefined
257
+ * @param options 查询选项
258
+ * @example
259
+ * TypeDemo.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
260
+ */
261
+ static findOne(options: FindOneOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo | undefined>;
262
+ /**
263
+ * 查询单个实体,未找到时抛出错误
264
+ * @param options 查询选项
265
+ * @example
266
+ * TypeDemo.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
267
+ */
268
+ static findOneOrFail(options: FindOneOrFailOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo>;
269
+ /**
270
+ * 根据 ID 获取单个实体
271
+ * @param options 查询选项
272
+ * @example
273
+ * TypeDemo.get('123').subscribe(entity => console.log(entity));
274
+ */
275
+ static get(options: UUID): Observable<TypeDemo>;
276
+ /**
277
+ * 删除
278
+ */
279
+ remove(): Promise<TypeDemo>;
280
+ /**
281
+ * 重置数据
282
+ */
283
+ reset(): void;
284
+ /**
285
+ * 保存
286
+ */
287
+ save(): Promise<TypeDemo>;
288
+ }
289
+
@@ -0,0 +1,137 @@
1
+ import { Entity, EntityBase, PropertyType, __decorateClass } from '@aiao/rxdb';
2
+ let TypeDemo = class extends EntityBase {};
3
+ TypeDemo = __decorateClass(
4
+ [
5
+ Entity({
6
+ name: "TypeDemo",
7
+ tableName: "type_demo",
8
+ properties: [
9
+ {
10
+ displayName: "UUID",
11
+ name: "uuid",
12
+ type: PropertyType.uuid,
13
+ nullable: true,
14
+ columnName: "uuid"
15
+ },
16
+ {
17
+ displayName: "字符串",
18
+ name: "string",
19
+ type: PropertyType.string,
20
+ nullable: true,
21
+ columnName: "string"
22
+ },
23
+ {
24
+ displayName: "数字",
25
+ name: "number",
26
+ type: PropertyType.number,
27
+ nullable: true,
28
+ columnName: "number"
29
+ },
30
+ {
31
+ displayName: "整数",
32
+ name: "integer",
33
+ type: PropertyType.integer,
34
+ nullable: true,
35
+ columnName: "integer"
36
+ },
37
+ {
38
+ displayName: "布尔值",
39
+ name: "boolean",
40
+ type: PropertyType.boolean,
41
+ nullable: true,
42
+ columnName: "boolean"
43
+ },
44
+ {
45
+ displayName: "日期",
46
+ name: "date",
47
+ type: PropertyType.date,
48
+ nullable: true,
49
+ columnName: "date"
50
+ },
51
+ {
52
+ displayName: "枚举",
53
+ name: "enum",
54
+ type: PropertyType.enum,
55
+ enum: [
56
+ "active",
57
+ "inactive",
58
+ "pending"
59
+ ],
60
+ nullable: true,
61
+ columnName: "enum"
62
+ },
63
+ {
64
+ displayName: "字符串数组",
65
+ name: "stringArray",
66
+ columnName: "string_array",
67
+ type: PropertyType.stringArray,
68
+ nullable: true
69
+ },
70
+ {
71
+ displayName: "数字数组",
72
+ name: "numberArray",
73
+ columnName: "number_array",
74
+ type: PropertyType.numberArray,
75
+ nullable: true
76
+ },
77
+ {
78
+ name: "keyValue",
79
+ columnName: "key_value",
80
+ type: PropertyType.keyValue,
81
+ displayName: "键值对",
82
+ nullable: true,
83
+ properties: [
84
+ {
85
+ displayName: "字符串",
86
+ name: "string",
87
+ type: PropertyType.string,
88
+ nullable: true
89
+ },
90
+ {
91
+ displayName: "数字",
92
+ name: "number",
93
+ type: PropertyType.number,
94
+ nullable: true
95
+ },
96
+ {
97
+ displayName: "整数",
98
+ name: "integer",
99
+ type: PropertyType.integer,
100
+ nullable: true
101
+ },
102
+ {
103
+ displayName: "布尔值",
104
+ name: "boolean",
105
+ type: PropertyType.boolean,
106
+ nullable: true
107
+ },
108
+ {
109
+ displayName: "日期",
110
+ name: "date",
111
+ type: PropertyType.date,
112
+ nullable: true
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ displayName: "JSON",
118
+ name: "json",
119
+ type: PropertyType.json,
120
+ nullable: true,
121
+ columnName: "json"
122
+ }
123
+ ],
124
+ repository: "Repository",
125
+ namespace: "public",
126
+ relations: [],
127
+ indexes: [],
128
+ computedProperties: [],
129
+ extends: [
130
+ "EntityBase"
131
+ ],
132
+ displayName: "TypeDemo"
133
+ })
134
+ ],
135
+ TypeDemo
136
+ );
137
+ export { TypeDemo };