@aiao/rxdb-test 0.0.4 → 0.0.6

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.
@@ -1,4 +1,4 @@
1
- import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityType, FindAllOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, FindTreeOptions, FindTreeRootOptions, GetOptions, IEntityStaticType, ITreeEntity, NumberRules, RelationBooleanRules, RelationDateRules, RelationEntitiesObservable, RelationEntityObservable, RelationNumberRules, RelationStringRules, RelationUUIDRules, RuleGroupCustom, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
1
+ import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, FindTreeOptions, FindTreeRootOptions, IEntity, IEntityStaticType, ITreeEntity, NumberRules, RelationBooleanRules, RelationDateRules, RelationEntitiesObservable, RelationEntityObservable, RelationNumberRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
2
2
  import { Observable } from 'rxjs';
3
3
 
4
4
  /**
@@ -9,9 +9,9 @@ declare type RxDBMigrationRule = NumberRules<RxDBMigration, 'id'>
9
9
  | DateRules<RxDBMigration, 'executedAt'>;
10
10
 
11
11
  /**
12
- * RuleGroupCustom
12
+ * RuleGroupBase
13
13
  */
14
- export declare type RxDBMigrationRuleGroup = RuleGroupCustom<typeof RxDBMigration,
14
+ export declare type RxDBMigrationRuleGroup = RuleGroupBase<typeof RxDBMigration,
15
15
  |'id'
16
16
  |'name'
17
17
  |'executedAt',
@@ -37,7 +37,7 @@ declare type RxDBChangeRule = NumberRules<RxDBChange, 'id'>
37
37
  | NumberRules<RxDBChange, 'revertChangeId'>
38
38
  | UUIDRules<RxDBChange, 'parentId'>
39
39
  | UUIDRules<RxDBChange, 'branchId'>
40
- | RelationNumberRules<'children.id', any>
40
+ | RelationNumberRules<'children.id', number>
41
41
  | RelationStringRules<'children.type', string>
42
42
  | RelationUUIDRules<'children.transactionId', UUID | null>
43
43
  | RelationStringRules<'children.namespace', string | null>
@@ -46,8 +46,8 @@ declare type RxDBChangeRule = NumberRules<RxDBChange, 'id'>
46
46
  | RelationDateRules<'children.createdAt', Date | null>
47
47
  | RelationDateRules<'children.updatedAt', Date | null>
48
48
  | RelationDateRules<'children.revertChangedAt', Date | null>
49
- | RelationNumberRules<'children.revertChangeId', any | null>
50
- | RelationNumberRules<'parent.id', any>
49
+ | RelationNumberRules<'children.revertChangeId', number | null>
50
+ | RelationNumberRules<'parent.id', number>
51
51
  | RelationStringRules<'parent.type', string>
52
52
  | RelationUUIDRules<'parent.transactionId', UUID | null>
53
53
  | RelationStringRules<'parent.namespace', string | null>
@@ -56,16 +56,16 @@ declare type RxDBChangeRule = NumberRules<RxDBChange, 'id'>
56
56
  | RelationDateRules<'parent.createdAt', Date | null>
57
57
  | RelationDateRules<'parent.updatedAt', Date | null>
58
58
  | RelationDateRules<'parent.revertChangedAt', Date | null>
59
- | RelationNumberRules<'parent.revertChangeId', any | null>
59
+ | RelationNumberRules<'parent.revertChangeId', number | null>
60
60
  | RelationStringRules<'branch.id', string>
61
61
  | RelationBooleanRules<'branch.activated', boolean>
62
62
  | RelationBooleanRules<'branch.local', boolean>
63
63
  | RelationBooleanRules<'branch.remote', boolean>;
64
64
 
65
65
  /**
66
- * RuleGroupCustom
66
+ * RuleGroupBase
67
67
  */
68
- export declare type RxDBChangeRuleGroup = RuleGroupCustom<typeof RxDBChange,
68
+ export declare type RxDBChangeRuleGroup = RuleGroupBase<typeof RxDBChange,
69
69
  |'id'
70
70
  |'type'
71
71
  |'transactionId'
@@ -124,12 +124,12 @@ declare type RxDBChangeTreeRule = RelationStringRules<'children.type', string>
124
124
  | RelationDateRules<'children.createdAt', Date | null>
125
125
  | RelationDateRules<'children.updatedAt', Date | null>
126
126
  | RelationDateRules<'children.revertChangedAt', Date | null>
127
- | RelationNumberRules<'children.revertChangeId', any | null>;
127
+ | RelationNumberRules<'children.revertChangeId', number | null>;
128
128
 
