multiwoven-integrations 0.37.4 → 0.37.5

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: '05388199967b31ad3c51c62b0e47a86912f323ffe5daae42a079774be79e0ae2'
4
- data.tar.gz: a481efc3b0f6017fbb162a589f5dca0bc3a7620542fd188eb216eef52bf0d877
3
+ metadata.gz: 59ea4a91d7a1b3f7f9850dc4510479cfa7ed041ca99a1fa9e7ab00438e9f3792
4
+ data.tar.gz: 9ff38a77ba515018547e30b952cc717747f29d8cb039a12c7353e019a967f5b2
5
5
  SHA512:
6
- metadata.gz: 617f3e4113419585e4879e3c65934ccece20619a15568058f6b51623a5ac87ee1b1059616d0e573c3606d93217439563fcee1a4f6a4761ac18d488ed34503b7e
7
- data.tar.gz: 37ae6dd49137ee8599b942ad1c848ff60186578b4d803a16867410096aec582ac0761336dc07cbf0f87c9cfde7d1e9a1f43f935a69851e0688fd83bf5953f740
6
+ metadata.gz: bb3428f6243ff49687d8ab3384112f11572d107928ff51be3b273ac81b6942cd411e9ed5a383e6c9a02b3c9a8add019ed78b438fe4b0e3789e7e55f11d4b70f1
7
+ data.tar.gz: 149180ed9a2cd5cb71a32d4163b52252b887676fd72eff62ae659d675ade36d1305f59161da64ec8a5a2013bc7deecafa9bc9e764a496c63a77e1d7edbb7044b
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.37.4"
5
+ VERSION = "0.37.5"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -56,7 +56,7 @@ module Multiwoven::Integrations::Source
56
56
  connection_config = sync_config.source.connection_specification
57
57
  connection_config = connection_config.with_indifferent_access
58
58
  connection_config = create_connection(connection_config)
59
- if sync_config.increment_strategy_config.increment_strategy == "page"
59
+ if sync_config.increment_strategy_config&.increment_strategy == "page"
60
60
  @limit = sync_config.increment_strategy_config.limit
61
61
  @offset = sync_config.increment_strategy_config.offset
62
62
  else
@@ -82,6 +82,19 @@ module Multiwoven::Integrations::Source
82
82
  end
83
83
  end
84
84
 
85
+ def duplicate_request?(connection_config)
86
+ signature = [
87
+ @url,
88
+ connection_config[:http_method],
89
+ connection_config[:params],
90
+ connection_config[:request_format]
91
+ ].to_json
92
+ return true if @last_request_signature == signature
93
+
94
+ @last_request_signature = signature
95
+ false
96
+ end
97
+
85
98
  def create_connection(connection_config)
86
99
  @url = "#{connection_config[:base_url]}#{connection_config[:path]}"
87
100
  connection_config
@@ -113,6 +126,8 @@ module Multiwoven::Integrations::Source
113
126
  def query(connection_config, query)
114
127
  connection_config = prepare_config(connection_config)
115
128
  build_paginated_request(connection_config, query)
129
+ return [] if duplicate_request?(connection_config)
130
+
116
131
  response = send_request(
117
132
  url: @url,
118
133
  http_method: connection_config[:http_method],
@@ -144,12 +159,11 @@ module Multiwoven::Integrations::Source
144
159
  def parse_response(response_body, parse_response)
145
160
  case parse_response
146
161
  when Array
147
- records = []
148
- parse_response.each do |path|
149
- records << JsonPath.on(response_body, path)
150
- end
151
- records[1].each_slice(records[0].size).map do |row_values|
152
- data = Hash[records[0].zip(row_values)]
162
+ headers = JsonPath.on(response_body, parse_response[0]).flatten(1)
163
+ values = JsonPath.on(response_body, parse_response[1])
164
+ rows = values.first.is_a?(Array) ? values : values.each_slice(headers.size).to_a
165
+ rows.map do |row_values|
166
+ data = Hash[headers.zip(row_values)]
153
167
  RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_multiwoven_message
154
168
  end
155
169
  else
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "parse_response": {
74
74
  "title": "Parse Response",
75
- "description": "A JSONPath expression that points to a single record (usually the first row) in the response. The keys of this object are treated as the column names. Example: `$.data[0]`",
75
+ "description": "How to extract rows from the response. Three supported forms: (1) a JSONPath expression pointing to a single record whose keys become column names, e.g. `$.data[0]`; (2) a JSON array of two JSONPaths `[\"$.headers_path\", \"$.values_path\"]` where the first resolves to column names and the second to a flat stream of values sliced into rows; (3) the same two-path form where the values path resolves to a 2D array (array of row-arrays), useful for Microsoft Graph Excel range endpoints, e.g. `[\"$.values[0]\", \"$.values[1:]\"]`.",
76
76
  "type": "string",
77
77
  "x-response-format": true,
78
78
  "order": 8,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.4
4
+ version: 0.37.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-15 00:00:00.000000000 Z
11
+ date: 2026-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport