cozy-client 38.0.1 → 38.1.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.
- package/dist/CozyClient.js +43 -45
- package/dist/RealTimeQueries.js +6 -8
- package/dist/StackLink.js +4 -6
- package/dist/associations/Association.js +2 -4
- package/dist/associations/HasMany.js +6 -8
- package/dist/associations/HasManyFiles.js +5 -7
- package/dist/associations/HasManyInPlace.js +2 -4
- package/dist/associations/HasOne.js +5 -7
- package/dist/associations/HasOneInPlace.js +2 -4
- package/dist/associations/helpers.js +10 -12
- package/dist/authentication/mobile.js +1 -3
- package/dist/devtools/Queries.js +4 -6
- package/dist/errors.js +4 -6
- package/dist/flagship-certification/flagship-certification.js +2 -4
- package/dist/flagship-certification/store-attestation.android.js +2 -4
- package/dist/flagship-certification/store-attestation.ios.js +2 -4
- package/dist/flagship-certification/store-attestation.js +2 -4
- package/dist/helpers/urlHelper.js +3 -5
- package/dist/hooks/useAppsInMaintenance.js +1 -3
- package/dist/hooks/useClientErrors.js +3 -5
- package/dist/hooks/useQuery.js +2 -4
- package/dist/hooks/useQueryAll.js +2 -4
- package/dist/models/dacc.js +5 -7
- package/dist/models/document/documentTypeData.js +12 -14
- package/dist/models/document/documentTypeDataHelpers.js +4 -6
- package/dist/models/document/locales/fr.json +1 -1
- package/dist/models/document/locales/index.js +1 -1
- package/dist/models/document/locales/index.spec.js +4 -4
- package/dist/models/file.js +23 -25
- package/dist/models/folder.js +5 -7
- package/dist/models/timeseries.js +1 -3
- package/dist/queries/dsl.js +6 -8
- package/dist/store/documents.js +1 -3
- package/dist/store/queries.js +28 -30
- package/package.json +3 -3
- package/types/CozyClient.d.ts +75 -92
- package/types/RealTimeQueries.d.ts +1 -2
- package/types/StackLink.d.ts +4 -7
- package/types/associations/Association.d.ts +3 -4
- package/types/associations/HasMany.d.ts +6 -7
- package/types/associations/HasOne.d.ts +5 -6
- package/types/associations/helpers.d.ts +4 -7
- package/types/errors.d.ts +9 -11
- package/types/flagship-certification/flagship-certification.d.ts +1 -2
- package/types/flagship-certification/store-attestation.android.d.ts +1 -3
- package/types/flagship-certification/store-attestation.d.ts +3 -5
- package/types/flagship-certification/store-attestation.ios.d.ts +1 -3
- package/types/helpers/urlHelper.d.ts +2 -5
- package/types/hooks/useAppsInMaintenance.d.ts +2 -3
- package/types/hooks/useQuery.d.ts +3 -5
- package/types/hooks/useQueryAll.d.ts +3 -5
- package/types/models/dacc.d.ts +4 -7
- package/types/models/document/documentTypeData.d.ts +2 -3
- package/types/models/document/documentTypeDataHelpers.d.ts +1 -3
- package/types/models/file.d.ts +22 -24
- package/types/models/folder.d.ts +3 -5
- package/types/queries/dsl.d.ts +13 -16
- package/types/store/documents.d.ts +1 -2
- package/types/store/queries.d.ts +11 -16
package/dist/devtools/Queries.js
CHANGED
|
@@ -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)([]),
|
|
@@ -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
|
|
package/dist/hooks/useQuery.js
CHANGED
|
@@ -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),
|
package/dist/models/dacc.js
CHANGED
|
@@ -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
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bank_statement": "Relevé de compte |||| Relevés de compte",
|
|
26
26
|
"birth_certificate": "Certificat de naissance |||| Certificats de naissance",
|
|
27
27
|
"building_permit": "Permis de construire",
|
|
28
|
-
"caf": "Attestation de quotient familial
|
|
28
|
+
"caf": "Attestation de quotient familial CAF |||| Attestations de quotient familial CAF",
|
|
29
29
|
"car_insurance": "Attestation d'assurance auto |||| Attestations d'assurance auto",
|
|
30
30
|
"citizen_registration_certificate": "Attestation de recensement citoyen |||| Attestations de recensement citoyen",
|
|
31
31
|
"diploma": "Diplôme |||| Diplômes",
|
|
@@ -42,7 +42,7 @@ var getBoundT = function getBoundT(lang) {
|
|
|
42
42
|
smart_count: (opts === null || opts === void 0 ? void 0 : opts.smart_count) || 1
|
|
43
43
|
};
|
|
44
44
|
var emojiCountry = (0, _emojiCountry.getEmojiByCountry)(opts === null || opts === void 0 ? void 0 : opts.country, t);
|
|
45
|
-
return emojiCountry ? "".concat(t(label, newOpts), "
|
|
45
|
+
return emojiCountry ? "".concat(t(label, newOpts), " ").concat(emojiCountry) : t(label, newOpts);
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -17,10 +17,10 @@ describe('getBoundT', () => {
|
|
|
17
17
|
it.each`
|
|
18
18
|
translationKey | country | smart_count | lang | expected
|
|
19
19
|
${'Scan.items.national_id_card'} | ${undefined} | ${undefined} | ${'en'} | ${'ID card'}
|
|
20
|
-
${'Scan.items.national_id_card'} | ${'fr'} | ${undefined} | ${'en'} | ${'ID card
|
|
21
|
-
${'Scan.items.national_id_card'} | ${'stranger'} | ${undefined} | ${'en'} | ${'ID card
|
|
22
|
-
${'Scan.items.national_id_card'} | ${'fr'} | ${1} | ${'en'} | ${'ID card
|
|
23
|
-
${'Scan.items.national_id_card'} | ${'fr'} | ${2} | ${'en'} | ${'ID cards
|
|
20
|
+
${'Scan.items.national_id_card'} | ${'fr'} | ${undefined} | ${'en'} | ${'ID card 🇫🇷'}
|
|
21
|
+
${'Scan.items.national_id_card'} | ${'stranger'} | ${undefined} | ${'en'} | ${'ID card Stranger'}
|
|
22
|
+
${'Scan.items.national_id_card'} | ${'fr'} | ${1} | ${'en'} | ${'ID card 🇫🇷'}
|
|
23
|
+
${'Scan.items.national_id_card'} | ${'fr'} | ${2} | ${'en'} | ${'ID cards 🇫🇷'}
|
|
24
24
|
${'Scan.items.national_id_card'} | ${undefined} | ${1} | ${'en'} | ${'ID card'}
|
|
25
25
|
${'Scan.items.national_id_card'} | ${undefined} | ${2} | ${'en'} | ${'ID cards'}
|
|
26
26
|
`(
|