notion_ruby_mapping 0.8.7 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44187f3a9b5d75e5849efa0b28e28837301b88a8b4bb49054b1085e7a884516e
4
- data.tar.gz: c8b55a99ca0d48d5bcba5eeb211bb425e7483682edfa138e229f75511ed59d4c
3
+ metadata.gz: bd6b2157ccc35fd74afcb19e5c3a1f79a47fc85bbd37a40615244d7ab0e94dcc
4
+ data.tar.gz: 8a8b3a3a816159cf1759ffef5bc2a3c2a8cd4533fa0aa85591c6a0079fb8e8c7
5
5
  SHA512:
6
- metadata.gz: d94a89a097a12ba12d116493e8a4da6bd6f2d5b8fdbecff61e6c510f0188b5b7125b3d028ba9f9cbc9e62c5c975738f324e0abf701579f1520f3382c3547f288
7
- data.tar.gz: 622cc36a0fea56774dadbf9ee47f1e190b2ecc92f3db800da1cb83b242bc9a92b6e1b4ab221c47e49df61778ac5d3071f26858c88c0e3f662f38266a75055733
6
+ metadata.gz: d39c8c323487e2cad1782dd3b19a9f3a02b6c843fe31a4d61dc4ddd23af7de1f81f22c4a29a085ffe510d76186738c99246f1bb2f7fd87c8b0085db8c74d3bed
7
+ data.tar.gz: 18d4e3bdc38409ff21a76e76129a1b208c28ab539d02f9fa17662b70d1d56dbab084bda4cd467fccafab421174b55b9fc8556f1e19f39e35a2953cffefe68f5f
data/README.md CHANGED
@@ -119,7 +119,7 @@ NotionRubyMapping.configuration { |c| c.notion_token = ENV["NOTION_API_TOKEN"] }
119
119
  4. [Create ER Diagram from Notion database / Notion データベースの ER 図を作成](https://hkob.notion.site/notionErDiagram-Sample-1720c2199c534ca08138cde38f31f710)
120
120
  5. [Create Sitemap from Notion pages / Notion page からサイトマップを作成](https://hkob.notion.site/notionSitemap-sample-14e195c83d024c5382aab09210916c87)
121
121
  6. [Create Notion databases from ER Diagram / ER 図から Notion データベースを作成](https://hkob.notion.site/erdToNotionDb-sample-87e5e52a6b9f46abbdeebcb3c902a516)
122
- 6. [NotionTimeRecorder & GTD template](https://hkob.notion.site/NotionTimeRecorder-GTD-template-8c4b5813dbbe4774a517314c9b20bafa)
122
+ 7. [NotionTimeRecorder & GTD template](https://hkob.notion.site/NotionTimeRecorder-GTD-template-8c4b5813dbbe4774a517314c9b20bafa)
123
123
 
124
124
  ### 2.5 API reference / API リファレンス
125
125
 
@@ -127,6 +127,13 @@ NotionRubyMapping.configuration { |c| c.notion_token = ENV["NOTION_API_TOKEN"] }
127
127
 
128
128
  ## 3. ChangeLog
129
129
 
130
+ - 2025/2/11 [v0.8.9] Add verification_property
131
+ - 2024/9/15 [v0.8.8] Add link_mention support
132
+ - 2024/5/29 [v0.8.7] Change file attribute for button_property
133
+ - 2024/5/29 [v0.8.6] Change Query.page_size to writable
134
+ - 2024/4/26 [v0.8.5] change permission of button_property.rb
135
+ - 2024/4/1 [v0.8.4] fix payload for update database
136
+ - 2024/2/5 [v0.8.3] Add Button Property
130
137
  - 2023/7/13 [v0.8.2] add 'after' option to append_block_chidren, 'append_after' method to block, and 'public_url' method to page
131
138
  - 2023/7/10 [v0.8.1] Automatically change type to external when file object is updated
132
139
  - 2023/6/4 [v0.8.0] add unique_id properties, filter_properties
@@ -82,6 +82,11 @@ module NotionRubyMapping
82
82
  "url" => @options["link_preview"],
83
83
  },
84
84
  }
85
+ elsif @options.key? "href"
86
+ {
87
+ "type" => "link_mention",
88
+ "link_mention" => @options.slice("href", "icon_url", "link_provider", "thumbnail_url", "title"),
89
+ }
85
90
  else
86
91
  raise StandardError, "Irregular mention type: #{@options.keys}"
87
92
  end
@@ -45,6 +45,9 @@ module NotionRubyMapping
45
45
  end
46
46
  when "link_preview"
47
47
  MentionObject.new options.merge({"link_preview" => mention["link_preview"]["url"]})
48
+ when "link_mention"
49
+ lm_keys = %w[href icon_url link_provider thumbnail_url title]
50
+ MentionObject.new options.merge(mention["link_mention"].slice(*lm_keys))
48
51
  else
49
52
  raise StandardError, "Unknown mention type: #{mention["type"]}"
50
53
  end
@@ -118,6 +118,7 @@ module NotionRubyMapping
118
118
  "rich_text" => RichTextProperty,
119
119
  "unique_id" => UniqueIdProperty,
120
120
  "url" => UrlProperty,
121
+ "verification" => VerificationProperty,
121
122
  }[type]
122
123
  raise StandardError, "Irregular property type: #{type}" unless klass
123
124
 
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NotionRubyMapping
4
+ # Status property
5
+ class VerificationProperty < Property
6
+ TYPE = "verification"
7
+
8
+ ### Public announced methods
9
+
10
+ ## Common methods
11
+
12
+ # @see https://www.notion.so/hkob/StatusProperty-c8b2c83019bc42edbc1527386c7ef453#bdb34c0aeaa74729887da087d0bd8022
13
+ def verification
14
+ @json
15
+ end
16
+
17
+ ## Page property only methods
18
+
19
+ ## Page property only methods
20
+
21
+ ### Not public announced methods
22
+
23
+ ## Common methods
24
+
25
+ # @param [String] name Property name
26
+ # @param [Boolean, Hash] json
27
+ def initialize(name, will_update: false, base_type: :page, property_id: nil, property_cache: nil, json: {})
28
+ super name, will_update: will_update, base_type: base_type, property_id: property_id,
29
+ property_cache: property_cache
30
+ @json = json
31
+ end
32
+
33
+ ## Page property only methods
34
+
35
+ # @return [Hash]
36
+ def property_values_json
37
+ assert_page_property __method__
38
+ {@name => {"verification" => @json, "type" => "verification"}}
39
+ end
40
+ end
41
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionRubyMapping
4
- VERSION = "0.8.7"
4
+ VERSION = "0.8.9"
5
5
  NOTION_VERSION = "2022-06-28"
6
6
  end
@@ -20,7 +20,7 @@ require_relative "notion_ruby_mapping/version"
20
20
  date_property email_property files_property formula_property last_edited_by_property
21
21
  last_edited_time_property multi_select_property number_property people_property phone_number_property
22
22
  relation_property text_property rich_text_property rollup_property select_property status_property
23
- title_property unique_id_property url_property button_property],
23
+ title_property unique_id_property url_property button_property verification_property],
24
24
  }.each do |key, values|
25
25
  values.each do |klass|
26
26
  require_relative "notion_ruby_mapping/#{key}/#{klass}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_ruby_mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki KOBAYASHI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2025-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -257,6 +257,7 @@ files:
257
257
  - lib/notion_ruby_mapping/properties/title_property.rb
258
258
  - lib/notion_ruby_mapping/properties/unique_id_property.rb
259
259
  - lib/notion_ruby_mapping/properties/url_property.rb
260
+ - lib/notion_ruby_mapping/properties/verification_property.rb
260
261
  - lib/notion_ruby_mapping/version.rb
261
262
  - notion_ruby_mapping.gemspec
262
263
  - sig/notion_ruby_mapping.rbs
@@ -280,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
281
  - !ruby/object:Gem::Version
281
282
  version: '0'
282
283
  requirements: []
283
- rubygems_version: 3.5.11
284
+ rubygems_version: 3.5.18
284
285
  signing_key:
285
286
  specification_version: 4
286
287
  summary: Notion Ruby mapping tool