ask-notion 0.1.1 → 0.1.3

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: 10fd8189426e5d6f0b2a48dceab879344e8875d6edd4d8e40a0c2b8926129047
4
- data.tar.gz: dc4a9867f46503da940d6f1572c6b17a012478165ff373ef13b8c08d36425632
3
+ metadata.gz: 47d6854ce6682921d9539ee76011a7d107f3e3c26f56aadb16591ba2cd6a4dd4
4
+ data.tar.gz: 458565c92e6a87a3435f4ba092592987feeec1f16398d26c4e1f756d64ce8f55
5
5
  SHA512:
6
- metadata.gz: 045c832fa42bc8b2e9e905210a8a50949458541343f192fd66f674c41d75f3621c1aae255ded8953afe4f06e6faa1b4008cc4ba15e534e8a8f6fe62da623253d
7
- data.tar.gz: 9fd11d103a3267320d4f731bf180bfda4e0bb5b8cb7c03871634061ad83bc6e867e2685249af60672112a3dbd05ddfd26511fa42ef849a352baf53657ea16266
6
+ metadata.gz: d6e2a8f315130af92740b830bff885a5324d1c30913218054e2c60c45e3adb4cae6d859347c39c69d2b7fba5a4dab2ce7da6468f51dcfd62d7bfdaffe204b16a
7
+ data.tar.gz: b3506a0ef4d249be2496b6442881ef3b9b638dce906f1bd3760547aa91b2a05ff3db51c18d5c3eb08a1bbc81d6cb4589fbf28d778bb7a3e65c133105990f8cac
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ ## [0.1.2] - 2026-06-25
2
+
3
+ ### Changed
4
+ - Gemspec validation test. Infrastructure: rubocop, overcommit, bin/setup, CI matrix.
5
+
6
+ ## 0.1.1 (2026-06-21)
7
+
8
+ - Release preparation: gemspec metadata, skills directory, rubygems dependency
9
+
10
+ # Changelog
11
+
12
+ ## 0.1.0 (2026-06-09)
13
+
14
+ - Initial release
15
+ - `Ask::Notion.client` — authenticated Notion API client via notion-ruby-client
16
+ - `Ask::Notion::DESCRIPTION`, `DOCS_URL`, `OPENAPI_URL`, `AUTH_NAME`, `AUTH_HOW`, `GEM_NAME`, `GEM_VERSION`, `GEM_DOCS`, `QUICK_START` — context constants
17
+ - `Ask::Notion::Errors` — structured error knowledge for Notion API
18
+ - Full test coverage with mocked credentials
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # ask-notion
2
2
 
