-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add form data to request helper * Add upload_file method to rooms * Add file upload to docs
- Loading branch information
Showing
14 changed files
with
414 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
</dict> | ||
</plist> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions
62
spec/fixtures/messages/room/upload/file_upload_success.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"message": { | ||
"_id": "%{message_id}", | ||
"rid": "%{room_id}", | ||
"ts": "2023-07-06T12:05:07.127Z", | ||
"file": { | ||
"_id": "%{file_id}", | ||
"name": "%{file_name}", | ||
"type": "application/octet-stream" | ||
}, | ||
"files": [ | ||
{ | ||
"_id": "%{file_id}", | ||
"name": "%{file_name}", | ||
"type": "application/octet-stream" | ||
} | ||
], | ||
"attachments": [ | ||
{ | ||
"ts": "1970-01-01T00:00:00.000Z", | ||
"title": "%{file_name}", | ||
"title_link": "/file-upload/%{file_id}/%{file_name}", | ||
"title_link_download": true, | ||
"type": "file", | ||
"description": "%{description}", | ||
"format": "%{format}", | ||
"size": 8347, | ||
"descriptionMd": [ | ||
{ | ||
"type": "PARAGRAPH", | ||
"value": [ | ||
{ | ||
"type": "PLAIN_TEXT", | ||
"value": "%{description}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"msg": "%{msg}", | ||
"u": { | ||
"_id": "%{user_id}", | ||
"username": "admin", | ||
"name": "Admin" | ||
}, | ||
"_updatedAt": "2023-07-06T12:05:07.264Z", | ||
"urls": [], | ||
"md": [ | ||
{ | ||
"type": "PARAGRAPH", | ||
"value": [ | ||
{ | ||
"type": "PLAIN_TEXT", | ||
"value": "%{msg}" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"success": true | ||
} |
40 changes: 40 additions & 0 deletions
40
spec/fixtures/messages/room/upload/file_upload_without_message_success.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
{ | ||
"message": { | ||
"_id": "%{message_id}", | ||
"rid": "%{room_id}", | ||
"ts": "2023-07-07T10:03:44.048Z", | ||
"file": { | ||
"_id": "%{file_id}", | ||
"name": "%{file_name}", | ||
"type": "application/octet-stream" | ||
}, | ||
"files": [ | ||
{ | ||
"_id": "%{file_id}", | ||
"name": "%{file_name}", | ||
"type": "application/octet-stream" | ||
} | ||
], | ||
"attachments": [ | ||
{ | ||
"ts": "1970-01-01T00:00:00.000Z", | ||
"title": "%{file_name}", | ||
"title_link": "/file-upload/%{file_id}/%{file_name}", | ||
"title_link_download": true, | ||
"type": "file", | ||
"format": "%{format}", | ||
"size": 8347 | ||
} | ||
], | ||
"msg": "", | ||
"u": { | ||
"_id": "%{user_id}", | ||
"username": "rocket_admin", | ||
"name": "Admin" | ||
}, | ||
"_updatedAt": "2023-07-07T10:03:44.097Z", | ||
"urls": [] | ||
}, | ||
"success": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"success": false, | ||
"error": "File type is not accepted. [error-invalid-file-type]", | ||
"errorType": "error-invalid-file-type" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"success": false, | ||
"error": "[No file uploaded]", | ||
"errorType": "No file uploaded" | ||
} |
73 changes: 73 additions & 0 deletions
73
spec/fixtures/messages/room/upload/png_upload_success.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"message": { | ||
"_id": "%{message_id}", | ||
"rid": "%{room_id}", | ||
"ts": "2023-07-07T08:05:32.625Z", | ||
"file": { | ||
"_id": "%{file_id}", | ||
"name": "%{file_name}", | ||
"type": "image/png" | ||
}, | ||
"files": [ | ||
{ | ||
"_id": "%{file_id}", | ||
"name": "%{file_name}", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"_id": "%{preview_file_id}", | ||
"name": "%{file_name}", | ||
"type": "image/png" | ||
} | ||
], | ||
"attachments": [ | ||
{ | ||
"ts": "1970-01-01T00:00:00.000Z", | ||
"title": "%{file_name}", | ||
"title_link": "/file-upload/%{file_id}/%{file_name}", | ||
"title_link_download": true, | ||
"image_dimensions": { | ||
"width": 480, | ||
"height": 300 | ||
}, | ||
"image_preview": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAUACADASIAAhEBAxEB/8QAGQAAAwADAAAAAAAAAAAAAAAAAAIDAQQH/8QAHxABAAICAgIDAAAAAAAAAAAAAQACAxESIRMxBEFS/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAUC/8QAFREBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhEDEQA/AOFx8PEuche4FtG+PUal26V0SgiFza8jr1JsrZCzyO4rY/MALutfUxRS4kIQK4jy5kv2Tcr8XE1XXo3CEzSP/9k=", | ||
"image_url": "/file-upload/%{preview_file_id}/%{file_name}", | ||
"image_type": "image/png", | ||
"image_size": 103724, | ||
"type": "file", | ||
"description": "%{description}", | ||
"descriptionMd": [ | ||
{ | ||
"type": "PARAGRAPH", | ||
"value": [ | ||
{ | ||
"type": "PLAIN_TEXT", | ||
"value": "%{description}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"msg": "%{msg}", | ||
"u": { | ||
"_id": "%{user_id}", | ||
"username": "admin", | ||
"name": "Admin" | ||
}, | ||
"_updatedAt": "2023-07-07T08:05:32.669Z", | ||
"urls": [], | ||
"md": [ | ||
{ | ||
"type": "PARAGRAPH", | ||
"value": [ | ||
{ | ||
"type": "PLAIN_TEXT", | ||
"value": "%{msg}" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"success": true | ||
} |
Oops, something went wrong.