@frontera-sdk/knowledge 1.53.21 → 1.53.23

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.
package/README.md CHANGED
@@ -55,6 +55,11 @@ default.
55
55
  A file may be at most 50 MB. `documents.list(baseId, { limit: 100 })` answers a
56
56
  page, newest first, and `nextCursor` for the next one.
57
57
 
58
+ `documents.rename(documentId, 'Holiday calendar 2026')` gives an uploaded file
59
+ a new title, at most 300 characters, which lists, search and citations show.
60
+ Its file name stays, and no later reading replaces the title. A document a
61
+ source syncs is refused with `conflict`: its source names it.
62
+
58
63
  ## Add a folder
59
64
 
60
65
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontera-sdk/knowledge",
3
- "version": "1.53.21",
3
+ "version": "1.53.23",
4
4
  "description": "Typed client for Frontera Knowledge: knowledge bases, documents, uploads, search with citations and sources, from a backend, a script or an App.",
5
5
  "keywords": [
6
6
  "frontera",
@@ -59,7 +59,7 @@
59
59
  "typecheck": "../../node_modules/typescript7/bin/tsc --noEmit"
60
60
  },
61
61
  "dependencies": {
62
- "@frontera-sdk/core": "1.53.21"
62
+ "@frontera-sdk/core": "1.53.23"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@tanstack/react-query": "^5.90.21",
@@ -103,6 +103,9 @@ export class KnowledgeClient {
103
103
  return answer
104
104
  },
105
105
  remove: async (id: string): Promise<KnowledgeDocument> => (await this.call<{ document: KnowledgeDocument }>(R.removeDocument, { id })).document,
106
+ /** A new title for an uploaded file, at most 300 characters; its file name stays. A synced document is refused (`conflict`): its source names it. */
107
+ rename: async (id: string, title: string): Promise<KnowledgeDocument> =>
108
+ (await this.call<{ document: KnowledgeDocument }>(R.renameDocument, { id }, { body: { title } })).document,
106
109
  /** Read a failed or old document again. */
107
110
  reprocess: async (id: string): Promise<KnowledgeDocument> => (await this.call<{ document: KnowledgeDocument }>(R.reprocessDocument, { id })).document,
108
111
  /** A ready document's text page by page, for citing it. */
package/src/routes.ts CHANGED
@@ -16,6 +16,7 @@ export const KNOWLEDGE_ROUTES = {
16
16
  documentStatuses: 'POST /documents/status',
17
17
  getDocument: 'GET /documents/:id',
18
18
  removeDocument: 'DELETE /documents/:id',
19
+ renameDocument: 'PATCH /documents/:id',
19
20
  reprocessDocument: 'POST /documents/:id/reprocess',
20
21
  documentText: 'GET /documents/:id/text',
21
22
  documentFile: 'GET /documents/:id/file',
package/src/wire-types.ts CHANGED
@@ -97,8 +97,10 @@ export type DocumentsAnswer = {
97
97
  } | null
98
98
  createdAt: string
99
99
  updatedAt: string
100
+ documentUpdatedAt: string
100
101
  }>
101
102
  nextCursor: string | null
103
+ total: number
102
104
  }
103
105
 
104
106
  export type DocumentAnswer = {
@@ -126,6 +128,7 @@ export type DocumentAnswer = {
126
128
  } | null
127
129
  createdAt: string
128
130
  updatedAt: string
131
+ documentUpdatedAt: string
129
132
  }
130
133
  }
131
134
 
@@ -154,6 +157,7 @@ export type UploadedAnswer = {
154
157
  } | null
155
158
  createdAt: string
156
159
  updatedAt: string
160
+ documentUpdatedAt: string
157
161
  }
158
162
  duplicate: boolean
159
163
  }
@@ -183,6 +187,7 @@ export type DocumentDetailsAnswer = {
183
187
  } | null
184
188
  createdAt: string
185
189
  updatedAt: string
190
+ documentUpdatedAt: string
186
191
  knowledgeBase: {
187
192
  id: string
188
193
  name: string
@@ -215,6 +220,7 @@ export type StatusesAnswer = {
215
220
  } | null
216
221
  createdAt: string
217
222
  updatedAt: string
223
+ documentUpdatedAt: string
218
224
  }>
219
225
  missing: string[]
220
226
  }