3
- Notion service context for the ask-rb ecosystem.
3
+ [![Gem Version](https://badge.fury.io/rb/ask-notion.svg)](https://badge.fury.io/rb/ask-notion)
4
4
 
5
- Provides:
6
- - `Ask::Notion.client` authenticated Notion API client
7
- - `Ask::Notion::DESCRIPTION` context metadata for the system prompt
8
- - `Ask::Notion::Errors` — structured error knowledge for AI agents
5
+ Notion service context for AI agents in the ask-rb ecosystem. It provides an
6
+ authenticated Notion API client built on notion-ruby-client, metadata
7
+ constants for system prompts, and a structured error guide for common Notion
8
+ API issues.
9
9
 
10
10
  ## Installation
11
11
 
@@ -13,43 +13,40 @@ Provides:
13
13
  gem "ask-notion"
14
14
  ```
15
15
 
16
- ## Usage
16
+ ## Quick Start
17
17
 
18
18
  ```ruby
19
19
  require "ask-notion"
20
20
 
21
- # Returns an authenticated Notion::Client
22
21
  client = Ask::Notion.client
23
22
 
24
23
  # Query a database
25
- results = client.database_query(database_id: "your-database-id")
24
+ results = client.database_query(database_id: "DB_ID")
26
25
 
27
26
  # Get a page
28
- page = client.page_retrieve(page_id: "your-page-id")
27
+ page = client.page_retrieve(page_id: "PAGE_ID")
29
28
 
30
29
  # Create a page in a database
31
30
  client.page_create(
32
- parent: { database_id: "your-database-id" },
33
- properties: {
34
- "Name" => { title: [{ text: { content: "New Task" } }] },
35
- "Status" => { status: { name: "In Progress" } }
36
- }
31
+ parent: { database_id: "DB_ID" },
32
+ properties: { "Name" => { title: [{ text: { content: "New Page" } }] } }
37
33
  )
38
34
 
39
35
  # Search across Notion
40
- results = client.search(query: "project notes")
41
- ```
36
+ client.search(query: "project")
42
37
 
43
- ## Auth Setup
38
+ # List blocks in a page and list workspace users
39
+ client.block_children_list(block_id: "BLOCK_ID")
40
+ client.user_list
41
+ ```
44
42
 
45
- This gem uses `Ask::Auth` to resolve the `:notion_token` credential.
43
+ ## Authentication
46
44
 
47
- 1. Go to https://www.notion.so/my-integrations
48
- 2. Create a new integration and copy the Internal Integration Secret
49
- 3. Set the token in your environment:
45
+ `Ask::Notion.client` resolves a token via `Ask::Auth.resolve(:notion_token)`.
46
+ Set it in your environment:
50
47
 
51
48
  ```bash
52
- export NOTION_TOKEN="ntn_your_integration_token"
49
+ export NOTION_TOKEN=ntn_your_integration_token
53
50
  ```
54
51
 
55
52
  Or add it to `~/.ask/credentials.yml`:
@@ -58,10 +55,33 @@ Or add it to `~/.ask/credentials.yml`:
58
55
  notion_token: ntn_your_integration_token
59
56
  ```
60
57
 
58
+ Credentials can also come from Rails credentials, a database, or an OAuth
59
+ provider, depending on your `ask-auth` configuration. Create an integration at
60
+ [notion.so/my-integrations](https://www.notion.so/my-integrations) and copy
61
+ the Internal Integration Secret.
62
+
63
+ ## Key entry points
64
+
65
+ - `Ask::Notion.client` - an authenticated `Notion::Client`. It is wrapped in a
66
+ proxy that converts `Notion::Api::Errors::Unauthorized` into
67
+ `Ask::Auth::InvalidCredential` and retries rate limits and transient
68
+ failures with exponential backoff.
69
+ - `Ask::Notion::Errors` - structured error knowledge for agents: guidance by
70
+ exception class, HTTP status code descriptions, and rate limit info.
71
+ - `Ask::Notion::DESCRIPTION`, `DOCS_URL`, `AUTH_NAME`, `GEM_NAME`,
72
+ `GEM_VERSION`, and `QUICK_START` - metadata constants for system prompts.
73
+
74
+ ## Full documentation
75
+
76
+ The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs.
77
+ [Services: Notion](https://ask-rb.github.io/ask-docs/services/notion) covers
78
+ ask-notion in depth, including the client, error guide, and constants.
79
+ API reference: https://ask-rb.github.io/ask-docs/reference/api.
80
+
61
81
  ## Development
62
82
 
63
- ```bash
64
- bin/setup
83
+ ```
84
+ bundle install
65
85
  bundle exec rake test
66
86
  ```
67
87
 
@@ -11,8 +11,9 @@ module Ask
11
11
  # URL for the Notion API reference.
12
12
  API_REF_URL = "https://developers.notion.com/reference"
13
13
 
14
- # URL for the Notion OpenAPI specification.
15
- OPENAPI_URL = "https://developers.notion.com/.well-known/openapi.json"
14
+ # Notion no longer serves an OpenAPI spec at a stable URL.
15
+ # The API reference is at API_REF_URL instead.
16
+ # OPENAPI_URL was removed because the spec is no longer available.
16
17
 
17
18
  # Credential name used with Ask::Auth.resolve.
18
19
  AUTH_NAME = :notion_token
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Notion
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-notion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: ask-auth
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0.1'
18
+ version: 0.3.2
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '0.1'
25
+ version: 0.3.2
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: notion-ruby-client
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - CHANGELOG.md
90
91
  - LICENSE
91
92
  - README.md
92
93
  - lib/ask-notion.rb
@@ -99,7 +100,10 @@ files:
99
100
  homepage: https://github.com/ask-rb/ask-notion
100
101
  licenses:
101
102
  - MIT
102
- metadata: {}
103
+ metadata:
104
+ homepage_uri: https://github.com/ask-rb/ask-notion
105
+ source_code_uri: https://github.com/ask-rb/ask-notion
106
+ changelog_uri: https://github.com/ask-rb/ask-notion/blob/master/CHANGELOG.md
103
107
  rdoc_options: []
104
108
  require_paths:
105
109
  - lib
@@ -114,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
118
  - !ruby/object:Gem::Version
115
119
  version: '0'
116
120
  requirements: []
117
- rubygems_version: 4.0.3
121
+ rubygems_version: 4.0.18
118
122
  specification_version: 4
119
123
  summary: Notion service context for the ask-rb ecosystem
120
124
  test_files: []