@squidcloud/client 1.0.84 → 1.0.86
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/cjs/index.js +5 -5
- package/dist/common/src/index.d.ts +0 -1
- package/dist/common/src/query/base-query-builder.d.ts +64 -0
- package/dist/common/src/query/query-context.d.ts +34 -6
- package/dist/common/src/query.types.d.ts +22 -34
- package/dist/common/src/types.d.ts +8 -2
- package/dist/esm/index.js +5 -5
- package/dist/typescript-client/src/document-reference.d.ts +3 -3
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +16 -1
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +2 -2
- package/package.json +1 -1
- package/dist/common/src/query.schemas.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentData, Paths } from '@squidcloud/common';
|
|
1
|
+
import { DeepRecord, DocumentData, Paths } from '@squidcloud/common';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { TransactionId } from './types';
|
|
4
4
|
/**
|
|
@@ -69,7 +69,7 @@ export declare class DocumentReference<T extends DocumentData = any> {
|
|
|
69
69
|
* @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
|
|
70
70
|
* immediately.
|
|
71
71
|
*/
|
|
72
|
-
update(data: Partial<
|
|
72
|
+
update(data: Partial<DeepRecord<T>>, transactionId?: TransactionId): Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* Similar to {@link update}, but only updates the given path.
|
|
75
75
|
* @param path The path to update.
|
|
@@ -77,7 +77,7 @@ export declare class DocumentReference<T extends DocumentData = any> {
|
|
|
77
77
|
* @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
|
|
78
78
|
* immediately.
|
|
79
79
|
*/
|
|
80
|
-
setInPath
|
|
80
|
+
setInPath<K extends Paths<T>>(path: K, value: DeepRecord<T>[K], transactionId?: TransactionId): Promise<void>;
|
|
81
81
|
/**
|
|
82
82
|
* Similar to `update`, but only deletes the given path.
|
|
83
83
|
* @param path The path to delete.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseQueryBuilder, DocumentData, FieldName, HasDereference, Operator, PrimitiveFieldType, SnapshotEmitter } from '@squidcloud/common';
|
|
1
|
+
import { BaseQueryBuilder, DocumentData, FieldName, HasDereference, Operator, Pagination, PaginationOptions, PrimitiveFieldType, SnapshotEmitter } from '@squidcloud/common';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { DocumentReference } from '../document-reference';
|
|
4
4
|
import { QueryBuilder } from './query-builder.factory';
|
|
@@ -96,6 +96,7 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
|
|
|
96
96
|
grouped(): GroupedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
|
|
97
97
|
/** @inheritDoc */
|
|
98
98
|
dereference(): DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
|
|
99
|
+
paginate(options?: Partial<PaginationOptions>): Pagination<WithDocumentReferences<ReturnType>>;
|
|
99
100
|
}
|
|
100
101
|
declare class DereferencedJoin<Aliases extends Record<Alias, Alias[]>, ReturnType extends Record<Alias, DocumentData>, RootAlias extends Alias, LatestAlias extends Alias> implements SnapshotEmitter<ReturnType>, HasGrouped {
|
|
101
102
|
private readonly joinQueryBuilder;
|
|
@@ -106,5 +107,19 @@ declare class DereferencedJoin<Aliases extends Record<Alias, Alias[]>, ReturnTyp
|
|
|
106
107
|
snapshot(): Promise<Array<ReturnType>>;
|
|
107
108
|
/** @inheritDoc */
|
|
108
109
|
snapshots(subscribe?: boolean): Observable<Array<ReturnType>>;
|
|
110
|
+
paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
|
|
111
|
+
}
|
|
112
|
+
declare class GroupedJoin<Aliases extends Record<Alias, Alias[]>, ReturnType extends Record<Alias, DocumentData>, RootAlias extends Alias, LatestAlias extends Alias> implements SnapshotEmitter<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>, HasDereference {
|
|
113
|
+
readonly joinQueryBuilder: JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
|
|
114
|
+
/** internal */
|
|
115
|
+
constructor(joinQueryBuilder: JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>);
|
|
116
|
+
/** @inheritDoc */
|
|
117
|
+
snapshot(): Promise<Array<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>>;
|
|
118
|
+
/** @inheritDoc */
|
|
119
|
+
snapshots(subscribe?: boolean): Observable<Array<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>>;
|
|
120
|
+
/** @inheritDoc */
|
|
121
|
+
dereference(): SnapshotEmitter<Grouped<Aliases, ReturnType, RootAlias>>;
|
|
122
|
+
private groupData;
|
|
123
|
+
paginate(options?: Partial<PaginationOptions>): Pagination<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>;
|
|
109
124
|
}
|
|
110
125
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseQueryBuilder, DocumentData, FieldName, FieldSort, HasDereference, Operator,
|
|
1
|
+
import { BaseQueryBuilder, DocumentData, FieldName, FieldSort, HasDereference, Operator, Pagination, PaginationOptions, PrimitiveFieldType, SnapshotEmitter } from '@squidcloud/common';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { DocumentReference } from '../document-reference';
|
|
4
4
|
/** A query builder that can be used to build a query that returns a list of documents. */
|
|
@@ -10,7 +10,6 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
|
|
|
10
10
|
private readonly queryBuilderFactory;
|
|
11
11
|
private readonly documentIdentityService;
|
|
12
12
|
private forceFetchFromServer;
|
|
13
|
-
protected readonly query: Query<DocumentType>;
|
|
14
13
|
/** @inheritDoc */
|
|
15
14
|
where(fieldName: (keyof DocumentType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
16
15
|
/** @inheritDoc */
|
|
@@ -45,6 +44,7 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
|
|
|
45
44
|
get hash(): string;
|
|
46
45
|
/** @inheritDoc */
|
|
47
46
|
dereference(): SnapshotEmitter<DocumentType>;
|
|
47
|
+
paginate(options?: Partial<PaginationOptions>): Pagination<DocumentReference<DocumentType>>;
|
|
48
48
|
}
|
|
49
49
|
/** Describes the changes to a query result. */
|
|
50
50
|
export declare class Changes<DocumentType extends DocumentData> {
|
package/package.json
CHANGED