kinetic_sdk 5.0.26 → 5.0.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09033c94f603013cfa19f24170e70a085ff4490de6716bd214d4df76569777a8'
4
- data.tar.gz: 5cf2daefa8cdd2f322e2263bcd4d75b029691a9b40deba56634f34fd18413070
3
+ metadata.gz: e8637eaa13377299182574e1e99d04b4956dd10c56042e3ecbf88e9fa73de6ce
4
+ data.tar.gz: 6b826e2698e7f371424d5003eb4b2ce1b83e688ca2553769a9be0a49baea33ec
5
5
  SHA512:
6
- metadata.gz: c59ff2c48b32662b52a07804766e87ea7d3e97ec97b8d984c778897f881e222d8dfdfae90d4f1e59861ba463663993196b71e15dd1a1f9dac64bf51ff8ff0c88
7
- data.tar.gz: d56f66770c84241edca41675494614e44582c25f7d47d00d1698f26bf308a040e8cc4096ac566e80e224de322bf07e81642a187791296720e65e890ee494d9bc
6
+ metadata.gz: bd359dfec6a58c1e69e9fb29828a7aacb551aa5fb017eac28383c85359315b0de4b6e3ddf729b9dc9b82817e664a653d42ff654352035065f20773badd474d03
7
+ data.tar.gz: 7e79cf6f3fa34bf71ef2a200c28a16d86848a0ad7a449738fb7af8e0bbead08f2a3a05325978a99622046d0ad88a25ac6640d83843df245423498c1d45023477
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [5.0.27](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.27) (2024-06-26)
4
+
5
+ **Implemented enhancements:**
6
+
7
+ - Enhance the export_handlers method to export all handlers. Previously, this method was
8
+ limited to only exporting the first page of handlers since it wasn't handling pagination.
9
+
3
10
  ## [5.0.26](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.26) (2024-03-28)
4
11
 
5
12
  **Implemented enhancements:**
@@ -109,11 +109,24 @@ module KineticSdk
109
109
  def export_handlers(headers=header_basic_auth)
110
110
  raise StandardError.new "An export directory must be defined to export handlers." if @options[:export_directory].nil?
111
111
  @logger.info("Exporting handlers to #{@options[:export_directory]}.")
112
- # Get the handler metadata to geta all handler_ids
113
- response = find_handlers(headers)
114
- # Parse the response and export each handler
115
- (response.content["handlers"] || []).each do |handler|
116
- export_handler(handler['definitionId'], headers)
112
+
113
+ # Setup the parameters sent to the find_handlers method.
114
+ # limit and offset are used for pagination.
115
+ limit, offset, count = 10, 0, nil
116
+ params = { "limit" => limit }
117
+
118
+ # Paginate through all the handlers
119
+ while (count.nil? || offset < count)
120
+ # Get the handler metadata to geta all handler_ids
121
+ response = find_handlers(params, headers)
122
+ count = response.content["count"].to_i
123
+ # Export each handler
124
+ (response.content["handlers"] || []).each do |handler|
125
+ export_handler(handler['definitionId'], headers)
126
+ end
127
+ # Increment the offset to the next page
128
+ offset += limit
129
+ params["offset"] = offset
117
130
  end
118
131
  end
119
132
 
@@ -288,7 +288,8 @@ module KineticSdk
288
288
  @logger.info("Exporting trees and local routines for source \"#{source_name}\" to #{@options[:export_directory]}.")
289
289
  end
290
290
 
291
- # Setup the parameters sent to the find_trees method. Limit is used for pagination.
291
+ # Setup the parameters sent to the find_trees method.
292
+ # limit and offset are used for pagination.
292
293
  limit, offset, count = 10, 0, nil
293
294
  params = {
294
295
  "source" => source_name,
@@ -299,7 +300,7 @@ module KineticSdk
299
300
  # Paginate through all the trees and routines for the source
300
301
  while (count.nil? || offset < count)
301
302
  response = find_trees(params, headers)
302
- count = response.content["count"].to_i if count.nil?
303
+ count = response.content["count"].to_i
303
304
  # Export each tree
304
305
  (response.content["trees"] || []).each do |tree|
305
306
  if export_opts[:include_workflows] || (!tree.has_key?("event") || tree["event"].nil?)
@@ -3,5 +3,5 @@ module KineticSdk
3
3
  # Version of Kinetic SDK
4
4
  #
5
5
  # @return [String] Version of the SDK
6
- VERSION = "5.0.26"
6
+ VERSION = "5.0.27"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kinetic_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.26
4
+ version: 5.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kinetic Data
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-28 00:00:00.000000000 Z
11
+ date: 2024-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slugify