multiwoven-integrations 0.41.11 → 0.41.12
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a5ab25c5d1822be4693cc76a3a908d9bc6e184e9228c795402604a9af2d60cb
|
|
4
|
+
data.tar.gz: 4c8797fa1a3a13511b768ad005ab97d315d1ee6b61112315186a357049c0c21b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc2fd15a76a451de8830938c1f16c3f1f5c793697f48c4ae02939f1a4f3b416db84e93a736fc06cd1fd6af931f2e444318524198bd7424060b58e79cc9030c51
|
|
7
|
+
data.tar.gz: 84230e4d57d5763a02ea21b65dfb9e34d8e88ea71590068292718e84df5e9b4be84a4cf41135b8a4c3bf1053fb3cf1255cc5d929a1c6a260027cecf3c9280c08
|
|
@@ -6,6 +6,9 @@ module Multiwoven::Integrations::Source
|
|
|
6
6
|
class Client < UnstructuredSourceConnector
|
|
7
7
|
SPREADSHEET_EXTENSIONS = %w[.csv .xlsx .xls .xlsm].freeze
|
|
8
8
|
EXPIRED_ACCESS_TOKEN_ERROR_CODE = "InvalidAuthenticationToken"
|
|
9
|
+
# Matches list_files / SHOW TABLES with optional LIMIT/OFFSET appended by
|
|
10
|
+
# Connector#execute_query or SourceConnector#batched_query.
|
|
11
|
+
LIST_TABLES_QUERY = /\A\s*(?:list_files|show\s+tables)\s*(?:limit\s+(\d+))?\s*(?:offset\s+(\d+))?\s*;?\s*\z/i.freeze
|
|
9
12
|
|
|
10
13
|
def check_connection(connection_config)
|
|
11
14
|
connection_config = connection_config.with_indifferent_access
|
|
@@ -309,6 +312,10 @@ module Multiwoven::Integrations::Source
|
|
|
309
312
|
|
|
310
313
|
def query(connection, query)
|
|
311
314
|
local_file = nil
|
|
315
|
+
if (match = query.to_s.match(LIST_TABLES_QUERY))
|
|
316
|
+
return list_spreadsheet_tables(limit: match[1]&.to_i, offset: match[2]&.to_i)
|
|
317
|
+
end
|
|
318
|
+
|
|
312
319
|
file_name = extract_file_name_from_query(query)
|
|
313
320
|
local_basename = File.basename(file_name)
|
|
314
321
|
local_file = download_spreadsheet_for_query(file_name)
|
|
@@ -322,6 +329,27 @@ module Multiwoven::Integrations::Source
|
|
|
322
329
|
cleanup_ephemeral_download(local_file)
|
|
323
330
|
end
|
|
324
331
|
|
|
332
|
+
# Catalog-style listing for structured OneDrive: spreadsheet files in the
|
|
333
|
+
# configured folder as rows (use file_path in FROM clauses).
|
|
334
|
+
def list_spreadsheet_tables(limit: nil, offset: nil)
|
|
335
|
+
files = spreadsheet_files(fetch_list_items)
|
|
336
|
+
offset = offset.to_i
|
|
337
|
+
limit = limit.to_i unless limit.nil?
|
|
338
|
+
files = files.drop(offset) if offset.positive?
|
|
339
|
+
files = files.first(limit) unless limit.nil?
|
|
340
|
+
|
|
341
|
+
files.map do |file|
|
|
342
|
+
relative_path = relative_file_path(file)
|
|
343
|
+
RecordMessage.new(
|
|
344
|
+
data: {
|
|
345
|
+
file_name: file["name"],
|
|
346
|
+
file_path: relative_path
|
|
347
|
+
},
|
|
348
|
+
emitted_at: Time.now.to_i
|
|
349
|
+
).to_multiwoven_message
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
|
|
325
353
|
# Prefer Graph item IDs (same as discover) so nested / shared-folder files
|
|
326
354
|
# resolve during model preview. Resolve id with one path metadata GET —
|
|
327
355
|
# never a full folder listing / recursive BFS. Fall back to path-based download.
|
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.41.
|
|
4
|
+
version: 0.41.12
|
|
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-09-
|
|
11
|
+
date: 2026-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|