cozy-client 34.3.0 → 34.5.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.
@@ -2644,7 +2644,7 @@ var CozyClient = /*#__PURE__*/function () {
2644
2644
  CozyClient.hooks = CozyClient.hooks || {};
2645
2645
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2646
2646
 
2647
- CozyClient.version = "34.3.0";
2647
+ CozyClient.version = "34.5.0";
2648
2648
 
2649
2649
  _microee.default.mixin(CozyClient);
2650
2650
 
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.doctypes = exports.dacc = exports.sharing = exports.timeseries = exports.document = exports.contact = exports.utils = exports.permission = exports.note = exports.account = exports.folder = exports.file = exports.applications = exports.instance = exports.trigger = exports.accounts = exports.triggers = void 0;
8
+ exports.paper = exports.doctypes = exports.dacc = exports.sharing = exports.timeseries = exports.document = exports.contact = exports.utils = exports.permission = exports.note = exports.account = exports.folder = exports.file = exports.applications = exports.instance = exports.trigger = exports.accounts = exports.triggers = void 0;
9
9
 
10
10
  var trigger = _interopRequireWildcard(require("./trigger"));
11
11
 
@@ -66,6 +66,10 @@ exports.dacc = dacc;
66
66
  var doctypes = _interopRequireWildcard(require("./doctypes"));
67
67
 
68
68
  exports.doctypes = doctypes;
69
+
70
+ var paper = _interopRequireWildcard(require("./paper"));
71
+
72
+ exports.paper = paper;
69
73
  // For backward compatibility before 9.0.0
70
74
  var triggers = trigger;
71
75
  exports.triggers = triggers;
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.isExpiringSoon = exports.isExpired = exports.computeExpirationNoticeLink = exports.computeExpirationNoticeDate = exports.computeExpirationDate = exports.isExpiring = void 0;
9
+
10
+ var _add = _interopRequireDefault(require("date-fns/add"));
11
+
12
+ var _sub = _interopRequireDefault(require("date-fns/sub"));
13
+
14
+ /**
15
+ * @typedef {import("../types").IOCozyFile} IOCozyFile
16
+ */
17
+ var PERSONAL_SPORTING_LICENCE_PERIOD_DAYS = 365;
18
+ var PERSONAL_SPORTING_LICENCE_NOTICE_PERIOD_DAYS = 15;
19
+ /**
20
+ * @param {IOCozyFile} file - io.cozy.files document
21
+ * @returns {boolean}
22
+ * @description Tells if a given file is a national id card, is French, has an expiration date set and has a notice period set
23
+ */
24
+
25
+ var isExpiringFrenchNationalIdCard = function isExpiringFrenchNationalIdCard(file) {
26
+ var _file$metadata, _file$metadata$qualif, _file$metadata2, _file$metadata3, _file$metadata4;
27
+
28
+ var label = (_file$metadata = file.metadata) === null || _file$metadata === void 0 ? void 0 : (_file$metadata$qualif = _file$metadata.qualification) === null || _file$metadata$qualif === void 0 ? void 0 : _file$metadata$qualif.label;
29
+ var country = (_file$metadata2 = file.metadata) === null || _file$metadata2 === void 0 ? void 0 : _file$metadata2.country;
30
+ var expirationDate = (_file$metadata3 = file.metadata) === null || _file$metadata3 === void 0 ? void 0 : _file$metadata3.expirationDate;
31
+ var noticePeriod = (_file$metadata4 = file.metadata) === null || _file$metadata4 === void 0 ? void 0 : _file$metadata4.noticePeriod;
32
+
33
+ if (label === 'national_id_card' && (!country || country === 'fr') && expirationDate && noticePeriod) {
34
+ return true;
35
+ }
36
+
37
+ return false;
38
+ };
39
+ /**
40
+ * @param {IOCozyFile} file - io.cozy.files document
41
+ * @returns {boolean}
42
+ * @description Tells if a given file has an expiration date set and a notice period set
43
+ */
44
+
45
+
46
+ var isExpiringGeneric = function isExpiringGeneric(file) {
47
+ var _file$metadata5, _file$metadata6;
48
+
49
+ var expirationDate = (_file$metadata5 = file.metadata) === null || _file$metadata5 === void 0 ? void 0 : _file$metadata5.expirationDate;
50
+ var noticePeriod = (_file$metadata6 = file.metadata) === null || _file$metadata6 === void 0 ? void 0 : _file$metadata6.noticePeriod;
51
+
52
+ if (expirationDate && noticePeriod) {
53
+ return true;
54
+ }
55
+
56
+ return false;
57
+ };
58
+ /**
59
+ * @param {IOCozyFile} file - io.cozy.files document
60
+ * @returns {boolean}
61
+ * @description Tells if a given file is a sporting license, has a reference date set or a creation date if not
62
+ */
63
+
64
+
65
+ var isExpiringPersonalSportingLicense = function isExpiringPersonalSportingLicense(file) {
66
+ var _file$metadata7, _file$metadata7$quali, _file$metadata8;
67
+
68
+ var label = (_file$metadata7 = file.metadata) === null || _file$metadata7 === void 0 ? void 0 : (_file$metadata7$quali = _file$metadata7.qualification) === null || _file$metadata7$quali === void 0 ? void 0 : _file$metadata7$quali.label;
69
+ var referencedDate = (_file$metadata8 = file.metadata) === null || _file$metadata8 === void 0 ? void 0 : _file$metadata8.referencedDate;
70
+ var created_at = file.created_at;
71
+
72
+ if (label === 'personal_sporting_licence' && (referencedDate || created_at)) {
73
+ return true;
74
+ }
75
+
76
+ return false;
77
+ };
78
+ /**
79
+ * @param {IOCozyFile} file - io.cozy.files document
80
+ * @returns {boolean}
81
+ * @description Tells if a given file matches one of the known types of expiring papers
82
+ */
83
+
84
+
85
+ var isExpiring = function isExpiring(file) {
86
+ if (isExpiringFrenchNationalIdCard(file)) {
87
+ return true;
88
+ }
89
+
90
+ if (isExpiringGeneric(file)) {
91
+ return true;
92
+ }
93
+
94
+ if (isExpiringPersonalSportingLicense(file)) {
95
+ return true;
96
+ }
97
+
98
+ return false;
99
+ };
100
+ /**
101
+ * @param {IOCozyFile} file - io.cozy.files document
102
+ * @returns {Date | null} Expiration date
103
+ * @description Computes et returns the expiration date of the given file, or null if it is not expiring
104
+ */
105
+
106
+
107
+ exports.isExpiring = isExpiring;
108
+
109
+ var computeExpirationDate = function computeExpirationDate(file) {
110
+ if (isExpiringFrenchNationalIdCard(file) || isExpiringGeneric(file)) {
111
+ var _file$metadata9;
112
+
113
+ var expirationDate = (_file$metadata9 = file.metadata) === null || _file$metadata9 === void 0 ? void 0 : _file$metadata9.expirationDate;
114
+ return new Date(expirationDate);
115
+ }
116
+
117
+ if (isExpiringPersonalSportingLicense(file)) {
118
+ var _file$metadata10;
119
+
120
+ var referencedDate = (_file$metadata10 = file.metadata) === null || _file$metadata10 === void 0 ? void 0 : _file$metadata10.referencedDate;
121
+ var created_at = file.created_at;
122
+ return (0, _add.default)(new Date(referencedDate !== null && referencedDate !== void 0 ? referencedDate : created_at), {
123
+ days: PERSONAL_SPORTING_LICENCE_PERIOD_DAYS
124
+ });
125
+ }
126
+
127
+ return null;
128
+ };
129
+ /**
130
+ * @param {IOCozyFile} file - io.cozy.files document
131
+ * @returns {number | null} Expiration notice period in days
132
+ * @description Computes et returns the expiration notice period of the given file, or null if it is not expiring
133
+ */
134
+
135
+
136
+ exports.computeExpirationDate = computeExpirationDate;
137
+
138
+ var computeExpirationNoticePeriodInDays = function computeExpirationNoticePeriodInDays(file) {
139
+ if (isExpiringFrenchNationalIdCard(file) || isExpiringGeneric(file)) {
140
+ var _file$metadata11;
141
+
142
+ var noticePeriodInDays = (_file$metadata11 = file.metadata) === null || _file$metadata11 === void 0 ? void 0 : _file$metadata11.noticePeriod;
143
+ return parseInt(noticePeriodInDays, 10);
144
+ }
145
+
146
+ if (isExpiringPersonalSportingLicense(file)) {
147
+ return PERSONAL_SPORTING_LICENCE_NOTICE_PERIOD_DAYS;
148
+ }
149
+
150
+ return null;
151
+ };
152
+ /**
153
+ * @param {IOCozyFile} file - io.cozy.files document
154
+ * @returns {Date | null} Expiration notice date
155
+ * @description Computes et returns the expiration notice date of the given file, or null if it is not expiring
156
+ */
157
+
158
+
159
+ var computeExpirationNoticeDate = function computeExpirationNoticeDate(file) {
160
+ var expirationDate = computeExpirationDate(file);
161
+
162
+ if (expirationDate == null) {
163
+ return null;
164
+ }
165
+
166
+ var noticePeriodInDays = computeExpirationNoticePeriodInDays(file);
167
+
168
+ if (noticePeriodInDays == null) {
169
+ return null;
170
+ }
171
+
172
+ return (0, _sub.default)(expirationDate, {
173
+ days: noticePeriodInDays
174
+ });
175
+ };
176
+ /**
177
+ * @param {IOCozyFile} file - io.cozy.files document
178
+ * @returns {string | null} Expiration notice link
179
+ * @description Computes et returns the expiration notice link of the given file, or null if it has none or it is not expiring
180
+ */
181
+
182
+
183
+ exports.computeExpirationNoticeDate = computeExpirationNoticeDate;
184
+
185
+ var computeExpirationNoticeLink = function computeExpirationNoticeLink(file) {
186
+ var _file$metadata12, _file$metadata12$qual;
187
+
188
+ var qualificationLabel = (_file$metadata12 = file.metadata) === null || _file$metadata12 === void 0 ? void 0 : (_file$metadata12$qual = _file$metadata12.qualification) === null || _file$metadata12$qual === void 0 ? void 0 : _file$metadata12$qual.label;
189
+
190
+ if (isExpiringFrenchNationalIdCard(file)) {
191
+ return 'https://www.service-public.fr/particuliers/vosdroits/N358';
192
+ }
193
+
194
+ if (isExpiringGeneric(file) && qualificationLabel === 'residence_permit') {
195
+ return 'https://www.service-public.fr/particuliers/vosdroits/N110';
196
+ }
197
+
198
+ return null;
199
+ };
200
+ /**
201
+ * @param {IOCozyFile} file - io.cozy.files document
202
+ * @returns {boolean}
203
+ * @description Tells if the given file is expiring and if today is after its expiration date
204
+ */
205
+
206
+
207
+ exports.computeExpirationNoticeLink = computeExpirationNoticeLink;
208
+
209
+ var isExpired = function isExpired(file) {
210
+ var now = new Date();
211
+ var expirationDate = computeExpirationDate(file);
212
+ var isExpired = expirationDate != null && expirationDate <= now;
213
+ return isExpired;
214
+ };
215
+ /**
216
+ * @param {IOCozyFile} file - io.cozy.files document
217
+ * @returns {boolean}
218
+ * @description Tells if the given file is expiring and if today is between its expiration notice date and its expiration date
219
+ */
220
+
221
+
222
+ exports.isExpired = isExpired;
223
+
224
+ var isExpiringSoon = function isExpiringSoon(file) {
225
+ var now = new Date();
226
+ var expirationDate = computeExpirationDate(file);
227
+ var expirationNoticeDate = computeExpirationNoticeDate(file);
228
+ var isExpiringSoon = expirationDate != null && expirationNoticeDate != null && expirationNoticeDate <= now && now < expirationDate;
229
+ return isExpiringSoon;
230
+ };
231
+
232
+ exports.isExpiringSoon = isExpiringSoon;
@@ -0,0 +1,170 @@
1
+ import MockDate from 'mockdate'
2
+
3
+ import * as paperModel from './paper'
4
+
5
+ /**
6
+ *
7
+ * @param {object} param - options
8
+ * @param {string} param.qualificationLabel - qualification label
9
+ * @param {string} [param.expirationDate] - expiration date of file
10
+ * @param {string} [param.referencedDate] - reference date of file
11
+ * @param {string} [param.noticePeriod] - period before send notification
12
+ */
13
+ const buildMockFile = ({
14
+ qualificationLabel,
15
+ expirationDate,
16
+ referencedDate,
17
+ noticePeriod
18
+ }) => {
19
+ return /** @type {import('../types').IOCozyFile} */ ({
20
+ name: qualificationLabel,
21
+ created_at: '2022-09-01T00:00:00.000Z',
22
+ metadata: {
23
+ qualification: { label: qualificationLabel },
24
+ ...(expirationDate && { expirationDate }),
25
+ ...(referencedDate && { referencedDate }),
26
+ ...(noticePeriod && { noticePeriod })
27
+ }
28
+ })
29
+ }
30
+
31
+ describe('Expiration', () => {
32
+ beforeEach(() => {
33
+ MockDate.set('2022-11-01T11:35:58.118Z')
34
+ })
35
+ afterEach(() => {
36
+ MockDate.reset()
37
+ })
38
+
39
+ const fakeFileWithoutMetadata = /** @type {import('../types').IOCozyFile} */ ({
40
+ _id: '00',
41
+ name: 'unknown'
42
+ })
43
+ const fakeNationalIdCardFile = buildMockFile({
44
+ qualificationLabel: 'national_id_card',
45
+ expirationDate: '2022-09-23T11:35:58.118Z',
46
+ noticePeriod: '90'
47
+ })
48
+ const fakePersonalSportingLicenceFile = buildMockFile({
49
+ qualificationLabel: 'personal_sporting_licence',
50
+ referencedDate: '2022-09-23T11:35:58.118Z'
51
+ })
52
+ const fakeResidencePermitFile = buildMockFile({
53
+ qualificationLabel: 'residence_permit',
54
+ expirationDate: '2022-09-23T11:35:58.118Z',
55
+ noticePeriod: '90'
56
+ })
57
+
58
+ describe('computeExpirationDate', () => {
59
+ it('should return expirationDate', () => {
60
+ const res = paperModel.computeExpirationDate(fakeNationalIdCardFile)
61
+
62
+ expect(res.toISOString()).toBe('2022-09-23T11:35:58.118Z')
63
+ })
64
+ it('should return referencedDate plus 365 days', () => {
65
+ const res = paperModel.computeExpirationDate(
66
+ fakePersonalSportingLicenceFile
67
+ )
68
+
69
+ expect(res.toISOString()).toBe('2023-09-23T11:35:58.118Z')
70
+ })
71
+
72
+ it('should return "null" if metadata is not found', () => {
73
+ const res = paperModel.computeExpirationDate(fakeFileWithoutMetadata)
74
+
75
+ expect(res).toBeNull()
76
+ })
77
+ })
78
+
79
+ describe('computeExpirationNoticeDate', () => {
80
+ it('should return notice date for file with expirationDate metadata', () => {
81
+ const res = paperModel.computeExpirationNoticeDate(fakeNationalIdCardFile)
82
+
83
+ expect(res.toISOString()).toBe('2022-06-25T11:35:58.118Z')
84
+ })
85
+ it('should return notice date for file with referencedDate metadata', () => {
86
+ const res = paperModel.computeExpirationNoticeDate(
87
+ fakePersonalSportingLicenceFile
88
+ )
89
+
90
+ expect(res.toISOString()).toBe('2023-09-08T11:35:58.118Z')
91
+ })
92
+ it('should return null for file without corresponding metadata', () => {
93
+ const res = paperModel.computeExpirationNoticeDate(
94
+ fakeFileWithoutMetadata
95
+ )
96
+
97
+ expect(res).toBeNull()
98
+ })
99
+ })
100
+
101
+ describe('computeExpirationNoticeLink', () => {
102
+ it.each`
103
+ file | link
104
+ ${fakeNationalIdCardFile} | ${'https://www.service-public.fr/particuliers/vosdroits/N358'}
105
+ ${fakeResidencePermitFile} | ${'https://www.service-public.fr/particuliers/vosdroits/N110'}
106
+ `(
107
+ `should return "$link" link for an file with "$file.metadata.qualification.label" qualification label`,
108
+ ({ file, link }) => {
109
+ expect(paperModel.computeExpirationNoticeLink(file)).toEqual(link)
110
+ }
111
+ )
112
+ })
113
+
114
+ describe('isExpiring', () => {
115
+ const fakeNationalIdCardFileWithoutNoticeDate = buildMockFile({
116
+ qualificationLabel: 'national_id_card',
117
+ expirationDate: '2022-09-23T11:35:58.118Z',
118
+ noticePeriod: ''
119
+ })
120
+ const fakeResidencePermitFileWithoutNoticeDate = buildMockFile({
121
+ qualificationLabel: 'residence_permit',
122
+ expirationDate: '2022-09-23T11:35:58.118Z',
123
+ noticePeriod: ''
124
+ })
125
+ const fakeNationalIdCardFileWithoutExpirationDate = buildMockFile({
126
+ qualificationLabel: 'national_id_card',
127
+ expirationDate: '',
128
+ noticePeriod: '90'
129
+ })
130
+ const fakeResidencePermitFileWithoutExpirationDate = buildMockFile({
131
+ qualificationLabel: 'residence_permit',
132
+ expirationDate: '',
133
+ noticePeriod: '90'
134
+ })
135
+
136
+ it.each`
137
+ file | result
138
+ ${fakeNationalIdCardFile} | ${true}
139
+ ${fakePersonalSportingLicenceFile} | ${true}
140
+ ${fakeResidencePermitFile} | ${true}
141
+ `(
142
+ `should return "$result" for each file with "noticePeriod" & "expirationDate" metadata`,
143
+ ({ file, result }) => {
144
+ expect(paperModel.isExpiring(file)).toEqual(result)
145
+ }
146
+ )
147
+
148
+ it.each`
149
+ file | result
150
+ ${fakeNationalIdCardFileWithoutNoticeDate} | ${false}
151
+ ${fakeResidencePermitFileWithoutNoticeDate} | ${false}
152
+ `(
153
+ `should return "$result" for each file without "noticePeriod" metadata`,
154
+ ({ file, result }) => {
155
+ expect(paperModel.isExpiring(file)).toEqual(result)
156
+ }
157
+ )
158
+
159
+ it.each`
160
+ file | result
161
+ ${fakeNationalIdCardFileWithoutExpirationDate} | ${false}
162
+ ${fakeResidencePermitFileWithoutExpirationDate} | ${false}
163
+ `(
164
+ `should return "$result" for each file without "expirationDate" metadata`,
165
+ ({ file, result }) => {
166
+ expect(paperModel.isExpiring(file)).toEqual(result)
167
+ }
168
+ )
169
+ })
170
+ })
package/dist/types.js CHANGED
@@ -7,6 +7,10 @@ exports.default = void 0;
7
7
 
8
8
  var _dsl = require("./queries/dsl");
9
9
 
10
+ /**
11
+ * @typedef {import("./models/document/qualification").Qualification} Qualification
12
+ */
13
+
10
14
  /**
11
15
  * @typedef {"io.cozy.accounts"} AccountsDoctype
12
16
  * @typedef {"io.cozy.triggers"} TriggersDoctype
@@ -177,6 +181,11 @@ var _dsl = require("./queries/dsl");
177
181
  * @property {object} [schema] - the schema used by prosemirror (with notes and marks serialized as arrays to preserve the order).
178
182
  * @property {string} [title] - the initial title of the note (that will also be used for the file name)
179
183
  * @property {number} [version] - Number of a note
184
+ * @property {Qualification} [qualification] - Qualification of the file
185
+ * @property {string} [country] - Country of the paper
186
+ * @property {string} [expirationDate] - Expiration date of the paper
187
+ * @property {string} [referencedDate] - Reference date of the paper
188
+ * @property {string} [noticePeriod] - Notice period of the paper, in days
180
189
  */
181
190
 
182
191
  /**
@@ -190,6 +199,7 @@ var _dsl = require("./queries/dsl");
190
199
  * @property {string} mime - Mime of the file
191
200
  * @property {boolean} executable - Whether or not the file is executable
192
201
  * @property {boolean} encrypted - Whether or not the file is client-side encrypted
202
+ * @property {string} created_at - Creation date of the file
193
203
  * @typedef {CozyClientDocument & FileDocument} IOCozyFile - An io.cozy.files document
194
204
  */
195
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "34.3.0",
3
+ "version": "34.5.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -19,6 +19,7 @@
19
19
  "@types/lodash": "^4.14.170",
20
20
  "btoa": "^1.2.1",
21
21
  "cozy-stack-client": "^34.1.5",
22
+ "date-fns": "2.29.3",
22
23
  "json-stable-stringify": "^1.0.1",
23
24
  "lodash": "^4.17.13",
24
25
  "microee": "^0.0.6",
@@ -51,7 +52,6 @@
51
52
  "cozy-flags": "2.10.2",
52
53
  "cozy-logger": "1.7.0",
53
54
  "cozy-ui": "48.0.0",
54
- "date-fns": "2.27.0",
55
55
  "jsdoc-plugin-intersection": "1.0.4",
56
56
  "mockdate": "2.0.5",
57
57
  "react": "16.14.0",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "30c2fc2dd8d92fbb73f254a3aa50137757a2f51e"
76
+ "gitHead": "ecbee1a9f002b3c40ff8aa7b01f5418a7d9519af"
77
77
  }
