Skip to content

Commit cd5ffd5

Browse files
authored
Merge pull request #4 from FoxNoseTech/docs/fix-inconsistency
Docs/fix inconsistency
2 parents 609a62c + 73fd984 commit cd5ffd5

8 files changed

Lines changed: 67 additions & 71 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![codecov](https://codecov.io/gh/FoxNoseTech/foxnose-python/graph/badge.svg)](https://codecov.io/gh/FoxNoseTech/foxnose-python)
77
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
88

9-
[FoxNose](https://foxnose.net) is a managed knowledge layer for RAG and AI agents — auto-embeddings, hybrid search, and zero ETL pipelines to maintain.
9+
[FoxNose](https://foxnose.net?utm_source=github&utm_medium=repository&utm_campaign=foxnose-python) is a managed knowledge layer for RAG and AI agents — auto-embeddings, hybrid search, and zero ETL pipelines to maintain.
1010

1111
This is the official Python SDK for FoxNose Management and Flux APIs.
1212

@@ -22,10 +22,10 @@ This is the official Python SDK for FoxNose Management and Flux APIs.
2222
**SDK Documentation:** [foxnose-python.readthedocs.io](https://foxnose-python.readthedocs.io)
2323

2424
**FoxNose Platform:**
25-
- [Product Documentation](https://foxnose.net/docs)
26-
- [Guides](https://foxnose.net/docs/guides)
27-
- [Management API Reference](https://foxnose.net/docs/management-api/v1/get-started)
28-
- [Flux API Reference](https://foxnose.net/docs/flux-api/v1/get-started)
25+
- [Product Documentation](https://foxnose.net/docs?utm_source=github&utm_medium=repository&utm_campaign=foxnose-python)
26+
- [Guides](https://foxnose.net/docs/guides?utm_source=github&utm_medium=repository&utm_campaign=foxnose-python)
27+
- [Management API Reference](https://foxnose.net/docs/management-api/v1/get-started?utm_source=github&utm_medium=repository&utm_campaign=foxnose-python)
28+
- [Flux API Reference](https://foxnose.net/docs/flux-api/v1/get-started?utm_source=github&utm_medium=repository&utm_campaign=foxnose-python)
2929

3030
## Installation
3131

docs/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ client = ManagementClient(
9999

100100
# Create a Flux API key
101101
flux_key = client.create_flux_api_key({
102-
"name": "Frontend Key",
103-
"roles": ["reader-role-key"],
102+
"description": "Frontend Key",
103+
"role": "reader-role-key",
104104
})
105105

106106
print(f"Key created: {flux_key.key}")

docs/error-handling.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ When creating or updating resources, validation errors include field-level detai
224224
```python
225225
try:
226226
resource = client.create_resource("folder-key", {
227-
"title": "", # Required field is empty
228-
"email": "invalid-email", # Invalid format
227+
"data": {
228+
"title": "", # Required field is empty
229+
"email": "invalid-email", # Invalid format
230+
},
229231
})
230232
except FoxnoseAPIError as e:
231233
if e.status_code in (400, 422):

docs/examples.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ folder = client.get_folder("blog-posts")
7676
resources = client.list_resources(folder)
7777

7878
# Chain objects through a full workflow
79-
resource = client.create_resource(folder, {"title": "New Article"})
79+
resource = client.create_resource(folder, {"data": {"title": "New Article"}})
8080
revision = client.create_revision(folder, resource, {
81-
"title": "Draft Content",
82-
"body": "...",
81+
"data": {"title": "Draft Content", "body": "..."},
8382
})
8483
client.publish_revision(folder, resource, revision)
8584

@@ -104,15 +103,14 @@ Complete resource lifecycle management:
104103
```python
105104
# Create a resource
106105
resource = client.create_resource("blog-posts", {
107-
"title": "My First Post",
108-
"content": "Hello, world!",
106+
"data": {"title": "My First Post", "content": "Hello, world!"},
109107
})
110108

111109
# Create a new revision
112110
revision = client.create_revision(
113111
"blog-posts",
114112
resource.key,
115-
{"title": "Updated Title", "content": "Updated content"},
113+
{"data": {"title": "Updated Title", "content": "Updated content"}},
116114
)
117115

118116
# Publish the revision
@@ -136,9 +134,9 @@ version = client.create_folder_version("blog-posts", {"name": "v2.0"})
136134

137135
# Add fields
138136
client.create_folder_field("blog-posts", version.key, {
139-
"name": "author",
140-
"alias": "author",
141-
"field_type": "text",
137+
"key": "author",
138+
"name": "Author",
139+
"type": "text",
142140
"required": True,
143141
})
144142

@@ -166,17 +164,15 @@ role = client.create_management_role({
166164

167165
# Add permissions
168166
client.upsert_management_role_permission(role.key, {
169-
"content_type": "document",
170-
"can_read": True,
171-
"can_create": True,
172-
"can_update": True,
173-
"can_delete": False,
167+
"content_type": "resources",
168+
"actions": ["read", "create", "update"],
169+
"all_objects": True,
174170
})
175171

176172
# Create an API key with this role
177173
api_key = client.create_management_api_key({
178-
"name": "Editor Key",
179-
"roles": [role.key],
174+
"description": "Editor Key",
175+
"role": role.key,
180176
})
181177
```
182178

@@ -203,10 +199,10 @@ client = FluxClient(
203199

204200
# Get published content
205201
resource = client.get_resource("blog-posts", "my-article")
206-
print(resource["title"])
202+
print(resource["data"]["title"])
207203

208204
# Search for content
209-
results = client.search("blog-posts", body={"query": "python"})
205+
results = client.search("blog-posts", body={"find_text": {"query": "python"}})
210206
```
211207

212208
## Running Examples

docs/flux-client.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,11 @@ Fetch a list of published resources from a folder:
4545
```python
4646
resources = client.list_resources(
4747
"blog-posts", # folder path
48-
params={
49-
"limit": 10,
50-
"offset": 0,
51-
},
48+
params={"limit": 10},
5249
)
5350

5451
for resource in resources["results"]:
55-
print(f"{resource['key']}: {resource['title']}")
52+
print(f"{resource['_sys']['key']}: {resource['data']['title']}")
5653
```
5754

5855
### Get Resource
@@ -61,8 +58,8 @@ Fetch a specific resource by key:
6158

6259
```python
6360
resource = client.get_resource("blog-posts", "my-first-post")
64-
print(resource["title"])
65-
print(resource["content"])
61+
print(resource["data"]["title"])
62+
print(resource["data"]["content"])
6663
```
6764

6865
### Get Resource with Params
@@ -71,7 +68,7 @@ print(resource["content"])
7168
resource = client.get_resource(
7269
"blog-posts",
7370
"my-article",
74-
params={"locale": "de-DE"},
71+
params={"return_locales": "de"},
7572
)
7673
```
7774

@@ -83,13 +80,13 @@ Search for resources within a folder:
8380
results = client.search(
8481
"blog-posts",
8582
body={
86-
"query": "python tutorial",
83+
"find_text": {"query": "python tutorial"},
8784
"limit": 10,
8885
},
8986
)
9087

91-
for hit in results["hits"]:
92-
print(f"{hit['title']} (score: {hit['_score']})")
88+
for item in results["results"]:
89+
print(item["data"]["title"])
9390
```
9491

9592
## Query Parameters
@@ -100,8 +97,8 @@ for hit in results["hits"]:
10097
resources = client.list_resources(
10198
"products",
10299
params={
103-
"filter[category]": "electronics",
104-
"filter[in_stock]": "true",
100+
"where__category__eq": "electronics",
101+
"where__in_stock__eq": "true",
105102
},
106103
)
107104
```
@@ -121,12 +118,13 @@ resources = client.list_resources(
121118

122119
```python
123120
# First page
124-
page1 = client.list_resources("posts", params={"limit": 10, "offset": 0})
121+
page1 = client.list_resources("posts", params={"limit": 10})
125122

126-
# Second page
127-
page2 = client.list_resources("posts", params={"limit": 10, "offset": 10})
123+
# Next page (use the cursor from the previous response)
124+
if page1["next"]:
125+
page2 = client.list_resources("posts", params={"limit": 10, "next": "<cursor>"})
128126

129-
print(f"Total: {page1['count']}")
127+
print(f"Got {len(page1['results'])} items")
130128
```
131129

132130
## Error Handling

docs/management-client.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ This works across all methods and supports chaining naturally:
4848
```python
4949
# Create a resource and publish a revision in one flow
5050
folder = client.get_folder("blog-posts")
51-
resource = client.create_resource(folder, {"title": "New Post"})
52-
revision = client.create_revision(folder, resource, {"title": "Draft"})
51+
resource = client.create_resource(folder, {"data": {"title": "New Post"}})
52+
revision = client.create_revision(folder, resource, {"data": {"title": "Draft"}})
5353
client.publish_revision(folder, resource, revision)
5454
```
5555

@@ -157,8 +157,10 @@ resource = client.get_resource("folder-key", "resource-key")
157157
resource = client.create_resource(
158158
"folder-key",
159159
{
160-
"title": "My Article",
161-
"content": "Article content here...",
160+
"data": {
161+
"title": "My Article",
162+
"content": "Article content here...",
163+
},
162164
},
163165
)
164166
```
@@ -169,10 +171,7 @@ resource = client.create_resource(
169171
resource = client.update_resource(
170172
"folder-key",
171173
"resource-key",
172-
{
173-
"title": "Updated Title",
174-
"content": "Updated content...",
175-
},
174+
{"name": "Updated Resource Name"},
176175
)
177176
```
178177

@@ -203,8 +202,10 @@ revision = client.create_revision(
203202
"folder-key",
204203
"resource-key",
205204
{
206-
"title": "New Title",
207-
"content": "New content...",
205+
"data": {
206+
"title": "New Title",
207+
"content": "New content...",
208+
},
208209
},
209210
)
210211
```
@@ -257,9 +258,9 @@ field = client.create_folder_field(
257258
"folder-key",
258259
"version-key",
259260
{
260-
"name": "title",
261-
"alias": "title",
262-
"field_type": "text",
261+
"key": "title",
262+
"name": "Title",
263+
"type": "text",
263264
"required": True,
264265
},
265266
)
@@ -295,11 +296,9 @@ role = client.create_management_role({
295296
client.upsert_management_role_permission(
296297
"role-key",
297298
{
298-
"content_type": "document",
299-
"can_read": True,
300-
"can_create": True,
301-
"can_update": True,
302-
"can_delete": False,
299+
"content_type": "resources",
300+
"actions": ["read", "create", "update"],
301+
"all_objects": True,
303302
},
304303
)
305304
```
@@ -317,8 +316,9 @@ role = client.create_flux_role({
317316
client.upsert_flux_role_permission(
318317
"role-key",
319318
{
320-
"content_type": "document",
321-
"can_read": True,
319+
"content_type": "flux-apis",
320+
"actions": ["read"],
321+
"all_objects": True,
322322
},
323323
)
324324
```
@@ -328,14 +328,14 @@ client.upsert_flux_role_permission(
328328
```python
329329
# Management API key
330330
mgmt_key = client.create_management_api_key({
331-
"name": "CI/CD Key",
332-
"roles": ["role-key-1", "role-key-2"],
331+
"description": "CI/CD Key",
332+
"role": "role-key-1",
333333
})
334334

335335
# Flux API key
336336
flux_key = client.create_flux_api_key({
337-
"name": "Frontend Key",
338-
"roles": ["reader-role"],
337+
"description": "Frontend Key",
338+
"role": "reader-role",
339339
})
340340
```
341341

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
site_name: FoxNose Python SDK
2-
site_url: https://foxnosetech.github.io/foxnose-python/
2+
site_url: https://foxnose-python.readthedocs.io/en/latest/
33
site_description: Official Python client for FoxNose Management and Flux APIs
44
site_author: FoxNose
55

@@ -83,6 +83,6 @@ extra:
8383
- icon: fontawesome/brands/github
8484
link: https://github.com/FoxNoseTech/foxnose-python
8585
- icon: fontawesome/solid/globe
86-
link: https://foxnose.net
86+
link: https://foxnose.net?utm_source=readthedocs&utm_medium=documentation&utm_campaign=foxnose-python
8787

8888
copyright: Copyright &copy; 2024-2026 FoxNose

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ docs = [
4646
]
4747

4848
[project.urls]
49-
"Homepage" = "https://foxnose.net"
49+
"Homepage" = "https://foxnose.net?utm_source=pypi&utm_medium=repository&utm_campaign=foxnose-python"
5050
"Source" = "https://github.com/FoxNoseTech/foxnose-python"
5151
"Documentation" = "https://foxnose-python.readthedocs.io"
5252

0 commit comments

Comments
 (0)