aspose_html 1.0.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.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +12 -0
  3. data/Gemfile.lock +92 -0
  4. data/LICENSE +21 -0
  5. data/README.md +181 -0
  6. data/Rakefile +8 -0
  7. data/aspose_html.gemspec +58 -0
  8. data/docs/ConversionApi.md +837 -0
  9. data/docs/DocumentApi.md +386 -0
  10. data/docs/OcrApi.md +128 -0
  11. data/docs/SummarizationApi.md +111 -0
  12. data/docs/TranslationApi.md +126 -0
  13. data/docs/storage/DiscUsage.md +9 -0
  14. data/docs/storage/DiscUsageResponse.md +10 -0
  15. data/docs/storage/FileApi.md +240 -0
  16. data/docs/storage/FileDetail.md +13 -0
  17. data/docs/storage/FileDetailsResponse.md +10 -0
  18. data/docs/storage/FileExist.md +9 -0
  19. data/docs/storage/FileExistResponse.md +10 -0
  20. data/docs/storage/FileVersion.md +15 -0
  21. data/docs/storage/FileVersionsResponse.md +10 -0
  22. data/docs/storage/FolderApi.md +229 -0
  23. data/docs/storage/MessageResponse.md +9 -0
  24. data/docs/storage/MoveFileResponse.md +9 -0
  25. data/docs/storage/MoveFolderResponse.md +9 -0
  26. data/docs/storage/RemoveFileResponse.md +9 -0
  27. data/docs/storage/RemoveFolderResponse.md +9 -0
  28. data/docs/storage/StorageApi.md +217 -0
  29. data/docs/storage/StorageExistResponse.md +10 -0
  30. data/lib/aspose_html.rb +68 -0
  31. data/lib/aspose_html/api/html_api.rb +1900 -0
  32. data/lib/aspose_html/api/storage_api.rb +774 -0
  33. data/lib/aspose_html/api_client.rb +386 -0
  34. data/lib/aspose_html/api_error.rb +54 -0
  35. data/lib/aspose_html/configuration.rb +175 -0
  36. data/lib/aspose_html/models/disc_usage.rb +223 -0
  37. data/lib/aspose_html/models/disc_usage_response.rb +260 -0
  38. data/lib/aspose_html/models/file_detail.rb +254 -0
  39. data/lib/aspose_html/models/file_details_response.rb +262 -0
  40. data/lib/aspose_html/models/file_exist.rb +223 -0
  41. data/lib/aspose_html/models/file_exist_response.rb +274 -0
  42. data/lib/aspose_html/models/file_version.rb +273 -0
  43. data/lib/aspose_html/models/file_versions_response.rb +262 -0
  44. data/lib/aspose_html/models/message_response.rb +251 -0
  45. data/lib/aspose_html/models/move_file_response.rb +251 -0
  46. data/lib/aspose_html/models/move_folder_response.rb +251 -0
  47. data/lib/aspose_html/models/remove_file_response.rb +251 -0
  48. data/lib/aspose_html/models/remove_folder_response.rb +251 -0
  49. data/lib/aspose_html/models/storage_exist_response.rb +260 -0
  50. data/lib/aspose_html/version.rb +31 -0
  51. data/spec/api/html_api_spec.rb +971 -0
  52. data/spec/api/model_spec.rb +622 -0
  53. data/spec/api/storage_api_spec.rb +596 -0
  54. data/spec/spec_helper.rb +169 -0
  55. data/testdata/test.txt +1 -0
  56. data/testdata/test1.html +19 -0
  57. data/testdata/test1.html.zip +0 -0
  58. data/testdata/test2.html +46 -0
  59. data/testdata/test2.html.zip +0 -0
  60. data/testdata/test3.html.zip +0 -0
  61. data/testdata/test4.html.zip +0 -0
  62. data/testdata/test_download.jpg +0 -0
  63. data/testdata/test_en.html +46 -0
  64. data/testdata/test_for_delete.html +46 -0
  65. data/testdata/test_for_move.html +46 -0
  66. data/testdata/test_get_doc.zip +0 -0
  67. data/testdata/test_ocr.jpg +0 -0
  68. data/testdata/test_ocr.png +0 -0
  69. data/testdata/test_put_create.html +19 -0
  70. data/testdata/test_put_create.jpg +0 -0
  71. data/testresult/Convert_html.bmp +0 -0
  72. data/testresult/Convert_html.pdf +0 -0
  73. data/testresult/Convert_html.xps +0 -0
  74. data/testresult/Convert_url.pdf +0 -0
  75. data/testresult/Convert_url.png +0 -0
  76. data/testresult/Convert_url.xps +0 -0
  77. data/testresult/Get_document.zip +0 -0
  78. data/testresult/Get_fragment_css_by_url.html +447 -0
  79. data/testresult/Get_fragment_doc.html +9 -0
  80. data/testresult/Get_fragment_doc_css.html +9 -0
  81. data/testresult/Get_fragment_xpath_by_url.html +38 -0
  82. data/testresult/Get_images_doc.zip +0 -0
  83. data/testresult/Get_images_from_url.zip +0 -0
  84. data/testresult/Keyword_by_doc.json +1 -0
  85. data/testresult/Keyword_by_url.json +1 -0
  86. data/testresult/Recognize_en_png.html +10 -0
  87. data/testresult/Translate_url_en_fr.zip +0 -0
  88. data/testresult/putTest.pdf +0 -0
  89. data/testresult/putTest.png +0 -0
  90. data/testresult/putTest.xps +0 -0
  91. data/testresult/putTestDoc.pdf +0 -0
  92. data/testresult/putTestDoc.tiff +0 -0
  93. data/testresult/putTestDoc.xps +0 -0
  94. data/testresult/test_download.jpg +0 -0
  95. metadata +320 -0
