@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,339 @@
1
+ import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, 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 RxDBSyncRule = StringRules<RxDBSync, 'id'>
8
+ | StringRules<RxDBSync, 'namespace'>
9
+ | StringRules<RxDBSync, 'entity'>
10
+ | StringRules<RxDBSync, 'syncType'>
11
+ | NumberRules<RxDBSync, 'lastPushedChangeId'>
12
+ | DateRules<RxDBSync, 'lastPushedAt'>
13
+ | DateRules<RxDBSync, 'lastPulledAt'>
14
+ | NumberRules<RxDBSync, 'lastPullRemoteChangeId'>
15
+ | BooleanRules<RxDBSync, 'enabled'>
16
+ | DateRules<RxDBSync, 'createdAt'>
17
+ | DateRules<RxDBSync, 'updatedAt'>
18
+ | StringRules<RxDBSync, 'branchId'>
19
+ | RelationExistsRules<'branch', RxDBBranchRuleGroup>
20
+ | RelationStringRules<'branch.id', string>
21
+ | RelationBooleanRules<'branch.activated', boolean>
22
+ | RelationNumberRules<'branch.fromChangeId', number | null>
23
+ | RelationBooleanRules<'branch.local', boolean>
24
+ | RelationBooleanRules<'branch.remote', boolean>
25
+ | RelationDateRules<'branch.createdAt', Date | null>
26
+ | RelationDateRules<'branch.updatedAt', Date | null>
27
+ | StringRules<RxDBBranch, 'parentId'>
28
+ | RelationNumberRules<'branch.changes.id', number>
29
+ | RelationNumberRules<'branch.changes.remoteId', number | null>
30
+ | RelationStringRules<'branch.changes.type', string>
31
+ | RelationUUIDRules<'branch.changes.transactionId', UUID | null>
32
+ | RelationStringRules<'branch.changes.namespace', string>
33
+ | RelationStringRules<'branch.changes.entity', string>
34
+ | RelationUUIDRules<'branch.changes.entityId', UUID>
35
+ | RelationDateRules<'branch.changes.createdAt', Date>
36
+ | RelationDateRules<'branch.changes.updatedAt', Date>
37
+ | RelationDateRules<'branch.changes.revertChangedAt', Date | null>
38
+ | RelationNumberRules<'branch.changes.revertChangeId', number | null>
39
+ | RelationDateRules<'branch.changes.redoInvalidatedAt', Date | null>
40
+ | StringRules<RxDBChange, 'branchId'>
41
+ | RelationStringRules<'branch.children.id', string>
42
+ | RelationBooleanRules<'branch.children.activated', boolean>
43
+ | RelationNumberRules<'branch.children.fromChangeId', number | null>
44
+ | RelationBooleanRules<'branch.children.local', boolean>
45
+ | RelationBooleanRules<'branch.children.remote', boolean>
46
+ | RelationDateRules<'branch.children.createdAt', Date | null>
47
+ | RelationDateRules<'branch.children.updatedAt', Date | null>
48
+ | RelationStringRules<'branch.parent.id', string>
49
+ | RelationBooleanRules<'branch.parent.activated', boolean>
50
+ | RelationNumberRules<'branch.parent.fromChangeId', number | null>
51
+ | RelationBooleanRules<'branch.parent.local', boolean>
52
+ | RelationBooleanRules<'branch.parent.remote', boolean>
53
+ | RelationDateRules<'branch.parent.createdAt', Date | null>
54
+ | RelationDateRules<'branch.parent.updatedAt', Date | null>;
55
+
56
+ /**
57
+ * RuleGroupBase
58
+ */
59
+ export declare type RxDBSyncRuleGroup = RuleGroupBase<typeof RxDBSync,
60
+ |'id'
61
+ |'namespace'
62
+ |'entity'
63
+ |'syncType'
64
+ |'lastPushedChangeId'
65
+ |'lastPushedAt'
66
+ |'lastPulledAt'
67
+ |'lastPullRemoteChangeId'
68
+ |'enabled'
69
+ |'createdAt'
70
+ |'updatedAt'
71
+ |'branchId'
72
+ |'branch'
73
+ |'branch.id'
74
+ |'branch.activated'
75
+ |'branch.fromChangeId'
76
+ |'branch.local'
77
+ |'branch.remote'
78
+ |'branch.createdAt'
79
+ |'branch.updatedAt'
80
+ |'parentId'
81
+ |'branch.changes.id'
82
+ |'branch.changes.remoteId'
83
+ |'branch.changes.type'
84
+ |'branch.changes.transactionId'
85
+ |'branch.changes.namespace'
86
+ |'branch.changes.entity'
87
+ |'branch.changes.entityId'
88
+ |'branch.changes.createdAt'
89
+ |'branch.changes.updatedAt'
90
+ |'branch.changes.revertChangedAt'
91
+ |'branch.changes.revertChangeId'
92
+ |'branch.changes.redoInvalidatedAt'
93
+ |'branchId'
94
+ |'branch.children.id'
95
+ |'branch.children.activated'
96
+ |'branch.children.fromChangeId'
97
+ |'branch.children.local'
98
+ |'branch.children.remote'
99
+ |'branch.children.createdAt'
100
+ |'branch.children.updatedAt'
101
+ |'parentId'
102
+ |'branch.parent.id'
103
+ |'branch.parent.activated'
104
+ |'branch.parent.fromChangeId'
105
+ |'branch.parent.local'
106
+ |'branch.parent.remote'
107
+ |'branch.parent.createdAt'
108
+ |'branch.parent.updatedAt'
109
+ |'parentId',
110
+ RxDBSyncRule>;
111
+
112
+ /**
113
+ * OrderByField
114
+ */
115
+ declare type RxDBSyncOrderByField = "id" | "namespace" | "entity" | "syncType" | "lastPushedChangeId" | "lastPushedAt" | "lastPulledAt" | "lastPullRemoteChangeId" | "enabled" | "createdAt" | "updatedAt";
116
+
117
+ /**
118
+ * 静态类型
119
+ */
120
+ export interface RxDBSyncStaticTypes {
121
+ /**
122
+ * id 类型
123
+ */
124
+ idType: string;
125
+ /**
126
+ * 查询选项
127
+ */
128
+ getOptions: string;
129
+ /**
130
+ * 查询选项
131
+ */
132
+ findOneOrFailOptions: FindOneOrFailOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
133
+ /**
134
+ * 查询选项
135
+ */
136
+ findOptions: FindOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
137
+ /**
138
+ * 查询选项
139
+ */
140
+ findOneOptions: FindOneOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
141
+ /**
142
+ * 查询选项
143
+ */
144
+ findAllOptions: FindAllOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
145
+ /**
146
+ * 查询选项
147
+ */
148
+ findByCursorOptions: FindByCursorOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
149
+ /**
150
+ * 查询选项
151
+ */
152
+ countOptions: CountOptions<typeof RxDBSync,RxDBSyncRuleGroup>;
153
+ }
154
+
155
+ /**
156
+ * 初始化数据
157
+ */
158
+ export interface RxDBSyncInitData {
159
+ /**
160
+ * id
161
+ */
162
+ id?: string;
163
+ /**
164
+ * namespace
165
+ */
166
+ namespace?: string;
167
+ /**
168
+ * entity
169
+ */
170
+ entity?: string;
171
+ /**
172
+ * syncType
173
+ * @default 'none'
174
+ */
175
+ syncType?: string;
176
+ /**
177
+ * lastPushedChangeId
178
+ */
179
+ lastPushedChangeId?: number | null;
180
+ /**
181
+ * lastPushedAt
182
+ */
183
+ lastPushedAt?: Date | null;
184
+ /**
185
+ * lastPulledAt
186
+ */
187
+ lastPulledAt?: Date | null;
188
+ /**
189
+ * lastPullRemoteChangeId
190
+ */
191
+ lastPullRemoteChangeId?: number | null;
192
+ /**
193
+ * enabled
194
+ */
195
+ enabled?: boolean;
196
+ /**
197
+ * createdAt
198
+ * @default new Date()
199
+ */
200
+ createdAt?: Date | null;
201
+ /**
202
+ * updatedAt
203
+ * @default new Date()
204
+ */
205
+ updatedAt?: Date | null;
206
+ /**
207
+ * branch id
208
+ */
209
+ branchId?: string;
210
+ }
211
+
212
+ /**
213
+ * RxDBSync
214
+ */
215
+ export declare class RxDBSync {
216
+ static [ENTITY_STATIC_TYPES]: RxDBSyncStaticTypes;
217
+ /**
218
+ * branch
219
+ */
220
+ readonly branch$: RelationEntityObservable<typeof RxDBBranch>;
221
+ /**
222
+ * createdAt
223
+ * @default new Date()
224
+ */
225
+ readonly createdAt?: Date | null;
226
+ /**
227
+ * updatedAt
228
+ * @default new Date()
229
+ */
230
+ readonly updatedAt?: Date | null;
231
+ /**
232
+ * branch id
233
+ */
234
+ branchId: string;
235
+ /**
236
+ * enabled
237
+ */
238
+ enabled: boolean;
239
+ /**
240
+ * entity
241
+ */
242
+ entity: string;
243
+ /**
244
+ * id
245
+ */
246
+ id: string;
247
+ /**
248
+ * lastPulledAt
249
+ */
250
+ lastPulledAt?: Date | null;
251
+ /**
252
+ * lastPullRemoteChangeId
253
+ */
254
+ lastPullRemoteChangeId?: number | null;
255
+ /**
256
+ * lastPushedAt
257
+ */
258
+ lastPushedAt?: Date | null;
259
+ /**
260
+ * lastPushedChangeId
261
+ */
262
+ lastPushedChangeId?: number | null;
263
+ /**
264
+ * namespace
265
+ */
266
+ namespace: string;
267
+ /**
268
+ * syncType
269
+ * @default 'none'
270
+ */
271
+ syncType: string;
272
+ /**
273
+ * 初始化数据
274
+ * @param initData 初始化数据
275
+ */
276
+ constructor(initData?: RxDBSyncInitData);
277
+ /**
278
+ * 统计实体数量
279
+ * @param options 查询选项
280
+ * @example
281
+ * RxDBSync.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
282
+ */
283
+ static count(options: CountOptions<typeof RxDBSync,RxDBSyncRuleGroup>): Observable<number>;
284
+ /**
285
+ * 查询多个实体
286
+ * @param options 查询选项
287
+ * @example
288
+ * RxDBSync.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
289
+ */
290
+ static find(options: FindOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync[]>;
291
+ /**
292
+ * 查询所有实体
293
+ * @param options 查询选项
294
+ * @example
295
+ * RxDBSync.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
296
+ */
297
+ static findAll(options: FindAllOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync[]>;
298
+ /**
299
+ * 游标分页查询
300
+ * @param options 查询选项
301
+ * @example
302
+ * RxDBSync.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
303
+ */
304
+ static findByCursor(options: FindByCursorOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync[]>;
305
+ /**
306
+ * 查询单个实体,未找到时返回 undefined
307
+ * @param options 查询选项
308
+ * @example
309
+ * RxDBSync.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
310
+ */
311
+ static findOne(options: FindOneOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync | undefined>;
312
+ /**
313
+ * 查询单个实体,未找到时抛出错误
314
+ * @param options 查询选项
315
+ * @example
316
+ * RxDBSync.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
317
+ */
318
+ static findOneOrFail(options: FindOneOrFailOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync>;
319
+ /**
320
+ * 根据 ID 获取单个实体
321
+ * @param options 查询选项
322
+ * @example
323
+ * RxDBSync.get('123').subscribe(entity => console.log(entity));
324
+ */
325
+ static get(options: string): Observable<RxDBSync>;
326
+ /**
327
+ * 删除
328
+ */
329
+ remove(): Promise<RxDBSync>;
330
+ /**
331
+ * 重置数据
332
+ */
333
+ reset(): void;
334
+ /**
335
+ * 保存
336
+ */
337
+ save(): Promise<RxDBSync>;
338
+ }
339
+
@@ -0,0 +1,122 @@
1
+ import { Entity, PropertyType, RelationKind, __decorateClass } from '@aiao/rxdb';
2
+ let RxDBSync = class {};
3
+ RxDBSync = __decorateClass(
4
+ [
5
+ Entity({
6
+ name: "RxDBSync",
7
+ tableName: "rxdb_sync",
8
+ log: false,
9
+ properties: [
10
+ {
11
+ name: "id",
12
+ type: PropertyType.string,
13
+ primary: true,
14
+ columnName: "id"
15
+ },
16
+ {
17
+ name: "namespace",
18
+ type: PropertyType.string,
19
+ columnName: "namespace"
20
+ },
21
+ {
22
+ name: "entity",
23
+ type: PropertyType.string,
24
+ columnName: "entity"
25
+ },
26
+ {
27
+ name: "syncType",
28
+ columnName: "sync_type",
29
+ type: PropertyType.string,
30
+ default: "none"
31
+ },
32
+ {
33
+ name: "lastPushedChangeId",
34
+ columnName: "last_pushed_change_id",
35
+ type: PropertyType.integer,
36
+ nullable: true
37
+ },
38
+ {
39
+ name: "lastPushedAt",
40
+ columnName: "last_pushed_at",
41
+ type: PropertyType.date,
42
+ nullable: true
43
+ },
44
+ {
45
+ name: "lastPulledAt",
46
+ columnName: "last_pulled_at",
47
+ type: PropertyType.date,
48
+ nullable: true
49
+ },
50
+ {
51
+ name: "lastPullRemoteChangeId",
52
+ columnName: "last_pull_remote_change_id",
53
+ type: PropertyType.integer,
54
+ nullable: true
55
+ },
56
+ {
57
+ name: "enabled",
58
+ type: PropertyType.boolean,
59
+ default: true,
60
+ columnName: "enabled"
61
+ },
62
+ {
63
+ name: "createdAt",
64
+ columnName: "created_at",
65
+ type: PropertyType.date,
66
+ readonly: true,
67
+ nullable: true
68
+ },
69
+ {
70
+ name: "updatedAt",
71
+ columnName: "updated_at",
72
+ type: PropertyType.date,
73
+ readonly: true,
74
+ nullable: true
75
+ }
76
+ ],
77
+ indexes: [
78
+ {
79
+ name: "idx_repo_sync_branch",
80
+ properties: [
81
+ "branchId"
82
+ ]
83
+ },
84
+ {
85
+ name: "idx_repo_sync_entity",
86
+ properties: [
87
+ "namespace",
88
+ "entity",
89
+ "branchId"
90
+ ],
91
+ unique: true
92
+ },
93
+ {
94
+ name: "idx_repo_sync_type",
95
+ properties: [
96
+ "syncType",
97
+ "branchId"
98
+ ]
99
+ }
100
+ ],
101
+ relations: [
102
+ {
103
+ name: "branch",
104
+ kind: RelationKind.MANY_TO_ONE,
105
+ mappedEntity: "RxDBBranch",
106
+ mappedProperty: "syncs",
107
+ onDelete: "CASCADE",
108
+ mappedNamespace: "public",
109
+ onUpdate: "RESTRICT",
110
+ columnName: "branchId"
111
+ }
112
+ ],
113
+ repository: "Repository",
114
+ namespace: "public",
115
+ computedProperties: [],
116
+ extends: [],
117
+ displayName: "RxDBSync"
118
+ })
119
+ ],
120
+ RxDBSync
121
+ );
122
+ export { RxDBSync };