cozy-client 61.0.0 → 61.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.
- package/dist/CozyClient.js +1 -1
- package/dist/models/doctypes/locales/de.json +10 -1
- package/dist/models/doctypes/locales/en.json +10 -1
- package/dist/models/doctypes/locales/es.json +10 -1
- package/dist/models/doctypes/locales/fr.json +10 -1
- package/dist/models/doctypes/locales/it.json +10 -1
- package/dist/models/doctypes/locales/ru.json +10 -1
- package/dist/models/doctypes/locales/vi.json +10 -1
- package/dist/models/file.js +8 -6
- package/dist/models/file.spec.js +22 -0
- package/package.json +2 -2
package/dist/CozyClient.js
CHANGED
|
@@ -3149,7 +3149,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
3149
3149
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
3150
3150
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
3151
3151
|
|
|
3152
|
-
CozyClient.version = "61.0.
|
|
3152
|
+
CozyClient.version = "61.0.2";
|
|
3153
3153
|
|
|
3154
3154
|
_microee.default.mixin(CozyClient);
|
|
3155
3155
|
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Fahrten",
|
|
81
81
|
"timeseries.grades": "Schulnoten",
|
|
82
82
|
"triggers": "Aufgabenplanung",
|
|
83
|
-
"drive.settings": "Drive-Einstellungen"
|
|
83
|
+
"drive.settings": "Drive-Einstellungen",
|
|
84
|
+
"banners": "Banner",
|
|
85
|
+
"doctypes": "Datentypen",
|
|
86
|
+
"exports": "Datenexporte",
|
|
87
|
+
"home.settings": "Startseiten-Einstellungen",
|
|
88
|
+
"imports": "Datenimporte",
|
|
89
|
+
"nextcloud.migrations": "Nextcloud-Migrationen",
|
|
90
|
+
"remote.requests": "Externe Anfragen",
|
|
91
|
+
"sessions": "Web-Sitzungen",
|
|
92
|
+
"sessions.logins": "Anmeldeverlauf"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Trips",
|
|
81
81
|
"timeseries.grades": "Grades",
|
|
82
82
|
"triggers": "Scheduling jobs",
|
|
83
|
-
"drive.settings": "Drive settings"
|
|
83
|
+
"drive.settings": "Drive settings",
|
|
84
|
+
"banners": "Banners",
|
|
85
|
+
"doctypes": "Data types",
|
|
86
|
+
"exports": "Data exports",
|
|
87
|
+
"home.settings": "Home settings",
|
|
88
|
+
"imports": "Data imports",
|
|
89
|
+
"nextcloud.migrations": "Nextcloud migrations",
|
|
90
|
+
"remote.requests": "Remote requests",
|
|
91
|
+
"sessions": "Web sessions",
|
|
92
|
+
"sessions.logins": "Login history"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Trayectos",
|
|
81
81
|
"timeseries.grades": "Notas escolares",
|
|
82
82
|
"triggers": "Programación de tareas",
|
|
83
|
-
"drive.settings": "Ajustes de Drive"
|
|
83
|
+
"drive.settings": "Ajustes de Drive",
|
|
84
|
+
"banners": "Banners",
|
|
85
|
+
"doctypes": "Tipos de datos",
|
|
86
|
+
"exports": "Exportaciones de datos",
|
|
87
|
+
"home.settings": "Ajustes de la página de inicio",
|
|
88
|
+
"imports": "Importaciones de datos",
|
|
89
|
+
"nextcloud.migrations": "Migraciones de Nextcloud",
|
|
90
|
+
"remote.requests": "Solicitudes remotas",
|
|
91
|
+
"sessions": "Sesiones web",
|
|
92
|
+
"sessions.logins": "Historial de inicios de sesión"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Déplacements",
|
|
81
81
|
"timeseries.grades": "Notes",
|
|
82
82
|
"triggers": "Planification de tâches à exécuter dans le futur",
|
|
83
|
-
"drive.settings": "Paramètres de Drive"
|
|
83
|
+
"drive.settings": "Paramètres de Drive",
|
|
84
|
+
"banners": "Bannières",
|
|
85
|
+
"doctypes": "Types de données",
|
|
86
|
+
"exports": "Exports de données",
|
|
87
|
+
"home.settings": "Réglages de l'accueil",
|
|
88
|
+
"imports": "Imports de données",
|
|
89
|
+
"nextcloud.migrations": "Migrations Nextcloud",
|
|
90
|
+
"remote.requests": "Requêtes distantes",
|
|
91
|
+
"sessions": "Sessions web",
|
|
92
|
+
"sessions.logins": "Historique de connexions"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Spostamenti",
|
|
81
81
|
"timeseries.grades": "Voti",
|
|
82
82
|
"triggers": "Pianificazione delle attività",
|
|
83
|
-
"drive.settings": "Impostazioni di Drive"
|
|
83
|
+
"drive.settings": "Impostazioni di Drive",
|
|
84
|
+
"banners": "Banner",
|
|
85
|
+
"doctypes": "Tipi di dati",
|
|
86
|
+
"exports": "Esportazioni di dati",
|
|
87
|
+
"home.settings": "Impostazioni della home",
|
|
88
|
+
"imports": "Importazioni di dati",
|
|
89
|
+
"nextcloud.migrations": "Migrazioni Nextcloud",
|
|
90
|
+
"remote.requests": "Richieste remote",
|
|
91
|
+
"sessions": "Sessioni web",
|
|
92
|
+
"sessions.logins": "Cronologia degli accessi"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Поездки",
|
|
81
81
|
"timeseries.grades": "Школьные оценки",
|
|
82
82
|
"triggers": "Планирование задач",
|
|
83
|
-
"drive.settings": "Настройки Drive"
|
|
83
|
+
"drive.settings": "Настройки Drive",
|
|
84
|
+
"banners": "Баннеры",
|
|
85
|
+
"doctypes": "Типы данных",
|
|
86
|
+
"exports": "Экспорт данных",
|
|
87
|
+
"home.settings": "Настройки главного экрана",
|
|
88
|
+
"imports": "Импорт данных",
|
|
89
|
+
"nextcloud.migrations": "Миграции Nextcloud",
|
|
90
|
+
"remote.requests": "Удалённые запросы",
|
|
91
|
+
"sessions": "Веб-сеансы",
|
|
92
|
+
"sessions.logins": "История входов"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
|
@@ -80,7 +80,16 @@
|
|
|
80
80
|
"timeseries.geojson": "Chuyến đi",
|
|
81
81
|
"timeseries.grades": "Điểm học tập",
|
|
82
82
|
"triggers": "Lập lịch tác vụ",
|
|
83
|
-
"drive.settings": "Cài đặt Drive"
|
|
83
|
+
"drive.settings": "Cài đặt Drive",
|
|
84
|
+
"banners": "Biểu ngữ",
|
|
85
|
+
"doctypes": "Loại dữ liệu",
|
|
86
|
+
"exports": "Xuất dữ liệu",
|
|
87
|
+
"home.settings": "Cài đặt trang chủ",
|
|
88
|
+
"imports": "Nhập dữ liệu",
|
|
89
|
+
"nextcloud.migrations": "Di chuyển Nextcloud",
|
|
90
|
+
"remote.requests": "Yêu cầu từ xa",
|
|
91
|
+
"sessions": "Phiên web",
|
|
92
|
+
"sessions.logins": "Lịch sử đăng nhập"
|
|
84
93
|
}
|
|
85
94
|
},
|
|
86
95
|
"fr": {
|
package/dist/models/file.js
CHANGED
|
@@ -189,21 +189,23 @@ exports.isEncryptedFileOrFolder = isEncryptedFileOrFolder;
|
|
|
189
189
|
|
|
190
190
|
var isOnlyOfficeFile = function isOnlyOfficeFile(file) {
|
|
191
191
|
return isFile(file) && !isNote(file) && (file.class === 'text' || file.class === 'spreadsheet' || file.class === 'slide');
|
|
192
|
-
};
|
|
192
|
+
}; // text/* types OnlyOffice can edit, from https://github.com/ONLYOFFICE/document-formats
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
exports.isOnlyOfficeFile = isOnlyOfficeFile;
|
|
196
|
+
var ONLY_OFFICE_TEXT_MIME_TYPES = ['text/rtf', 'text/csv', 'text/x-csv', 'text/x-comma-separated-values', 'text/tab-separated-values', 'text/fb2+xml'];
|
|
193
197
|
/**
|
|
194
198
|
* Whether the file should be opened by only office
|
|
195
199
|
* We want to be consistent with the stack so we check the class attributes
|
|
196
|
-
* But we want to exclude .txt
|
|
200
|
+
* But we want to exclude .txt, .md and other plain text files not supported
|
|
201
|
+
* by only office (.vcf, .ics...) because the CozyUI Viewer can already show them
|
|
197
202
|
*
|
|
198
203
|
* @param {import("../types").IOCozyFile} file - io.cozy.file document
|
|
199
204
|
* @returns {boolean}
|
|
200
205
|
*/
|
|
201
206
|
|
|
202
|
-
|
|
203
|
-
exports.isOnlyOfficeFile = isOnlyOfficeFile;
|
|
204
|
-
|
|
205
207
|
var shouldBeOpenedByOnlyOffice = function shouldBeOpenedByOnlyOffice(file) {
|
|
206
|
-
return isOnlyOfficeFile(file) && !file.name.endsWith('.txt') && !file.name.endsWith('.md');
|
|
208
|
+
return isOnlyOfficeFile(file) && !file.name.endsWith('.txt') && !file.name.endsWith('.md') && (!isPlainText(file.mime, file.name) || ONLY_OFFICE_TEXT_MIME_TYPES.includes(file.mime));
|
|
207
209
|
};
|
|
208
210
|
/**
|
|
209
211
|
*
|
package/dist/models/file.spec.js
CHANGED
|
@@ -163,6 +163,28 @@ describe('File Model', () => {
|
|
|
163
163
|
expect(fileModel.shouldBeOpenedByOnlyOffice(mdFile)).toBe(false)
|
|
164
164
|
})
|
|
165
165
|
|
|
166
|
+
it.each`
|
|
167
|
+
name | mime | result
|
|
168
|
+
${'test.docx'} | ${'application/vnd.openxmlformats-officedocument.wordprocessingml.document'} | ${true}
|
|
169
|
+
${'test.odt'} | ${'application/vnd.oasis.opendocument.text'} | ${true}
|
|
170
|
+
${'test.rtf'} | ${'text/rtf'} | ${true}
|
|
171
|
+
${'test.csv'} | ${'text/csv'} | ${true}
|
|
172
|
+
${'test.csv'} | ${'text/x-csv'} | ${true}
|
|
173
|
+
${'test.tsv'} | ${'text/tab-separated-values'} | ${true}
|
|
174
|
+
${'test.txt'} | ${'text/plain'} | ${false}
|
|
175
|
+
${'test.md'} | ${'text/markdown'} | ${false}
|
|
176
|
+
${'contact.vcf'} | ${'text/vcard'} | ${false}
|
|
177
|
+
${'contact.vcf'} | ${'text/x-vcard'} | ${false}
|
|
178
|
+
${'event.ics'} | ${'text/calendar'} | ${false}
|
|
179
|
+
${'server.log'} | ${'text/plain'} | ${false}
|
|
180
|
+
`(
|
|
181
|
+
'should return $result for $name ($mime) with only office',
|
|
182
|
+
({ name, mime, result }) => {
|
|
183
|
+
const file = { type: 'file', class: 'text', name, mime }
|
|
184
|
+
expect(fileModel.shouldBeOpenedByOnlyOffice(file)).toBe(result)
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
|
|
166
188
|
it('should test if a file has a specific metadata', () => {
|
|
167
189
|
const doc = {
|
|
168
190
|
metadata: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "61.0.
|
|
3
|
+
"version": "61.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-native-ios11-devicecheck": "^0.0.3"
|
|
75
75
|
},
|
|
76
76
|
"sideEffects": false,
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "23099764f8fccb82f1c013f101b5f0792cfa65dd"
|
|
78
78
|
}
|