cozy-client 38.0.0 → 38.0.2
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/CozyClient.js +44 -46
- package/dist/RealTimeQueries.js +6 -8
- package/dist/StackLink.js +4 -6
- package/dist/associations/Association.js +2 -4
- package/dist/associations/HasMany.js +6 -8
- package/dist/associations/HasManyFiles.js +5 -7
- package/dist/associations/HasManyInPlace.js +2 -4
- package/dist/associations/HasOne.js +5 -7
- package/dist/associations/HasOneInPlace.js +2 -4
- package/dist/associations/helpers.js +10 -12
- package/dist/authentication/mobile.js +1 -3
- package/dist/devtools/Queries.js +4 -6
- package/dist/errors.js +4 -6
- package/dist/flagship-certification/flagship-certification.js +2 -4
- package/dist/flagship-certification/store-attestation.android.js +2 -4
- package/dist/flagship-certification/store-attestation.ios.js +2 -4
- package/dist/flagship-certification/store-attestation.js +2 -4
- package/dist/helpers/urlHelper.js +3 -5
- package/dist/hooks/useAppsInMaintenance.js +1 -3
- package/dist/hooks/useCapabilities.js +1 -1
- package/dist/hooks/useClientErrors.js +3 -5
- package/dist/hooks/useQuery.js +2 -4
- package/dist/hooks/useQueryAll.js +2 -4
- package/dist/models/dacc.js +5 -7
- package/dist/models/document/documentTypeData.js +12 -14
- package/dist/models/document/documentTypeDataHelpers.js +4 -6
- package/dist/models/file.js +23 -25
- package/dist/models/folder.js +5 -7
- package/dist/models/timeseries.js +1 -3
- package/dist/queries/dsl.js +6 -8
- package/dist/store/documents.js +1 -3
- package/dist/store/queries.js +28 -30
- package/package.json +3 -3
- package/types/CozyClient.d.ts +75 -92
- package/types/RealTimeQueries.d.ts +1 -2
- package/types/StackLink.d.ts +4 -7
- package/types/associations/Association.d.ts +3 -4
- package/types/associations/HasMany.d.ts +6 -7
- package/types/associations/HasOne.d.ts +5 -6
- package/types/associations/helpers.d.ts +4 -7
- package/types/errors.d.ts +9 -11
- package/types/flagship-certification/flagship-certification.d.ts +1 -2
- package/types/flagship-certification/store-attestation.android.d.ts +1 -3
- package/types/flagship-certification/store-attestation.d.ts +3 -5
- package/types/flagship-certification/store-attestation.ios.d.ts +1 -3
- package/types/helpers/urlHelper.d.ts +2 -5
- package/types/hooks/useAppsInMaintenance.d.ts +2 -3
- package/types/hooks/useQuery.d.ts +3 -5
- package/types/hooks/useQueryAll.d.ts +3 -5
- package/types/models/dacc.d.ts +4 -7
- package/types/models/document/documentTypeData.d.ts +2 -3
- package/types/models/document/documentTypeDataHelpers.d.ts +1 -3
- package/types/models/file.d.ts +22 -24
- package/types/models/folder.d.ts +3 -5
- package/types/queries/dsl.d.ts +13 -16
- package/types/store/documents.d.ts +1 -2
- package/types/store/queries.d.ts +11 -16
|
@@ -7,8 +7,8 @@ export function generateWebLink({ cozyUrl, searchParams: searchParamsOption, pat
|
|
|
7
7
|
slug: string;
|
|
8
8
|
subDomainType: string;
|
|
9
9
|
}): string;
|
|
10
|
-
export function deconstructCozyWebLinkWithSlug(webLink: string, subDomainType?: SubdomainType): CozyLinkData;
|
|
11
|
-
export function deconstructRedirectLink(redirectLink: string): RedirectLinkData;
|
|
10
|
+
export function deconstructCozyWebLinkWithSlug(webLink: string, subDomainType?: import("../types").SubdomainType): import("../types").CozyLinkData;
|
|
11
|
+
export function deconstructRedirectLink(redirectLink: string): import("../types").RedirectLinkData;
|
|
12
12
|
export class InvalidRedirectLinkError extends Error {
|
|
13
13
|
constructor(redirectLink: any);
|
|
14
14
|
redirectLink: any;
|
|
@@ -22,6 +22,3 @@ export class InvalidCozyUrlError extends Error {
|
|
|
22
22
|
url: any;
|
|
23
23
|
}
|
|
24
24
|
export function rootCozyUrl(url: URL): Promise<URL>;
|
|
25
|
-
import { SubdomainType } from "../types";
|
|
26
|
-
import { CozyLinkData } from "../types";
|
|
27
|
-
import { RedirectLinkData } from "../types";
|
|
@@ -4,8 +4,7 @@ export default useAppsInMaintenance;
|
|
|
4
4
|
*
|
|
5
5
|
* @param {CozyClient} client CozyClient instance
|
|
6
6
|
*
|
|
7
|
-
* @returns {AppsDoctype[]} An array with all apps in maintenance
|
|
7
|
+
* @returns {import("../types").AppsDoctype[]} An array with all apps in maintenance
|
|
8
8
|
*/
|
|
9
|
-
declare function useAppsInMaintenance(client: CozyClient): AppsDoctype[];
|
|
9
|
+
declare function useAppsInMaintenance(client: CozyClient): import("../types").AppsDoctype[];
|
|
10
10
|
import CozyClient from "../CozyClient";
|
|
11
|
-
import { AppsDoctype } from "../types";
|
|
@@ -4,10 +4,8 @@ export default useQuery;
|
|
|
4
4
|
* Fetches a queryDefinition and returns the queryState
|
|
5
5
|
*
|
|
6
6
|
* @param {QueryDefinition} queryDefinition - Definition created with Q()
|
|
7
|
-
* @param {QueryOptions} options - Options created with Q()
|
|
8
|
-
* @returns {UseQueryReturnValue}
|
|
7
|
+
* @param {import("../types").QueryOptions} options - Options created with Q()
|
|
8
|
+
* @returns {import("../types").UseQueryReturnValue}
|
|
9
9
|
*/
|
|
10
|
-
declare function useQuery(queryDefinition: QueryDefinition, options: QueryOptions): UseQueryReturnValue;
|
|
10
|
+
declare function useQuery(queryDefinition: QueryDefinition, options: import("../types").QueryOptions): import("../types").UseQueryReturnValue;
|
|
11
11
|
import { QueryDefinition } from "../queries/dsl";
|
|
12
|
-
import { QueryOptions } from "../types";
|
|
13
|
-
import { UseQueryReturnValue } from "../types";
|
|
@@ -3,10 +3,8 @@ export default useQueryAll;
|
|
|
3
3
|
* Fetches a queryDefinition and run fetchMore on the query until the query is fully loaded
|
|
4
4
|
*
|
|
5
5
|
* @param {QueryDefinition} queryDefinition - Definition created with Q()
|
|
6
|
-
* @param {QueryOptions} options - Options created with Q()
|
|
7
|
-
* @returns {UseQueryReturnValue}
|
|
6
|
+
* @param {import("../types").QueryOptions} options - Options created with Q()
|
|
7
|
+
* @returns {import("../types").UseQueryReturnValue}
|
|
8
8
|
*/
|
|
9
|
-
declare function useQueryAll(queryDefinition: QueryDefinition, options: QueryOptions): UseQueryReturnValue;
|
|
9
|
+
declare function useQueryAll(queryDefinition: QueryDefinition, options: import("../types").QueryOptions): import("../types").UseQueryReturnValue;
|
|
10
10
|
import { QueryDefinition } from "../queries/dsl";
|
|
11
|
-
import { QueryOptions } from "../types";
|
|
12
|
-
import { UseQueryReturnValue } from "../types";
|
package/types/models/dacc.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export function isCorrectDateFormat(date: string): boolean;
|
|
2
|
-
export function checkMeasureParams(measure: DACCMeasure): void;
|
|
3
|
-
export function sendMeasureToDACC(client: CozyClient, remoteDoctype: string, measure: DACCMeasure): Promise<void>;
|
|
4
|
-
export function buildAggregateParams(params: Params): DACCAggregatesParams;
|
|
5
|
-
export function fetchAggregatesFromDACC(client: CozyClient, remoteDoctype: string, params: DACCAggregatesParams): Promise<DACCAggregatesResponse>;
|
|
2
|
+
export function checkMeasureParams(measure: import("../types").DACCMeasure): void;
|
|
3
|
+
export function sendMeasureToDACC(client: CozyClient, remoteDoctype: string, measure: import("../types").DACCMeasure): Promise<void>;
|
|
4
|
+
export function buildAggregateParams(params: Params): import("../types").DACCAggregatesParams;
|
|
5
|
+
export function fetchAggregatesFromDACC(client: CozyClient, remoteDoctype: string, params: import("../types").DACCAggregatesParams): Promise<import("../types").DACCAggregatesResponse>;
|
|
6
6
|
/**
|
|
7
7
|
* - The unformatted DACC aggregate params
|
|
8
8
|
*/
|
|
@@ -20,7 +20,4 @@ export type Params = {
|
|
|
20
20
|
*/
|
|
21
21
|
endDate?: string;
|
|
22
22
|
};
|
|
23
|
-
import { DACCMeasure } from "../types";
|
|
24
23
|
import CozyClient from "../CozyClient";
|
|
25
|
-
import { DACCAggregatesParams } from "../types";
|
|
26
|
-
import { DACCAggregatesResponse } from "../types";
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export function getThemeByItem(item: QualificationAttributes): Theme | undefined;
|
|
2
|
-
import { QualificationAttributes } from "../../types";
|
|
3
|
-
import { Theme } from "../../types";
|
|
1
|
+
export function getThemeByItem(item: import("../../types").QualificationAttributes): import("../../types").Theme | undefined;
|
package/types/models/file.d.ts
CHANGED
|
@@ -25,25 +25,25 @@ export function ensureFilePath(file: object, parent: object): object;
|
|
|
25
25
|
*/
|
|
26
26
|
export function getParentFolderId(file: object): string | null;
|
|
27
27
|
export const ALBUMS_DOCTYPE: "io.cozy.photos.albums";
|
|
28
|
-
export function splitFilename(file: IOCozyFile): object;
|
|
29
|
-
export function isFile(file: IOCozyFile): boolean;
|
|
30
|
-
export function isDirectory(file: IOCozyFile): boolean;
|
|
31
|
-
export function isNote(file: IOCozyFile): boolean;
|
|
32
|
-
export function isEncrypted(file: IOCozyFile): boolean;
|
|
33
|
-
export function isOnlyOfficeFile(file: IOCozyFile): boolean;
|
|
34
|
-
export function shouldBeOpenedByOnlyOffice(file: IOCozyFile): boolean;
|
|
35
|
-
export function isShortcut(file: IOCozyFile): boolean;
|
|
36
|
-
export function getSharingShortcutStatus(file: IOCozyFile): string;
|
|
37
|
-
export function getSharingShortcutTargetMime(file: IOCozyFile): string;
|
|
38
|
-
export function getSharingShortcutTargetDoctype(file: IOCozyFile): string;
|
|
39
|
-
export function isSharingShortcut(file: IOCozyFile): boolean;
|
|
40
|
-
export function isSharingShorcut(file: IOCozyFile): boolean;
|
|
41
|
-
export function isSharingShortcutNew(file: IOCozyFile): boolean;
|
|
28
|
+
export function splitFilename(file: import("../types").IOCozyFile): object;
|
|
29
|
+
export function isFile(file: import("../types").IOCozyFile): boolean;
|
|
30
|
+
export function isDirectory(file: import("../types").IOCozyFile): boolean;
|
|
31
|
+
export function isNote(file: import("../types").IOCozyFile): boolean;
|
|
32
|
+
export function isEncrypted(file: import("../types").IOCozyFile): boolean;
|
|
33
|
+
export function isOnlyOfficeFile(file: import("../types").IOCozyFile): boolean;
|
|
34
|
+
export function shouldBeOpenedByOnlyOffice(file: import("../types").IOCozyFile): boolean;
|
|
35
|
+
export function isShortcut(file: import("../types").IOCozyFile): boolean;
|
|
36
|
+
export function getSharingShortcutStatus(file: import("../types").IOCozyFile): string;
|
|
37
|
+
export function getSharingShortcutTargetMime(file: import("../types").IOCozyFile): string;
|
|
38
|
+
export function getSharingShortcutTargetDoctype(file: import("../types").IOCozyFile): string;
|
|
39
|
+
export function isSharingShortcut(file: import("../types").IOCozyFile): boolean;
|
|
40
|
+
export function isSharingShorcut(file: import("../types").IOCozyFile): boolean;
|
|
41
|
+
export function isSharingShortcutNew(file: import("../types").IOCozyFile): boolean;
|
|
42
42
|
export function isSharingShorcutNew(file: object): boolean;
|
|
43
|
-
export function saveFileQualification(client: CozyClient, file: IOCozyFile, qualification: object): Promise<IOCozyFile>;
|
|
44
|
-
export function fetchFilesByQualificationRules(client: object, docRules: object): Promise<QueryResult>;
|
|
43
|
+
export function saveFileQualification(client: CozyClient, file: import("../types").IOCozyFile, qualification: object): Promise<import("../types").IOCozyFile>;
|
|
44
|
+
export function fetchFilesByQualificationRules(client: object, docRules: object): Promise<import("../types").QueryResult>;
|
|
45
45
|
export function hasMetadataAttribute({ file, attribute }: {
|
|
46
|
-
file: IOCozyFile;
|
|
46
|
+
file: import("../types").IOCozyFile;
|
|
47
47
|
attribute: string;
|
|
48
48
|
}): boolean;
|
|
49
49
|
export function getFullpath(client: CozyClient, dirId: string, name: string): Promise<string>;
|
|
@@ -51,16 +51,16 @@ export function move(client: CozyClient, fileId: string, destination: {
|
|
|
51
51
|
folderId: string;
|
|
52
52
|
path: string;
|
|
53
53
|
}, force?: boolean): Promise<any>;
|
|
54
|
-
export function overrideFileForPath(client: CozyClient, dirPath: string, file: object, metadata: object): Promise<IOCozyFile>;
|
|
54
|
+
export function overrideFileForPath(client: CozyClient, dirPath: string, file: object, metadata: object): Promise<import("../types").IOCozyFile>;
|
|
55
55
|
export function generateNewFileNameOnConflict(filenameWithoutExtension: string): string;
|
|
56
|
-
export function generateFileNameForRevision(file: IOCozyFile, revision: object, f: Function): string;
|
|
56
|
+
export function generateFileNameForRevision(file: import("../types").IOCozyFile, revision: object, f: Function): string;
|
|
57
57
|
export function uploadFileWithConflictStrategy(client: CozyClient, file: string | ArrayBuffer, options: FileUploadOptions): any;
|
|
58
58
|
export function readMobileFile(fileURL: string): Promise<any>;
|
|
59
59
|
export function doMobileUpload(client: CozyClient, fileURL: string, options: FileUploadOptions): Promise<any>;
|
|
60
60
|
export function isPlainText(mimeType?: string, fileName?: string): boolean;
|
|
61
|
-
export function hasQualifications(file: IOCozyFile): boolean;
|
|
62
|
-
export function hasCertifications(file: IOCozyFile): boolean;
|
|
63
|
-
export function isFromKonnector(file: IOCozyFile): boolean;
|
|
61
|
+
export function hasQualifications(file: import("../types").IOCozyFile): boolean;
|
|
62
|
+
export function hasCertifications(file: import("../types").IOCozyFile): boolean;
|
|
63
|
+
export function isFromKonnector(file: import("../types").IOCozyFile): boolean;
|
|
64
64
|
export function fetchBlobFileById(client: CozyClient, fileId: string): Promise<Blob>;
|
|
65
65
|
export type FileUploadOptions = {
|
|
66
66
|
/**
|
|
@@ -84,6 +84,4 @@ export type FileUploadOptions = {
|
|
|
84
84
|
*/
|
|
85
85
|
conflictStrategy?: string;
|
|
86
86
|
};
|
|
87
|
-
import { IOCozyFile } from "../types";
|
|
88
87
|
import CozyClient from "../CozyClient";
|
|
89
|
-
import { QueryResult } from "../types";
|
package/types/models/folder.d.ts
CHANGED
|
@@ -8,9 +8,7 @@ export namespace MAGIC_FOLDERS {
|
|
|
8
8
|
const PAPERS: string;
|
|
9
9
|
const COACH_CO2: string;
|
|
10
10
|
}
|
|
11
|
-
export function ensureMagicFolder(client: CozyClient, id: string, path: string): Promise<IOCozyFolder>;
|
|
12
|
-
export function createFolderWithReference(client: CozyClient, path: string, document: CozyClientDocument): Promise<IOCozyFolder>;
|
|
13
|
-
export function getReferencedFolder(client: CozyClient, document: CozyClientDocument): Promise<IOCozyFolder>;
|
|
11
|
+
export function ensureMagicFolder(client: CozyClient, id: string, path: string): Promise<import("../types").IOCozyFolder>;
|
|
12
|
+
export function createFolderWithReference(client: CozyClient, path: string, document: import("../types").CozyClientDocument): Promise<import("../types").IOCozyFolder>;
|
|
13
|
+
export function getReferencedFolder(client: CozyClient, document: import("../types").CozyClientDocument): Promise<import("../types").IOCozyFolder>;
|
|
14
14
|
import CozyClient from "../CozyClient";
|
|
15
|
-
import { IOCozyFolder } from "../types";
|
|
16
|
-
import { CozyClientDocument } from "../types";
|
package/types/queries/dsl.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function Q(doctype: Doctype): QueryDefinition;
|
|
1
|
+
export function Q(doctype: import('../types').Doctype): QueryDefinition;
|
|
2
2
|
export function isAGetByIdQuery(queryDefinition: QueryDefinition): boolean;
|
|
3
3
|
export function createDocument(document: any): {
|
|
4
4
|
mutationType: string;
|
|
@@ -73,7 +73,6 @@ export type PartialQueryDefinition = {
|
|
|
73
73
|
};
|
|
74
74
|
export type MangoSelector = any;
|
|
75
75
|
export type MangoPartialFilter = any;
|
|
76
|
-
import { Doctype } from "../types";
|
|
77
76
|
/**
|
|
78
77
|
* @typedef PartialQueryDefinition
|
|
79
78
|
*
|
|
@@ -100,9 +99,9 @@ export class QueryDefinition {
|
|
|
100
99
|
* @class
|
|
101
100
|
*
|
|
102
101
|
* @param {object} options Initial options for the query definition
|
|
103
|
-
* @param
|
|
104
|
-
* @param {DocId|null} [options.id] - The id of the doc.
|
|
105
|
-
* @param {Array<DocId>} [options.ids] - The ids of the docs.
|
|
102
|
+
* @param {import('../types').Doctype} [options.doctype] - The doctype of the doc.
|
|
103
|
+
* @param {import('../types').DocId|null} [options.id] - The id of the doc.
|
|
104
|
+
* @param {Array<import('../types').DocId>} [options.ids] - The ids of the docs.
|
|
106
105
|
* @param {MangoSelector} [options.selector] - The selector to query the docs.
|
|
107
106
|
* @param {Array<string>} [options.fields] - The fields to return.
|
|
108
107
|
* @param {Array<string>} [options.indexedFields] - The fields to index.
|
|
@@ -112,13 +111,13 @@ export class QueryDefinition {
|
|
|
112
111
|
* @param {string|null} [options.referenced] - The referenced document.
|
|
113
112
|
* @param {number|null} [options.limit] - The document's limit to return.
|
|
114
113
|
* @param {number|null} [options.skip] - The number of docs to skip.
|
|
115
|
-
* @param {CouchDBViewCursor} [options.cursor] - The cursor to paginate views.
|
|
114
|
+
* @param {import('../types').CouchDBViewCursor} [options.cursor] - The cursor to paginate views.
|
|
116
115
|
* @param {string} [options.bookmark] - The bookmark to paginate mango queries.
|
|
117
116
|
*/
|
|
118
117
|
constructor(options?: {
|
|
119
|
-
doctype: Doctype;
|
|
120
|
-
id: DocId | null;
|
|
121
|
-
ids: Array<DocId>;
|
|
118
|
+
doctype: import('../types').Doctype;
|
|
119
|
+
id: import('../types').DocId | null;
|
|
120
|
+
ids: Array<import('../types').DocId>;
|
|
122
121
|
selector: MangoSelector;
|
|
123
122
|
fields: Array<string>;
|
|
124
123
|
indexedFields: Array<string>;
|
|
@@ -128,7 +127,7 @@ export class QueryDefinition {
|
|
|
128
127
|
referenced: string | null;
|
|
129
128
|
limit: number | null;
|
|
130
129
|
skip: number | null;
|
|
131
|
-
cursor: CouchDBViewCursor;
|
|
130
|
+
cursor: import('../types').CouchDBViewCursor;
|
|
132
131
|
bookmark: string;
|
|
133
132
|
});
|
|
134
133
|
doctype: string;
|
|
@@ -143,7 +142,7 @@ export class QueryDefinition {
|
|
|
143
142
|
referenced: string;
|
|
144
143
|
limit: number;
|
|
145
144
|
skip: number;
|
|
146
|
-
cursor: CouchDBViewCursor;
|
|
145
|
+
cursor: import("../types").CouchDBViewCursor;
|
|
147
146
|
bookmark: string;
|
|
148
147
|
/**
|
|
149
148
|
* Checks if the sort order matches the index' fields order.
|
|
@@ -259,10 +258,10 @@ export class QueryDefinition {
|
|
|
259
258
|
* the starting document of the query, e.g. "file-id".
|
|
260
259
|
* Use the last docid of each query as startkey_docid to paginate or leave blank for the first query.
|
|
261
260
|
*
|
|
262
|
-
* @param {CouchDBViewCursor} cursor The cursor for pagination.
|
|
261
|
+
* @param {import('../types').CouchDBViewCursor} cursor The cursor for pagination.
|
|
263
262
|
* @returns {QueryDefinition} The QueryDefinition object.
|
|
264
263
|
*/
|
|
265
|
-
offsetCursor(cursor: CouchDBViewCursor): QueryDefinition;
|
|
264
|
+
offsetCursor(cursor: import('../types').CouchDBViewCursor): QueryDefinition;
|
|
266
265
|
/**
|
|
267
266
|
* Use [bookmark](https://docs.couchdb.org/en/2.2.0/api/database/find.html#pagination) pagination.
|
|
268
267
|
* Note this only applies for mango-queries (not views) and is way more efficient than skip pagination.
|
|
@@ -293,7 +292,7 @@ export class QueryDefinition {
|
|
|
293
292
|
referenced: string;
|
|
294
293
|
limit: number;
|
|
295
294
|
skip: number;
|
|
296
|
-
cursor: CouchDBViewCursor;
|
|
295
|
+
cursor: import("../types").CouchDBViewCursor;
|
|
297
296
|
bookmark: string;
|
|
298
297
|
};
|
|
299
298
|
}
|
|
@@ -306,6 +305,4 @@ declare const REMOVE_REFERENCES_TO: "REMOVE_REFERENCES_TO";
|
|
|
306
305
|
declare const ADD_REFERENCED_BY: "ADD_REFERENCED_BY";
|
|
307
306
|
declare const REMOVE_REFERENCED_BY: "REMOVE_REFERENCED_BY";
|
|
308
307
|
declare const UPLOAD_FILE: "UPLOAD_FILE";
|
|
309
|
-
import { CouchDBViewCursor } from "../types";
|
|
310
|
-
import { DocId } from "../types";
|
|
311
308
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export function mergeDocumentsWithRelationships(prevDocument?: {}, nextDocument?: {}): CozyClientDocument;
|
|
1
|
+
export function mergeDocumentsWithRelationships(prevDocument?: {}, nextDocument?: {}): import("../types").CozyClientDocument;
|
|
2
2
|
export default documents;
|
|
3
3
|
export function getDocumentFromSlice(state: {}, doctype: any, id: any): any;
|
|
4
4
|
export function getCollectionFromSlice(state: {}, doctype: any): any[];
|
|
5
5
|
export function extractAndMergeDocument(data: any, updatedStateWithIncluded: any): any;
|
|
6
|
-
import { CozyClientDocument } from "../types";
|
|
7
6
|
declare function documents(state: {}, action: any): any;
|
package/types/store/queries.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export function isQueryAction(action: any): boolean;
|
|
2
2
|
export function isReceivingData(action: any): boolean;
|
|
3
|
-
export function sortAndLimitDocsIds(queryState: QueryState, documents: DocumentsStateSlice, ids: Array<string>, { count, fetchedPagesCount }: {
|
|
3
|
+
export function sortAndLimitDocsIds(queryState: import("../types").QueryState, documents: import("../types").DocumentsStateSlice, ids: Array<string>, { count, fetchedPagesCount }: {
|
|
4
4
|
count: number;
|
|
5
5
|
fetchedPagesCount: number;
|
|
6
6
|
}): Array<string>;
|
|
7
7
|
export function convert$gtNullSelectors(selector: any): object;
|
|
8
8
|
export function mergeSelectorAndPartialIndex(queryDefinition: object): object;
|
|
9
|
-
export function makeSorterFromDefinition(definition: QueryDefinition): (arg0: Array<CozyClientDocument>) => Array<CozyClientDocument>;
|
|
10
|
-
export function updateData(query: QueryState, newData: Array<CozyClientDocument>, documents: DocumentsStateSlice): QueryState;
|
|
9
|
+
export function makeSorterFromDefinition(definition: QueryDefinition): (arg0: Array<import("../types").CozyClientDocument>) => Array<import("../types").CozyClientDocument>;
|
|
10
|
+
export function updateData(query: import("../types").QueryState, newData: Array<import("../types").CozyClientDocument>, documents: import("../types").DocumentsStateSlice): import("../types").QueryState;
|
|
11
11
|
export default queries;
|
|
12
|
-
export function initQuery(queryId: string, queryDefinition: QueryDefinition, options?: QueryOptions): object;
|
|
13
|
-
export function loadQuery(queryId: string, options?: QueryOptions): object;
|
|
14
|
-
export function receiveQueryResult(queryId: string, response: object, options?: QueryOptions): object;
|
|
15
|
-
export function receiveQueryError(queryId: string, error: object, options?: QueryOptions): object;
|
|
12
|
+
export function initQuery(queryId: string, queryDefinition: QueryDefinition, options?: import("../types").QueryOptions): object;
|
|
13
|
+
export function loadQuery(queryId: string, options?: import("../types").QueryOptions): object;
|
|
14
|
+
export function receiveQueryResult(queryId: string, response: object, options?: import("../types").QueryOptions): object;
|
|
15
|
+
export function receiveQueryError(queryId: string, error: object, options?: import("../types").QueryOptions): object;
|
|
16
16
|
export function getQueryFromSlice(state: any, queryId: any, documents: any): any;
|
|
17
17
|
export class QueryIDGenerator {
|
|
18
18
|
idCounter: number;
|
|
@@ -35,17 +35,12 @@ export class QueryIDGenerator {
|
|
|
35
35
|
export namespace QueryIDGenerator {
|
|
36
36
|
const UNNAMED: string;
|
|
37
37
|
}
|
|
38
|
-
import { QueryState } from "../types";
|
|
39
|
-
import { DocumentsStateSlice } from "../types";
|
|
40
38
|
import { QueryDefinition } from "../queries/dsl";
|
|
41
|
-
import { CozyClientDocument } from "../types";
|
|
42
39
|
/**
|
|
43
|
-
* @param {QueriesStateSlice} state - Redux slice containing all the query states indexed by name
|
|
40
|
+
* @param {import("../types").QueriesStateSlice} state - Redux slice containing all the query states indexed by name
|
|
44
41
|
* @param {object} action - Income redux action
|
|
45
|
-
* @param {DocumentsStateSlice} documents - Reference to documents slice
|
|
42
|
+
* @param {import("../types").DocumentsStateSlice} documents - Reference to documents slice
|
|
46
43
|
* @param {boolean} haveDocumentsChanged - Has the document slice changed with current action
|
|
47
|
-
* @returns {QueriesStateSlice}
|
|
44
|
+
* @returns {import("../types").QueriesStateSlice}
|
|
48
45
|
*/
|
|
49
|
-
declare function queries(state: QueriesStateSlice, action: object, documents?: DocumentsStateSlice, haveDocumentsChanged?: boolean): QueriesStateSlice;
|
|
50
|
-
import { QueryOptions } from "../types";
|
|
51
|
-
import { QueriesStateSlice } from "../types";
|
|
46
|
+
declare function queries(state: import("../types").QueriesStateSlice, action: object, documents?: import("../types").DocumentsStateSlice, haveDocumentsChanged?: boolean): import("../types").QueriesStateSlice;
|