multiwoven-integrations 0.39.0 → 0.39.1
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: 6ec4e8509d2c6cf3e2e3ab4ecab5198b748956f0d8b8108b6374855b8f866531
|
|
4
|
+
data.tar.gz: 374946a9e09d51b4bc82a0f72693991472659e11a7651f39b2aa1f678a06adda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e3a05154a4092ea28e4d66584da10e120ecc1043607337453ead51585e7cfad4ff88cf5e1516832c48ad3f12845a996d810bce2088df3a98b7a30b1cb77ea4b
|
|
7
|
+
data.tar.gz: d6de430fa20d12ecb00d2ae65898f40108ffc5c8b8762874fa2766dc9dad9b687692516651da6e9674f2322497c04c44c350a5fc465b00b19c3b0b3b4b872378
|
|
@@ -91,6 +91,7 @@ module Multiwoven::Integrations::Source
|
|
|
91
91
|
raise ArgumentError, "User Name or Share URL is required" unless connection_config[:share_url].present? || connection_config[:user_name].present?
|
|
92
92
|
|
|
93
93
|
load_connection_config(connection_config)
|
|
94
|
+
@sync_id ||= "preview"
|
|
94
95
|
|
|
95
96
|
if @share_url.present?
|
|
96
97
|
@drive_id = shared_folder_reference[:drive_id]
|
|
@@ -310,7 +311,7 @@ module Multiwoven::Integrations::Source
|
|
|
310
311
|
local_file = nil
|
|
311
312
|
file_name = extract_file_name_from_query(query)
|
|
312
313
|
local_basename = File.basename(file_name)
|
|
313
|
-
local_file =
|
|
314
|
+
local_file = download_spreadsheet_for_query(file_name)
|
|
314
315
|
|
|
315
316
|
file = read_local_file(connection, local_basename, local_file)
|
|
316
317
|
query = apply_local_file_to_query(query, file)
|
|
@@ -321,6 +322,34 @@ module Multiwoven::Integrations::Source
|
|
|
321
322
|
cleanup_ephemeral_download(local_file)
|
|
322
323
|
end
|
|
323
324
|
|
|
325
|
+
# Prefer Graph item IDs (same as discover) so nested / shared-folder files
|
|
326
|
+
# resolve during model preview. Resolve id with one path metadata GET —
|
|
327
|
+
# never a full folder listing / recursive BFS. Fall back to path-based download.
|
|
328
|
+
def download_spreadsheet_for_query(file_name)
|
|
329
|
+
file_item = fetch_drive_item_by_path(file_name)
|
|
330
|
+
if file_item&.[]("id")
|
|
331
|
+
download_file_to_local(
|
|
332
|
+
file_name,
|
|
333
|
+
@sync_id,
|
|
334
|
+
item_id: file_item["id"],
|
|
335
|
+
drive_id: file_item.dig("parentReference", "driveId")
|
|
336
|
+
)
|
|
337
|
+
else
|
|
338
|
+
download_file_to_local(file_name, @sync_id)
|
|
339
|
+
end
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
def fetch_drive_item_by_path(file_name)
|
|
343
|
+
return fetch_shared_item_metadata if @share_url.present? && shared_folder_reference[:is_file]
|
|
344
|
+
|
|
345
|
+
response = microsoft_graph_request(single_file_item_url(file_name))
|
|
346
|
+
return unless success?(response)
|
|
347
|
+
|
|
348
|
+
JSON.parse(response.body)
|
|
349
|
+
rescue StandardError
|
|
350
|
+
nil
|
|
351
|
+
end
|
|
352
|
+
|
|
324
353
|
def extract_file_name_from_query(sql_query)
|
|
325
354
|
match = sql_query.match(
|
|
326
355
|
/\bFROM\s+(?:[`"]([^`"]+)[`"]|'([^']+)'|([^\s;]+))/i
|
|
@@ -379,6 +408,7 @@ module Multiwoven::Integrations::Source
|
|
|
379
408
|
end
|
|
380
409
|
|
|
381
410
|
def local_download_path(file_name, sync_id)
|
|
411
|
+
sync_id = sync_id.presence || "preview"
|
|
382
412
|
download_path = ENV["FILE_DOWNLOAD_PATH"]
|
|
383
413
|
if download_path
|
|
384
414
|
File.join(download_path, "syncs", sync_id, File.basename(file_name))
|
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.39.
|
|
4
|
+
version: 0.39.1
|
|
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-08-
|
|
11
|
+
date: 2026-08-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|