cozy-client 38.0.0 → 38.0.2

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.
Files changed (57) hide show
  1. package/dist/CozyClient.js +44 -46
  2. package/dist/RealTimeQueries.js +6 -8
  3. package/dist/StackLink.js +4 -6
  4. package/dist/associations/Association.js +2 -4
  5. package/dist/associations/HasMany.js +6 -8
  6. package/dist/associations/HasManyFiles.js +5 -7
  7. package/dist/associations/HasManyInPlace.js +2 -4
  8. package/dist/associations/HasOne.js +5 -7
  9. package/dist/associations/HasOneInPlace.js +2 -4
  10. package/dist/associations/helpers.js +10 -12
  11. package/dist/authentication/mobile.js +1 -3
  12. package/dist/devtools/Queries.js +4 -6
  13. package/dist/errors.js +4 -6
  14. package/dist/flagship-certification/flagship-certification.js +2 -4
  15. package/dist/flagship-certification/store-attestation.android.js +2 -4
  16. package/dist/flagship-certification/store-attestation.ios.js +2 -4
  17. package/dist/flagship-certification/store-attestation.js +2 -4
  18. package/dist/helpers/urlHelper.js +3 -5
  19. package/dist/hooks/useAppsInMaintenance.js +1 -3
  20. package/dist/hooks/useCapabilities.js +1 -1
  21. package/dist/hooks/useClientErrors.js +3 -5
  22. package/dist/hooks/useQuery.js +2 -4
  23. package/dist/hooks/useQueryAll.js +2 -4
  24. package/dist/models/dacc.js +5 -7
  25. package/dist/models/document/documentTypeData.js +12 -14
  26. package/dist/models/document/documentTypeDataHelpers.js +4 -6
  27. package/dist/models/file.js +23 -25
  28. package/dist/models/folder.js +5 -7
  29. package/dist/models/timeseries.js +1 -3
  30. package/dist/queries/dsl.js +6 -8
  31. package/dist/store/documents.js +1 -3
  32. package/dist/store/queries.js +28 -30
  33. package/package.json +3 -3
  34. package/types/CozyClient.d.ts +75 -92
  35. package/types/RealTimeQueries.d.ts +1 -2
  36. package/types/StackLink.d.ts +4 -7
  37. package/types/associations/Association.d.ts +3 -4
  38. package/types/associations/HasMany.d.ts +6 -7
  39. package/types/associations/HasOne.d.ts +5 -6
  40. package/types/associations/helpers.d.ts +4 -7
  41. package/types/errors.d.ts +9 -11
  42. package/types/flagship-certification/flagship-certification.d.ts +1 -2
  43. package/types/flagship-certification/store-attestation.android.d.ts +1 -3
  44. package/types/flagship-certification/store-attestation.d.ts +3 -5
  45. package/types/flagship-certification/store-attestation.ios.d.ts +1 -3
  46. package/types/helpers/urlHelper.d.ts +2 -5
  47. package/types/hooks/useAppsInMaintenance.d.ts +2 -3
  48. package/types/hooks/useQuery.d.ts +3 -5
  49. package/types/hooks/useQueryAll.d.ts +3 -5
  50. package/types/models/dacc.d.ts +4 -7
  51. package/types/models/document/documentTypeData.d.ts +2 -3
  52. package/types/models/document/documentTypeDataHelpers.d.ts +1 -3
  53. package/types/models/file.d.ts +22 -24
  54. package/types/models/folder.d.ts +3 -5
  55. package/types/queries/dsl.d.ts +13 -16
  56. package/types/store/documents.d.ts +1 -2
  57. package/types/store/queries.d.ts +11 -16
@@ -53,8 +53,6 @@ var _context = _interopRequireDefault(require("../context"));
53
53
 
54
54
  var _useClient = _interopRequireDefault(require("../hooks/useClient"));
55
55
 
56
- var _types = require("../types");
57
-
58
56
  var _common = require("./common");
59
57
 
60
58
  var _PanelContent = _interopRequireDefault(require("./PanelContent"));
@@ -93,7 +91,7 @@ var getClassNameForExecutedTimesQuery = function getClassNameForExecutedTimesQue
93
91
  }
94
92
  };
95
93
  /**
96
- * @param {{ queryState: QueryState }} props - Query state containing fetchStatus, lastError
94
+ * @param {{ queryState: import("../types").QueryState }} props - Query state containing fetchStatus, lastError
97
95
  */
