cozy-client 46.5.0 → 46.6.1
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
|
@@ -2705,7 +2705,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
2705
2705
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
2706
2706
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
2707
2707
|
|
|
2708
|
-
CozyClient.version = "46.
|
|
2708
|
+
CozyClient.version = "46.6.1";
|
|
2709
2709
|
|
|
2710
2710
|
_microee.default.mixin(CozyClient);
|
|
2711
2711
|
|
|
@@ -42,6 +42,8 @@ var authenticateWithReactNativeInAppBrowser = /*#__PURE__*/function () {
|
|
|
42
42
|
switch (_context.prev = _context.next) {
|
|
43
43
|
case 0:
|
|
44
44
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
45
|
+
var linkingSubscription = null;
|
|
46
|
+
|
|
45
47
|
_reactNativeInappbrowserReborn.InAppBrowser.open(url, {
|
|
46
48
|
// iOS Properties
|
|
47
49
|
readerMode: false,
|
|
@@ -72,10 +74,6 @@ var authenticateWithReactNativeInAppBrowser = /*#__PURE__*/function () {
|
|
|
72
74
|
}
|
|
73
75
|
});
|
|
74
76
|
|
|
75
|
-
var removeListener = function removeListener() {
|
|
76
|
-
_reactNative.Linking.removeEventListener('url', linkListener);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
77
|
var linkListener = function linkListener(_ref2) {
|
|
80
78
|
var url = _ref2.url;
|
|
81
79
|
var sanitizedUrl = url;
|
|
@@ -99,7 +97,7 @@ var authenticateWithReactNativeInAppBrowser = /*#__PURE__*/function () {
|
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
resolve(sanitizedUrl);
|
|
102
|
-
|
|
100
|
+
linkingSubscription.remove();
|
|
103
101
|
|
|
104
102
|
_reactNativeInappbrowserReborn.InAppBrowser.close();
|
|
105
103
|
} else if (closeSignal) {
|
|
@@ -107,7 +105,7 @@ var authenticateWithReactNativeInAppBrowser = /*#__PURE__*/function () {
|
|
|
107
105
|
}
|
|
108
106
|
};
|
|
109
107
|
|
|
110
|
-
_reactNative.Linking.addEventListener('url', linkListener);
|
|
108
|
+
linkingSubscription = _reactNative.Linking.addEventListener('url', linkListener);
|
|
111
109
|
}));
|
|
112
110
|
|
|
113
111
|
case 1:
|
package/dist/models/paper.js
CHANGED
|
@@ -244,7 +244,7 @@ var isExpiringSoon = function isExpiringSoon(file) {
|
|
|
244
244
|
/**
|
|
245
245
|
* @param {Object} params -
|
|
246
246
|
* @param {Object} params.metadata - An io.cozy.files metadata object
|
|
247
|
-
* @param {string} params.
|
|
247
|
+
* @param {string} params.knownMetadataPath - Path of the metadata
|
|
248
248
|
* @param {string | null} [params.value] - Value of the metadata
|
|
249
249
|
* @returns {{ name: string, value: string | null }} displayable metadata
|
|
250
250
|
*/
|
|
@@ -254,16 +254,18 @@ exports.isExpiringSoon = isExpiringSoon;
|
|
|
254
254
|
|
|
255
255
|
var makeMetadataQualification = function makeMetadataQualification(_ref) {
|
|
256
256
|
var metadata = _ref.metadata,
|
|
257
|
-
|
|
257
|
+
knownMetadataPath = _ref.knownMetadataPath,
|
|
258
258
|
value = _ref.value;
|
|
259
259
|
|
|
260
|
-
var _value = value || (0, _get.default)(metadata,
|
|
260
|
+
var _value = value || (0, _get.default)(metadata, knownMetadataPath, null) || null;
|
|
261
261
|
|
|
262
|
-
var shouldReturnThisMetadata =
|
|
262
|
+
var shouldReturnThisMetadata = Object.keys(metadata).some(function (val) {
|
|
263
|
+
return knownMetadataPath.startsWith(val);
|
|
264
|
+
});
|
|
263
265
|
|
|
264
|
-
if (shouldReturnThisMetadata ||
|
|
266
|
+
if (shouldReturnThisMetadata || knownMetadataPath === 'contact') {
|
|
265
267
|
return {
|
|
266
|
-
name:
|
|
268
|
+
name: knownMetadataPath,
|
|
267
269
|
value: _value
|
|
268
270
|
};
|
|
269
271
|
}
|
|
@@ -281,7 +283,7 @@ var formatMetadataQualification = function formatMetadataQualification(metadata)
|
|
|
281
283
|
var dates = KNOWN_DATE_METADATA_NAMES.map(function (dateName) {
|
|
282
284
|
return makeMetadataQualification({
|
|
283
285
|
metadata: metadata,
|
|
284
|
-
|
|
286
|
+
knownMetadataPath: dateName
|
|
285
287
|
});
|
|
286
288
|
}).filter(Boolean).filter(function (data, _, arr) {
|
|
287
289
|
if (arr.length > 1) return data.name !== 'datetime';
|
|
@@ -290,7 +292,7 @@ var formatMetadataQualification = function formatMetadataQualification(metadata)
|
|
|
290
292
|
var informations = KNOWN_INFORMATION_METADATA_NAMES.map(function (infoName) {
|
|
291
293
|
return makeMetadataQualification({
|
|
292
294
|
metadata: metadata,
|
|
293
|
-
|
|
295
|
+
knownMetadataPath: infoName
|
|
294
296
|
});
|
|
295
297
|
}).filter(Boolean);
|
|
296
298
|
var others = KNOWN_OTHER_METADATA_NAMES.map(function (otherName) {
|
|
@@ -299,7 +301,7 @@ var formatMetadataQualification = function formatMetadataQualification(metadata)
|
|
|
299
301
|
var value = otherName === 'qualification' ? (_metadata$otherName = metadata[otherName]) === null || _metadata$otherName === void 0 ? void 0 : _metadata$otherName.label : metadata[otherName];
|
|
300
302
|
return makeMetadataQualification({
|
|
301
303
|
metadata: metadata,
|
|
302
|
-
|
|
304
|
+
knownMetadataPath: otherName,
|
|
303
305
|
value: value
|
|
304
306
|
});
|
|
305
307
|
}).filter(Boolean);
|
|
@@ -196,7 +196,8 @@ describe('Expiration', () => {
|
|
|
196
196
|
datetime: '2029-12-10T23:00:00.000Z',
|
|
197
197
|
qualification: { label: 'fake_label' },
|
|
198
198
|
page: 'front',
|
|
199
|
-
contact: 'Alice Durand'
|
|
199
|
+
contact: 'Alice Durand',
|
|
200
|
+
noticePeriod: ''
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
const computedMetadata = [
|
|
@@ -210,6 +211,7 @@ describe('Expiration', () => {
|
|
|
210
211
|
{ name: 'shootingDate', value: '2029-12-08T23:00:00.000Z' },
|
|
211
212
|
{ name: 'date', value: '2029-12-09T23:00:00.000Z' },
|
|
212
213
|
{ name: 'number', value: '111111' },
|
|
214
|
+
{ name: 'noticePeriod', value: null },
|
|
213
215
|
{ name: 'contact', value: 'Alice Durand' },
|
|
214
216
|
{ name: 'page', value: 'front' },
|
|
215
217
|
{ name: 'qualification', value: 'fake_label' }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
|
|
76
76
|
},
|
|
77
77
|
"sideEffects": false,
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "3e67cae916cbef8aefe6a11102c6f5a5b746890f"
|
|
79
79
|
}
|