blob: 98fb729224ec85660984670e94cf192f1b20e66a [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5[
6 {
7 "namespace":"fileBrowserPrivate",
Ben Murdocheb525c52013-07-10 11:40:50 +01008 "description": "none",
Torne (Richard Coles)58218062012-11-14 11:43:16 +00009 "types": [
10 {
Ben Murdoch2385ea32013-08-06 11:01:04 +010011 "id": "FileTask",
Torne (Richard Coles)58218062012-11-14 11:43:16 +000012 "type": "object",
Ben Murdoch2385ea32013-08-06 11:01:04 +010013 "description": "A file task represents an action that the file manager can perform over the currently selected files. See chrome/browser/chromeos/extensions/file_manager/file_tasks.h for details about how file tasks are handled.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +000014 "properties": {
Ben Murdoch2385ea32013-08-06 11:01:04 +010015 "taskId": {
16 "type": "string",
17 "description": "The unique identifier of the task."
18 },
19 "title": {
20 "type": "string",
21 "description": "Task title (ex. App name)."
22 },
23 "iconUrl": {
24 "type": "string",
25 "description": "Task icon url (from chrome://extension-icon/...)"
26 },
27 "driveApp": {
28 "type": "boolean",
29 "description": "True if this is Drive App."
30 },
31 "isDefault": {
32 "type": "boolean",
33 "description": "True if this task is a default task for the selected files."
34 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +000035 }
36 },
37 {
38 "id": "VolumeInfo",
39 "type": "object",
40 "description": "Mounted disk volume information.",
41 "properties": {
42 "mountPath": {
43 "type": "string",
44 "description": "Disk volume mount point path. The value corresponds to its Entry.fullPath in File API."
45 },
46 "devicePath": {
47 "type": "string",
48 "description": "Disk volume device path."
49 },
50 "label": {
51 "type": "string",
52 "description": "Volume label."
53 },
54 "deviceType": {
55 "type": "string",
56 "enum": ["sd", "usb", "optical", "mobile", "unknown"],
57 "description": "Device type."
58 },
59 "readOnly": {
60 "type": "boolean",
61 "description": "Flag that specifies if volume is mounted in read-only mode."
62 },
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010063 "totalSize": {
64 "type": "number",
65 "description": "Approximated total disk volume size in bytes."
Torne (Richard Coles)58218062012-11-14 11:43:16 +000066 }
67 }
68 },
69 {
70 "id": "DriveWebApp",
71 "type": "object",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000072 "description": "Drive WebApp properties.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +000073 "properties": {
74 "appId": {
75 "type": "string",
76 "description": "WebApp ID."
77 },
78 "appName": {
79 "type": "string",
80 "description": "WebApp name."
81 },
82 "appIcon": {
83 "type": "string",
84 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000085 "description": "URL to the Drive application icon for this application."
Torne (Richard Coles)58218062012-11-14 11:43:16 +000086 },
87 "docIcon": {
88 "type": "string",
89 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000090 "description": "URL to the Drive document icon for documents associated with this application."
Torne (Richard Coles)58218062012-11-14 11:43:16 +000091 },
92 "objectType": {
93 "type": "string",
94 "description": "Object (file) type description."
95 },
96 "isPrimary": {
97 "type": "boolean",
98 "description": "True if this WebApp is the primary (default) open action for this file."
99 }
100 }
101 },
102 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100103 "id": "DriveEntryProperties",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000104 "type": "object",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000105 "description": "Drive file properties.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000106 "properties": {
107 "fileUrl": {
108 "type": "string",
109 "optional": true,
110 "description": "the URL given for this file."
111 },
112 "thumbnailUrl": {
113 "type": "string",
114 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000115 "description": "URL to the Drive thumbnail image for this file."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000116 },
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000117 "isPinned": {
118 "type": "boolean",
119 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000120 "description": "True if the file is pinned in Drive cache."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000121 },
122 "isPresent": {
123 "type": "boolean",
124 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000125 "description": "True if the file is present in Drive cache."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000126 },
127 "isDirty": {
128 "type": "boolean",
129 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000130 "description": "True if the file is awaiting upload in Drive cache."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000131 },
132 "isHosted": {
133 "type": "boolean",
134 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000135 "description": "True if the file is hosted on a Drive server instead of local."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000136 },
137 "errorCode": {
138 "type": "integer",
139 "optional": true,
140 "description": "The error code (from base::PlatformFileError) if fetching the properties for this file had an error."
141 },
142 "driveApps" : {
143 "type": "array",
144 "optional": true,
145 "items": {"$ref": "DriveWebApp"},
146 "description": "An array of WebApps capable of opening this file."
147 },
148 "contentMimeType": {
149 "type": "string",
150 "optional": true,
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000151 "description": "Drive MIME type for this file."
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100152 },
153 "sharedWithMe": {
154 "type": "boolean",
155 "optional": true,
156 "description": "True if the entry is labeled as shared-with-me."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000157 }
158 }
159 },
160 {
161 "id": "MountPointInfo",
162 "type": "object",
163 "description": "Mounted point information.",
164 "properties": {
165 "mountPath": {
166 "type": "string",
167 "optional": true,
168 "description": "Disk volume mount point path. The value corresponds to its Entry.fullPath in File API."
169 },
170 "sourcePath": {
171 "type": "string",
172 "description": "The path to the mounted device, archive file or network resource."
173 },
174 "mountType": {
175 "type": "string",
176 "enum": ["device", "file", "network"],
177 "description": "Type of the mount."
178 },
179 "mountCondition": {
180 "type": "string",
181 "description": "Additional data about mount, for example, that the filesystem is not supported."
182 }
183 }
184 },
185 {
186 "id": "MountPointSizeStats",
187 "type": "object",
188 "description": "Information about total and remaining size on the mount point.",
189 "properties": {
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100190 "totalSize": {
191 "type": "number",
192 "description": "Approximate total available size on the mount point."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000193 },
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100194 "remainingSize": {
195 "type": "number",
196 "description": "Approximate remaining available size on the mount point."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000197 }
198 }
199 },
200 {
201 "id": "VolumeMetadata",
202 "type": "object",
203 "description": "Mounted disk volume metadata.",
204 "properties": {
205 "mountPath": {
206 "type": "string",
207 "description": "Disk volume mount point path."
208 },
209 "devicePath": {
210 "type": "string",
211 "description": "Disk volume device path."
212 },
213 "systemPath": {
214 "type": "string",
215 "description": "Disk volume system path."
216 },
217 "filePath": {
218 "type": "string",
219 "description": "Disk volume file path."
220 },
221 "deviceLabel": {
222 "type": "string",
223 "description": "Volume label."
224 },
225 "driveLabel": {
226 "type": "string",
227 "description": "Volume's disk label."
228 },
229 "deviceType": {
230 "type": "string",
231 "enum": ["usb", "sd", "optical", "mobile", "unknown"],
232 "description": "Device type."
233 },
234 "isParent": {
235 "type": "boolean",
236 "description": "Flag that specifies if volume is a parent device."
237 },
238 "isReadOnly": {
239 "type": "boolean",
240 "description": "Flag that specifies if volume is mounted in read-only mode."
241 },
242 "hasMedia": {
243 "type": "boolean",
244 "description": "Flag that specifies if volume has any media."
245 },
246 "isOnBootDevice": {
247 "type": "boolean",
248 "description": "Flag that specifies if volume is on boot device."
249 },
250 "totalSize": {
251 "type": "integer",
252 "description": "Total disk volume size."
253 }
254 }
255 },
256 {
257 "id": "MountEvent",
258 "type": "object",
259 "description": "Payload data for disk mount / unmount event.",
260 "properties": {
261 "eventType": {
262 "type": "string",
263 "enum": ["added", "removed"],
264 "description": "Event type that tells listeners which disk volume even was raised."
265 },
266 "volumeInfo": {
267 "$ref": "VolumeInfo",
268 "description":"Volume information that this mount event applies to."
269 }
270 }
271 },
272 {
273 "id": "MountCompletedEvent",
274 "type": "object",
275 "description": "Payload data for mount event.",
276 "properties": {
277 "eventType": {
278 "type": "string",
279 "enum": ["mount", "unmount"],
280 "description": "Is the event raised for mounting or unmounting."
281 },
282 "status": {
283 "type": "string",
284 "enum": ["success", "error_unknown", "error_internal",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000285 "error_invalid_argument", "error_invalid_path",
286 "error_path_already_mounted", "error_path_not_mounted",
287 "error_directory_creation_failed",
288 "error_invalid_mount_options",
289 "error_invalid_unmount_options",
290 "error_insufficient_permissions",
291 "error_mount_program_not_found",
292 "error_mount_program_failed", "error_invalid_device_path",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000293 "error_unknown_filesystem", "error_unsuported_filesystem",
294 "error_invalid_archive", "error_authentication",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000295 "error_path_unmounted"],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000296 "description": "Event type that tells listeners if mount was successful or an error occurred. It also specifies the error."
297 },
298 "sourcePath": {
299 "type": "string",
300 "description": "Path that has been mounted."
301 },
302 "mountPath": {
303 "type": "string",
304 "optional": true,
305 "description": "Path that sourcePath was mounted to."
306 },
307 "mountType": {
308 "type": "string",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000309 "enum": ["device", "file", "network", "drive"],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000310 "description": "Type of the mount."
311 }
312 }
313 },
314 {
315 "id": "FileTransferStatus",
316 "type": "object",
317 "description": "Payload data for file transfer status updates.",
318 "properties": {
319 "fileUrl": {
320 "type": "string",
321 "description": "URL of file that is being transfered."
322 },
323 "transferState": {
324 "type": "string",
325 "enum": ["started", "in_progress", "completed", "failed"],
326 "description": "File transfer progress state."
327 },
328 "transferType": {
329 "type": "string",
330 "enum": ["upload", "download"],
331 "description": "Defines file transfer direction."
332 },
333 "processed": {
Ben Murdochbb1529c2013-08-08 10:24:53 +0100334 "type": "number",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000335 "optional": true,
Ben Murdochbb1529c2013-08-08 10:24:53 +0100336 "description": "Approximated completed portion of the transfer operation."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000337 },
338 "total": {
Ben Murdochbb1529c2013-08-08 10:24:53 +0100339 "type": "number",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000340 "optional": true,
Ben Murdochbb1529c2013-08-08 10:24:53 +0100341 "description": "Approximated total size of transfer operation."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000342 }
343 }
344 },
345 {
346 "id": "FileTransferCancelStatus",
347 "type": "object",
348 "description": "Payload data for file transfer cancel response.",
349 "properties": {
350 "fileUrl": {
351 "type": "string",
352 "description": "URL of file that is being transfered."
353 },
354 "canceled": {
355 "type": "boolean",
356 "description": "True if ongoing transfer operation was found and canceled."
357 }
358 }
359 },
360 {
361 "id": "FileWatchEvent",
362 "type": "object",
363 "description": "Directory change notification details.",
364 "properties": {
365 "eventType": {
366 "type": "string",
367 "enum": ["changed", "error"],
368 "description": "Specifies type of event that is raised."
369 },
370 "directoryUrl": {
371 "type": "string",
372 "description": "URL of watched directory."
373 },
374 "changedEntries": {
375 "type": "array",
376 "items": {"$ref": "FileWatchChangedEntry"}
377 }
378 }
379 },
380 {
381 "id": "FileWatchChangedEntry",
382 "type": "object",
383 "description": "Information about changed file or directory",
384 "properties": {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000385 "changeType": {
386 "type": "string",
387 "enum": ["added", "deleted", "updated"],
388 "description": "Specifies type of the change."
389 },
390 "fileUrl": {
391 "type": "string",
392 "description": "URL of the changed file."
393 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000394 }
395 }
396 ],
397 "functions": [
398 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000399 "name": "logoutUser",
400 "type": "function",
401 "description": "Logout the current user.",
402 "parameters": []
403 },
404 {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000405 "name": "cancelDialog",
406 "type": "function",
407 "description": "Cancels file selection.",
408 "parameters": []
409 },
410 {
411 "name": "executeTask",
412 "description": "Executes file browser task over selected files",
413 "parameters": [
414 {
415 "name": "taskId",
416 "type": "string",
417 "description": "The unique identifier of task to execute."
418 },
419 {
420 "name": "fileURLs",
421 "type": "array",
422 "description": "Array of file URLs",
423 "items": { "type": "string" }
424 },
425 {
426 "name": "callback",
427 "type": "function",
428 "optional": true,
429 "parameters": [
430 {
431 "name": "success",
432 "type": "boolean",
433 "optional": true,
434 "description": "True of task execution was successfully initiated."
435 }
436 ]
437 }
438 ]
439 },
440 {
441 "name": "setDefaultTask",
442 "description": "Sets the default task for the supplied MIME types and suffixes of the supplied file URLs. Lists of MIME types and URLs may contain duplicates.",
443 "parameters": [
444 {
445 "name": "taskId",
446 "type": "string",
447 "description": "The unique identifier of task to mark as default."
448 },
449 {
450 "name": "fileURLs",
451 "type": "array",
452 "description": "Array of selected file URLs to extract suffixes from.",
453 "items": { "type": "string" }
454 },
455 {
456 "name": "mimeTypes",
457 "type": "array",
458 "optional": true,
459 "description": "Array of selected file MIME types.",
460 "items": { "type": "string" }
461 },
462 {
463 "name": "callback",
464 "type": "function",
465 "optional": true,
466 "parameters": []
467 }
Ben Murdocheb525c52013-07-10 11:40:50 +0100468 ]
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000469 },
470 {
471 "name": "getFileTasks",
472 "description": "Gets the list of tasks that can be performed over selected files.",
473 "parameters": [
474 {
475 "name": "fileURLs",
476 "type": "array",
477 "description": "Array of selected file URLs",
478 "items": { "type": "string" }
479 },
480 {
481 "name": "mimeTypes",
482 "type": "array",
483 "description": "Array of selected file MIME types",
484 "items": { "type": "string" }
485 },
486 {
487 "name": "callback",
488 "type": "function",
489 "parameters": [
490 {
491 "name": "tasks",
492 "type": "array",
Ben Murdoch2385ea32013-08-06 11:01:04 +0100493 "items": {"$ref": "FileTask"},
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000494 "description": "The list of matched file URL patterns for this task."
495 }
496 ]
497 }
498 ]
499 },
500 {
501 "name": "getStrings",
502 "type": "function",
503 "description": "Gets localized strings and initialization data.",
504 "parameters": [
505 {
506 "type": "function",
507 "name": "callback",
508 "parameters": [
509 {
510 "name": "result",
511 "type": "object",
512 "additionalProperties": { "type": "any" }
513 }
514 ]
515 }
516 ]
517 },
518 {
519 "name": "addFileWatch",
520 "description": "Adds file watch.",
521 "parameters": [
522 {
523 "name": "fileUrl",
524 "type": "string",
525 "description": "URL of file to watch"
526 },
527 {
528 "name": "callback",
529 "type": "function",
530 "parameters": [
531 {
532 "name" : "success",
533 "type": "boolean",
534 "optional": true,
535 "description": "True when file watch is successfully added."
536 }
537 ]
538 }
539 ]
540 },
541 {
542 "name": "removeFileWatch",
543 "description": "Removes file watch.",
544 "parameters": [
545 {
546 "name": "fileUrl",
547 "type": "string",
548 "description": "URL of watched file to remove"
549 },
550 {
551 "name": "callback",
552 "type": "function",
553 "parameters": [
554 {
555 "name" : "success",
556 "type": "boolean",
557 "optional": true,
558 "description": "True when file watch is successfully removed."
559 }
560 ]
561 }
562 ]
563 },
564 {
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100565 "name": "requestFileSystem",
566 "description": "Requests access to the file system specially set up for Files.app. The filesystem has multiple mount points which provide access to the user's Downloadsfolder, removal media like SD cards, and Drive. See comments at CrosDiskMountPorivder for details.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000567 "parameters": [
568 {
569 "name": "callback",
570 "type": "function",
571 "parameters": [
572 {
573 "name" : "fileSystem",
574 "type": "object",
575 "optional": true,
576 "description": "A DOMFileSystem instance for local file system access. null if the caller has no appropriate permissions."
577 }
578 ]
579 }
580 ]
581 },
582 {
583 "name": "selectFiles",
584 "type": "function",
585 "description": "Selects multiple files.",
586 "parameters": [
587 {
588 "name": "selectedPaths",
589 "type": "array",
590 "description": "Array of selected paths",
591 "items": {"type": "string"}
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000592 },
593 {
594 "name": "shouldReturnLocalPath",
595 "type": "boolean",
596 "description": "true if paths need to be resolved to local paths."
597 },
598 {
599 "name": "callback",
600 "type": "function",
601 "parameters": []
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000602 }
603 ]
604 },
605 {
606 "name": "selectFile",
607 "type": "function",
608 "description": "Selects a file.",
609 "parameters": [
610 {
611 "name": "selectedPath",
612 "type": "string",
613 "description": "A selected path"
614 },
615 {
616 "name": "index",
617 "type": "integer",
618 "description": "Index of Filter"
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000619 },
620 {
621 "name": "forOpening",
622 "type": "boolean",
623 "description": "true if paths are selected for opening. false if for saving."
624 },
625 {
626 "name": "shouldReturnLocalPath",
627 "type": "boolean",
628 "description": "true if paths need to be resolved to local paths."
629 },
630 {
631 "name": "callback",
632 "type": "function",
633 "parameters": []
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000634 }
635 ]
636 },
637 {
638 "name": "viewFiles",
639 "type": "function",
640 "description": "Views multiple files.",
641 "parameters": [
642 {
643 "name": "fileUrls",
644 "type": "array",
645 "description": "Array of selected paths",
646 "items": {"type": "string"}
647 },
648 {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000649 "name": "callback",
650 "type": "function",
651 "parameters": [
652 {
653 "name" : "success",
654 "type": "boolean",
655 "description": "True if the selected files can be viewed by the browser."
656 }
657 ]
658 }
659 ]
660 },
661 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100662 "name": "getDriveEntryProperties",
663 "description": "Requests Drive file properties for a file",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000664 "parameters": [
665 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100666 "name": "fileUrl",
667 "type": "string",
668 "description": "URL of a file"
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000669 },
670 {
671 "name": "callback",
672 "type": "function",
673 "parameters": [
674 {
675 "name" : "fileProperties",
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100676 "$ref": "DriveEntryProperties",
677 "description": "A dictionary containing properties of the requested entry."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000678 }
679 ]
680 }
681 ]
682 },
683 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000684 "name": "pinDriveFile",
685 "description": "Pins/unpins a Drive file in the cache",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000686 "parameters": [
687 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100688 "name": "fileUrl",
689 "type": "string",
690 "description": "URL of a file to pin/unpin."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000691 },
692 {
693 "name": "pin",
694 "type": "boolean",
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100695 "description": "Pass true to pin the file."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000696 },
697 {
698 "name": "callback",
699 "type": "function",
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100700 "optional": true,
701 "description": "Completion callback. $ref:runtime.lastError will be set if there was an error.",
702 "parameters": []
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000703 }
704 ]
705 },
706 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000707 "name": "getDriveFiles",
708 "description": "Get Drive files",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000709 "parameters": [
710 {
711 "name": "fileUrls",
712 "type": "array",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000713 "description": "Array of Drive file URLs to get.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000714 "items": { "type": "string" }
715 },
716 {
717 "name": "callback",
718 "type": "function",
719 "parameters": [
720 {
721 "name" : "localFilePaths",
722 "type": "array",
723 "items": {"type": "string"},
724 "description": "An array of the local file paths for the requested files, one entry for each file in fileUrls."
725 }
726 ]
727 }
728 ]
729 },
730 {
731 "name": "getVolumeMetadata",
732 "description": "Requests volume's metadata",
733 "parameters": [
734 {
735 "name": "mountUrl",
736 "type": "string",
737 "description": "Mount url of the volume."
738 },
739 {
740 "name": "callback",
741 "type": "function",
742 "parameters": [
743 {
744 "name" : "volumeMetadata",
745 "$ref": "VolumeMetadata",
746 "optional": true,
747 "description": "A requested metadata dictionary object. undefined if there is no volume with selected devicePath"
748 }
749 ]
750 }
751 ]
752 },
753 {
754 "name": "addMount",
755 "description": "Mount a resource or a file.",
756 "parameters": [
757 {
758 "name": "source",
759 "type": "string",
760 "description": "Mount point source. For compressed files it is relative file path within external file system"
761 },
762 {
763 "name": "mountType",
764 "type": "string",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000765 "enum": ["device", "file", "network", "drive"],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000766 "description": "Mount point type. 'file' for compressed files"
767 },
768 {
769 "name": "options",
770 "type": "object",
771 "description": "Name/value pairs for source specific options"
772 },
773 {
774 "name": "callback",
775 "type": "function",
776 "parameters": [
777 {
778 "name": "sourcePath",
779 "type": "string",
780 "description": "Source path of the mount."
781 }
782 ]
783 }
784 ]
785 },
786 {
787 "name": "removeMount",
788 "description": "Unmounts a mounted resource.",
789 "parameters": [
790 {
791 "name": "mountPath",
792 "type": "string",
793 "description": "A path of the mount."
794 }
795 ]
796 },
797 {
798 "name": "getMountPoints",
799 "description": "Get the list of mount points.",
800 "parameters": [
801 {
802 "name": "callback",
803 "type": "function",
804 "parameters": [
805 {
806 "name" : "mountPoints",
807 "type": "array",
808 "items": {"$ref": "MountPointInfo"},
809 "description": "The list of MountPointInfo representing mounted devices."
810 }
811 ]
812 }
813 ]
814 },
815 {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000816 "name": "cancelFileTransfers",
817 "description": "Cancels ongoing file transfers for selected files.",
818 "parameters": [
819 {
820 "name": "fileUrls",
821 "type": "array",
822 "description": "Array of files for which ongoing transfer should be canceled.",
823 "items": {"type": "string"}
824 },
825 {
826 "name": "callback",
827 "type": "function",
828 "parameters": [
829 {
830 "name" : "fileTransferCancelStatuses",
831 "type": "array",
832 "items": {"$ref": "FileTransferCancelStatus"},
833 "description": "The list of FileTransferCancelStatus."
834 }
835 ]
836 }
837 ]
838 },
839 {
840 "name": "setLastModified",
841 "description": "Updates last modified to specified time in seconds",
842 "parameters": [
843 {
844 "name": "fileUrl",
845 "type": "string",
846 "description": "File url from the local file system."
847 },
848 {
849 "name": "lastModified",
850 "type": "string",
851 "description": "Date to set as last modification date in ms. Should be passed to C++ as string, since 'long' type isn't supported"
852 },
853 {
854 "name": "callback",
855 "type": "function",
856 "optional": true,
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100857 "description": "Completion callback. $ref:runtime.lastError will be set if there was an error.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000858 "parameters": []
859 }
860 ]
861 },
862 {
863 "name": "getSizeStats",
864 "description": "Retrieves total and remaining size of a mount point.",
865 "parameters": [
866 {
867 "name": "mountPath",
868 "type": "string",
869 "description": "Mount point path."
870 },
871 {
872 "name": "callback",
873 "type": "function",
874 "parameters": [
875 {
876 "name" : "sizeStats",
877 "optional": true,
878 "$ref": "MountPointSizeStats",
879 "description": "Name/value pairs of size stats. Will be undefined if stats could not be determined."
880 }
881 ]
882 }
883 ]
884 },
885 {
886 "name": "formatDevice",
887 "description": "Formats a mounted device",
888 "parameters": [
889 {
890 "name": "mountPath",
891 "type": "string",
892 "description": "Device's mount path."
893 }
894 ]
895 },
896 {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000897 "name": "getPreferences",
898 "description": "Retrieves file manager preferences .",
899 "parameters": [
900 {
901 "name": "callback",
902 "type": "function",
903 "parameters": [
904 {
905 "name": "result",
906 "type": "object",
907 "properties": {
908 "driveEnabled": {"type":"boolean"},
909 "cellularDisabled": {"type":"boolean"},
910 "hostedFilesDisabled": {"type":"boolean"},
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000911 "use24hourClock": {"type":"boolean"},
912 "allowRedeemOffers": {"type":"boolean"}
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000913 }
914 }
915 ]
916 }
917 ]
918 },
919 {
920 "name": "setPreferences",
921 "description": "Sets file manager preferences.",
922 "parameters": [
923 {
924 "name": "changeInfo",
925 "type": "object",
926 "properties": {
927 "cellularDisabled": {"type":"boolean", "optional":true},
928 "hostedFilesDisabled": {"type":"boolean", "optional":true}
929 }
930 }
931 ]
932 },
933 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000934 "name": "searchDrive",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000935 "type": "function",
936 "description": "Performs drive content search.",
937 "parameters": [
938 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000939 "name": "searchParams",
940 "type": "object",
941 "properties": {
942 "query": {
943 "type": "string",
944 "optional": true,
945 "description": "Search query."
946 },
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000947 "nextFeed": {
948 "type": "string",
949 "optional": true,
950 "description": "ID of the search feed that should be fetched next. Value passed here should be gotten from previous searchDrive call. It can be empty for the initial search request."
951 }
952 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000953 },
954 {
955 "name": "callback",
956 "type": "function",
957 "parameters": [
958 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100959 "name": "entries",
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000960 "type": "array",
961 "items": {
962 "type": "object",
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100963 "isInstanceOf": "Entry",
964 "description": "An Entry object which represents a Drive file. The conversion into a kind of FileEntry object is done in file_browser_handler_custom_bindings.cc. For filesystem API's Entry interface, see <a href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry interface</a>."
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000965 }
966 },
967 {
968 "name": "nextFeed",
969 "type": "string",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000970 "description": "ID of the feed that contains next chunk of the search result. Should be sent to the next searchDrive request to perform incremental search."
971 }
972 ]
973 }
974 ]
975 },
Ben Murdoch7dbb3d52013-07-17 14:55:54 +0100976 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000977 "name": "searchDriveMetadata",
978 "type": "function",
979 "description": "Performs drive metadata search.",
980 "parameters": [
981 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100982 "name": "searchParams",
983 "type": "object",
984 "properties": {
985 "query": {
986 "type": "string",
987 "optional": true,
988 "description": "Search query. It can be empty. Any filename matches to an empty query."
989 },
990 "types": {
991 "type": "string",
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100992 "enum": ["EXCLUDE_DIRECTORIES", "SHARED_WITH_ME", "OFFLINE", "ALL"],
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100993 "optional": true,
994 "description": "The type of entry that is needed. Default to ALL."
995 },
996 "maxResults": {
997 "type": "integer",
998 "optional": true,
999 "description": "Maximum number of results."
1000 }
1001 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001002 },
1003 {
1004 "name": "callback",
1005 "type": "function",
1006 "parameters": [
1007 {
1008 "name": "results",
1009 "type": "array",
1010 "items": {
1011 "type": "object",
1012 "properties": {
1013 "entry": {
1014 "type": "object",
1015 "isInstanceOf": "Entry",
1016 "description": "A dictionary object which represents a Drive file. This will be converted into a kind of FileEntry object. See file_browser_handler_custom_bindings.cc for details. For filesystem API's Entry interface, see <a href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry interface</a>."
1017 },
1018 "highlightedBaseName": {
1019 "type": "string",
1020 "description": "The base name of a Drive file that matched the search query. The matched sub strings are highlighted with <b> element. Meta characters are escaped like &lt;."
1021 }
1022 },
1023 "description": "Entry and Drive-related properties representing a search result."
1024 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001025 }
1026 ]
1027 }
1028 ]
1029 },
1030 {
1031 "name": "clearDriveCache",
Ben Murdoch7dbb3d52013-07-17 14:55:54 +01001032 "description": "Clear all Drive local caches including locally cached user files and filesystem metadata. The file system metadata will be reloaded from the server immediately.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001033 "parameters": []
1034 },
1035 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001036 "name": "zipSelection",
1037 "description": "Create a zip file for the selected files.",
1038 "parameters": [
1039 {
1040 "name": "dirURL",
1041 "type": "string",
1042 "description": "URL of the directory containing the selected files."
1043 },
1044 {
1045 "name": "selectionURLs",
1046 "type": "array",
1047 "description": "URLs of the selected files. The files must be under the directory specified by dirURL.",
1048 "items": { "type": "string" }
1049 },
1050 {
1051 "name": "destName",
1052 "type": "string",
1053 "description": "Name of the destination zip file. The zip file will be created under the directory specified by dirURL."
1054 },
1055 {
1056 "name": "callback",
1057 "type": "function",
1058 "optional": true,
1059 "parameters": [
1060 {
1061 "name" : "success",
1062 "type" : "boolean",
1063 "optional": true
1064 }
1065 ]
1066 }
1067 ]
1068 },
1069 {
1070 "name": "getDriveConnectionState",
1071 "description": "Retrieves the state of the current drive connection.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001072 "parameters": [
1073 {
1074 "name": "callback",
1075 "type": "function",
1076 "parameters": [
1077 {
1078 "name": "result",
1079 "type": "object",
1080 "properties": {
1081 "type": {"type": "string"},
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001082 "reasons": {
1083 "type": "array",
1084 "description": "Reasons of offline.",
1085 "items": { "type": "string" }
1086 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001087 }
1088 }
1089 ]
1090 }
1091 ]
1092 },
1093 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001094 "name": "validatePathNameLength",
1095 "description": "Checks whether the path name length fits in the limit of the filesystem.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001096 "parameters": [
1097 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001098 "name": "parent_directory_url",
1099 "type": "string",
1100 "description": "The URL of the parent directory entry."
1101 },
1102 {
1103 "name": "name",
1104 "type": "string",
1105 "description": "The name of the file."
1106 },
1107 {
1108 "name": "callback",
1109 "type": "function",
Ben Murdocheb525c52013-07-10 11:40:50 +01001110 "description": "Called back when the check is finished.",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001111 "parameters": [
1112 {
1113 "name": "result",
1114 "type": "boolean",
1115 "description": "true if the length is in the valid range, false otherwise."
1116 }
1117 ]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001118 }
1119 ]
1120 },
1121 {
Ben Murdocheb525c52013-07-10 11:40:50 +01001122 "name": "zoom",
1123 "description": "Changes the zoom factor of the Files.app.",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001124 "parameters": [
1125 {
Ben Murdocheb525c52013-07-10 11:40:50 +01001126 "name": "operation",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001127 "type": "string",
Ben Murdoch7dbb3d52013-07-17 14:55:54 +01001128 "description": "Zooming mode.",
Ben Murdocheb525c52013-07-10 11:40:50 +01001129 "enum": ["in", "out", "reset"]
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001130 }
1131 ]
Ben Murdoch7dbb3d52013-07-17 14:55:54 +01001132 },
1133 {
1134 "name": "requestAccessToken",
1135 "description": "Requests a Drive API OAuth2 access token.",
1136 "parameters": [
1137 {
1138 "name": "refresh",
1139 "type": "boolean",
1140 "description": "Whether the token should be refetched instead of using the cached one."
1141 },
1142 {
1143 "name": "callback",
1144 "type": "function",
1145 "parameters": [
1146 {
Ben Murdochbbcdd452013-07-25 10:06:34 +01001147 "name": "accessToken",
Ben Murdoch7dbb3d52013-07-17 14:55:54 +01001148 "type": "string",
1149 "description": "OAuth2 access token, or an empty string if failed to fetch."
1150 }
1151 ]
1152 }
1153 ]
Ben Murdochbbcdd452013-07-25 10:06:34 +01001154 },
1155 {
1156 "name": "getShareUrl",
1157 "description": "Requests a share dialog url for the specified file.",
1158 "parameters": [
1159 {
1160 "name": "url",
1161 "type": "string",
1162 "description": "Url for the file."
1163 },
1164 {
1165 "name": "callback",
1166 "type": "function",
1167 "parameters": [
1168 {
1169 "name": "shareUrl",
1170 "type": "string",
1171 "description": "Share Url for the sharing dialog."
1172 }
1173 ]
1174 }
1175 ]
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001176 }
1177 ],
1178 "events": [
1179 {
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001180 "name": "onMountCompleted",
1181 "type": "function",
1182 "description": "Fired when mount event is detected.",
1183 "parameters": [
1184 {
1185 "$ref": "MountCompletedEvent",
1186 "name": "event",
1187 "description": "MountCompleted event information."
1188 }
1189 ]
1190 },
1191 {
1192 "name": "onFileTransfersUpdated",
1193 "type": "function",
1194 "description": "Fired when file transfers with remote file system are in progress.",
1195 "parameters": [
1196 {
1197 "type": "array",
1198 "items": {"$ref": "FileTransferStatus"},
1199 "name": "event",
1200 "description": "List of ongoing file statuses for ongoing transfer operations."
1201 }
1202 ]
1203 },
1204 {
1205 "name": "onDirectoryChanged",
1206 "type": "function",
1207 "description": "Fired when watched file change event is detected in a watched directory.",
1208 "parameters": [
1209 {
1210 "$ref": "FileWatchEvent",
1211 "name": "event",
1212 "description": "File watch event information."
1213 }
1214 ]
1215 },
1216 {
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001217 "name": "onPreferencesChanged",
1218 "type": "function",
1219 "description": "Fired when file manager preferences change. The preferences can be retrieved via 'getPreferences'.",
1220 "parameters": []
1221 },
1222 {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001223 "name": "onDriveConnectionStatusChanged",
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001224 "type": "function",
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001225 "description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getDriveConnectionState'.",
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001226 "parameters": []
1227 }
1228 ]
1229 }
1230]