cozy-client 57.7.1 → 58.0.0
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
CHANGED
|
@@ -162,7 +162,9 @@ var DOC_UPDATE = 'update';
|
|
|
162
162
|
* @property {object} [schema] - Schema description for each doctypes
|
|
163
163
|
* @property {import("./types").AppMetadata} [appMetadata] - Metadata about the application that will be used in ensureCozyMetadata
|
|
164
164
|
* @property {import("./types").ClientCapabilities} [capabilities] - Capabilities sent by the stack
|
|
165
|
-
* @property {boolean} [
|
|
165
|
+
* @property {boolean} [useCustomStore=false] - If set to true, the client will not instantiate a Redux store automatically. Use this if you want to merge cozy-client's store with your own redux store. Note will have to call `setStore` eventually. See [here](https://docs.cozy.io/en/cozy-client/react-integration/#1b-use-your-own-redux-store) for more information.
|
|
166
|
+
* @property {boolean} [disableStoreForQueries=false] - If set to true, the client will not leverage the redux store to execute queries and store data.
|
|
167
|
+
|
|
166
168
|
* @property {import('./performances/types').PerformanceAPI} [performanceApi] - The performance API that can be used to measure performances
|
|
167
169
|
*/
|
|
168
170
|
|
|
@@ -309,10 +311,13 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
309
311
|
|
|
310
312
|
|
|
311
313
|
this.storeAccesors = null;
|
|
314
|
+
this.useCustomStore = _options.useCustomStore || false;
|
|
312
315
|
|
|
313
|
-
if (
|
|
316
|
+
if (this.useCustomStore !== true) {
|
|
314
317
|
this.ensureStore();
|
|
315
318
|
}
|
|
319
|
+
|
|
320
|
+
this.disableStoreForQueries = _options.disableStoreForQueries || false;
|
|
316
321
|
}
|
|
317
322
|
/**
|
|
318
323
|
* Gets overrided by MicroEE.mixin
|
|
@@ -1293,7 +1298,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
1293
1298
|
markQuery = this.performanceApi.mark("client.query(".concat(queryDefinition.doctype, ")"));
|
|
1294
1299
|
this.ensureStore();
|
|
1295
1300
|
queryId = options.as || this.queryIdGenerator.generateId(queryDefinition);
|
|
1296
|
-
existingQuery = this.getQueryFromState(queryId, options);
|
|
1301
|
+
existingQuery = this.disableStoreForQueries ? null : this.getQueryFromState(queryId, options);
|
|
1297
1302
|
|
|
1298
1303
|
if (!(options.enabled !== undefined)) {
|
|
1299
1304
|
_context8.next = 9;
|
|
@@ -1346,12 +1351,19 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
1346
1351
|
}));
|
|
1347
1352
|
|
|
1348
1353
|
case 18:
|
|
1349
|
-
this.
|
|
1354
|
+
if (!this.disableStoreForQueries) {
|
|
1355
|
+
this.ensureQueryExists(queryId, queryDefinition, options);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1350
1358
|
_context8.prev = 19;
|
|
1351
1359
|
backgroundFetching = options.backgroundFetching !== undefined ? options.backgroundFetching : this.options.backgroundFetching;
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1360
|
+
|
|
1361
|
+
if (!this.disableStoreForQueries) {
|
|
1362
|
+
this.dispatch((0, _store.loadQuery)(queryId, {
|
|
1363
|
+
backgroundFetching: backgroundFetching
|
|
1364
|
+
}));
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1355
1367
|
requestFn = executeFromStore ? function () {
|
|
1356
1368
|
return Promise.resolve((0, _store.executeQueryFromState)(_this4.store.getState(), queryDefinition));
|
|
1357
1369
|
} : function () {
|
|
@@ -1364,6 +1376,15 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
1364
1376
|
|
|
1365
1377
|
case 25:
|
|
1366
1378
|
response = _context8.sent;
|
|
1379
|
+
|
|
1380
|
+
if (!this.disableStoreForQueries) {
|
|
1381
|
+
_context8.next = 28;
|
|
1382
|
+
break;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
return _context8.abrupt("return", response);
|
|
1386
|
+
|
|
1387
|
+
case 28:
|
|
1367
1388
|
this.dispatch((0, _store.receiveQueryResult)(queryId, response, {
|
|
1368
1389
|
update: update,
|
|
1369
1390
|
backgroundFetching: backgroundFetching
|
|
@@ -1375,8 +1396,8 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
1375
1396
|
});
|
|
1376
1397
|
return _context8.abrupt("return", response);
|
|
1377
1398
|
|
|
1378
|
-
case
|
|
1379
|
-
_context8.prev =
|
|
1399
|
+
case 33:
|
|
1400
|
+
_context8.prev = 33;
|
|
1380
1401
|
_context8.t0 = _context8["catch"](19);
|
|
1381
1402
|
this.performanceApi.measure({
|
|
1382
1403
|
markName: markQuery,
|
|
@@ -1386,34 +1407,34 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
1386
1407
|
this.dispatch((0, _store.receiveQueryError)(queryId, _context8.t0)); // specific onError
|
|
1387
1408
|
|
|
1388
1409
|
if (!options.onError) {
|
|
1389
|
-
_context8.next =
|
|
1410
|
+
_context8.next = 41;
|
|
1390
1411
|
break;
|
|
1391
1412
|
}
|
|
1392
1413
|
|
|
1393
1414
|
options.onError(_context8.t0); // defaulted onError
|
|
1394
1415
|
|
|
1395
|
-
_context8.next =
|
|
1416
|
+
_context8.next = 46;
|
|
1396
1417
|
break;
|
|
1397
1418
|
|
|
1398
|
-
case
|
|
1419
|
+
case 41:
|
|
1399
1420
|
if (!this.options.onError) {
|
|
1400
|
-
_context8.next =
|
|
1421
|
+
_context8.next = 45;
|
|
1401
1422
|
break;
|
|
1402
1423
|
}
|
|
1403
1424
|
|
|
1404
1425
|
this.options.onError(_context8.t0);
|
|
1405
|
-
_context8.next =
|
|
1426
|
+
_context8.next = 46;
|
|
1406
1427
|
break;
|
|
1407
1428
|
|
|
1408
|
-
case
|
|
1429
|
+
case 45:
|
|
1409
1430
|
throw _context8.t0;
|
|
1410
1431
|
|
|
1411
|
-
case
|
|
1432
|
+
case 46:
|
|
1412
1433
|
case "end":
|
|
1413
1434
|
return _context8.stop();
|
|
1414
1435
|
}
|
|
1415
1436
|
}
|
|
1416
|
-
}, _callee8, this, [[19,
|
|
1437
|
+
}, _callee8, this, [[19, 33]]);
|
|
1417
1438
|
}));
|
|
1418
1439
|
|
|
1419
1440
|
function query(_x9) {
|
|
@@ -3112,7 +3133,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
3112
3133
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
3113
3134
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
3114
3135
|
|
|
3115
|
-
CozyClient.version = "
|
|
3136
|
+
CozyClient.version = "58.0.0";
|
|
3116
3137
|
|
|
3117
3138
|
_microee.default.mixin(CozyClient);
|
|
3118
3139
|
|
package/dist/__tests__/utils.js
CHANGED
|
@@ -44,7 +44,7 @@ var createTestAssets = function createTestAssets() {
|
|
|
44
44
|
var link = new _CozyLink.default(requestHandler);
|
|
45
45
|
var client = new _CozyClient.default({
|
|
46
46
|
links: [link],
|
|
47
|
-
|
|
47
|
+
useCustomStore: true
|
|
48
48
|
});
|
|
49
49
|
var store = (0, _redux.createStore)((0, _redux.combineReducers)({
|
|
50
50
|
cozy: client.reducer()
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
"io": {
|
|
39
39
|
"cozy": {
|
|
40
40
|
"accounts": "Login details",
|
|
41
|
+
"ai.chat.conversations": "AI conversations",
|
|
42
|
+
"ai.chat.events": "AI events",
|
|
41
43
|
"apps": "List of installed applications",
|
|
42
44
|
"apps.suggestions": "Application suggestions",
|
|
43
45
|
"bank.accounts": "Banking accounts",
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
"konnectors.result": "Connectors results",
|
|
66
68
|
"netflix.views": "Netflix history",
|
|
67
69
|
"netflix.opinions": "Netflix opinions",
|
|
70
|
+
"notes.documents": "Notes",
|
|
68
71
|
"notifications": "Notifications",
|
|
69
72
|
"oauth.clients": "Connected devices",
|
|
70
73
|
"permissions": "Delegating permissions",
|
|
@@ -72,6 +75,7 @@
|
|
|
72
75
|
"photos.settings": "Photo settings",
|
|
73
76
|
"settings": "Settings",
|
|
74
77
|
"sharings": "Sharing",
|
|
78
|
+
"support": "Support",
|
|
75
79
|
"tags": "Tags",
|
|
76
80
|
"timeseries.geojson": "Trips",
|
|
77
81
|
"timeseries.grades": "Grades",
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
"io": {
|
|
38
38
|
"cozy": {
|
|
39
39
|
"accounts": "Identifiants",
|
|
40
|
+
"ai.chat.conversations": "Conversations IA",
|
|
41
|
+
"ai.chat.events": "Évènements IA",
|
|
40
42
|
"apps": "Liste des applications installées",
|
|
41
43
|
"apps.suggestions": "Suggestions d'applications",
|
|
42
44
|
"bank.accounts": "Comptes bancaires",
|
|
@@ -64,6 +66,7 @@
|
|
|
64
66
|
"konnectors.result": "Résultats de connecteurs",
|
|
65
67
|
"netflix.views": "Historique Netflix",
|
|
66
68
|
"netflix.opinions": "Opinions Netflix",
|
|
69
|
+
"notes.documents": "Notes",
|
|
67
70
|
"notifications": "Notifications",
|
|
68
71
|
"oauth.clients": "Appareils connectés",
|
|
69
72
|
"permissions": "Délégation de permissions",
|
|
@@ -71,6 +74,7 @@
|
|
|
71
74
|
"photos.settings": "Paramètres des photos",
|
|
72
75
|
"settings": "Paramètres",
|
|
73
76
|
"sharings": "Partage",
|
|
77
|
+
"support": "Support",
|
|
74
78
|
"tags": "Tags",
|
|
75
79
|
"timeseries.geojson": "Déplacements",
|
|
76
80
|
"timeseries.grades": "Notes",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "58.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@types/jest": "^26.0.20",
|
|
20
20
|
"@types/lodash": "^4.14.170",
|
|
21
21
|
"btoa": "^1.2.1",
|
|
22
|
-
"cozy-stack-client": "^
|
|
22
|
+
"cozy-stack-client": "^58.0.0",
|
|
23
23
|
"date-fns": "2.29.3",
|
|
24
24
|
"fast-deep-equal": "^3.1.3",
|
|
25
25
|
"json-stable-stringify": "^1.0.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-native-ios11-devicecheck": "^0.0.3"
|
|
75
75
|
},
|
|
76
76
|
"sideEffects": false,
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "2f9205fddd2e51dfec6c72ac58ffd677a28d5ff6"
|
|
78
78
|
}
|
package/types/CozyClient.d.ts
CHANGED
|
@@ -73,9 +73,13 @@ export type ClientOptions = {
|
|
|
73
73
|
*/
|
|
74
74
|
capabilities?: import("./types").ClientCapabilities;
|
|
75
75
|
/**
|
|
76
|
-
* - If set to
|
|
76
|
+
* - If set to true, the client will not instantiate a Redux store automatically. Use this if you want to merge cozy-client's store with your own redux store. Note will have to call `setStore` eventually. See [here](https://docs.cozy.io/en/cozy-client/react-integration/#1b-use-your-own-redux-store) for more information.
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
useCustomStore?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* - If set to true, the client will not leverage the redux store to execute queries and store data.
|
|
81
|
+
*/
|
|
82
|
+
disableStoreForQueries?: boolean;
|
|
79
83
|
/**
|
|
80
84
|
* - The performance API that can be used to measure performances
|
|
81
85
|
*/
|
|
@@ -102,7 +106,9 @@ export type ClientOptions = {
|
|
|
102
106
|
* @property {object} [schema] - Schema description for each doctypes
|
|
103
107
|
* @property {import("./types").AppMetadata} [appMetadata] - Metadata about the application that will be used in ensureCozyMetadata
|
|
104
108
|
* @property {import("./types").ClientCapabilities} [capabilities] - Capabilities sent by the stack
|
|
105
|
-
* @property {boolean} [
|
|
109
|
+
* @property {boolean} [useCustomStore=false] - If set to true, the client will not instantiate a Redux store automatically. Use this if you want to merge cozy-client's store with your own redux store. Note will have to call `setStore` eventually. See [here](https://docs.cozy.io/en/cozy-client/react-integration/#1b-use-your-own-redux-store) for more information.
|
|
110
|
+
* @property {boolean} [disableStoreForQueries=false] - If set to true, the client will not leverage the redux store to execute queries and store data.
|
|
111
|
+
|
|
106
112
|
* @property {import('./performances/types').PerformanceAPI} [performanceApi] - The performance API that can be used to measure performances
|
|
107
113
|
*/
|
|
108
114
|
/**
|
|
@@ -216,9 +222,13 @@ declare class CozyClient {
|
|
|
216
222
|
*/
|
|
217
223
|
onError?: Function;
|
|
218
224
|
/**
|
|
219
|
-
* - If set to
|
|
225
|
+
* - If set to true, the client will not instantiate a Redux store automatically. Use this if you want to merge cozy-client's store with your own redux store. Note will have to call `setStore` eventually. See [here](https://docs.cozy.io/en/cozy-client/react-integration/#1b-use-your-own-redux-store) for more information.
|
|
226
|
+
*/
|
|
227
|
+
useCustomStore?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* - If set to true, the client will not leverage the redux store to execute queries and store data.
|
|
220
230
|
*/
|
|
221
|
-
|
|
231
|
+
disableStoreForQueries?: boolean;
|
|
222
232
|
};
|
|
223
233
|
queryIdGenerator: QueryIDGenerator;
|
|
224
234
|
isLogged: boolean;
|
|
@@ -244,6 +254,8 @@ declare class CozyClient {
|
|
|
244
254
|
* @type {object}
|
|
245
255
|
*/
|
|
246
256
|
storeAccesors: object;
|
|
257
|
+
useCustomStore: boolean;
|
|
258
|
+
disableStoreForQueries: boolean;
|
|
247
259
|
/**
|
|
248
260
|
* Gets overrided by MicroEE.mixin
|
|
249
261
|
* This is here just so typescript does not scream
|