kinetic_sdk 5.0.23 → 5.0.24

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: c15fffa0069dff0dc689708a7cb458c1b6a45de45315da762da5c9f66dc82138
4
- data.tar.gz: 30a1bfde1cd8ca25042767a4c203ae21a657b7ba4b106e2f58fd9bcbcd22f827
3
+ metadata.gz: 75c12f87315bc7166b04e3b37bc8e18b6a1f592d4a397a9b241919439e6daba9
4
+ data.tar.gz: 1b10422f3500fb4db654d811dd5db5c6eb7a2d0471c44231eedfeaca4b373d45
5
5
  SHA512:
6
- metadata.gz: ec6bef24ff2087cb4e883af2f9f5ae20dc58f9b94de49c2f45c365d67527d319f88ab9b46c67cf64cd14627c284727e66cce50287a6d38f64b60646a143529ef
7
- data.tar.gz: 692912114b3628e490861a2e042ded9e6496ddc68c60e167d378434fcd0efb7aa7211669790cffaa35950a2852888524178309d9c82eb8b1ee01202bdf8e4e00
6
+ metadata.gz: afd08693d9f448d0b82cee38f213f65135f9e9b16ba9828fe1d4769f28d1d89c9ad2d94c4be08ec9ee88ec9a0f2bc6c75a2bc7429fbbb6acd3b629fa41f99f72
7
+ data.tar.gz: 7fe741c9b21dfba525e5889453e0904236a09217ca8c43781fd484873e1aed131bd013334235394d65871790058c37fc77bdf7856ac2b0196a06fd24c57e03d6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [5.0.24](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.24) (2024-03-28)
4
+
5
+ **Implemented enhancements:**
6
+
7
+ - Enhance the export_trees method to export all trees. Previously, this method was
8
+ limited to only exporting the first page of trees since it wasn't handling pagination.
9
+
3
10
  ## [5.0.23](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.23) (2024-01-31)
4
11
 
5
12
  **Implemented enhancements:**
@@ -41,7 +41,7 @@ module KineticSdk
41
41
  # * access keys
42
42
  #
43
43
  # @param headers [Hash] hash of headers to send, default is basic authentication
44
- # @rbuneturn nil
44
+ # @return nil
45
45
  def export_all_except_trees(headers=header_basic_auth)
46
46
  export_sources(headers)
47
47
  export_handlers(headers)
@@ -288,13 +288,27 @@ 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
- # Get all the trees and routines for the source
292
- response = find_trees({ "source" => source_name, "include" => "details" }, headers)
293
- # Parse the response and export each tree
294
- (response.content["trees"] || []).each do |tree|
295
- if export_opts[:include_workflows] || (!tree.has_key?("event") || tree["event"].nil?)
296
- export_tree(tree['title'], headers, export_opts)
291
+ # Setup the parameters sent to the find_trees method. Limit is used for pagination.
292
+ limit, offset, count = 10, 0, nil
293
+ params = {
294
+ "source" => source_name,
295
+ "include" => "details",
296
+ "limit" => limit
297
+ }
298
+
299
+ # Paginate through all the trees and routines for the source
300
+ while (count.nil? || offset < count)
301
+ response = find_trees(params, headers)
302
+ count = response.content["count"].to_i if count.nil?
303
+ # Export each tree
304
+ (response.content["trees"] || []).each do |tree|
305
+ if export_opts[:include_workflows] || (!tree.has_key?("event") || tree["event"].nil?)
306
+ export_tree(tree['title'], headers, export_opts)
307
+ end
297
308
  end
309
+ # Increment the offset to the next page
310
+ offset += limit
311
+ params["offset"] = offset
298
312
  end
299
313
  end
300
314
 
@@ -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.23"
6
+ VERSION = "5.0.24"
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.23
4
+ version: 5.0.24
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-01-31 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slugify
@@ -744,7 +744,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
744
744
  - !ruby/object:Gem::Version
745
745
  version: '0'
746
746
  requirements: []
747
- rubygems_version: 3.1.6
747
+ rubygems_version: 3.3.3
748
748
  signing_key:
749
749
  specification_version: 4
750
750
  summary: Ruby SDK for Kinetic Data application APIs