aspose_slides_cloud 23.10.0 → 23.11.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_utils.rb CHANGED
@@ -22,16 +22,16 @@ SOFTWARE.
22
22
 
23
23
  module AsposeSlidesCloud
24
24
  class SpecUtils
25
- def self.ensureOperationId()
25
+ def self.getOperationId()
26
26
  unless @@operation_id
27
27
  source_file = File.binread("TestData/test.pptx")
28
28
  @@operation_id = SpecUtils.testSlidesAsyncApi.start_convert(source_file, AsposeSlidesCloud::ExportFormat::PDF, "password")
29
29
  sleep(10)
30
30
  end
31
+ @@operation_id
31
32
  end
32
33
 
33
34
  def self.initialize(method, name, value)
34
- SpecUtils.ensureOperationId()
35
35
  if !@@is_initialized
36
36
  version = ""
37
37
  begin
@@ -76,7 +76,6 @@ module AsposeSlidesCloud
76
76
  end
77
77
 
78
78
  def self.get_param_value(name, method, type)
79
- SpecUtils.ensureOperationId()
80
79
  value = nil
81
80
  SpecUtils.test_rules["Values"].each do |rule|
82
81
  if SpecUtils.good_rule?(rule, name, method, type) and rule.key?("Value")
@@ -189,7 +188,7 @@ module AsposeSlidesCloud
189
188
  result = File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, file_name))
190
189
  end
191
190
  elsif template == "#OperationId"
192
- return @@operation_id
191
+ return SpecUtils.getOperationId()
193
192
  elsif template == "#NewId"
194
193
  return "96b0a57c-d9ae-453f-b56f-3b154eb10cda"
195
194
  else
@@ -64,6 +64,95 @@ describe 'UseCases' do
64
64
  expect(converted.size).to be > 0
65
65
  end
66
66
 
67
+ it 'async convert and save' do
68
+ sleep_timeout = 3
69
+ max_tries = 10
70
+ out_path = "TestData/converted.pptx"
71
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_file(out_path)
72
+
73
+ source = File.binread("TestData/test.pptx")
74
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_convert_and_save(source, AsposeSlidesCloud::ExportFormat::PDF, out_path, "password")
75
+ for i in 1 .. max_tries do
76
+ sleep(sleep_timeout)
77
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
78
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
79
+ break
80
+ end
81
+ end
82
+ expect(operation.status).to eq('Finished')
83
+ expect(operation.error).to be_nil
84
+
85
+ expect(AsposeSlidesCloud::SpecUtils.testSlidesApi.object_exists(out_path).exists).to be true
86
+ end
87
+
88
+ it 'async save presentation' do
89
+ sleep_timeout = 3
90
+ max_tries = 10
91
+ folder_name = "TempSlidesSDK"
92
+ file_name = "test.pptx"
93
+ out_path = "TestData/converted.pptx"
94
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_file(out_path)
95
+
96
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
97
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_save_presentation(file_name, AsposeSlidesCloud::ExportFormat::PDF, out_path, nil, "password", folder_name)
98
+ for i in 1 .. max_tries do
99
+ sleep(sleep_timeout)
100
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
101
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
102
+ break
103
+ end
104
+ end
105
+ expect(operation.status).to eq('Finished')
106
+ expect(operation.error).to be_nil
107
+
108
+ expect(AsposeSlidesCloud::SpecUtils.testSlidesApi.object_exists(out_path).exists).to be true
109
+ end
110
+
111
+ it 'async merge' do
112
+ sleep_timeout = 3
113
+ max_tries = 10
114
+ source1 = File.binread("TestData/TemplateCV.pptx")
115
+ source2 = File.binread("TestData/test-unprotected.pptx")
116
+ files = [ source1, source2 ]
117
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_merge(files)
118
+ for i in 1 .. max_tries do
119
+ sleep(sleep_timeout)
120
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
121
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
122
+ break
123
+ end
124
+ end
125
+ expect(operation.status).to eq('Finished')
126
+ expect(operation.error).to be_nil
127
+
128
+ merged = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_result(operation_id)
129
+ expect(merged.size).to be > 0
130
+ end
131
+
132
+ it 'async merge and save' do
133
+ sleep_timeout = 3
134
+ max_tries = 10
135
+
136
+ out_path = "TestData/merged.pptx"
137
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_file(out_path)
138
+
139
+ source1 = File.binread("TestData/TemplateCV.pptx")
140
+ source2 = File.binread("TestData/test-unprotected.pptx")
141
+ files = [ source1, source2 ]
142
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_merge_and_save(out_path, files)
143
+ for i in 1 .. max_tries do
144
+ sleep(sleep_timeout)
145
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
146
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
147
+ break
148
+ end
149
+ end
150
+ expect(operation.status).to eq('Finished')
151
+ expect(operation.error).to be_nil
152
+
153
+ expect(AsposeSlidesCloud::SpecUtils.testSlidesApi.object_exists(out_path).exists).to be true
154
+ end
155
+
67
156
  it 'async bad operation' do
68
157
  sleep_timeout = 3
69
158
  max_tries = 10
@@ -117,6 +117,22 @@ describe 'UseCases' do
117
117
  expect(slide.layout_slide.href.include? layout_slide_href).to eq(true)
118
118
  end
119
119
 
120
+ it "set slide transition" do
121
+ folder_name = "TempSlidesSDK"
122
+ file_name = "test.pptx"
123
+ password = "password"
124
+ slide_index = 1
125
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
126
+
127
+ dto = AsposeSlidesCloud::Slide.new
128
+ dto.slide_show_transition = AsposeSlidesCloud::SlideShowTransition.new
129
+ dto.slide_show_transition.type = 'Circle'
130
+ dto.slide_show_transition.speed = 'Medium'
131
+
132
+ slide = AsposeSlidesCloud::SpecUtils.testSlidesApi.update_slide(file_name, slide_index, dto, password, folder_name)
133
+ expect(slide.slide_show_transition.type).to eq(dto.slide_show_transition.type)
134
+ end
135
+
120
136
  it "delete slides" do
121
137
  folder_name = "TempSlidesSDK"
122
138
  file_name = "test.pptx"
data/testRules.json CHANGED
@@ -57,14 +57,15 @@
57
57
  { "Value": { "Type": "Regular", "Author": "Caesar", "Text": "Veni vidi vici" }, "Type": "SlideComment", "Method": "/CreateComment/" },
58
58
  { "Value": { "List": [{ "Name": "Prop001", "Value": "Value001" }] }, "Type": "DocumentProperties" },
59
59
  { "Value": { "Name": "testProperty001", "Value": "testValue002" }, "Type": "DocumentProperty" },
60
+ { "Value": { "PresentationPaths": [ "TempSlidesSDK/test.pptx" ], "PresentationPasswords": [ "password" ] }, "Type": "PresentationsMergeRequest" },
60
61
  { "Value": { "Presentations": [{ "Path": "test.pptx", "Password": "password" }, { "Path": "test-unprotected.pptx" }] }, "Type": "OrderedMergeRequest" },
61
62
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Python" },
62
63
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Go" },
63
64
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Ruby" },
64
65
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "Perl" },
65
66
  { "Value": { "Presentations": [{ "Path": "file1", "Password": "password" }, { "Path": "file2" }] }, "Type": "OrderedMergeRequest", "Language": "C++" },
67
+ { "Value": { "Presentations": [{ "Path": "TempSlidesSDK/test.pptx", "Password": "password" }] }, "Type": "OrderedMergeRequest", "Method": "OrderedMerge" },
66
68
  { "Value": { "Name": "testModule001", "SourceCode": "Test" }, "Type": "VbaModule" },
67
- { "Value": {}, "Type": "OrderedMergeRequest", "Method": "OrderedMerge" },
68
69
  { "Value": { "paths": [ { "pathData": [ { "type": "MoveTo" } ] } ] }, "Type": "GeometryPaths" },
69
70
  { "Value": null, "Parameter": "PictureFrame" },
70
71
  { "Value": null, "Parameter": "Options" },
@@ -149,6 +150,7 @@
149
150
  { "Parameter": "SrcPath", "Method": "MoveFolder" },
150
151
  { "Parameter": "DestPath" },
151
152
  { "Parameter": "StorageName", "Method": "StorageExists" },
153
+ { "Parameter": "StorageName", "Method": "GetDiscUsage" },
152
154
  { "Parameter": "Html" },
153
155
  { "Parameter": "Text" },
154
156
  { "Parameter": "Regex" },
@@ -187,6 +189,7 @@
187
189
  { "Code": 200, "Method": "/CreateSmartArtNode/" },
188
190
  { "Code": 200, "Method": "CreateFolder" },
189
191
  { "Code": 201, "Method": "/^Copy.*Slide$/" },
192
+ { "Code": 201, "Method": "/^Start/" },
190
193
  { "Code": 400, "Invalid": true },
191
194
  { "Code": 404, "Message" : "AmazonS3 Storage exception: The specified key does not exist.", "Parameter": "Name" },
192
195
  { "Code": 404, "Message" : "Operation does not exist", "Parameter": "Id", "Method": "/^GetOperation/" },
@@ -210,8 +213,9 @@
210
213
  { "Message": "Invalid value for ", "Parameter": "SlideType" },
211
214
  { "Message": "Invalid value for ", "Parameter": "Format" },
212
215
  { "Message": " required parameter", "Type": "stream" },
213
- { "Message": "Error processing presentation ", "Parameter": "Files" },
214
216
  { "Message": "Image expected", "Parameter": "Image" },
217
+ { "Message": " required parameter", "Type": "stream", "Parameter": "Image", "Method": "/ReplaceImage/" },
218
+ { "Message": "Error processing presentation ", "Parameter": "Files" },
215
219
  { "Message": " required parameter", "Type": "model" },
216
220
  { "Message": "Failed to load the presentation", "Parameter": "Request", "Method": "/Merge.*Online/" },
217
221
  { "Message": "Invalid Request", "Parameter": "VersionId" },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_slides_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.10.0
4
+ version: 23.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Putrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-30 00:00:00.000000000 Z
11
+ date: 2023-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -417,6 +417,7 @@ files:
417
417
  - lib/aspose_slides_cloud/models/one_value_chart_data_point.rb
418
418
  - lib/aspose_slides_cloud/models/one_value_series.rb
419
419
  - lib/aspose_slides_cloud/models/operation.rb
420
+ - lib/aspose_slides_cloud/models/operation_progress.rb
420
421
  - lib/aspose_slides_cloud/models/ordered_merge_request.rb
421
422
  - lib/aspose_slides_cloud/models/outer_shadow_effect.rb
422
423
  - lib/aspose_slides_cloud/models/output_file.rb
@@ -485,6 +486,7 @@ files:
485
486
  - lib/aspose_slides_cloud/models/slide_properties.rb
486
487
  - lib/aspose_slides_cloud/models/slide_replace_result.rb
487
488
  - lib/aspose_slides_cloud/models/slide_show_properties.rb
489
+ - lib/aspose_slides_cloud/models/slide_show_transition.rb
488
490
  - lib/aspose_slides_cloud/models/slides.rb
489
491
  - lib/aspose_slides_cloud/models/smart_art.rb
490
492
  - lib/aspose_slides_cloud/models/smart_art_node.rb