@@ -15,4 +15,5 @@ import * as timeseries from "./timeseries";
15
15
  import * as sharing from "./sharing";
16
16
  import * as dacc from "./dacc";
17
17
  import * as doctypes from "./doctypes";
18
- export { trigger, instance, applications, file, folder, note, account, permission, utils, contact, document, timeseries, sharing, dacc, doctypes };
18
+ import * as paper from "./paper";
19
+ export { trigger, instance, applications, file, folder, note, account, permission, utils, contact, document, timeseries, sharing, dacc, doctypes, paper };
@@ -0,0 +1,7 @@
1
+ export function isExpiring(file: IOCozyFile): boolean;
2
+ export function computeExpirationDate(file: IOCozyFile): Date | null;
3
+ export function computeExpirationNoticeDate(file: IOCozyFile): Date | null;
4
+ export function computeExpirationNoticeLink(file: IOCozyFile): string | null;
5
+ export function isExpired(file: IOCozyFile): boolean;
6
+ export function isExpiringSoon(file: IOCozyFile): boolean;
7
+ export type IOCozyFile = import("../types").CozyClientDocument & import("../types").FileDocument;
package/types/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  declare var _default: {};
2
2
  export default _default;
3
+ export type Qualification = import("./models/document/qualification").Qualification;
3
4
  export type AccountsDoctype = "io.cozy.accounts";
