amplify_syndication 0.3.1 → 0.3.2

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: f0dda531062bfbbef4387181c6e46705b75254f69795cc2edb5ed7190adeb0c9
4
- data.tar.gz: fbeb9c17508bdcc30296e936912742b1ecd70baccec988008678256eec589f9c
3
+ metadata.gz: 7574dd18cfcb664982bd58bac580c86a3a0414da03f6e969ea707fa13f44be9b
4
+ data.tar.gz: 05317e7cf3994f09d27b2e1cfecc7775d400bb4222a64281da3540e84c2fbcdc
5
5
  SHA512:
6
- metadata.gz: e6898e0c47727b6d6f6f51342a47d425adfda709943036ff9f8361375cae03787c69c02e99624773ff5242d9294bcd439d5cb9882d489e64af640ad04d715b74
7
- data.tar.gz: c8e6b5aef477525e0bfd9a9d2caba49aad4929cae0553121c471ff40ed41619965b5891cf267779a2c1dbf79016871f3727d15fcc03ee86c779c40db7997937c
6
+ metadata.gz: 99d5d0b34d293b5c32a088bc0d54fb46dbd860af70b58b30b5e4646aa3c5bc4d30f42e8514b0f7589aa72285a2df250218502840b52afb1fac3fdfcc0217785c
7
+ data.tar.gz: d10722a79d7fc28cbb3c91e1224e6ff85b43544f34ba22b2dd8ddc123c85b6435fd80013d8fd38174812f03b6d839d23b17d38a0c25bc56b2ee38cedd0bdbde1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ ## 0.3.2 (2025-11-19)
2
+
3
+ ### Improved
4
+ - Internal request logging now clearly displays the final AMPRE request path for easier debugging.
5
+ - Media filter logic now mirrors the stable pattern used in Property replication filters.
6
+
7
+ ### Fixed
8
+ - Corrected Media API $filter construction to comply with AMPRE OData requirements.
9
+ - Removed incorrect manual URI-encoding that caused 400 The URI is malformed errors.
10
+ - Resolved issues where HTTPClient encoding differed from curl behavior, ensuring valid query formation.
11
+ - Restored full pagination functionality for media fetching via:
12
+ - `fetch_all_media_for_resource`
13
+
14
+ ## 0.3.1 (2025-11-18)
15
+
16
+ ### Added
17
+ - Full media pagination support:
18
+ - `fetch_media_batch`
19
+ - `each_media_batch`
20
+ - `fetch_all_media_for_listing`
21
+ - Media batching now matches the Property replication architecture.
22
+ - Support for listing-level media syncs with ordered pagination (`Order asc, MediaKey`).
23
+
24
+ ### Improved
25
+ - Internal consistency updates across API helper layers.
26
+
27
+ ### Fixed
28
+ - Minor documentation improvements around Media calls.
29
+
30
+ ## 0.2.2
31
+
32
+ #### Enhancements
33
+
34
+ - Added lookup helpers:
35
+ - `fetch_lookup_batch`
36
+ - `each_lookup_batch`
37
+ - `fetch_all_lookups`
38
+ - `lookup(lookup_name, batch_size:, sleep_seconds:)`
39
+ These support optional filters and configurable sleep intervals for safer long-running syncs.
40
+
41
+ - Added replication helpers:
42
+ - `fetch_initial_download_batch`
43
+ - `each_initial_download_batch`
44
+ - Improved `perform_initial_download` and `fetch_updates` to support batch-style processing and resumable checkpoints.
45
+
46
+ - Improved internal filter construction for replication queries to better combine user-provided filters with checkpoint-based ranges.
47
+
48
+
1
49
  ## 0.1.0
2
50
 
3
51
  API Client for use with Amplify Syndication API
@@ -326,62 +326,32 @@ module AmplifySyndication
326
326
  fetch_with_options("Media", query_options)
327
327
  end
328
328
 
329
- # Fetch media by ResourceName and ResourceRecordKey
330
- def fetch_media_by_resource(resource_name, resource_key, batch_size = 100)
331
- filter = "ResourceRecordKey eq '#{resource_key}' and ResourceName eq '#{resource_name}'"
329
+ def fetch_all_media_for_resource(resource_name, resource_key, batch_size: 100, sleep_seconds: 1)
330
+ filter = "(ResourceRecordKey eq '#{resource_key}' and ResourceName eq '#{resource_name}')"
332
331
 
333
- query_options = {
334
- "$filter" => filter,
335
- "$orderby" => "ModificationTimestamp,MediaKey",
336
- "$top" => batch_size
337
- }
338
-
339
- fetch_with_options("Media", query_options)
340
- end
341
-
342
- def fetch_media_batch(listing_key:, skip:, top: 100)
343
- query_options = {
344
- "$filter" => "ResourceName eq 'Property' and ResourceRecordKey eq '#{listing_key}'",
345
- "$orderby" => "Order asc, MediaKey",
346
- "$top" => top,
347
- "$skip" => skip
348
- }
349
-
350
- response = fetch_with_options("Media", query_options)
351
- response["value"] || []
352
- end
353
-
354
- def each_media_batch(listing_key:, batch_size: 100, sleep_seconds: 1)
332
+ results = []
355
333
  skip = 0
356
334
 
357
335
  loop do
358
- batch = fetch_media_batch(
359
- listing_key: listing_key,
360
- skip: skip,
361
- top: batch_size
362
- )
363
-
336
+ query_options = {
337
+ "$filter" => filter,
338
+ "$orderby" => "ModificationTimestamp,MediaKey",
339
+ "$top" => batch_size,
340
+ "$skip" => skip
341
+ }
342
+
343
+ response = fetch_with_options("Media", query_options)
344
+ batch = response["value"] || []
364
345
  break if batch.empty?
365
- yield(batch) if block_given?
366
-
367
- skip += batch_size
368
- sleep(sleep_seconds) if sleep_seconds.positive?
369
- end
370
- end
371
346
 
372
- def fetch_all_media_for_listing(listing_key, batch_size: 100, sleep_seconds: 1)
373
- results = []
374
-
375
- each_media_batch(
376
- listing_key: listing_key,
377
- batch_size: batch_size,
378
- sleep_seconds: sleep_seconds
379
- ) do |batch|
380
347
  results.concat(batch)
348
+
349
+ break if batch.size < batch_size
350
+ skip += batch_size
351
+ sleep(sleep_seconds)
381
352
  end
382
353
 
383
354
  results
384
355
  end
385
-
386
356
  end
387
357
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AmplifySyndication
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amplify_syndication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Higgins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-11-18 00:00:00.000000000 Z
11
+ date: 2025-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient