trophonius 1.4.3.2 → 1.4.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d92b08e8204f1d2647b419cd5457f0aa756072526f528f868148f9bbcbd4316
4
- data.tar.gz: 70df9b9746b4a07d34ab9a9cda2cc837cc5c6f9c359701da51f1958ee2425fb2
3
+ metadata.gz: c25ac6f70f1f81be6d74ee6c429c9eba4b9398ed946c95db4afbef9edd5d7427
4
+ data.tar.gz: 2e5ff0271d0c59bf9b0c0698c828036a29241d52bef858b4742322ae57696a04
5
5
  SHA512:
6
- metadata.gz: d49725b94357cd94c4286ece7b2f2039899067ca4171685a8dd199daaa71a73a7ec2c1d8efe1a07eaa475232e0a08b7fe2d9d289ca932d269f1f5c1b2d422068
7
- data.tar.gz: bb80ab56647654628ae70753b7f92600ad1aa79a9ecf00fa97db33fe009c870daa77807f00d4882d7b9341bb51cbcedb405e2887ed48009f8f9f3e3b16ef759e
6
+ metadata.gz: 36392a0d5088283582cfdaeb8c06fff3c51d9f049c1e7e942d83a49dfab727af868fad7d86adfe79ffdf9d587fa5fc5034c02009467c4fef86dd3fcf3c421914
7
+ data.tar.gz: 3a17c5d3f9a7d6bbe3fbfb4e279b5f5000363827c2c22c2a5215e6f6cc7a9782701fd5217cc18ab43f0d394aa6ca7122a4536928aafd31e435f68996e6e65e82
@@ -36,9 +36,10 @@ module Trophonius
36
36
  end
37
37
  ssl_verifyhost = Trophonius.config.local_network ? 0 : 2
38
38
  ssl_verifypeer = !Trophonius.config.local_network
39
+ uri = URI::RFC2396_Parser.new
39
40
  url =
40
41
  URI(
41
- URI.escape(
42
+ uri.escape(
42
43
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{Trophonius.config.database}/sessions"
43
44
  )
44
45
  )
@@ -83,9 +84,10 @@ module Trophonius
83
84
  # Disconnects from the FileMaker server
84
85
  #
85
86
  def self.disconnect
87
+ uri = URI::RFC2396_Parser.new
86
88
  url =
87
89
  URI(
88
- URI.escape(
90
+ uri.escape(
89
91
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
90
92
  Trophonius.config.database
91
93
  }/sessions/#{Trophonius.config.redis_connection ? Trophonius::RedisManager.get_key(key: 'token') : @token}"
@@ -137,9 +139,10 @@ module Trophonius
137
139
  # Tests whether the FileMaker token is still valid
138
140
  # @return [Boolean] True if the token is valid False if invalid
139
141
  def self.test_connection
142
+ uri = URI::RFC2396_Parser.new
140
143
  url =
141
144
  URI(
142
- URI.escape(
145
+ uri.escape(
143
146
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
144
147
  Trophonius.config.database
145
148
  }/layouts/#{Trophonius.config.layout_name}/records?_limit=1"
@@ -176,9 +176,10 @@ module Trophonius
176
176
  # @return [Record] the created record
177
177
  # Model.create(fieldOne: "Data")
178
178
  def self.create(fieldData, portalData: {})
179
+ uri = URI::RFC2396_Parser.new
179
180
  url =
180
181
  URI(
181
- URI.escape(
182
+ uri.escape(
182
183
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
183
184
  Trophonius.config.database
184
185
  }/layouts/#{layout_name}/records"
@@ -229,7 +230,7 @@ module Trophonius
229
230
  else
230
231
  url =
231
232
  URI(
232
- URI.escape(
233
+ uri.escape(
233
234
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
234
235
  Trophonius.config.database
235
236
  }/layouts/#{layout_name}/records/#{response['response']['recordId']}"
@@ -249,9 +250,10 @@ module Trophonius
249
250
  # @return [Record] a Record object that correspond to FileMaker record fitting the find request
250
251
  # Model.find_by(fieldOne: "Data")
251
252
  def self.find_by(fieldData)
253
+ uri = URI::RFC2396_Parser.new
252
254
  url =
253
255
  URI(
254
- URI.escape(
256
+ uri.escape(
255
257
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
256
258
  Trophonius.config.database
257
259
  }/layouts/#{self.layout_name}/_find?_limit=1"
@@ -292,9 +294,10 @@ module Trophonius
292
294
  #
293
295
  # @return [Record] the record
294
296
  def self.find(record_id)
297
+ uri = URI::RFC2396_Parser.new
295
298
  url =
296
299
  URI(
297
- URI.escape(
300
+ uri.escape(
298
301
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
299
302
  Trophonius.config.database
300
303
  }/layouts/#{layout_name}/records/#{record_id}"
@@ -317,9 +320,10 @@ module Trophonius
317
320
  #
318
321
  # @return [Boolean] True if the delete was successful
319
322
  def self.delete(record_id)
323
+ uri = URI::RFC2396_Parser.new
320
324
  url =
321
325
  URI(
322
- URI.escape(
326
+ uri.escape(
323
327
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
324
328
  Trophonius.config.database
325
329
  }/layouts/#{layout_name}/records/#{record_id}"
@@ -342,9 +346,10 @@ module Trophonius
342
346
  #
343
347
  # @return [Boolean] True if the delete was successful
344
348
  def self.edit(record_id, fieldData)
349
+ uri = URI::RFC2396_Parser.new
345
350
  url =
346
351
  URI(
347
- URI.escape(
352
+ uri.escape(
348
353
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
349
354
  Trophonius.config.database
350
355
  }/layouts/#{layout_name}/records/#{record_id}"
@@ -466,12 +471,13 @@ module Trophonius
466
471
  #
467
472
  # @return [RecordSet]: a RecordSet containing all the Record objects that correspond to the FileMaker records.
468
473
  def self.all(sort: {})
474
+ uri = URI::RFC2396_Parser.new
469
475
  results = Request.retrieve_all(layout_name, sort)
470
476
  count = results['response']['scriptResult'].to_i
471
477
  unless @limit.empty? || @offset.empty?
472
478
  url =
473
479
  URI(
474
- URI.escape(
480
+ uri.escape(
475
481
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
476
482
  Trophonius.config.database
477
483
  }/layouts/#{layout_name}/records?_offset=#{@offset}&_limit=#{@limit}"
@@ -480,7 +486,7 @@ module Trophonius
480
486
  else
481
487
  url =
482
488
  URI(
483
- URI.escape(
489
+ uri.escape(
484
490
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
485
491
  Trophonius.config.database
486
492
  }/layouts/#{layout_name}/records?_limit=#{count == 0 ? 1_000_000 : count}"
@@ -184,9 +184,10 @@ module Trophonius
184
184
  #
185
185
  # @return Response of the called method
186
186
  def run_query(method, *args, &block)
187
+ uri = URI::RFC2396_Parser.new
187
188
  url =
188
189
  URI(
189
- URI.escape(
190
+ uri.escape(
190
191
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
191
192
  Trophonius.config.database
192
193
  }/layouts/#{@trophonius_model.layout_name}/_find"
@@ -32,9 +32,10 @@ module Trophonius
32
32
  layout = model.layout_name
33
33
  model.create_translations if model.translations.keys.empty?
34
34
 
35
+ uri = URI::RFC2396_Parser.new
35
36
  url =
36
37
  URI(
37
- URI.escape(
38
+ uri.escape(
38
39
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
39
40
  Trophonius.config.database
40
41
  }/layouts/#{layout}/_find"
@@ -94,9 +95,10 @@ module Trophonius
94
95
  layout = pk_model.layout_name
95
96
  pk_model.create_translations if pk_model.translations.keys.empty?
96
97
 
98
+ uri = URI::RFC2396_Parser.new
97
99
  url =
98
100
  URI(
99
- URI.escape(
101
+ uri.escape(
100
102
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
101
103
  Trophonius.config.database
102
104
  }/layouts/#{layout}/_find"
@@ -167,9 +169,10 @@ module Trophonius
167
169
  #
168
170
  # @return [String]: string representing the script result returned by FileMaker
169
171
  def run_script(script: '', scriptparameter: '')
172
+ uri = URI::RFC2396_Parser.new
170
173
  url =
171
174
  URI(
172
- URI.escape(
175
+ uri.escape(
173
176
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
174
177
  Trophonius.config.database
175
178
  }/layouts/#{layout_name}/records/#{record_id}?script=#{script}&script.param=#{scriptparameter}"
@@ -194,9 +197,10 @@ module Trophonius
194
197
  #
195
198
  # @return [True] if successful
196
199
  def save
200
+ uri = URI::RFC2396_Parser.new
197
201
  url =
198
202
  URI(
199
- URI.escape(
203
+ uri.escape(
200
204
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
201
205
  Trophonius.config.database
202
206
  }/layouts/#{layout_name}/records/#{record_id}"
@@ -213,9 +217,10 @@ module Trophonius
213
217
  #
214
218
  # @return [True] if successful
215
219
  def delete
220
+ uri = URI::RFC2396_Parser.new
216
221
  url =
217
222
  URI(
218
- URI.escape(
223
+ uri.escape(
219
224
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
220
225
  Trophonius.config.database
221
226
  }/layouts/#{layout_name}/records/#{record_id}"
@@ -233,9 +238,10 @@ module Trophonius
233
238
  #
234
239
  # @return [True] if successful
235
240
  def update(fieldData)
241
+ uri = URI::RFC2396_Parser.new
236
242
  url =
237
243
  URI(
238
- URI.escape(
244
+ uri.escape(
239
245
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
240
246
  Trophonius.config.database
241
247
  }/layouts/#{layout_name}/records/#{record_id}"
@@ -271,9 +277,10 @@ module Trophonius
271
277
  #
272
278
  # @return [True] if successful
273
279
  def upload(container_name:, container_repetition: 1, file:)
280
+ uri = URI::RFC2396_Parser.new
274
281
  url =
275
282
  URI(
276
- URI.escape(
283
+ uri.escape(
277
284
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
278
285
  Trophonius.config.database
279
286
  }/layouts/#{layout_name}/records/#{record_id}/containers/#{container_name}/#{container_repetition}"
@@ -83,9 +83,10 @@ module Trophonius
83
83
  #
84
84
  # @return [JSON] The first record from FileMaker
85
85
  def self.retrieve_first(layout_name)
86
+ uri = URI::RFC2396_Parser.new
86
87
  url =
87
88
  URI(
88
- URI.escape(
89
+ uri.escape(
89
90
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
90
91
  Trophonius.config.database
91
92
  }/layouts/#{layout_name}/records?_limit=1"
@@ -99,9 +100,10 @@ module Trophonius
99
100
  #
100
101
  # @return [JSON] The fieldnames of a layout
101
102
  def self.get_layout_field_names(layout_name)
103
+ uri = URI::RFC2396_Parser.new
102
104
  url =
103
105
  URI(
104
- URI.escape(
106
+ uri.escape(
105
107
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
106
108
  Trophonius.config.database
107
109
  }/layouts/#{layout_name}"
@@ -119,9 +121,10 @@ module Trophonius
119
121
  #
120
122
  # @return [JSON] The script result from FileMaker
121
123
  def self.run_script(script, scriptparameter, layout_name)
124
+ uri = URI::RFC2396_Parser.new
122
125
  url =
123
126
  URI(
124
- URI.escape(
127
+ uri.escape(
125
128
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
126
129
  Trophonius.config.database
127
130
  }/layouts/#{layout_name}/records?_limit=1&script=#{script}&script.param=#{scriptparameter}"
@@ -135,11 +138,12 @@ module Trophonius
135
138
  #
136
139
  # @return [JSON] The first 10000000 records from FileMaker
137
140
  def self.retrieve_all(layout_name, sort)
141
+ uri = URI::RFC2396_Parser.new
138
142
  if !sort.empty?
139
143
  sort_order = sort.to_json.to_s
140
144
  url =
141
145
  URI(
142
- URI.escape(
146
+ uri.escape(
143
147
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
144
148
  Trophonius.config.database
145
149
  }/layouts/#{layout_name}/records?_limit=10000000_sort=#{sort_order}#{
@@ -150,7 +154,7 @@ module Trophonius
150
154
  else
151
155
  url =
152
156
  URI(
153
- URI.escape(
157
+ uri.escape(
154
158
  "http#{Trophonius.config.ssl == true ? 's' : ''}://#{Trophonius.config.host}/fmi/data/v1/databases/#{
155
159
  Trophonius.config.database
156
160
  }/layouts/#{layout_name}/records?_limit=10000000#{
@@ -15,9 +15,10 @@ module Trophonius
15
15
  end
16
16
 
17
17
  def where(fieldData)
18
+ uri = URI::RFC2396_Parser.new
18
19
  url =
19
20
  URI(
20
- URI.escape(
21
+ uri.escape(
21
22
  "http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/layouts/#{
22
23
  @config[:layout_name]
23
24
  }/_find"
@@ -49,9 +50,10 @@ module Trophonius
49
50
  end
50
51
 
51
52
  def first
53
+ uri = URI::RFC2396_Parser.new
52
54
  url =
53
55
  URI(
54
- URI.escape(
56
+ uri.escape(
55
57
  "http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/layouts/#{
56
58
  @config[:layout_name]
57
59
  }/records?_limit=1"
@@ -81,9 +83,10 @@ module Trophonius
81
83
  end
82
84
 
83
85
  def run_script(script:, scriptparameter:)
86
+ uri = URI::RFC2396_Parser.new
84
87
  url =
85
88
  URI(
86
- URI.escape(
89
+ uri.escape(
87
90
  "http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/layouts/#{
88
91
  @config[:layout_name]
89
92
  }/records?_limit=1&script=#{script}&script.param=#{scriptparameter}"
@@ -189,7 +192,8 @@ module Trophonius
189
192
  def setup_connection
190
193
  ssl_verifyhost = @config[:local_network] ? 0 : 2
191
194
  ssl_verifypeer = !@config[:local_network]
192
- url = URI(URI.escape("http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/sessions"))
195
+ uri = URI::RFC2396_Parser.new
196
+ url = URI(uri.escape("http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/sessions"))
193
197
  request =
194
198
  Typhoeus::Request.new(
195
199
  url,
@@ -220,8 +224,9 @@ module Trophonius
220
224
  end
221
225
 
222
226
  def close_connection(token)
227
+ uri = URI::RFC2396_Parser.new
223
228
  url =
224
- URI(URI.escape("http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/sessions/#{token}"))
229
+ URI(uri.escape("http#{@config[:ssl] == true ? 's' : ''}://#{@config[:host]}/fmi/data/v1/databases/#{@config[:database]}/sessions/#{token}"))
225
230
  ssl_verifyhost = @config[:local_network] ? 0 : 2
226
231
  ssl_verifypeer = !@config[:local_network]
227
232
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trophonius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3.2
4
+ version: 1.4.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kempen Automatisering
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.0.3
97
+ rubygems_version: 3.1.6
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Link between Ruby (on Rails) and FileMaker.