cozy-client 43.1.0 → 43.3.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.1.0";
2706
+ CozyClient.version = "43.3.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
  },
@@ -61,6 +61,12 @@ Object.defineProperty(exports, "useMutation", {
61
61
  return _useMutation.useMutation;
62
62
  }
63
63
  });
64
+ Object.defineProperty(exports, "useInstanceInfo", {
65
+ enumerable: true,
66
+ get: function get() {
67
+ return _useInstanceInfo.useInstanceInfo;
68
+ }
69
+ });
64
70
 
65
71
  var _useAppLinkWithStoreFallback = _interopRequireDefault(require("./useAppLinkWithStoreFallback"));
66
72
 
@@ -76,4 +82,6 @@ var _useAppsInMaintenance = _interopRequireDefault(require("./useAppsInMaintenan
76
82
 
77
83
  var _useQueryAll = _interopRequireDefault(require("./useQueryAll"));
78
84
 
79
- var _useMutation = require("./useMutation");
85
+ var _useMutation = require("./useMutation");
86
+
87
+ var _useInstanceInfo = require("./useInstanceInfo");
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useInstanceInfo = void 0;
9
+
10
+ var _useQuery = _interopRequireDefault(require("./useQuery"));
11
+
12
+ var _CozyClient = _interopRequireDefault(require("../CozyClient"));
13
+
14
+ var _dsl = require("../queries/dsl");
15
+
16
+ var _utils = require("../utils");
17
+
18
+ /**
19
+ * Retrieve intance info like context, uuid, disk usage etc
20
+ *
21
+ * @returns {import("../types").InstanceInfo}
22
+ */
23
+ var useInstanceInfo = function useInstanceInfo() {
24
+ var instanceQuery = buildSettingsByIdQuery('io.cozy.settings.instance');
25
+ var instanceResult = (0, _useQuery.default)(instanceQuery.definition, instanceQuery.options);
26
+ var contextQuery = buildSettingsByIdQuery('context');
27
+ var contextResult = (0, _useQuery.default)(contextQuery.definition, contextQuery.options);
28
+ var diskUsageQuery = buildSettingsByIdQuery('disk-usage');
29
+ var diskUsageResult = (0, _useQuery.default)(diskUsageQuery.definition, diskUsageQuery.options);
30
+ return {
31
+ isLoaded: !!(0, _utils.hasQueryBeenLoaded)(instanceResult) !== null && !!(0, _utils.hasQueryBeenLoaded)(contextResult) !== null && !!(0, _utils.hasQueryBeenLoaded)(diskUsageResult) !== null,
32
+ instance: {
33
+ data: instanceResult.data
34
+ },
35
+ context: {
36
+ data: contextResult.data
37
+ },
38
+ diskUsage: {
39
+ data: diskUsageResult.data
40
+ }
41
+ };
42
+ };
43
+
44
+ exports.useInstanceInfo = useInstanceInfo;
45
+ var DEFAULT_CACHE_TIMEOUT_QUERIES = 9 * 60 * 1000;
46
+
47
+ var buildSettingsByIdQuery = function buildSettingsByIdQuery(id) {
48
+ return {
49
+ definition: (0, _dsl.Q)('io.cozy.settings').getById(id),
50
+ options: {
51
+ as: "io.cozy.settings/".concat(id),
52
+ fetchPolicy: _CozyClient.default.fetchPolicies.olderThan(DEFAULT_CACHE_TIMEOUT_QUERIES),
53
+ singleDocData: true
54
+ }
55
+ };
56
+ };
@@ -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
  *
@@ -566,5 +566,76 @@ var _dsl = require("./queries/dsl");
566
566
  * @template T
567
567
  * @typedef {[T, import('react').Dispatch<import('react').SetStateAction<T>>]} useState
568
568
  */
569
+
570
+ /**
571
+ * Represents the Cozy's instance parameters
572
+ *
573
+ * @typedef {object} InstanceData
574
+ * @property {string} email - The email of the instance
575
+ * @property {string} locale - The locale used on the server
576
+ * @property {string} [public_name] - The public displayed name of the instance
577
+ * @property {string} [uuid] - UUID associated with the instance
578
+ * @property {string} [context] - The name of the context attached to the instance
579
+ * @property {string} [default_redirection] - Redirect to a specific route after the login (format: 'appslug/#/path/to/route'). This value has priority over the Context's default_redirection
580
+ * @property {boolean} [onboarding_finished] - Whether or not the onboarding is complete
581
+ * @property {boolean} [password_defined] - Whether or not the Cozy has a password defined (i.e. may be false for OIDC instances)
582
+ * @property {'basic' | 'two_factor_mail'} [auth_mode] - Authentication type (basic or 2FA)
583
+ * @property {string} [oidc_id] - An identifier to check authentication from OIDC
584
+ * @property {string} [tos] - Terms of Service signed version
585
+ * @property {string} [tos_latest] - Terms of Service latest version
586
+ */
587
+
588
+ /**
589
+ * Represents the Cozy's instance parameters
590
+ *
591
+ * @typedef {object} Instance
592
+ * @property {InstanceData} data - data from Instance Query
593
+ */
594
+
595
+ /**
596
+ * Represents the Cozy's context parameters
597
+ *
598
+ * @typedef {object} ContextData
599
+ * @property {string} [default_redirection] - Redirect to a specific route after the login (format: 'appslug/#/path/to/route')
600
+ * @property {string} [onboarded_redirection] - Redirect to a specific route after the onboarding (format: appslug/#/path/to/route')
601
+ * @property {string} [help_link] - Link that the user can use to get help (i.e. 'https://forum.cozy.io/')
602
+ * @property {string} [manager_url] - Url of the instance's Manager that can be use to enable/disable premium features
603
+ * @property {boolean} [enable_premium_links] - Whether or not the Cozy can show links to the Manager in order to enable/disable premium features
604
+ */
605
+
606
+ /**
607
+ * Represents the Cozy's context parameters
608
+ *
609
+ * @typedef {object} Context
610
+ * @property {ContextData} data - data from Context Query
611
+ */
612
+
613
+ /**
614
+ * Represents the Cozy's disk usage
615
+ *
616
+ * @typedef {object} DiskUsageData
617
+ * @property {string} [quota] - Value in bytes representing the maximum space available. Omitted means unlimited
618
+ * @property {string} used - Value in bytes representing the space used
619
+ * @property {string} files - Value in bytes representing the space used by files in their last version
620
+ * @property {string} versions - Value in bytes representing the space used by files in their older version
621
+ * @property {string} [trash] - Value in bytes representing the space used by files in the trash
622
+ */
623
+
624
+ /**
625
+ * Represents the Cozy's disk usage
626
+ *
627
+ * @typedef {object} DiskUsage
628
+ * @property {DiskUsageData} data - data from DiskUsage Query
629
+ */
630
+
631
+ /**
632
+ * Represents the Cozy's instance info (instance level parameters, context level parameters and disk usage)
633
+ *
634
+ * @typedef {object} InstanceInfo
635
+ * @property {boolean} isLoaded - Whether or not the queries have been loaded
636
+ * @property {Instance} instance - The Cozy's instance parameters
637
+ * @property {Context} context - The Cozy's context parameters
638
+ * @property {DiskUsage} diskUsage - The Cozy's disk usage
639
+ */
569
640
  var _default = {};
570
641
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "43.1.0",
3
+ "version": "43.3.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": "81e6523fab6fc927e6526d880910608124168059"
78
+ "gitHead": "eeefc22374dbb95969c385ca383b7d6ee8a1a58f"
79
79
  }
@@ -5,4 +5,5 @@ export { default as useClient } from "./useClient";
5
5
  export { default as useAppsInMaintenance } from "./useAppsInMaintenance";
6
6
  export { default as useQueryAll } from "./useQueryAll";
7
7
  export { useMutation } from "./useMutation";
8
+ export { useInstanceInfo } from "./useInstanceInfo";
8
9
  export { default as useQuery, useQueries } from "./useQuery";
@@ -0,0 +1 @@
1
+ export function useInstanceInfo(): import("../types").InstanceInfo;
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
  */
@@ -920,4 +920,155 @@ export type RedirectLinkData = {
920
920
  * Template to type useState
921
921
  */
922
922
  export type useState<T> = [T, import("react").Dispatch<import("react").SetStateAction<T>>];
923
+ /**
924
+ * Represents the Cozy's instance parameters
925
+ */
926
+ export type InstanceData = {
927
+ /**
928
+ * - The email of the instance
929
+ */
930
+ email: string;
931
+ /**
932
+ * - The locale used on the server
933
+ */
934
+ locale: string;
935
+ /**
936
+ * - The public displayed name of the instance
937
+ */
938
+ public_name?: string;
939
+ /**
940
+ * - UUID associated with the instance
941
+ */
942
+ uuid?: string;
943
+ /**
944
+ * - The name of the context attached to the instance
945
+ */
946
+ context?: string;
947
+ /**
948
+ * - Redirect to a specific route after the login (format: 'appslug/#/path/to/route'). This value has priority over the Context's default_redirection
949
+ */
950
+ default_redirection?: string;
951
+ /**
952
+ * - Whether or not the onboarding is complete
953
+ */
954
+ onboarding_finished?: boolean;
955
+ /**
956
+ * - Whether or not the Cozy has a password defined (i.e. may be false for OIDC instances)
957
+ */
958
+ password_defined?: boolean;
959
+ /**
960
+ * - Authentication type (basic or 2FA)
961
+ */
962
+ auth_mode?: 'basic' | 'two_factor_mail';
963
+ /**
964
+ * - An identifier to check authentication from OIDC
965
+ */
966
+ oidc_id?: string;
967
+ /**
968
+ * - Terms of Service signed version
969
+ */
970
+ tos?: string;
971
+ /**
972
+ * - Terms of Service latest version
973
+ */
974
+ tos_latest?: string;
975
+ };
976
+ /**
977
+ * Represents the Cozy's instance parameters
978
+ */
979
+ export type Instance = {
980
+ /**
981
+ * - data from Instance Query
982
+ */
983
+ data: InstanceData;
984
+ };
985
+ /**
986
+ * Represents the Cozy's context parameters
987
+ */
988
+ export type ContextData = {
989
+ /**
990
+ * - Redirect to a specific route after the login (format: 'appslug/#/path/to/route')
991
+ */
992
+ default_redirection?: string;
993
+ /**
994
+ * - Redirect to a specific route after the onboarding (format: appslug/#/path/to/route')
995
+ */
996
+ onboarded_redirection?: string;
997
+ /**
998
+ * - Link that the user can use to get help (i.e. 'https://forum.cozy.io/')
999
+ */
1000
+ help_link?: string;
1001
+ /**
1002
+ * - Url of the instance's Manager that can be use to enable/disable premium features
1003
+ */
1004
+ manager_url?: string;
1005
+ /**
1006
+ * - Whether or not the Cozy can show links to the Manager in order to enable/disable premium features
1007
+ */
1008
+ enable_premium_links?: boolean;
1009
+ };
1010
+ /**
1011
+ * Represents the Cozy's context parameters
1012
+ */
1013
+ export type Context = {
1014
+ /**
1015
+ * - data from Context Query
1016
+ */
1017
+ data: ContextData;
1018
+ };
1019
+ /**
1020
+ * Represents the Cozy's disk usage
1021
+ */
1022
+ export type DiskUsageData = {
1023
+ /**
1024
+ * - Value in bytes representing the maximum space available. Omitted means unlimited
1025
+ */
1026
+ quota?: string;
1027
+ /**
1028
+ * - Value in bytes representing the space used
1029
+ */
1030
+ used: string;
1031
+ /**
1032
+ * - Value in bytes representing the space used by files in their last version
1033
+ */
1034
+ files: string;
1035
+ /**
1036
+ * - Value in bytes representing the space used by files in their older version
1037
+ */
1038
+ versions: string;
1039
+ /**
1040
+ * - Value in bytes representing the space used by files in the trash
1041
+ */
1042
+ trash?: string;
1043
+ };
1044
+ /**
1045
+ * Represents the Cozy's disk usage
1046
+ */
1047
+ export type DiskUsage = {
1048
+ /**
1049
+ * - data from DiskUsage Query
1050
+ */
1051
+ data: DiskUsageData;
1052
+ };
1053
+ /**
1054
+ * Represents the Cozy's instance info (instance level parameters, context level parameters and disk usage)
1055
+ */
1056
+ export type InstanceInfo = {
1057
+ /**
1058
+ * - Whether or not the queries have been loaded
1059
+ */
1060
+ isLoaded: boolean;
1061
+ /**
1062
+ * - The Cozy's instance parameters
1063
+ */
1064
+ instance: Instance;
1065
+ /**
1066
+ * - The Cozy's context parameters
1067
+ */
1068
+ context: Context;
1069
+ /**
1070
+ * - The Cozy's disk usage
1071
+ */
1072
+ diskUsage: DiskUsage;
1073
+ };
923
1074
  import { QueryDefinition } from "./queries/dsl";