cozy-client 47.5.0 → 47.6.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.
@@ -2782,7 +2782,7 @@ var CozyClient = /*#__PURE__*/function () {
2782
2782
  CozyClient.hooks = CozyClient.hooks || {};
2783
2783
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2784
2784
 
2785
- CozyClient.version = "47.5.0";
2785
+ CozyClient.version = "47.6.0";
2786
2786
 
2787
2787
  _microee.default.mixin(CozyClient);
2788
2788
 
@@ -239,6 +239,9 @@
239
239
  "noticePeriod": "Expiration alert",
240
240
  "netSocialAmount": "Net social amount",
241
241
  "employerName": "Name of employer",
242
+ "employer": "Name of employer",
243
+ "amount": "Amount of expenditure",
244
+ "subtype": "Purpose of expenditure",
242
245
  "bicNumber": "BIC number"
243
246
  },
244
247
  "day": "day |||| days"
@@ -239,6 +239,9 @@
239
239
  "noticePeriod": "Alerte d’expiration",
240
240
  "netSocialAmount": "Montant net social",
241
241
  "employerName": "Nom de l'employeur",
242
+ "employer": "Nom de l'employeur",
243
+ "amount": "Montant de la dépense",
244
+ "subtype": "Objet de la dépense",
242
245
  "bicNumber": "Numéro BIC"
243
246
  },
244
247
  "day": "jour |||| jours"
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.makeExpirationDescription = exports.makeExpiresInMessage = exports.makeExpiredMessage = exports.formatContactValue = exports.getTranslatedNameForContact = exports.formatOtherMetadataValue = exports.getTranslatedNameForOtherMetadata = exports.formatInformationMetadataValue = exports.getTranslatedNameForInformationMetadata = exports.formatDateMetadataValue = exports.getTranslatedNameForDateMetadata = exports.getMetadataQualificationType = exports.formatMetadataQualification = exports.isExpiringSoon = exports.isExpired = exports.computeExpirationNoticeLink = exports.computeExpirationNoticeDate = exports.computeExpirationDate = exports.isExpiring = exports.KNOWN_OTHER_METADATA_NAMES = exports.KNOWN_INFORMATION_METADATA_NAMES = exports.KNOWN_DATE_METADATA_NAMES = void 0;
8
+ exports.makeExpirationDescription = exports.makeExpiresInMessage = exports.makeExpiredMessage = exports.formatContactValue = exports.getTranslatedNameForContact = exports.formatOtherMetadataValue = exports.getTranslatedNameForOtherMetadata = exports.formatInformationMetadataValue = exports.getTranslatedNameForInformationMetadata = exports.formatDateMetadataValue = exports.getTranslatedNameForDateMetadata = exports.getMetadataQualificationType = exports.formatMetadataQualification = exports.isExpiringSoon = exports.isExpired = exports.computeExpirationNoticeLink = exports.computeExpirationNoticeDate = exports.computeExpirationDate = exports.isExpiring = exports.KNOWN_BILLS_ATTRIBUTES_NAMES = exports.KNOWN_OTHER_METADATA_NAMES = exports.KNOWN_INFORMATION_METADATA_NAMES = exports.KNOWN_DATE_METADATA_NAMES = void 0;
9
9
 
10
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
11
 
@@ -43,13 +43,15 @@ exports.KNOWN_DATE_METADATA_NAMES = KNOWN_DATE_METADATA_NAMES;
43
43
  var KNOWN_INFORMATION_METADATA_NAMES = ['number', 'bicNumber', 'country', 'refTaxIncome', 'contractType', 'netSocialAmount', 'employerName', 'vehicle.licenseNumber', 'vehicle.confidentialNumber', 'noticePeriod'];
44
44
  exports.KNOWN_INFORMATION_METADATA_NAMES = KNOWN_INFORMATION_METADATA_NAMES;
45
45
  var KNOWN_OTHER_METADATA_NAMES = ['contact', 'page', 'qualification'];
46
+ exports.KNOWN_OTHER_METADATA_NAMES = KNOWN_OTHER_METADATA_NAMES;
47
+ var KNOWN_BILLS_ATTRIBUTES_NAMES = ['amount', 'subtype', 'employer'];
46
48
  /**
47
49
  * @param {IOCozyFile} file - io.cozy.files document
48
50
  * @returns {boolean}
49
51
  * @description Tells if a given file is a national id card, is French, has an expiration date set and has a notice period set
50
52
  */
51
53
 
52
- exports.KNOWN_OTHER_METADATA_NAMES = KNOWN_OTHER_METADATA_NAMES;
54
+ exports.KNOWN_BILLS_ATTRIBUTES_NAMES = KNOWN_BILLS_ATTRIBUTES_NAMES;
53
55
 
54
56
  var isExpiringFrenchNationalIdCard = function isExpiringFrenchNationalIdCard(file) {
55
57
  var _file$metadata, _file$metadata$qualif, _file$metadata2, _file$metadata3, _file$metadata4;
@@ -316,7 +318,7 @@ var formatMetadataQualification = function formatMetadataQualification(metadata)
316
318
  return [].concat((0, _toConsumableArray2.default)(dates), (0, _toConsumableArray2.default)(informations), (0, _toConsumableArray2.default)(others));
317
319
  };
318
320
  /**
319
- * @typedef {('date' | 'information' | 'contact' | 'other')} MetadataQualificationType
321
+ * @typedef {('date' | 'information' | 'contact' | 'other' | 'bills')} MetadataQualificationType
320
322
  */
321
323
 
322
324
  /**
@@ -345,6 +347,10 @@ var getMetadataQualificationType = function getMetadataQualificationType(metadat
345
347
  return 'other';
346
348
  }
347
349
 
350
+ if (KNOWN_BILLS_ATTRIBUTES_NAMES.includes(metadataName)) {
351
+ return 'bills';
352
+ }
353
+
348
354
  return null;
349
355
  };
350
356
  /**
@@ -447,7 +453,7 @@ var formatInformationMetadataValue = function formatInformationMetadataValue(val
447
453
  });
448
454
  }
449
455
 
450
- if (name === 'refTaxIncome' || name === 'netSocialAmount' || name === 'number' && qualificationLabel === 'pay_sheet') {
456
+ if (name === 'refTaxIncome' || name === 'netSocialAmount' || name === 'amount' || name === 'number' && qualificationLabel === 'pay_sheet') {
451
457
  return "".concat(value, " \u20AC");
452
458
  }
453
459
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "47.5.0",
3
+ "version": "47.6.0",
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": "1bf1593c5ee875519f1e987792087e144442ea2a"
78
+ "gitHead": "ea8b7909ac8241fcc443fc16536985b702966e40"
79
79
  }
@@ -1,6 +1,7 @@
1
1
  export const KNOWN_DATE_METADATA_NAMES: string[];
2
2
  export const KNOWN_INFORMATION_METADATA_NAMES: string[];
3
3
  export const KNOWN_OTHER_METADATA_NAMES: string[];
4
+ export const KNOWN_BILLS_ATTRIBUTES_NAMES: string[];
4
5
  export function isExpiring(file: IOCozyFile): boolean;
5
6
  export function computeExpirationDate(file: IOCozyFile): Date | null;
6
7
  export function computeExpirationNoticeDate(file: IOCozyFile): Date | null;
@@ -49,4 +50,4 @@ export function makeExpirationDescription(expirationDate: string, { lang }: {
49
50
  lang: string;
50
51
  }): string;
51
52
  export type IOCozyFile = import("../types").CozyClientDocument & import("../types").FileDocument;
52
- export type MetadataQualificationType = "other" | "date" | "contact" | "information";
53
+ export type MetadataQualificationType = "other" | "date" | "contact" | "information" | "bills";