4
5
  export type TriggersDoctype = "io.cozy.triggers";
5
6
  export type KonnectorsDoctype = "io.cozy.konnectors";
@@ -194,6 +195,26 @@ export type FileMetadata = {
194
195
  * - Number of a note
195
196
  */
196
197
  version?: number;
198
+ /**
199
+ * - Qualification of the file
200
+ */
201
+ qualification?: Qualification;
202
+ /**
203
+ * - Country of the paper
204
+ */
205
+ country?: string;
206
+ /**
207
+ * - Expiration date of the paper
208
+ */
209
+ expirationDate?: string;
210
+ /**
211
+ * - Reference date of the paper
212
+ */
213
+ referencedDate?: string;
214
+ /**
215
+ * - Notice period of the paper, in days
216
+ */
217
+ noticePeriod?: string;
197
218
  };
198
219
  /**
199
220
  * - An io.cozy.files document
@@ -235,6 +256,10 @@ export type FileDocument = {
235
256
  * - Whether or not the file is client-side encrypted
236
257
  */
237
258
  encrypted: boolean;
259
+ /**
260
+ * - Creation date of the file
261
+ */
262
+ created_at: string;
238
263
  };
239
264
  /**
240
265
  * - An io.cozy.files document
@@ -370,7 +395,7 @@ export type Theme = {
370
395
  defaultItems?: Array<string>;
371
396
  };
372
397
  export type ThemesList = Theme[];
373
- export type ThemesLabels = "transport" | "identity" | "family" | "work_study" | "health" | "home" | "finance" | "invoice";
398
+ export type ThemesLabels = "transport" | "identity" | "family" | "health" | "invoice" | "work_study" | "home" | "finance";
374
399
  export type QualificationAttributes = {
375
400
  label: string;
376
401
  purpose?: string;
@@ -381,13 +406,13 @@ export type QualificationAttributes = {
381
406
  export type IdentityLabel = "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "citizen_registration_certificate" | "personal_sporting_licence";
382
407
  export type FamilyLabel = "family_record_book" | "birth_certificate" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "payment_proof_family_allowance";
383
408
  export type WorkStudyLabels = "resume" | "diploma" | "work_contract" | "pay_sheet" | "unemployment_benefit" | "pension" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "work_disability_recognition" | "school_attendance_certificate";
384
- export type HealthLabels = "work_disability_recognition" | "health_certificate" | "health_book" | "national_health_insurance_card" | "health_insurance_card" | "prescription" | "health_invoice" | "national_health_insurance_right_certificate" | "pregnancy_medical_certificate" | "other_health_document";
385
- export type HomeLabels = "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "unfit_for_habitation_declaration" | "accommodation_proof";
409
+ 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";
410
+ 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";
386
411
  export type TransportLabels = "driver_license" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document";
387
- export type FinanceLabels = "payment_proof_family_allowance" | "pay_sheet" | "tax_return" | "tax_notice" | "tax_timetable" | "receipt" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "other_revenue";
388
- export type InvoiceLabels = "health_invoice" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "work_invoice" | "transport_invoice" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice";
412
+ export type FinanceLabels = "pay_sheet" | "other_revenue" | "tax_return" | "tax_notice" | "tax_timetable" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "receipt" | "payment_proof_family_allowance";
413
+ 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";
389
414
  export type ActivityLabels = "personal_sporting_licence" | "other_activity_document";
390
- export type ItemsLabels = "resume" | "identity_photo" | "national_id_card" | "passport" | "residence_permit" | "family_record_book" | "birth_certificate" | "driver_license" | "other_identity_document" | "citizen_registration_certificate" | "personal_sporting_licence" | "wedding" | "pacs" | "divorce" | "large_family_card" | "caf" | "other_family_document" | "payment_proof_family_allowance" | "diploma" | "work_contract" | "pay_sheet" | "unemployment_benefit" | "pension" | "gradebook" | "student_card" | "motivation_letter" | "other_work_document" | "work_disability_recognition" | "school_attendance_certificate" | "health_certificate" | "health_book" | "national_health_insurance_card" | "health_insurance_card" | "prescription" | "health_invoice" | "national_health_insurance_right_certificate" | "pregnancy_medical_certificate" | "other_health_document" | "phone_invoice" | "isp_invoice" | "telecom_invoice" | "energy_invoice" | "water_invoice" | "other_invoice" | "house_sale_agreeement" | "building_permit" | "technical_diagnostic_record" | "lease" | "rent_receipt" | "house_insurance" | "work_quote" | "work_invoice" | "other_house_document" | "unfit_for_habitation_declaration" | "accommodation_proof" | "vehicle_registration" | "car_insurance" | "mechanic_invoice" | "transport_invoice" | "other_transport_document" | "tax_return" | "tax_notice" | "tax_timetable" | "receipt" | "other_tax_document" | "bank_details" | "bank_statement" | "loan_agreement" | "other_bank_document" | "other_revenue" | "appliance_invoice" | "web_service_invoice" | "restaurant_invoice" | "other_activity_document";
415
+ 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" | "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" | "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" | "unfit_for_habitation_declaration" | "accommodation_proof" | "citizen_registration_certificate" | "personal_sporting_licence" | "other_activity_document";
391
416
  /**
392
417
  * See https://github.com/cozy/DACC
393
418
  */