@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,264 @@
|
|
|
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
|
+
| StringRules<TypeDemo, 'string'>
|
|
13
|
+
| NumberRules<TypeDemo, 'number'>
|
|
14
|
+
| NumberRules<TypeDemo, 'integer'>
|
|
15
|
+
| BooleanRules<TypeDemo, 'boolean'>
|
|
16
|
+
| DateRules<TypeDemo, 'date'>
|
|
17
|
+
| StringRules<TypeDemo, 'enum'>
|
|
18
|
+
| StringArrayRules<TypeDemo, 'stringArray', string>
|
|
19
|
+
| NumberArrayRules<TypeDemo, 'numberArray', number>
|
|
20
|
+
| KeyValueRules<TypeDemo, 'keyValue', Partial<TypeDemoKeyValueKeyValue>>
|
|
21
|
+
| RelationStringRules<'keyValue.string', string>
|
|
22
|
+
| RelationNumberRules<'keyValue.number', number>
|
|
23
|
+
| RelationNumberRules<'keyValue.integer', number>
|
|
24
|
+
| RelationBooleanRules<'keyValue.boolean', boolean>
|
|
25
|
+
| RelationDateRules<'keyValue.date', Date>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* RuleGroupBase
|
|
29
|
+
*/
|
|
30
|
+
export declare type TypeDemoRuleGroup = RuleGroupBase<typeof TypeDemo,
|
|
31
|
+
|'id'
|
|
32
|
+
|'createdAt'
|
|
33
|
+
|'updatedAt'
|
|
34
|
+
|'createdBy'
|
|
35
|
+
|'updatedBy'
|
|
36
|
+
|'string'
|
|
37
|
+
|'number'
|
|
38
|
+
|'integer'
|
|
39
|
+
|'boolean'
|
|
40
|
+
|'date'
|
|
41
|
+
|'enum'
|
|
42
|
+
|'stringArray'
|
|
43
|
+
|'numberArray'
|
|
44
|
+
|'keyValue'
|
|
45
|
+
|'keyValue.string'
|
|
46
|
+
|'keyValue.number'
|
|
47
|
+
|'keyValue.integer'
|
|
48
|
+
|'keyValue.boolean'
|
|
49
|
+
|'keyValue.date',
|
|
50
|
+
TypeDemoRule>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* OrderByField
|
|
54
|
+
*/
|
|
55
|
+
declare type TypeDemoOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "string" | "number" | "integer" | "boolean" | "date" | "enum" | "stringArray" | "numberArray" | "keyValue" | "json";
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 静态类型
|
|
59
|
+
*/
|
|
60
|
+
export interface TypeDemoStaticTypes {
|
|
61
|
+
/**
|
|
62
|
+
* id 类型
|
|
63
|
+
*/
|
|
64
|
+
idType: UUID;
|
|
65
|
+
/**
|
|
66
|
+
* 查询选项
|
|
67
|
+
*/
|
|
68
|
+
getOptions: UUID;
|
|
69
|
+
/**
|
|
70
|
+
* 查询选项
|
|
71
|
+
*/
|
|
72
|
+
findOneOrFailOptions: FindOneOrFailOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
|
|
73
|
+
/**
|
|
74
|
+
* 查询选项
|
|
75
|
+
*/
|
|
76
|
+
findOptions: FindOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
|
|
77
|
+
/**
|
|
78
|
+
* 查询选项
|
|
79
|
+
*/
|
|
80
|
+
findOneOptions: FindOneOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
|
|
81
|
+
/**
|
|
82
|
+
* 查询选项
|
|
83
|
+
*/
|
|
84
|
+
findAllOptions: FindAllOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
|
|
85
|
+
/**
|
|
86
|
+
* 查询选项
|
|
87
|
+
*/
|
|
88
|
+
findByCursorOptions: FindByCursorOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>;
|
|
89
|
+
/**
|
|
90
|
+
* 查询选项
|
|
91
|
+
*/
|
|
92
|
+
countOptions: CountOptions<typeof TypeDemo,TypeDemoRuleGroup>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 初始化数据
|
|
97
|
+
*/
|
|
98
|
+
export interface TypeDemoInitData {
|
|
99
|
+
/**
|
|
100
|
+
* string
|
|
101
|
+
*/
|
|
102
|
+
string?: string;
|
|
103
|
+
/**
|
|
104
|
+
* number
|
|
105
|
+
*/
|
|
106
|
+
number?: number;
|
|
107
|
+
/**
|
|
108
|
+
* integer
|
|
109
|
+
*/
|
|
110
|
+
integer?: number;
|
|
111
|
+
/**
|
|
112
|
+
* boolean
|
|
113
|
+
*/
|
|
114
|
+
boolean?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* date
|
|
117
|
+
*/
|
|
118
|
+
date?: Date;
|
|
119
|
+
/**
|
|
120
|
+
* enum
|
|
121
|
+
*/
|
|
122
|
+
enum?: 'active' | 'inactive' | 'pending' | null;
|
|
123
|
+
/**
|
|
124
|
+
* stringArray
|
|
125
|
+
*/
|
|
126
|
+
stringArray?: string[];
|
|
127
|
+
/**
|
|
128
|
+
* numberArray
|
|
129
|
+
*/
|
|
130
|
+
numberArray?: number[];
|
|
131
|
+
/**
|
|
132
|
+
* keyValue
|
|
133
|
+
*/
|
|
134
|
+
keyValue?: TypeDemoKeyValueKeyValue;
|
|
135
|
+
/**
|
|
136
|
+
* json
|
|
137
|
+
*/
|
|
138
|
+
json?: Record<string, any>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* keyValue keyValue 类型
|
|
143
|
+
*/
|
|
144
|
+
export interface TypeDemoKeyValueKeyValue {
|
|
145
|
+
string: string;
|
|
146
|
+
number: number;
|
|
147
|
+
integer: number;
|
|
148
|
+
boolean: boolean;
|
|
149
|
+
date: Date;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* TypeDemo
|
|
154
|
+
*/
|
|
155
|
+
export declare class TypeDemo extends EntityBase implements IEntity {
|
|
156
|
+
static [ENTITY_STATIC_TYPES]: TypeDemoStaticTypes;
|
|
157
|
+
/**
|
|
158
|
+
* boolean
|
|
159
|
+
*/
|
|
160
|
+
boolean: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* date
|
|
163
|
+
*/
|
|
164
|
+
date: Date;
|
|
165
|
+
/**
|
|
166
|
+
* enum
|
|
167
|
+
*/
|
|
168
|
+
enum?: 'active' | 'inactive' | 'pending' | null;
|
|
169
|
+
/**
|
|
170
|
+
* integer
|
|
171
|
+
*/
|
|
172
|
+
integer: number;
|
|
173
|
+
/**
|
|
174
|
+
* json
|
|
175
|
+
*/
|
|
176
|
+
json: Record<string, any>;
|
|
177
|
+
/**
|
|
178
|
+
* keyValue
|
|
179
|
+
*/
|
|
180
|
+
keyValue: TypeDemoKeyValueKeyValue;
|
|
181
|
+
/**
|
|
182
|
+
* number
|
|
183
|
+
*/
|
|
184
|
+
number: number;
|
|
185
|
+
/**
|
|
186
|
+
* numberArray
|
|
187
|
+
*/
|
|
188
|
+
numberArray: number[];
|
|
189
|
+
/**
|
|
190
|
+
* string
|
|
191
|
+
*/
|
|
192
|
+
string: string;
|
|
193
|
+
/**
|
|
194
|
+
* stringArray
|
|
195
|
+
*/
|
|
196
|
+
stringArray: string[];
|
|
197
|
+
/**
|
|
198
|
+
* 初始化数据
|
|
199
|
+
* @param initData 初始化数据
|
|
200
|
+
*/
|
|
201
|
+
constructor(initData?: TypeDemoInitData);
|
|
202
|
+
/**
|
|
203
|
+
* 统计实体数量
|
|
204
|
+
* @param options 查询选项
|
|
205
|
+
* @example
|
|
206
|
+
* TypeDemo.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
|
|
207
|
+
*/
|
|
208
|
+
static count(options: CountOptions<typeof TypeDemo,TypeDemoRuleGroup>): Observable<number>;
|
|
209
|
+
/**
|
|
210
|
+
* 查询多个实体
|
|
211
|
+
* @param options 查询选项
|
|
212
|
+
* @example
|
|
213
|
+
* TypeDemo.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
|
|
214
|
+
*/
|
|
215
|
+
static find(options: FindOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo[]>;
|
|
216
|
+
/**
|
|
217
|
+
* 查询所有实体
|
|
218
|
+
* @param options 查询选项
|
|
219
|
+
* @example
|
|
220
|
+
* TypeDemo.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
221
|
+
*/
|
|
222
|
+
static findAll(options: FindAllOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo[]>;
|
|
223
|
+
/**
|
|
224
|
+
* 游标分页查询
|
|
225
|
+
* @param options 查询选项
|
|
226
|
+
* @example
|
|
227
|
+
* TypeDemo.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
228
|
+
*/
|
|
229
|
+
static findByCursor(options: FindByCursorOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo[]>;
|
|
230
|
+
/**
|
|
231
|
+
* 查询单个实体,未找到时返回 undefined
|
|
232
|
+
* @param options 查询选项
|
|
233
|
+
* @example
|
|
234
|
+
* TypeDemo.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
235
|
+
*/
|
|
236
|
+
static findOne(options: FindOneOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo | undefined>;
|
|
237
|
+
/**
|
|
238
|
+
* 查询单个实体,未找到时抛出错误
|
|
239
|
+
* @param options 查询选项
|
|
240
|
+
* @example
|
|
241
|
+
* TypeDemo.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
242
|
+
*/
|
|
243
|
+
static findOneOrFail(options: FindOneOrFailOptions<typeof TypeDemo,TypeDemoRuleGroup,TypeDemoOrderByField>): Observable<TypeDemo>;
|
|
244
|
+
/**
|
|
245
|
+
* 根据 ID 获取单个实体
|
|
246
|
+
* @param options 查询选项
|
|
247
|
+
* @example
|
|
248
|
+
* TypeDemo.get('123').subscribe(entity => console.log(entity));
|
|
249
|
+
*/
|
|
250
|
+
static get(options: UUID): Observable<TypeDemo>;
|
|
251
|
+
/**
|
|
252
|
+
* 删除
|
|
253
|
+
*/
|
|
254
|
+
remove(): Promise<TypeDemo>;
|
|
255
|
+
/**
|
|
256
|
+
* 重置数据
|
|
257
|
+
*/
|
|
258
|
+
reset(): void;
|
|
259
|
+
/**
|
|
260
|
+
* 保存
|
|
261
|
+
*/
|
|
262
|
+
save(): Promise<TypeDemo>;
|
|
263
|
+
}
|
|
264
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
name: "string",
|
|
11
|
+
type: PropertyType.string,
|
|
12
|
+
columnName: "string"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "number",
|
|
16
|
+
type: PropertyType.number,
|
|
17
|
+
columnName: "number"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "integer",
|
|
21
|
+
type: PropertyType.integer,
|
|
22
|
+
columnName: "integer"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "boolean",
|
|
26
|
+
type: PropertyType.boolean,
|
|
27
|
+
columnName: "boolean"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "date",
|
|
31
|
+
type: PropertyType.date,
|
|
32
|
+
columnName: "date"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "enum",
|
|
36
|
+
type: PropertyType.enum,
|
|
37
|
+
enum: [
|
|
38
|
+
"active",
|
|
39
|
+
"inactive",
|
|
40
|
+
"pending"
|
|
41
|
+
],
|
|
42
|
+
nullable: true,
|
|
43
|
+
columnName: "enum"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "stringArray",
|
|
47
|
+
columnName: "string_array",
|
|
48
|
+
type: PropertyType.stringArray
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "numberArray",
|
|
52
|
+
columnName: "number_array",
|
|
53
|
+
type: PropertyType.numberArray
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "keyValue",
|
|
57
|
+
columnName: "key_value",
|
|
58
|
+
type: PropertyType.keyValue,
|
|
59
|
+
properties: [
|
|
60
|
+
{
|
|
61
|
+
name: "string",
|
|
62
|
+
type: PropertyType.string
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "number",
|
|
66
|
+
type: PropertyType.number
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "integer",
|
|
70
|
+
type: PropertyType.integer
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "boolean",
|
|
74
|
+
type: PropertyType.boolean
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "date",
|
|
78
|
+
type: PropertyType.date
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "json",
|
|
84
|
+
type: PropertyType.json,
|
|
85
|
+
columnName: "json"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
repository: "Repository",
|
|
89
|
+
namespace: "public",
|
|
90
|
+
relations: [],
|
|
91
|
+
indexes: [],
|
|
92
|
+
computedProperties: [],
|
|
93
|
+
extends: [
|
|
94
|
+
"EntityBase"
|
|
95
|
+
],
|
|
96
|
+
displayName: "TypeDemo"
|
|
97
|
+
})
|
|
98
|
+
],
|
|
99
|
+
TypeDemo
|
|
100
|
+
);
|
|
101
|
+
export { TypeDemo };
|