cozy-client 43.0.0 → 43.2.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.
@@ -2703,7 +2703,7 @@ var CozyClient = /*#__PURE__*/function () {
2703
2703
  CozyClient.hooks = CozyClient.hooks || {};
2704
2704
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2705
2705
 
2706
- CozyClient.version = "43.0.0";
2706
+ CozyClient.version = "43.2.0";
2707
2707
 
2708
2708
  _microee.default.mixin(CozyClient);
2709
2709
 
@@ -491,6 +491,10 @@
491
491
  {
492
492
  "label": "other_administrative_document"
493
493
  },
494
+ {
495
+ "label": "expense_claim",
496
+ "purpose": "invoice"
497
+ },
494
498
  {
495
499
  "label": "note_identity_document"
496
500
  },
package/dist/mock.js CHANGED
@@ -29,13 +29,19 @@ var fillQueryInsideClient = function fillQueryInsideClient(client, queryName, qu
29
29
  var definition = queryOptions.definition,
30
30
  doctype = queryOptions.doctype,
31
31
  data = queryOptions.data,
32
- queryResult = (0, _objectWithoutProperties2.default)(queryOptions, ["definition", "doctype", "data"]);
32
+ queryError = queryOptions.queryError,
33
+ queryResult = (0, _objectWithoutProperties2.default)(queryOptions, ["definition", "doctype", "data", "queryError"]);
33
34
  client.store.dispatch((0, _store.initQuery)(queryName, definition || (0, _dsl.Q)(doctype)));
34
- client.store.dispatch((0, _store.receiveQueryResult)(queryName, _objectSpread({
35
- data: data ? data.map(function (doc) {
36
- return (0, _cozyStackClient.normalizeDoc)(doc, doctype);
37
- }) : data
38
- }, queryResult)));
35
+
36
+ if (queryError) {
37
+ client.store.dispatch((0, _store.receiveQueryError)(queryName, queryError));
38
+ } else {
39
+ client.store.dispatch((0, _store.receiveQueryResult)(queryName, _objectSpread({
40
+ data: data ? data.map(function (doc) {
41
+ return (0, _cozyStackClient.normalizeDoc)(doc, doctype);
42
+ }) : data
43
+ }, queryResult)));
44
+ }
39
45
  };
40
46
 
41
47
  var mockedQueryFromMockedRemoteData = function mockedQueryFromMockedRemoteData(remoteData) {
package/dist/mock.spec.js CHANGED
@@ -14,6 +14,10 @@ describe('createMockClient', () => {
14
14
  simpsons: {
15
15
  data: simpsonsFixture,
16
16
  doctype: 'io.cozy.simpsons'
17
+ },
18
+ simpsonsError: {
19
+ doctype: 'io.cozy.simpsons',
20
+ queryError: new Error('some error')
17
21
  }
18
22
  }
19
23
  })
@@ -24,6 +28,9 @@ describe('createMockClient', () => {
24
28
  'homer',
25
29
  'marge'
26
30
  ])
31
+ const errorQuery = client.getQueryFromState('simpsonsError')
32
+ expect(errorQuery.fetchStatus).toBe('failed')
33
+ expect(errorQuery.lastError).toStrictEqual(new Error('some error'))
27
34
  })
28
35
 