98
96
 
99
97
 
@@ -106,7 +104,7 @@ var FetchStatus = function FetchStatus(props) {
106
104
  }, fetchStatus, fetchStatus === 'failed' ? " - ".concat(lastError) : null);
107
105
  };
108
106
  /**
109
- * @param {{ queryState: QueryState }} props - Query state containing definition
107
+ * @param {{ queryState: import("../types").QueryState }} props - Query state containing definition
110
108
  */
111
109
 
112
110
 
@@ -119,7 +117,7 @@ var IndexedFields = function IndexedFields(props) {
119
117
  };
120
118
  /**
121
119
  * @param {string} search - Search string
122
- * @returns {function(CozyClientDocument): Boolean}
120
+ * @returns {function(import("../types").CozyClientDocument): Boolean}
123
121
  */
124
122
 
125
123
 
@@ -232,7 +230,7 @@ var QueryStateView = function QueryStateView(_ref3) {
232
230
  var name = _ref3.name;
233
231
 
234
232
  /**
235
- * @type {QueryState}
233
+ * @type {import("../types").QueryState}
236
234
  */
237
235
  var queryState = useCozySelector(function (state) {
238
236
  return state.cozy.queries[name];
package/dist/errors.js CHANGED
@@ -23,8 +23,6 @@ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/w
23
23
 
24
24
  var _zipWith = _interopRequireDefault(require("lodash/zipWith"));
25
25
 
26
- var _types = require("./types");
27
-
28
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
29
27
 
30
28
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -41,8 +39,8 @@ var BulkEditError = /*#__PURE__*/function (_Error) {
41
39
  /**
42
40
  * Indicates that a bulk edit has (potentially partially) failed
43
41
  *
44
- * @param {CouchDBBulkResult[]} bulkResponse - CouchDB Bulk response
45
- * @param {CozyClientDocument[]} updatedDocs - Docs with updated _id and _rev
42
+ * @param {import("./types").CouchDBBulkResult[]} bulkResponse - CouchDB Bulk response
43
+ * @param {import("./types").CozyClientDocument[]} updatedDocs - Docs with updated _id and _rev
46
44
  */
47
45
  function BulkEditError(bulkResponse, updatedDocs) {
48
46
  var _this;
@@ -60,7 +58,7 @@ var BulkEditError = /*#__PURE__*/function (_Error) {
60
58
  /**
61
59
  * Get documents that have been correctly updated
62
60
  *
63
- * @returns {CozyClientDocument[]}
61
+ * @returns {import("./types").CozyClientDocument[]}
64
62
  */
65
63
 
66
64
 
@@ -76,7 +74,7 @@ var BulkEditError = /*#__PURE__*/function (_Error) {
76
74
  /**
77
75
  * Get bulk errors results
78
76
  *
79
- * @returns {Array<CouchDBBulkResult & { doc: CozyClientDocument }>}
77
+ * @returns {Array<import("./types").CouchDBBulkResult & { doc: import("./types").CozyClientDocument }>}
80
78
  */
81
79
 
82
80
  }, {
@@ -17,8 +17,6 @@ var _logger = _interopRequireDefault(require("../logger"));
17
17
 
18
18
  var _storeAttestation = require("./store-attestation");
19
19
 
20
- var _typedefs = require("./typedefs");
21
-
22
20
  /**
23
21
  * Request a challenge from the Stack that can be used to request the app attestation from the app store
24
22
  *
@@ -65,7 +63,7 @@ var getStackChallenge = /*#__PURE__*/function () {
65
63
  /**
66
64
  * Give the app attestation to the Stack
67
65
  *
68
- * @param {AttestationResult} appAttestation - the app attestation that was returned by the app store
66
+ * @param {import("./typedefs").AttestationResult} appAttestation - the app attestation that was returned by the app store
69
67
  * @param {string} nonce - the Nonce string retrieved from the stack
70
68
  * @param {CozyClient} client - the CozyClient instance
71
69
  */
@@ -118,7 +116,7 @@ var giveAppAttestationToStack = /*#__PURE__*/function () {
118
116
  * Verify app's identity and integrity so the Stack can trust it
119
117
  * Verification is done on Stack side by using information from the app's store (Google Play or Apple AppStore)
120
118
  *
121
- * @param {CertificationConfig} certificationConfig - the required configuration to access the stores API
119
+ * @param {import("./typedefs").CertificationConfig} certificationConfig - the required configuration to access the stores API
122
120
  * @param {CozyClient} client - the CozyClient instance
123
121
  */
124
122
 
@@ -13,16 +13,14 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
13
13
 
14
14
  var _reactNativeGoogleSafetynet = _interopRequireDefault(require("react-native-google-safetynet"));
15
15
 
16
- var _typedefs = require("./typedefs");
17
-
18
16
  //@ts-ignore next-line
19
17
 
20
18
  /**
21
19
  * Retrieve the app's attestation from the Google Play store
22
20
  *
23
21
  * @param {string} nonce - the Nonce string retrieved from the stack
24
- * @param {CertificationConfig} certificationConfig - Configuration to access the stores certification API
25
- * @returns {Promise<AttestationResult>} the app's attestation
22
+ * @param {import("./typedefs").CertificationConfig} certificationConfig - Configuration to access the stores certification API
23
+ * @returns {Promise<import("./typedefs").AttestationResult>} the app's attestation
26
24
  */
27
25
  var getAppAttestationFromStore = /*#__PURE__*/function () {
28
26
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(nonce, certificationConfig) {
@@ -13,16 +13,14 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
13
13
 
14
14
  var _reactNativeIos11Devicecheck = _interopRequireDefault(require("react-native-ios11-devicecheck"));
15
15
 
16
- var _typedefs = require("./typedefs");
17
-
18
16
  //@ts-ignore next-line
19
17
 
20
18
  /**
21
19
  * Retrieve the app's attestation from the Apple AppStore
22
20
  *
23
21
  * @param {string} nonce - the Nonce string retrieved from the stack
24
- * @param {CertificationConfig} certificationConfig - Configuration to access the stores certification API
25
- * @returns {Promise<AttestationResult>} the app's attestation
22
+ * @param {import("./typedefs").CertificationConfig} certificationConfig - Configuration to access the stores certification API
23
+ * @returns {Promise<import("./typedefs").AttestationResult>} the app's attestation
26
24
  */
27
25
  var getAppAttestationFromStore = /*#__PURE__*/function () {
28
26
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(nonce, certificationConfig) {
@@ -11,15 +11,13 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
11
11
 
12
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
13
 
14
- var _typedefs = require("./typedefs");
15
-
16
14
  /**
17
15
  * Retrieve the app's attestation from the app's store
18
16
  * /!\ This is a mock implementation that should never be called
19
17
  *
20
18
  * @param {string} nonce - the Nonce string retrieved from the stack
21
- * @param {CertificationConfig} certificationConfig - Configuration to access the stores certification API
22
- * @returns {Promise<AttestationResult>} the app's attestation
19
+ * @param {import("./typedefs").CertificationConfig} certificationConfig - Configuration to access the stores certification API
20
+ * @returns {Promise<import("./typedefs").AttestationResult>} the app's attestation
23
21
  */
24
22
  var validateAppMock = /*#__PURE__*/function () {
25
23
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(nonce, certificationConfig) {
@@ -27,8 +27,6 @@ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/w
27
27
 
28
28
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
29
29
 
30
- var _types = require("../types");
31
-
32
30
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
33
31
 
34
32
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
@@ -108,8 +106,8 @@ var generateWebLink = function generateWebLink(_ref) {
108
106
  * The given link MUST contain a slug
109
107
  *
110
108
  * @param {string} webLink - link to deconstruct. It should be a link from a Cozy and containing a slug
111
- * @param {SubdomainType} [subDomainType=flat] - whether the cozy is using flat or nested subdomains.
112
- * @returns {CozyLinkData} Deconstructed link
109
+ * @param {import("../types").SubdomainType} [subDomainType=flat] - whether the cozy is using flat or nested subdomains.
110
+ * @returns {import("../types").CozyLinkData} Deconstructed link
113
111
  */
114
112
 
115
113
 
@@ -141,7 +139,7 @@ var isValidSlug = function isValidSlug(slug) {
141
139
  * Deconstruct the given redirect link in order to retrieve slug, pathname and hash
142
140
  *
143
141
  * @param {string} redirectLink - redirect link to deconstruct (i.e. 'drive/public/#/folder/SOME_ID')
144
- * @returns {RedirectLinkData} Deconstructed link
142
+ * @returns {import("../types").RedirectLinkData} Deconstructed link
145
143
  * @throws {InvalidRedirectLinkError} Thrown when redirect link is invalid
146
144
  */
147
145
 
@@ -19,14 +19,12 @@ var _registry = _interopRequireDefault(require("../registry"));
19
19
 
20
20
  var _CozyClient = _interopRequireDefault(require("../CozyClient"));
21
21
 
22
- var _types = require("../types");
23
-
24
22
  /**
25
23
  * Returns all apps in maintenance
26
24
  *
27
25
  * @param {CozyClient} client CozyClient instance
28
26
  *
29
- * @returns {AppsDoctype[]} An array with all apps in maintenance
27
+ * @returns {import("../types").AppsDoctype[]} An array with all apps in maintenance
30
28
  */
31
29
  var useAppsInMaintenance = function useAppsInMaintenance(client) {
32
30
  var _useState = (0, _react.useState)([]),
@@ -41,7 +41,7 @@ var useCapabilities = function useCapabilities(client) {
41
41
  setFetchStatus('loading');
42
42
  _context.prev = 1;
43
43
  _context.next = 4;
44
- return client.query((0, _dsl.Q)('io.cozy.settings').getById('capabilities'));
44
+ return client.query((0, _dsl.Q)('io.cozy.settings').getById('io.cozy.settings.capabilities'));
45
45
 
46
46
  case 4:
47
47
  capabilitiesResult = _context.sent;
@@ -21,8 +21,6 @@ var _cozyStackClient = require("cozy-stack-client");
21
21
 
22
22
  var _ = require("./");
23
23
 
24
- var _types = require("../types");
25
-
26
24
  /**
27
25
  * Rendering functions for client fetch errors by status code
28
26
  *
@@ -52,7 +50,7 @@ function QuotaError(_ref) {
52
50
  /**
53
51
  * Returns the handler for an error
54
52
  *
55
- * @param {ClientError} error - The error
53
+ * @param {import("../types").ClientError} error - The error
56
54
  * @returns {Function|null} React Component
57
55
  */
58
56
 
@@ -70,7 +68,7 @@ function getErrorComponent(error) {
70
68
  *
71
69
  * @private
72
70
  * @see ClientErrors
73
- * @param {ClientError[]} errorStack - array of errors/exceptions
71
+ * @param {import("../types").ClientError[]} errorStack - array of errors/exceptions
74
72
  * @param {Function} setErrorStack - mutates the array of errors
75
73
  * @returns {Array<React.ReactElement>} React rendering
76
74
  */
@@ -140,7 +138,7 @@ function useClientErrors() {
140
138
  /**
141
139
  * Handle client errors, add them to the error stack
142
140
  *
143
- * @param {ClientError} error -
141
+ * @param {import("../types").ClientError} error -
144
142
  * @returns {boolean} true if the error was manager, false otherwise
145
143
  */
146
144
 
@@ -21,8 +21,6 @@ var _useClient = _interopRequireDefault(require("./useClient"));
21
21
 
22
22
  var _logger = _interopRequireDefault(require("../logger"));
23
23
 
24
- var _types = require("../types");
25
-
26
24
  var _context = require("../context");
27
25
 
28
26
  var _dsl = require("../queries/dsl");
@@ -44,8 +42,8 @@ var generateFetchMoreQueryDefinition = function generateFetchMoreQueryDefinition
44
42
  * Fetches a queryDefinition and returns the queryState
45
43
  *
46
44
  * @param {QueryDefinition} queryDefinition - Definition created with Q()
47
- * @param {QueryOptions} options - Options created with Q()
48
- * @returns {UseQueryReturnValue}
45
+ * @param {import("../types").QueryOptions} options - Options created with Q()
46
+ * @returns {import("../types").UseQueryReturnValue}
49
47
  */
50
48
 
51
49
 
@@ -15,8 +15,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
15
15
 
16
16
  var _react = require("react");
17
17
 
18
- var _types = require("../types");
19
-
20
18
  var _dsl = require("../queries/dsl");
21
19
 
22
20
  var _useQuery = _interopRequireDefault(require("./useQuery"));
@@ -27,8 +25,8 @@ var _useSafeState3 = _interopRequireDefault(require("./helpers/useSafeState"));
27
25
  * Fetches a queryDefinition and run fetchMore on the query until the query is fully loaded
28
26
  *
29
27
  * @param {QueryDefinition} queryDefinition - Definition created with Q()
30
- * @param {QueryOptions} options - Options created with Q()
31
- * @returns {UseQueryReturnValue}
28
+ * @param {import("../types").QueryOptions} options - Options created with Q()
29
+ * @returns {import("../types").UseQueryReturnValue}
32
30
  */
33
31
  var useQueryAll = function useQueryAll(queryDefinition, options) {
34
32
  var _useSafeState = (0, _useSafeState3.default)(false),
@@ -13,8 +13,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
13
13
 
14
14
  var _cozyLogger = _interopRequireDefault(require("cozy-logger"));
15
15
 
16
- var _types = require("../types");
17
-
18
16
  var _CozyClient = _interopRequireDefault(require("../CozyClient"));
19
17
 
20
18
  /**
@@ -34,7 +32,7 @@ var isCorrectDateFormat = function isCorrectDateFormat(date) {
34
32
  /**
35
33
  * Throw an errror if a DACC parameter is incorrect.
36
34
  *
37
- * @param { DACCMeasure} measure - The DACC measure
35
+ * @param { import("../types").DACCMeasure} measure - The DACC measure
38
36
  */
39
37
 
40
38
 
@@ -82,7 +80,7 @@ var checkMeasureParams = function checkMeasureParams(measure) {
82
80
  *
83
81
  * @param {CozyClient} client - The CozyClient instance
84
82
  * @param {string} remoteDoctype - The remote doctype to use
85
- * @param {DACCMeasure} measure - The DACC measure
83
+ * @param {import("../types").DACCMeasure} measure - The DACC measure
86
84
  */
87
85
 
88
86
 
@@ -134,7 +132,7 @@ var sendMeasureToDACC = /*#__PURE__*/function () {
134
132
  * @property {string} [endDate] - The measure end date
135
133
  *
136
134
  * @param {Params} params - The unformatted DACC aggregate params
137
- * @returns {DACCAggregatesParams}
135
+ * @returns {import("../types").DACCAggregatesParams}
138
136
  */
139
137
 
140
138
 
@@ -166,8 +164,8 @@ var buildAggregateParams = function buildAggregateParams(params) {
166
164
  *
167
165
  * @param {CozyClient} client - The CozyClient instance
168
166
  * @param {string} remoteDoctype - The remote doctype to use
169
- * @param {DACCAggregatesParams} params - The request params
170
- * @returns { Promise<DACCAggregatesResponse> }
167
+ * @param {import("../types").DACCAggregatesParams} params - The request params
168
+ * @returns { Promise<import("../types").DACCAggregatesResponse> }
171
169
  */
172
170
 
173
171
 
@@ -7,12 +7,10 @@ exports.themesList = void 0;
7
7
 
8
8
  var _qualification = require("./qualification");
9
9
 
10
- var _types = require("../../types");
11
-
12
10
  /**
13
11
  *
14
- * @param {Array<ItemsLabels>} labels - Array of items labels
15
- * @returns {Array<QualificationAttributes>}
12
+ * @param {Array<import("../../types").ItemsLabels>} labels - Array of items labels
13
+ * @returns {Array<import("../../types").QualificationAttributes>}
16
14
  */
17
15
  var buildItemsByLabel = function buildItemsByLabel(labels) {
18
16
  return labels.map(function (label) {
@@ -28,53 +26,53 @@ var buildItemsByLabel = function buildItemsByLabel(labels) {
28
26
  });
29
27
  };
30
28
  /**
31
- * @type {Array<IdentityLabel>}
29
+ * @type {Array<import("../../types").IdentityLabel>}
32
30
  */
33
31
 
34
32
 
35
33
  var identityLabels = ['identity_photo', 'national_id_card', 'passport', 'residence_permit', 'electoral_card', 'family_record_book', 'birth_certificate', 'driver_license', 'citizen_registration_certificate', 'other_identity_document'];
36
34
  /**
37
- * @type {Array<FamilyLabel>}
35
+ * @type {Array<import("../../types").FamilyLabel>}
38
36
  */
39
37
 
40
38
  var familyLabels = ['family_record_book', 'birth_certificate', 'wedding', 'pacs', 'single_parent_benefit', 'divorce', 'large_family_card', 'caf', 'payment_proof_family_allowance', 'other_family_document'];
41
39
  /**
42
- * @type {Array<WorkStudyLabels>}
40
+ * @type {Array<import("../../types").WorkStudyLabels>}
43
41
  */
44
42
 
45
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', 'other_work_document'];
46
44
  /**
47
- * @type {Array<HealthLabels>}
45
+ * @type {Array<import("../../types").HealthLabels>}
48
46
  */
49
47
 
50
48
  var healthLabels = ['health_certificate', 'health_book', 'national_health_insurance_card', 'national_health_insurance_right_certificate', 'health_insurance_card', 'prescription', 'health_invoice', 'work_disability_recognition', 'pregnancy_medical_certificate', 'other_health_document'];
51
49
  /**
52
- * @type {Array<HomeLabels>}
50
+ * @type {Array<import("../../types").HomeLabels>}
53
51
  */
54
52
 
55
53
  var homeLabels = ['phone_invoice', 'isp_invoice', 'telecom_invoice', 'energy_invoice', 'water_invoice', 'other_invoice', 'work_invoice', 'house_sale_agreeement', 'building_permit', 'technical_diagnostic_record', 'unfit_for_habitation_declaration', 'lease', 'rent_receipt', 'accommodation_proof', 'house_insurance', 'work_quote', 'other_house_document'];
56
54
  /**
57
- * @type {Array<TransportLabels>}
55
+ * @type {Array<import("../../types").TransportLabels>}
58
56
  */
59
57
 
60
58
  var transportLabels = ['driver_license', 'vehicle_registration', 'car_insurance', 'transport_card', 'mechanic_invoice', 'transport_invoice', 'other_transport_document'];
61
59
  /**
62
- * @type {Array<ActivityLabels>}
60
+ * @type {Array<import("../../types").ActivityLabels>}
63
61
  */
64
62
 
65
63
  var activityLabels = ['personal_sporting_licence', 'fidelity_card', 'library_card', 'other_activity_document'];
66
64
  /**
67
- * @type {Array<FinanceLabels>}
65
+ * @type {Array<import("../../types").FinanceLabels>}
68
66
  */
69
67
 
70
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', 'other_bank_document', 'other_revenue'];
71
69
  /**
72
- * @type {Array<InvoiceLabels>}
70
+ * @type {Array<import("../../types").InvoiceLabels>}
73
71
  */
74
72
 
75
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', 'other_invoice'];
76
74
  /**
77
- * @type {ThemesList}
75
+ * @type {import("../../types").ThemesList}
78
76
  */
79
77
 
80
78
  var themesList = [{
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getThemeByItem = void 0;
7
7
 
8
- var _types = require("../../types");
9
-
10
8
  var _documentTypeData = require("./documentTypeData");
11
9
 
12
10
  /**
13
- * @param {QualificationAttributes} item - Qualification item
14
- * @returns {Theme|undefined}
11
+ * @param {import("../../types").QualificationAttributes} item - Qualification item
12
+ * @returns {import("../../types").Theme|undefined}
15
13
  */
16
14
  var findDefaultItemTheme = function findDefaultItemTheme(item) {
17
15
  return _documentTypeData.themesList.find(function (theme) {
@@ -19,8 +17,8 @@ var findDefaultItemTheme = function findDefaultItemTheme(item) {
19
17
  });
20
18
  };
21
19
  /**
22
- * @param {QualificationAttributes} item - Qualification item
23
- * @returns {Theme|undefined}
20
+ * @param {import("../../types").QualificationAttributes} item - Qualification item
21
+ * @returns {import("../../types").Theme|undefined}
24
22
  */
25
23
 
26
24
 
@@ -28,8 +28,6 @@ var _qualification = require("./document/qualification");
28
28
 
29
29
  var _dsl = require("../queries/dsl");
30
30
 
31
- var _types = require("../types");
32
-
33
31
  var _const = require("../const");
34
32
 
35
33
  var _CozyClient = _interopRequireDefault(require("../CozyClient"));
@@ -48,7 +46,7 @@ var FILENAME_WITH_EXTENSION_REGEX = /(.+)(\..*)$/;
48
46
  /**
49
47
  * Returns base filename and extension
50
48
  *
51
- * @param {IOCozyFile} file An io.cozy.files
49
+ * @param {import("../types").IOCozyFile} file An io.cozy.files
52
50
  * @returns {object} {filename, extension}
53
51
  */
54
52
 
@@ -73,7 +71,7 @@ var splitFilename = function splitFilename(file) {
73
71
  };
74
72
  /**
75
73
  *
76
- * @param {IOCozyFile} file io.cozy.files
74
+ * @param {import("../types").IOCozyFile} file io.cozy.files
77
75
  */
78
76
 
79
77
 
@@ -84,7 +82,7 @@ var isFile = function isFile(file) {
84
82
  };
85
83
  /**
86
84
  *
87
- * @param {IOCozyFile} file io.cozy.files
85
+ * @param {import("../types").IOCozyFile} file io.cozy.files
88
86
  */
89
87
 
90
88
 
@@ -96,7 +94,7 @@ var isDirectory = function isDirectory(file) {
96
94
  /**
97
95
  * Is file param a correct note
98
96
  *
99
- * @param {IOCozyFile} file io.cozy.files
97
+ * @param {import("../types").IOCozyFile} file io.cozy.files
100
98
  * @returns {boolean}
101
99
  */
102
100
 
@@ -110,7 +108,7 @@ var isNote = function isNote(file) {
110
108
  /**
111
109
  * Whether the file is client-side encrypted
112
110
  *
113
- * @param {IOCozyFile} file - io.cozy.files document
111
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
114
112
  * @returns {boolean}
115
113
  */
116
114
 
@@ -123,7 +121,7 @@ var isEncrypted = function isEncrypted(file) {
123
121
  /**
124
122
  * Whether the file is supported by Only Office
125
123
  *
126
- * @param {IOCozyFile} file - io.cozy.file document
124
+ * @param {import("../types").IOCozyFile} file - io.cozy.file document
127
125
  * @returns {boolean}
128
126
  */
129
127
 
@@ -138,7 +136,7 @@ var isOnlyOfficeFile = function isOnlyOfficeFile(file) {
138
136
  * We want to be consistent with the stack so we check the class attributes
139
137
  * But we want to exclude .txt and .md because the CozyUI Viewer can already show them
140
138
  *
141
- * @param {IOCozyFile} file - io.cozy.file document
139
+ * @param {import("../types").IOCozyFile} file - io.cozy.file document
142
140
  * @returns {boolean}
143
141
  */
144
142
 
@@ -150,7 +148,7 @@ var shouldBeOpenedByOnlyOffice = function shouldBeOpenedByOnlyOffice(file) {
150
148
  };
151
149
  /**
152
150
  *
153
- * @param {IOCozyFile} file - io.cozy.files document
151
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
154
152
  * @returns {boolean} true if the file is a shortcut
155
153
  */
156
154
 
@@ -215,7 +213,7 @@ function getParentFolderId(file) {
215
213
  /**
216
214
  * Returns the status of a sharing shortcut.
217
215
  *
218
- * @param {IOCozyFile} file - io.cozy.files document
216
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
219
217
  *
220
218
  * @returns {string} A description of the status
221
219
  */
@@ -227,7 +225,7 @@ var getSharingShortcutStatus = function getSharingShortcutStatus(file) {
227
225
  /**
228
226
  * Returns the mime type of the target of the sharing shortcut, if it is a file.
229
227
  *
230
- * @param {IOCozyFile} file - io.cozy.files document
228
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
231
229
  *
232
230
  * @returns {string} The mime-type of the target file, or an empty string is the target is not a file.
233
231
  */
@@ -241,7 +239,7 @@ var getSharingShortcutTargetMime = function getSharingShortcutTargetMime(file) {
241
239
  /**
242
240
  * Returns the doctype of the target of the sharing shortcut.
243
241
  *
244
- * @param {IOCozyFile} file - io.cozy.files document
242
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
245
243
  *
246
244
  * @returns {string} A doctype
247
245
  */
@@ -255,7 +253,7 @@ var getSharingShortcutTargetDoctype = function getSharingShortcutTargetDoctype(f
255
253
  /**
256
254
  * Returns whether the file is a shortcut to a sharing
257
255
  *
258
- * @param {IOCozyFile} file - io.cozy.files document
256
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
259
257
  *
260
258
  * @returns {boolean}
261
259
  */
@@ -270,7 +268,7 @@ var isSharingShortcut = function isSharingShortcut(file) {
270
268
  * Returns whether the file is a shortcut to a sharing
271
269
  *
272
270
  * @deprecated Prefer to use isSharingShortcut.
273
- * @param {IOCozyFile} file - io.cozy.files document
271
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
274
272
  *
275
273
  * @returns {boolean}
276
274
  */
@@ -286,7 +284,7 @@ var isSharingShorcut = function isSharingShorcut(file) {
286
284
  /**
287
285
  * Returns whether the sharing shortcut is new
288
286
  *
289
- * @param {IOCozyFile} file - io.cozy.files document
287
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
290
288
  *
291
289
  * @returns {boolean}
292
290
  */
@@ -318,9 +316,9 @@ var isSharingShorcutNew = function isSharingShorcutNew(file) {
318
316
  * Save the file with the given qualification
319
317
  *
320
318
  * @param {CozyClient} client - The CozyClient instance
321
- * @param {IOCozyFile} file - The file to qualify
319
+ * @param {import("../types").IOCozyFile} file - The file to qualify
322
320
  * @param {object} qualification - The file qualification
323
- * @returns {Promise<IOCozyFile>} The saved file
321
+ * @returns {Promise<import("../types").IOCozyFile>} The saved file
324
322
  */
325
323
 
326
324
 
@@ -353,7 +351,7 @@ var saveFileQualification = /*#__PURE__*/function () {
353
351
  *
354
352
  * @param {object} client - The CozyClient instance
355
353
  * @param {object} docRules - the rules containing the searched qualification and the count
356
- * @returns {Promise<QueryResult>} The files found by the rules
354
+ * @returns {Promise<import("../types").QueryResult>} The files found by the rules
357
355
  */
358
356
 
359
357
 
@@ -395,7 +393,7 @@ var fetchFilesByQualificationRules = /*#__PURE__*/function () {
395
393
  * Whether the file's metadata attribute exists
396
394
  *
397
395
  * @param {object} params - Param
398
- * @param {IOCozyFile} params.file - An io.cozy.files document
396
+ * @param {import("../types").IOCozyFile} params.file - An io.cozy.files document
399
397
  * @param {string} params.attribute - Metadata attribute to check
400
398
  * @returns {boolean}
401
399
  */
@@ -583,7 +581,7 @@ var move = /*#__PURE__*/function () {
583
581
  * @param {string} dirPath - Fullpath of directory to upload to ex: path/to/
584
582
  * @param {object} file - HTML Object file
585
583
  * @param {object} metadata - An object containing the wanted metadata to attach
586
- * @returns {Promise<IOCozyFile>} The overrided file
584
+ * @returns {Promise<import("../types").IOCozyFile>} The overrided file
587
585
  */
588
586
 
589
587
 
@@ -685,7 +683,7 @@ var generateNewFileNameOnConflict = function generateNewFileNameOnConflict(filen
685
683
  /**
686
684
  * Generate a file name for a revision
687
685
  *
688
- * @param {IOCozyFile} file - io.cozy.files document
686
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
689
687
  * @param {object} revision - The revision containing the updated_at
690
688
  * @param {function} f - A function taking a a date and a format as arguments to generate the name.
691
689
  */
@@ -970,7 +968,7 @@ var isPlainText = function isPlainText() {
970
968
  return mimeType ? /^text\//.test(mimeType) : /\.(txt|md)$/.test(fileName);
971
969
  };
972
970
  /**
973
- * @param {IOCozyFile} file - io.cozy.files document
971
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
974
972
  * @returns {boolean}
975
973
  */
976
974
 
@@ -981,7 +979,7 @@ var hasQualifications = function hasQualifications(file) {
981
979
  return (0, _has.default)(file, 'metadata.qualification');
982
980
  };
983
981
  /**
984
- * @param {IOCozyFile} file - io.cozy.files document
982
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
985
983
  * @returns {boolean}
986
984
  */
987
985
 
@@ -992,7 +990,7 @@ var hasCertifications = function hasCertifications(file) {
992
990
  return (0, _get.default)(file, 'metadata.carbonCopy', false) || (0, _get.default)(file, 'metadata.electronicSafe', false);
993
991
  };
994
992
  /**
995
- * @param {IOCozyFile} file - io.cozy.files document
993
+ * @param {import("../types").IOCozyFile} file - io.cozy.files document
996
994
  * @returns {boolean}
997
995
  */
998
996