129
129
  /**
130
130
  * TreeRuleGroup
131
131
  */
132
- export declare type RxDBChangeTreeRuleGroup = RuleGroupCustom<typeof RxDBChange, 'children.type' | 'children.transactionId' | 'children.namespace' | 'children.entity' | 'children.entityId' | 'children.createdAt' | 'children.updatedAt' | 'children.revertChangedAt' | 'children.revertChangeId', RxDBChangeTreeRule>;
132
+ export declare type RxDBChangeTreeRuleGroup = RuleGroupBase<typeof RxDBChange, 'children.type' | 'children.transactionId' | 'children.namespace' | 'children.entity' | 'children.entityId' | 'children.createdAt' | 'children.updatedAt' | 'children.revertChangedAt' | 'children.revertChangeId', RxDBChangeTreeRule>;
133
133
 
134
134
  /**
135
135
  * rule
@@ -138,7 +138,7 @@ declare type RxDBBranchRule = StringRules<RxDBBranch, 'id'>
138
138
  | BooleanRules<RxDBBranch, 'activated'>
139
139
  | BooleanRules<RxDBBranch, 'local'>
140
140
  | BooleanRules<RxDBBranch, 'remote'>
141
- | RelationNumberRules<'changes.id', any>
141
+ | RelationNumberRules<'changes.id', number>
142
142
  | RelationStringRules<'changes.type', string>
143
143
  | RelationUUIDRules<'changes.transactionId', UUID | null>
144
144
  | RelationStringRules<'changes.namespace', string | null>
@@ -147,10 +147,10 @@ declare type RxDBBranchRule = StringRules<RxDBBranch, 'id'>
147
147
  | RelationDateRules<'changes.createdAt', Date | null>
148
148
  | RelationDateRules<'changes.updatedAt', Date | null>
149
149
  | RelationDateRules<'changes.revertChangedAt', Date | null>
150
- | RelationNumberRules<'changes.revertChangeId', any | null>
150
+ | RelationNumberRules<'changes.revertChangeId', number | null>
151
151
  | UUIDRules<RxDBChange, 'parentId'>
152
152
  | UUIDRules<RxDBChange, 'branchId'>
153
- | RelationNumberRules<'changes.children.id', any>
153
+ | RelationNumberRules<'changes.children.id', number>
154
154
  | RelationStringRules<'changes.children.type', string>
155
155
  | RelationUUIDRules<'changes.children.transactionId', UUID | null>
156
156
  | RelationStringRules<'changes.children.namespace', string | null>
@@ -159,8 +159,8 @@ declare type RxDBBranchRule = StringRules<RxDBBranch, 'id'>
159
159
  | RelationDateRules<'changes.children.createdAt', Date | null>
160
160
  | RelationDateRules<'changes.children.updatedAt', Date | null>
161
161
  | RelationDateRules<'changes.children.revertChangedAt', Date | null>
162
- | RelationNumberRules<'changes.children.revertChangeId', any | null>
163
- | RelationNumberRules<'changes.parent.id', any>
162
+ | RelationNumberRules<'changes.children.revertChangeId', number | null>
163
+ | RelationNumberRules<'changes.parent.id', number>
164
164
  | RelationStringRules<'changes.parent.type', string>
165
165
  | RelationUUIDRules<'changes.parent.transactionId', UUID | null>
166
166
  | RelationStringRules<'changes.parent.namespace', string | null>
@@ -169,12 +169,12 @@ declare type RxDBBranchRule = StringRules<RxDBBranch, 'id'>
169
169
  | RelationDateRules<'changes.parent.createdAt', Date | null>
170
170
  | RelationDateRules<'changes.parent.updatedAt', Date | null>
171
171
  | RelationDateRules<'changes.parent.revertChangedAt', Date | null>
172
- | RelationNumberRules<'changes.parent.revertChangeId', any | null>;
172
+ | RelationNumberRules<'changes.parent.revertChangeId', number | null>;
173
173
 
174
174
  /**
175
- * RuleGroupCustom
175
+ * RuleGroupBase
176
176
  */
177
- export declare type RxDBBranchRuleGroup = RuleGroupCustom<typeof RxDBBranch,
177
+ export declare type RxDBBranchRuleGroup = RuleGroupBase<typeof RxDBBranch,
178
178
  |'id'
179
179
  |'activated'
180
180
  |'local'