@@ -0,0 +1,111 @@
1
+ # Summarization Api
2
+
3
+ All URIs are relative to *https://api.aspose.cloud/v1.1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**summarization_get_detect_html_keywords**](SummarizationApi.md#get_detect_html_keywords) | **GET** /html/{name}/summ/keywords | Get the HTML document keywords using the keyword detection service.
8
+ [**summarization_get_detect_html_keywords_by_url**](SummarizationApi.md#get_detect_html_keywords_by_url) | **GET** /html/summ/keywords | Get the keywords from HTML document from Web specified by its URL using the keyword detection service
9
+
10
+
11
+ # **get_detect_html_keywords**
12
+ > Hash get_detect_html_keywords(name, opts)
13
+
14
+ Get the HTML document keywords using the keyword detection service.
15
+
16
+ ### Example
17
+ ```ruby
18
+ # load the gem
19
+ require 'aspose_html'
20
+
21
+ CONFIG = {
22
+ "basePath":"https://api.aspose.cloud/v1.1",
23
+ "authPath":"https://api.aspose.cloud/oauth2/token",
24
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
25
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
26
+ "debug":true
27
+ }
28
+
29
+ api_instance = AsposeHtml::HtmlApi.new CONFIG
30
+
31
+ name = "name_example" # String | Document name.
32
+
33
+ opts = {
34
+ folder: "folder_example", # String | Document folder.
35
+ storage: "storage_example" # String | Document storage.
36
+ }
37
+
38
+ begin
39
+ #Get the HTML document keywords using the keyword detection service.
40
+ result = api_instance.get_detect_html_keywords(name, opts)
41
+ p result
42
+ rescue AsposeHtml::ApiError => e
43
+ puts "Exception when calling HtmlApi->get_detect_html_keywords: #{e}"
44
+ end
45
+ ```
46
+
47
+ ### Parameters
48
+
49
+ Name | Type | Description | Notes
50
+ ------------- | ------------- | ------------- | -------------
51
+ **name** | **String**| Document name. |
52
+ **folder** | **String**| Document folder. | [optional]
53
+ **storage** | **String**| Document storage. | [optional]
54
+
55
+ ### Return type
56
+
57
+ **[Hash] {file: data, status: _status_code, headers: _headers}**
58
+
59
+ ### HTTP request headers
60
+
61
+ - **Content-Type**: application/json
62
+ - **Accept**: application/json
63
+
64
+
65
+
66
+ # **get_detect_html_keywords_by_url**
67
+ > Hash get_detect_html_keywords_by_url(source_url)
68
+
69
+ Get the keywords from HTML document from Web specified by its URL using the keyword detection service
70
+
71
+ ### Example
72
+ ```ruby
73
+ # load the gem
74
+ require 'aspose_html'
75
+
76
+ CONFIG = {
77
+ "basePath":"https://api.aspose.cloud/v1.1",
78
+ "authPath":"https://api.aspose.cloud/oauth2/token",
79
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
80
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
81
+ "debug":true
82
+ }
83
+
84
+ api_instance = AsposeHtml::HtmlApi.new CONFIG
85
+
86
+ source_url = "source_url_example" # String | Source document URL.
87
+
88
+
89
+ begin
90
+ #Get the keywords from HTML document from Web specified by its URL using the keyword detection service
91
+ result = api_instance.get_detect_html_keywords_by_url(source_url)
92
+ p result
93
+ rescue AsposeHtml::ApiError => e
94
+ puts "Exception when calling HtmlApi->get_detect_html_keywords_by_url: #{e}"
95
+ end
96
+ ```
97
+
98
+ ### Parameters
99
+
100
+ Name | Type | Description | Notes
101
+ ------------- | ------------- | ------------- | -------------
102
+ **source_url** | **String**| Source document URL. |
103
+
104
+ ### Return type
105
+
106
+ **[Hash] {file: data, status: _status_code, headers: _headers}**
107
+
108
+ ### HTTP request headers
109
+
110
+ - **Content-Type**: application/json
111
+ - **Accept**: application/json
@@ -0,0 +1,126 @@
1
+ # Translation API
2
+
3
+ All URIs are relative to *https://api.aspose.cloud/v1.1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_translate_document**](TranslationApi.md#get_translate_document) | **GET** /html/{name}/translate/{srcLang}/{resLang} | Translate the HTML document specified by the name from default or specified storage.
8
+ [**get_translate_document_by_url**](TranslationApi.md#get_translate_document_by_url) | **GET** /html/translate/{srcLang}/{resLang} | Translate the HTML document from Web specified by its URL.
9
+
10
+
11
+ # **get_translate_document**
12
+ > Hash get_translate_document(name, src_lang, res_lang, opts)
13
+
14
+ Translate the HTML document specified by the name from default or specified storage.
15
+
16
+ ### Example
17
+ ```ruby
18
+ # load the gem
19
+ require 'aspose_html'
20
+
21
+ CONFIG = {
22
+ "basePath":"https://api.aspose.cloud/v1.1",
23
+ "authPath":"https://api.aspose.cloud/oauth2/token",
24
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
25
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
26
+ "debug":true
27
+ }
28
+
29
+ api_instance = AsposeHtml::HtmlApi.new CONFIG
30
+
31
+ name = "test_en.html" # String | Document name.
32
+
33
+ src_lang = "en" # String | Source language.
34
+
35
+ res_lang = "fr" # String | Result language.
36
+
37
+ opts = {
38
+ storage: "storage_example", # String | The source document storage.
39
+ folder: "folder_example" # String | The source document folder.
40
+ }
41
+
42
+ begin
43
+ #Translate the HTML document specified by the name from default or specified storage.
44
+ result = api_instance.get_translate_document(name, src_lang, res_lang, opts)
45
+ p result
46
+ rescue AsposeHtml::ApiError => e
47
+ puts "Exception when calling HtmlApi->get_translate_document: #{e}"
48
+ end
49
+ ```
50
+
51
+ ### Parameters
52
+
53
+ Name | Type | Description | Notes
54
+ ------------- | ------------- | ------------- | -------------
55
+ **name** | **String**| Document name. |
56
+ **src_lang** | **String**| Source language. |
57
+ **res_lang** | **String**| Result language. |
58
+ **storage** | **String**| The source document storage. | [optional]
59
+ **folder** | **String**| The source document folder. | [optional]
60
+
61
+ ### Return type
62
+
63
+ **[Hash] {file: data, status: _status_code, headers: _headers}**
64
+
65
+ ### HTTP request headers
66
+
67
+ - **Content-Type**: application/json
68
+ - **Accept**: multipart/form-data
69
+
70
+
71
+
72
+ # **get_translate_document_by_url**
73
+ > Hash get_translate_document_by_url(source_url, src_lang, res_lang)
74
+
75
+ Translate the HTML document from Web specified by its URL.
76
+
77
+ ### Example
78
+ ```ruby
79
+ # load the gem
80
+ require 'aspose_html'
81
+
82
+ CONFIG = {
83
+ "basePath":"https://api.aspose.cloud/v1.1",
84
+ "authPath":"https://api.aspose.cloud/oauth2/token",
85
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
86
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
87
+ "debug":true
88
+ }
89
+
90
+ api_instance = AsposeHtml::HtmlApi.new CONFIG
91
+
92
+ source_url = "https://www.le.ac.uk/oerresources/bdra/html/page_01.htm" # String | Source document URL.
93
+
94
+ src_lang = "en" # String | Source language.
95
+
96
+ res_lang = "de" # String | Result language.
97
+
98
+
99
+ begin
100
+ #Translate the HTML document from Web specified by its URL.
101
+ result = api_instance.get_translate_document_by_url(source_url, src_lang, res_lang)
102
+ p result
103
+ rescue AsposeHtml::ApiError => e
104
+ puts "Exception when calling HtmlApi->get_translate_document_by_url: #{e}"
105
+ end
106
+ ```
107
+
108
+ ### Parameters
109
+
110
+ Name | Type | Description | Notes
111
+ ------------- | ------------- | ------------- | -------------
112
+ **source_url** | **String**| Source document URL. |
113
+ **src_lang** | **String**| Source language. |
114
+ **res_lang** | **String**| Result language. |
115
+
116
+ ### Return type
117
+
118
+ **[Hash] {file: data, status: _status_code, headers: _headers}**
119
+
120
+ ### HTTP request headers
121
+
122
+ - **Content-Type**: application/json
123
+ - **Accept**: multipart/form-data
124
+
125
+
126
+
@@ -0,0 +1,9 @@
1
+ # AsposeStorage::DiscUsage
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **used_size** | **Integer** | |
7
+ **total_size** | **Integer** | |
8
+
9
+
@@ -0,0 +1,10 @@
1
+ # AsposeStorage::DiscUsageResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **code** | **String** | |
7
+ **status** | **String** | | [optional]
8
+ **disc_usage** | [**DiscUsage**](DiscUsage.md) | | [optional]
9
+
10
+
@@ -0,0 +1,240 @@
1
+ # File API
2
+
3
+ All URIs are relative to *https://api.aspose.cloud/v1.1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**delete_file**](FileApi.md#delete_file) | **DELETE** /storage/file | Remove a specific file
8
+ [**get_download**](FileApi.md#get_download) | **GET** /storage/file | Download a specific file
9
+ [**post_move_file**](FileApi.md#post_move_file) | **POST** /storage/file | Move a specific file
10
+ [**put_create**](FileApi.md#put_create) | **PUT** /storage/file | Upload a specific file
11
+
12
+
13
+ # **delete_file**
14
+ > RemoveFileResponse delete_file(path, opts)
15
+
16
+ Remove a specific file
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'aspose_html'
22
+
23
+ CONFIG = {
24
+ "basePath":"https://api.aspose.cloud/v1.1",
25
+ "authPath":"https://api.aspose.cloud/oauth2/token",
26
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
27
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
28
+ "debug":true
29
+ }
30
+
31
+ api_instance = AsposeHtml::StorageApi.new CONFIG
32
+
33
+ path = "path_example" # String | Path of the file including file name and extension e.g. /Folder1/file.ext
34
+
35
+ opts = {
36
+ version_id: "version_id_example", # String | File's version
37
+ storage: "storage_example" # String | User's storage name
38
+ }
39
+
40
+ begin
41
+ #Remove a specific file
42
+ result = api_instance.delete_file(path, opts)
43
+ p result
44
+ rescue AsposeStorage::ApiError => e
45
+ puts "Exception when calling FileApi->delete_file: #{e}"
46
+ end
47
+ ```
48
+
49
+ ### Parameters
50
+
51
+ Name | Type | Description | Notes
52
+ ------------- | ------------- | ------------- | -------------
53
+ **path** | **String**| Path of the file including file name and extension e.g. /Folder1/file.ext |
54
+ **version_id** | **String**| File's version | [optional]
55
+ **storage** | **String**| User's storage name | [optional]
56
+
57
+ ### Return type
58
+
59
+ [**RemoveFileResponse**](RemoveFileResponse.md)
60
+
61
+ ### HTTP request headers
62
+
63
+ - **Content-Type**: application/json
64
+ - **Accept**: application/json
65
+
66
+
67
+
68
+ # **get_download**
69
+ > File get_download(path, opts)
70
+
71
+ Download a specific file
72
+
73
+ ### Example
74
+ ```ruby
75
+ # load the gem
76
+ require 'aspose_html'
77
+
78
+ CONFIG = {
79
+ "basePath":"https://api.aspose.cloud/v1.1",
80
+ "authPath":"https://api.aspose.cloud/oauth2/token",
81
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
82
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
83
+ "debug":true
84
+ }
85
+
86
+ api_instance = AsposeHtml::StorageApi.new CONFIG
87
+
88
+ path = "path_example" # String | Path of the file including the file name and extension e.g. /file.ext
89
+
90
+ opts = {
91
+ version_id: "version_id_example", # String | File's version
92
+ storage: "storage_example" # String | User's storage name
93
+ }
94
+
95
+ begin
96
+ #Download a specific file
97
+ result = api_instance.get_download(path, opts)
98
+ p result
99
+ rescue AsposeStorage::ApiError => e
100
+ puts "Exception when calling FileApi->get_download: #{e}"
101
+ end
102
+ ```
103
+
104
+ ### Parameters
105
+
106
+ Name | Type | Description | Notes
107
+ ------------- | ------------- | ------------- | -------------
108
+ **path** | **String**| Path of the file including the file name and extension e.g. /file.ext |
109
+ **version_id** | **String**| File's version | [optional]
110
+ **storage** | **String**| User's storage name | [optional]
111
+
112
+ ### Return type
113
+
114
+ **{file: path_to_tmp_file, code: 200, status: 'OK'}**
115
+
116
+ ### HTTP request headers
117
+
118
+ - **Content-Type**: application/json
119
+ - **Accept**: multipart/form-data
120
+
121
+
122
+
123
+ # **post_move_file**
124
+ > MoveFileResponse post_move_file(src, dest, opts)
125
+
126
+ Move a specific file
127
+
128
+ ### Example
129
+ ```ruby
130
+ # load the gem
131
+ require 'aspose_html'
132
+
133
+ CONFIG = {
134
+ "basePath":"https://api.aspose.cloud/v1.1",
135
+ "authPath":"https://api.aspose.cloud/oauth2/token",
136
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
137
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
138
+ "debug":true
139
+ }
140
+
141
+ api_instance = AsposeHtml::StorageApi.new CONFIG
142
+
143
+ src = "src_example" # String | Source file path e.g. /fileSource.ext
144
+
145
+ dest = "dest_example" # String | Destination file path e.g. /fileDestination.ext
146
+
147
+ opts = {
148
+ version_id: "version_id_example", # String | Source file's version,
149
+ storage: "storage_example", # String | User's source storage name
150
+ dest_storage: "dest_storage_example" # String | User's destination storage name
151
+ }
152
+
153
+ begin
154
+ #Move a specific file
155
+ result = api_instance.post_move_file(src, dest, opts)
156
+ p result
157
+ rescue AsposeStorage::ApiError => e
158
+ puts "Exception when calling FileApi->post_move_file: #{e}"
159
+ end
160
+ ```
161
+
162
+ ### Parameters
163
+
164
+ Name | Type | Description | Notes
165
+ ------------- | ------------- | ------------- | -------------
166
+ **src** | **String**| Source file path e.g. /fileSource.ext |
167
+ **dest** | **String**| Destination file path e.g. /fileDestination.ext |
168
+ **version_id** | **String**| Source file's version, | [optional]
169
+ **storage** | **String**| User's source storage name | [optional]
170
+ **dest_storage** | **String**| User's destination storage name | [optional]
171
+
172
+ ### Return type
173
+
174
+ [**MoveFileResponse**](MoveFileResponse.md)
175
+
176
+ ### HTTP request headers
177
+
178
+ - **Content-Type**: multipart/form-data
179
+ - **Accept**: application/json
180
+
181
+
182
+
183
+ # **put_create**
184
+ > File put_create(path, file, opts)
185
+
186
+ Upload a specific file
187
+
188
+ ### Example
189
+ ```ruby
190
+ # load the gem
191
+ require 'aspose_html'
192
+
193
+ CONFIG = {
194
+ "basePath":"https://api.aspose.cloud/v1.1",
195
+ "authPath":"https://api.aspose.cloud/oauth2/token",
196
+ "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
197
+ "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
198
+ "debug":true
199
+ }
200
+
201
+ api_instance = AsposeHtml::StorageApi.new CONFIG
202
+
203
+ path = "path_example" # String | Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
204
+
205
+ file = File.new("/path/to/file.txt") # File | File to upload
206
+
207
+ opts = {
208
+ version_id: "version_id_example", # String | Source file's version
209
+ storage: "storage_example" # String | User's storage name
210
+ }
211
+
212
+ begin
213
+ #Upload a specific file
214
+ result = api_instance.put_create(path, file, opts)
215
+ p result
216
+ rescue AsposeStorage::ApiError => e
217
+ puts "Exception when calling FileApi->put_create: #{e}"
218
+ end
219
+ ```
220
+
221
+ ### Parameters
222
+
223
+ Name | Type | Description | Notes
224
+ ------------- | ------------- | ------------- | -------------
225
+ **path** | **String**| Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext |
226
+ **file** | **File**| File to upload |
227
+ **version_id** | **String**| Source file's version | [optional]
228
+ **storage** | **String**| User's storage name | [optional]
229
+
230
+ ### Return type
231
+
232
+ [**MessageResponse**](MessageResponse.md)
233
+
234
+ ### HTTP request headers
235
+
236
+ - **Content-Type**: multipart/form-data
237
+ - **Accept**: application/json
238
+
239
+
240
+