notion_to_html 1.1.2 → 1.1.4

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: 6d677bc1dd405e5269dae90551674d8a4d98a00e187d080e622905280dabab9a
4
- data.tar.gz: 3475c62e5767b6b60904f98de493123730b16871d7c90a00e7deb7c4c41f0e6b
3
+ metadata.gz: 96198f047bc37e0468c3d63f267848c31343ae68df890de63ff37b451ca89d5b
4
+ data.tar.gz: 80324f4a691905d5889c1e168fcb4e311f430f42fd9fa97fb5543e3c0c60e8eb
5
5
  SHA512:
6
- metadata.gz: 85e1e23e843777136a81de17d2dff9ca4d64a352b17654245e880e6fc42a884ccee12d4f178b7608d0a054478fa0e6c6705aaaa4251f128ec12a6b42e621d33c
7
- data.tar.gz: 9bd18ae170fcf7864c1096ca87eeacf95f2fd158c1172774756b5fc45c0f7980ec78a82e01f40be16637af0e8d96d6fc11328774d8bf07270c7c618a845b1391
6
+ metadata.gz: 394c077b1b48db452fdcdc832641fb042412542e729b893c5f4086bf5d86ef790427d8a571bf1d5104f98620d1753e083a9fed23e303c929b7e4256043511215
7
+ data.tar.gz: 30962b4fda49771160d1fceaf9855a37901d3d79952cec636bfdfaa5b28a63ba7774d966eed117c0d48fd88587349c430c3873bb8b466c669b70a673bead392a
@@ -24,9 +24,19 @@ module NotionToHtml
24
24
  }
25
25
  }
26
26
  ]
27
+ or_query = []
27
28
 
28
- if slug
29
+ if tag
29
30
  query.push({
31
+ property: 'tags',
32
+ multi_select: {
33
+ contains: tag
34
+ }
35
+ })
36
+ end
37
+
38
+ if slug
39
+ or_query.push({
30
40
  property: 'slug',
31
41
  rich_text: {
32
42
  equals: slug
@@ -35,7 +45,7 @@ module NotionToHtml
35
45
  end
36
46
 
37
47
  if name
38
- query.push({
48
+ or_query.push({
39
49
  property: 'name',
40
50
  title: {
41
51
  contains: name
@@ -44,7 +54,7 @@ module NotionToHtml
44
54
  end
45
55
 
46
56
  if description
47
- query.push({
57
+ or_query.push({
48
58
  property: 'description',
49
59
  rich_text: {
50
60
  contains: description
@@ -52,15 +62,7 @@ module NotionToHtml
52
62
  })
53
63
  end
54
64
 
55
- if tag
56
- query.push({
57
- property: 'tags',
58
- multi_select: {
59
- contains: tag
60
- }
61
- })
62
- end
63
-
65
+ query.push('or': or_query) unless or_query.blank?
64
66
  query
65
67
  end
66
68
 
@@ -147,7 +149,13 @@ module NotionToHtml
147
149
  # Accessor for the client
148
150
  # @return [Notion::Client] The client instance used to interact with the Notion API
149
151
  def client
150
- @client ||= Notion::Client.new(token: NotionToHtml.config.notion_api_token)
152
+ @client ||= Notion::Client.new(
153
+ token: NotionToHtml.config.notion_api_token,
154
+ timeout: NotionToHtml.config.notion_timeout,
155
+ default_page_size: NotionToHtml.config.notion_default_page_size,
156
+ default_max_retries: NotionToHtml.config.notion_default_max_retries,
157
+ default_retry_after: NotionToHtml.config.notion_default_retry_after
158
+ )
151
159
  end
152
160
 
153
161
  # Retrieves pages from Notion using the client
@@ -2,5 +2,5 @@
2
2
 
3
3
  module NotionToHtml
4
4
  # The current version of the NotionToHtml gem.
5
- VERSION = '1.1.2'
5
+ VERSION = '1.1.4'
6
6
  end
@@ -19,6 +19,30 @@ module NotionToHtml
19
19
  # @return [String] The database ID in Notion that the module will interact with.
20
20
  setting :notion_database_id
21
21
 
22
+ # @!attribute [rw] notion_timeout
23
+ # @return [Integer] The number of seconds to wait for a response from the Notion API before timing out.
24
+ # @example
25
+ # config.notion_timeout = 60 # Wait up to 60 seconds for API responses
26
+ setting :notion_timeout, default: 30
27
+
28
+ # @!attribute [rw] notion_default_page_size
29
+ # @return [Integer] The default number of records to return per page when making paginated requests.
30
+ # @example
31
+ # config.notion_default_page_size = 50 # Return 50 records per page
32
+ setting :notion_default_page_size, default: 100
33
+
34
+ # @!attribute [rw] notion_default_max_retries
35
+ # @return [Integer] The maximum number of times to retry failed API requests.
36
+ # @example
37
+ # config.notion_default_max_retries = 3 # Retry failed requests up to 3 times
38
+ setting :notion_default_max_retries, default: 5
39
+
40
+ # @!attribute [rw] notion_default_retry_after
41
+ # @return [Integer] The number of seconds to wait between retry attempts for failed API requests.
42
+ # @example
43
+ # config.notion_default_retry_after = 5 # Wait 5 seconds between retries
44
+ setting :notion_default_retry_after, default: 10
45
+
22
46
  # @!attribute [rw] cache_store
23
47
  # @return [ActiveSupport::Cache::Store] The cache store used to cache responses from the Notion API.
24
48
  # @default ActiveSupport::Cache::MemoryStore.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_to_html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Aguirre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-03 00:00:00.000000000 Z
11
+ date: 2024-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.5.16
118
+ rubygems_version: 3.5.22
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Notion HTML renderer for Ruby