29
36
  it('should mock query with data passed in "remote" option', async () => {
@@ -40,7 +40,7 @@ var familyLabels = ['family_record_book', 'birth_certificate', 'wedding', 'pacs'
40
40
  * @type {Array<import("../../types").WorkStudyLabels>}
41
41
  */
42
42
 
43
- var workStudyLabels = ['diploma', 'work_contract', 'pay_sheet', 'unemployment_benefit', 'employment_center_certificate', 'pension', 'work_disability_recognition', 'gradebook', 'student_card', 'school_attendance_certificate', 'school_insurance_certificate', 'resume', 'motivation_letter', 'note_work_document', 'other_work_document'];
43
+ var workStudyLabels = ['diploma', 'work_contract', 'pay_sheet', 'unemployment_benefit', 'employment_center_certificate', 'pension', 'work_disability_recognition', 'gradebook', 'student_card', 'school_attendance_certificate', 'school_insurance_certificate', 'resume', 'motivation_letter', 'expense_claim', 'note_work_document', 'other_work_document'];
44
44
  /**
45
45
  * @type {Array<import("../../types").HealthLabels>}
46
46
  */
@@ -65,12 +65,12 @@ var activityLabels = ['personal_sporting_licence', 'fidelity_card', 'library_car
65
65
  * @type {Array<import("../../types").FinanceLabels>}
66
66
  */
67
67
 
68
- var financeLabels = ['tax_return', 'tax_notice', 'tax_timetable', 'real_estate_tax', 'pay_sheet', 'receipt', 'single_parent_benefit', 'other_tax_document', 'bank_details', 'bank_statement', 'loan_agreement', 'payment_proof_family_allowance', 'note_finance', 'other_bank_document', 'other_revenue'];
68
+ var financeLabels = ['tax_return', 'tax_notice', 'tax_timetable', 'real_estate_tax', 'pay_sheet', 'receipt', 'single_parent_benefit', 'other_tax_document', 'bank_details', 'bank_statement', 'loan_agreement', 'payment_proof_family_allowance', 'note_finance', 'expense_claim', 'other_bank_document', 'other_revenue'];
69
69
  /**
70
70
  * @type {Array<import("../../types").InvoiceLabels>}
71
71
  */
72
72
 
73
- var invoiceLabels = ['phone_invoice', 'isp_invoice', 'telecom_invoice', 'energy_invoice', 'water_invoice', 'appliance_invoice', 'web_service_invoice', 'restaurant_invoice', 'work_invoice', 'transport_invoice', 'health_invoice', 'note_invoice', 'other_invoice'];
73
+ var invoiceLabels = ['phone_invoice', 'isp_invoice', 'telecom_invoice', 'energy_invoice', 'water_invoice', 'appliance_invoice', 'web_service_invoice', 'restaurant_invoice', 'work_invoice', 'transport_invoice', 'health_invoice', 'note_invoice', 'expense_claim', 'other_invoice'];
74
74
  /**
75
75
  * @type {Array<import("../../types").OthersLabels>}
76
76
  */
@@ -35,6 +35,7 @@
35
35
  "employment_center_certificate": "Employment center certificate |||| Employment center certificates",
36
36
  "energy_contract": "Energy provider contract |||| Energy provider contracts",
37
37
  "energy_invoice": "Energy invoice |||| Energy invoices",
38
+ "expense_claim": "Expense claim |||| Expense claims",
38
39
  "family_record_book": "Family record book |||| Family record books",
39
40
  "family": "Family",
40
41
  "fidelity_card": "Fidelity card |||| Fidelity cards",
@@ -35,6 +35,7 @@
35
35
  "employment_center_certificate": "Attestation de Pôle emploi |||| Attestations de Pôle emploi",
36
36
  "energy_contract": "Contrat de fournisseur d'énergies |||| Contrats de fournisseur d'énergies",
37
37
  "energy_invoice": "Facture d'énergie |||| Factures d'énergie",
38
+ "expense_claim": "Note de frais |||| Notes de frais",
38
39
  "family_record_book": "Livret de famille |||| Livrets de famille",
39
40
  "family": "Famille",
40
41
  "fidelity_card": "Carte de fidélité |||| Cartes de fidélité",
@@ -122,7 +123,7 @@
122
123
  "work_quote": "Devis de travaux",
123
124
  "work_study": "Travail & Études"
124
125
  },
125
- "attributes":{
126
+ "attributes": {
126
127
  "contractType": {
127
128
  "cdi": "CDI",
128
129
  "cdd": "CDD",
package/dist/types.js CHANGED
@@ -435,7 +435,7 @@ var _dsl = require("./queries/dsl");
435
435
  *
436
436
  * @typedef {'family_record_book'|'birth_certificate'|'wedding'|'pacs'|'divorce'|'large_family_card'|'caf'|'other_family_document'|'payment_proof_family_allowance'|'single_parent_benefit'|'note_family_document'} FamilyLabel
437
437
  *
438
- * @typedef {'diploma'|'work_contract'|'pay_sheet'|'unemployment_benefit'|'pension'|'gradebook'|'student_card'|'resume'|'motivation_letter'|'other_work_document'|'work_disability_recognition'|'school_attendance_certificate'|'employment_center_certificate'|'school_insurance_certificate'|'note_work_document'} WorkStudyLabels
438
+ * @typedef {'diploma'|'work_contract'|'pay_sheet'|'unemployment_benefit'|'pension'|'gradebook'|'student_card'|'resume'|'motivation_letter'|'other_work_document'|'work_disability_recognition'|'school_attendance_certificate'|'employment_center_certificate'|'school_insurance_certificate'|'note_work_document'|'expense_claim'} WorkStudyLabels
439
439
  *
440
440
  * @typedef {'health_certificate'|'health_book'|'national_health_insurance_card'|'health_insurance_card'|'prescription'|'health_invoice'|'national_health_insurance_right_certificate'|'work_disability_recognition'|'pregnancy_medical_certificate'|'other_health_document'|'note_health_document'} HealthLabels
441
441
  *
@@ -443,9 +443,9 @@ var _dsl = require("./queries/dsl");
443
443
  *
444
444
  * @typedef {'driver_license'|'vehicle_registration'|'car_insurance'|'mechanic_invoice'|'transport_invoice'|'other_transport_document'|'transport_card'|'note_transport_document'} TransportLabels
445
445
  *
446
- * @typedef {'tax_return'|'tax_notice'|'tax_timetable'|'pay_sheet'|'receipt'|'other_tax_document'|'bank_details'|'bank_statement'|'loan_agreement'|'other_bank_document'|'payment_proof_family_allowance'|'other_revenue'|'single_parent_benefit'|'real_estate_tax'|'note_finance'} FinanceLabels
446
+ * @typedef {'tax_return'|'tax_notice'|'tax_timetable'|'pay_sheet'|'receipt'|'other_tax_document'|'bank_details'|'bank_statement'|'loan_agreement'|'other_bank_document'|'payment_proof_family_allowance'|'other_revenue'|'single_parent_benefit'|'real_estate_tax'|'note_finance'|'expense_claim'} FinanceLabels
447
447
  *
448
- * @typedef {'phone_invoice'|'isp_invoice'|'telecom_invoice'|'energy_invoice'|'water_invoice'|'appliance_invoice'|'web_service_invoice'|'restaurant_invoice'|'work_invoice'|'transport_invoice'|'health_invoice'|'other_invoice'|'note_invoice'} InvoiceLabels
448
+ * @typedef {'phone_invoice'|'isp_invoice'|'telecom_invoice'|'energy_invoice'|'water_invoice'|'appliance_invoice'|'web_service_invoice'|'restaurant_invoice'|'work_invoice'|'transport_invoice'|'health_invoice'|'other_invoice'|'note_invoice'|'expense_claim'} InvoiceLabels
449
449
  *
450
450
  * @typedef {'personal_sporting_licence'|'other_activity_document'|'fidelity_card'|'library_card'|'note_activity_document'} ActivityLabels
451
451
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "43.0.0",
3
+ "version": "43.2.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": "5718d4351b1e258cfa829f487ee2c08bf6000f8c"
78
+ "gitHead": "22a2cc2fd135eb337ddc918a4a69c2390978fb37"
79
79
  }
package/types/types.d.ts CHANGED
@@ -725,15 +725,15 @@ export type QualificationAttributes = {
725
725
  };
726
726
  export type IdentityLabel = "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "electoral_card" | "citizen_registration_certificate" | "personal_sporting_licence" | "note_identity_document";
727
727
  export type FamilyLabel = "family_record_book" | "birth_certificate" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "single_parent_benefit" | "payment_proof_family_allowance" | "note_family_document";
728
- export type WorkStudyLabels = "resume" | "diploma" | "work_contract" | "pay_sheet" | "employment_center_certificate" | "unemployment_benefit" | "pension" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "work_disability_recognition" | "school_attendance_certificate" | "school_insurance_certificate" | "note_work_document";
728
+ export type WorkStudyLabels = "resume" | "diploma" | "work_contract" | "pay_sheet" | "employment_center_certificate" | "unemployment_benefit" | "pension" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "work_disability_recognition" | "school_attendance_certificate" | "school_insurance_certificate" | "expense_claim" | "note_work_document";
729
729
  export type HealthLabels = "health_book" | "health_certificate" | "pregnancy_medical_certificate" | "work_disability_recognition" | "national_health_insurance_card" | "national_health_insurance_right_certificate" | "health_insurance_card" | "prescription" | "health_invoice" | "other_health_document" | "note_health_document";
730
730
  export type HomeLabels = "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "unfit_for_habitation_declaration" | "accommodation_proof" | "note_house_document";
731
731
  export type TransportLabels = "driver_license" | "transport_card" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document" | "note_transport_document";
732
- export type FinanceLabels = "pay_sheet" | "single_parent_benefit" | "other_revenue" | "real_estate_tax" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance" | "note_finance";
733
- export type InvoiceLabels = "health_invoice" | "transport_invoice" | "work_invoice" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_invoice" | "note_invoice";
732
+ export type FinanceLabels = "pay_sheet" | "single_parent_benefit" | "other_revenue" | "real_estate_tax" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance" | "expense_claim" | "note_finance";
733
+ export type InvoiceLabels = "health_invoice" | "transport_invoice" | "work_invoice" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_invoice" | "expense_claim" | "note_invoice";
734
734
  export type ActivityLabels = "fidelity_card" | "library_card" | "personal_sporting_licence" | "other_activity_document" | "note_activity_document";
735
735
  export type OthersLabels = "other_administrative_document" | "note_other";
736
- export type ItemsLabels = "resume" | "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "diploma" | "work_contract" | "pay_sheet" | "fidelity_card" | "library_card" | "single_parent_benefit" | "transport_card" | "electoral_card" | "employment_center_certificate" | "unemployment_benefit" | "pension" | "other_revenue" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "health_book" | "health_certificate" | "pregnancy_medical_certificate" | "work_disability_recognition" | "national_health_insurance_card" | "national_health_insurance_right_certificate" | "health_insurance_card" | "prescription" | "health_invoice" | "other_health_document" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document" | "house_sale_agreeement" | "real_estate_tax" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_invoice" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance" | "school_attendance_certificate" | "school_insurance_certificate" | "unfit_for_habitation_declaration" | "accommodation_proof" | "citizen_registration_certificate" | "personal_sporting_licence" | "other_activity_document" | "other_administrative_document" | "note_identity_document" | "note_family_document" | "note_work_document" | "note_health_document" | "note_house_document" | "note_transport_document" | "note_activity_document" | "note_finance" | "note_invoice" | "note_other";
736
+ export type ItemsLabels = "resume" | "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "diploma" | "work_contract" | "pay_sheet" | "fidelity_card" | "library_card" | "single_parent_benefit" | "transport_card" | "electoral_card" | "employment_center_certificate" | "unemployment_benefit" | "pension" | "other_revenue" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "health_book" | "health_certificate" | "pregnancy_medical_certificate" | "work_disability_recognition" | "national_health_insurance_card" | "national_health_insurance_right_certificate" | "health_insurance_card" | "prescription" | "health_invoice" | "other_health_document" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document" | "house_sale_agreeement" | "real_estate_tax" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_invoice" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance" | "school_attendance_certificate" | "school_insurance_certificate" | "unfit_for_habitation_declaration" | "accommodation_proof" | "citizen_registration_certificate" | "personal_sporting_licence" | "other_activity_document" | "other_administrative_document" | "expense_claim" | "note_identity_document" | "note_family_document" | "note_work_document" | "note_health_document" | "note_house_document" | "note_transport_document" | "note_activity_document" | "note_finance" | "note_invoice" | "note_other";
737
737
  /**
738
738
  * See https://github.com/cozy/DACC
739
739
  */