@@ -273,6 +273,10 @@ export interface RxDBMigrationStaticTypes {
273
273
  * 查询选项
274
274
  */
275
275
  findAllOptions: FindAllOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
276
+ /**
277
+ * 查询选项
278
+ */
279
+ findByCursorOptions: FindByCursorOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
276
280
  /**
277
281
  * 查询选项
278
282
  */
@@ -286,7 +290,7 @@ export interface RxDBMigrationInitData {
286
290
  /**
287
291
  * id
288
292
  */
289
- id?: any;
293
+ id?: number;
290
294
  /**
291
295
  * name
292
296
  */
@@ -329,19 +333,15 @@ export interface RxDBChangeStaticTypes {
329
333
  /**
330
334
  * 查询选项
331
335
  */
332
- countOptions: CountOptions<typeof RxDBChange,RxDBChangeRuleGroup>;
333
- /**
334
- * 查询的实体
335
- */
336
- entity: RxDBChange;
336
+ findByCursorOptions: FindByCursorOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>;
337
337
  /**
338
338
  * 查询选项
339
339
  */
340
- findRootOptions: FindTreeRootOptions<typeof RxDBChange,RxDBChangeTreeRuleGroup>;
340
+ countOptions: CountOptions<typeof RxDBChange,RxDBChangeRuleGroup>;
341
341
  /**
342
- * 查询选项
342
+ * 查询的实体
343
343
  */
344
- countRootOptions: FindTreeRootOptions<typeof RxDBChange,RxDBChangeTreeRuleGroup>;
344
+ entity: RxDBChange;
345
345
  /**
346
346
  * 查询选项
347
347
  */
@@ -367,7 +367,7 @@ export interface RxDBChangeInitData {
367
367
  /**
368
368
  * id
369
369
  */
370
- id?: any;
370
+ id?: number;
371
371
  /**
372
372
  * type
373
373
  */
@@ -391,11 +391,11 @@ export interface RxDBChangeInitData {
391
391
  /**
392
392
  * inversePatch
393
393
  */
394
- inversePatch?: any | null;
394
+ inversePatch?: Record<string, any> | null;
395
395
  /**
396
396
  * patch
397
397
  */
398
- patch?: any | null;
398
+ patch?: Record<string, any> | null;
399
399
  /**
400
400
  * createdAt
401
401
  * @default new Date()
@@ -413,7 +413,7 @@ export interface RxDBChangeInitData {
413
413
  /**
414
414
  * revertChangeId
415
415
  */
416
- revertChangeId?: any | null;
416
+ revertChangeId?: number | null;
417
417
  }
418
418
 
419
419
  /**
@@ -444,6 +444,10 @@ export interface RxDBBranchStaticTypes {
444
444
  * 查询选项
445
445
  */
446
446
  findAllOptions: FindAllOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
447
+ /**
448
+ * 查询选项
449
+ */
450
+ findByCursorOptions: FindByCursorOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
447
451
  /**
448
452
  * 查询选项
449
453
  */
@@ -476,6 +480,7 @@ export interface RxDBBranchInitData {
476
480
  * RxDBMigration
477
481
  */
478
482
  export declare class RxDBMigration implements IEntityStaticType {
483
+ static [ENTITY_STATIC_TYPES]: RxDBMigrationStaticTypes;
479
484
  /**
480
485
  * executedAt
481
486
  * @default new Date()
@@ -485,11 +490,10 @@ export declare class RxDBMigration implements IEntityStaticType {
485
490
  * name
486
491
  */
487
492
  name: string;
488
- [ENTITY_STATIC_TYPES]: RxDBMigrationStaticTypes;
489
493
  /**
490
494
  * id
491
495
  */
492
- id: any;
496
+ id: number;
493
497
  /**
494
498
  * 初始化数据
495
499
  * @param initData 初始化数据
@@ -510,6 +514,11 @@ export declare class RxDBMigration implements IEntityStaticType {
510
514
  * @param options 查询选项
511
515
  */
512
516
  static findAll(options: FindAllOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration[]>;
517
+ /**
518
+ * findByCursor 查询
519
+ * @param options 查询选项
520
+ */
521
+ static findByCursor(options: FindByCursorOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration[]>;
513
522
  /**
514
523
  * findOne 查询
515
524
  * @param options 查询选项
@@ -543,6 +552,7 @@ export declare class RxDBMigration implements IEntityStaticType {
543
552
  * RxDBChange
544
553
  */
545
554
  export declare class RxDBChange implements IEntityStaticType {
555
+ static [ENTITY_STATIC_TYPES]: RxDBChangeStaticTypes;
546
556
  /**
547
557
  * branch
548
558
  */
@@ -571,7 +581,7 @@ export declare class RxDBChange implements IEntityStaticType {
571
581
  /**
572
582
  * inversePatch
573
583
  */
574
- inversePatch?: any | null;
584
+ inversePatch?: Record<string, any> | null;
575
585
  /**
576
586
  * namespace
577
587
  */
@@ -587,7 +597,7 @@ export declare class RxDBChange implements IEntityStaticType {
587
597
  /**
588
598
  * patch
589
599
  */
590
- patch?: any | null;
600
+ patch?: Record<string, any> | null;
591
601
  /**
592
602
  * type
593
603
  */
@@ -597,11 +607,10 @@ export declare class RxDBChange implements IEntityStaticType {
597
607
  * @default new Date()
598
608
  */
599
609
  updatedAt?: Date | null;
600
- [ENTITY_STATIC_TYPES]: RxDBChangeStaticTypes;
601
610
  /**
602
611
  * id
603
612
  */
604
- id: any;
613
+ id: number;
605
614
  /**
606
615
  * revertChangedAt
607
616
  */
@@ -609,7 +618,7 @@ export declare class RxDBChange implements IEntityStaticType {
609
618
  /**
610
619
  * revertChangeId
611
620
  */
612
- revertChangeId?: any | null;
621
+ revertChangeId?: number | null;
613
622
  /**
614
623
  * transactionId
615
624
  */
@@ -634,11 +643,6 @@ export declare class RxDBChange implements IEntityStaticType {
634
643
  * @param options 查询选项
635
644
  */
636
645
  static countDescendants(options?: FindTreeOptions<typeof RxDBChange,RxDBChangeTreeRuleGroup>): Observable<number>;
637
- /**
638
- * 查询子孙实体数量
639
- * @param options 查询选项
640
- */
641
- static countRoot(options?: FindTreeRootOptions<typeof RxDBChange,RxDBChangeTreeRuleGroup>): Observable<number>;
642
646
  /**
643
647
  * find 查询
644
648
  * @param options 查询选项
@@ -654,6 +658,11 @@ export declare class RxDBChange implements IEntityStaticType {
654
658
  * @param options 查询选项
655
659
  */
656
660
  static findAncestors(options?: FindTreeOptions<typeof RxDBChange,RxDBChangeTreeRuleGroup>): Observable<RxDBChange[]>;
661
+ /**
662
+ * findByCursor 查询
663
+ * @param options 查询选项
664
+ */
665
+ static findByCursor(options: FindByCursorOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange[]>;
657
666
  /**
658
667
  * 查询子孙实体
659
668
  * @param options 查询选项
@@ -669,11 +678,6 @@ export declare class RxDBChange implements IEntityStaticType {
669
678
  * @param options 查询选项
670
679
  */
671
680
  static findOneOrFail(options: FindOneOrFailOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange>;
672
- /**
673
- * 查询子孙实体
674
- * @param options 查询选项
675
- */
676
- static findRoot(options?: FindTreeRootOptions<typeof RxDBChange,RxDBChangeTreeRuleGroup>): Observable<RxDBChange[]>;
677
681
  /**
678
682
  * get 查询
679
683
  * @param options 查询选项
@@ -697,11 +701,11 @@ export declare class RxDBChange implements IEntityStaticType {
697
701
  * RxDBBranch
698
702
  */
699
703
  export declare class RxDBBranch implements IEntityStaticType {
704
+ static [ENTITY_STATIC_TYPES]: RxDBBranchStaticTypes;
700
705
  /**
701
706
  * changes
702
707
  */
703
708
  changes$: RelationEntitiesObservable<RxDBChange>;
704
- [ENTITY_STATIC_TYPES]: RxDBBranchStaticTypes;
705
709
  /**
706
710
  * activated
707
711
  */
@@ -738,6 +742,11 @@ export declare class RxDBBranch implements IEntityStaticType {
738
742
  * @param options 查询选项
739
743
  */
740
744
  static findAll(options: FindAllOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch[]>;
745
+ /**
746
+ * findByCursor 查询
747
+ * @param options 查询选项
748
+ */
749
+ static findByCursor(options: FindByCursorOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch[]>;
741
750
  /**
742
751
  * findOne 查询
743
752
  * @param options 查询选项
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiao/rxdb-test",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -32,9 +32,9 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "@aiao/rxdb": "0.0.4"
35
+ "@aiao/rxdb": "0.0.6"
36
36
  },
37
37
  "devDependencies": {
38
- "@aiao/rxdb-client-generator": "0.0.4"
38
+ "@aiao/rxdb-client-generator": "0.0.6"
39
39
  }
40
40
  }