ragpack-js 0.1.2 → 1.0.0

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
@@ -77,6 +77,7 @@ Returns a `CollectionClient` scoped to that collection.
77
77
  | `jobs.get(id)` | Get a single job by ID |
78
78
  | `jobs.waitUntilComplete(id)` | Poll until job is `complete` or `failed` |
79
79
  | `documents.list(options?)` | List indexed documents |
80
+ | `documents.rename(id, name)` | Set the display name of a document |
80
81
  | `documents.delete(id)` | Delete a document and its chunks |
81
82
 
82
83
  #### `rag(options)`
package/dist/index.cjs CHANGED
@@ -118,6 +118,17 @@ var DocumentsResource = class {
118
118
  );
119
119
  return r.documents;
120
120
  }
121
+ /**
122
+ * Rename a document.
123
+ * @param id - The document ID.
124
+ * @param name - The new display name.
125
+ */
126
+ rename(id, name) {
127
+ return this.req(`/collections/${this.slug}/documents/${id}`, {
128
+ method: "PATCH",
129
+ body: JSON.stringify({ name })
130
+ });
131
+ }
121
132
  /**
122
133
  * Delete a document and all its chunks from this collection.
123
134
  * @param id - The document ID.
package/dist/index.d.cts CHANGED
@@ -39,6 +39,7 @@ interface Job {
39
39
  collection_id: string;
40
40
  file_uri: string;
41
41
  mime_type: string;
42
+ display_name?: string;
42
43
  status: "pending" | "processing" | "complete" | "failed";
43
44
  error?: string;
44
45
  created_at: string;
@@ -50,6 +51,7 @@ interface Document {
50
51
  job_id: string;
51
52
  file_uri: string;
52
53
  mime_type: string;
54
+ name?: string;
53
55
  chunk_count: number;
54
56
  status: "ingesting" | "complete" | "failed";
55
57
  error?: string;
@@ -144,6 +146,12 @@ declare class DocumentsResource {
144
146
  limit?: number;
145
147
  offset?: number;
146
148
  }): Promise<Document[]>;
149
+ /**
150
+ * Rename a document.
151
+ * @param id - The document ID.
152
+ * @param name - The new display name.
153
+ */
154
+ rename(id: string, name: string): Promise<Document>;
147
155
  /**
148
156
  * Delete a document and all its chunks from this collection.
149
157
  * @param id - The document ID.
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ interface Job {
39
39
  collection_id: string;
40
40
  file_uri: string;
41
41
  mime_type: string;
42
+ display_name?: string;
42
43
  status: "pending" | "processing" | "complete" | "failed";
43
44
  error?: string;
44
45
  created_at: string;
@@ -50,6 +51,7 @@ interface Document {
50
51
  job_id: string;
51
52
  file_uri: string;
52
53
  mime_type: string;
54
+ name?: string;
53
55
  chunk_count: number;
54
56
  status: "ingesting" | "complete" | "failed";
55
57
  error?: string;
@@ -144,6 +146,12 @@ declare class DocumentsResource {
144
146
  limit?: number;
145
147
  offset?: number;
146
148
  }): Promise<Document[]>;
149
+ /**
150
+ * Rename a document.
151
+ * @param id - The document ID.
152
+ * @param name - The new display name.
153
+ */
154
+ rename(id: string, name: string): Promise<Document>;
147
155
  /**
148
156
  * Delete a document and all its chunks from this collection.
149
157
  * @param id - The document ID.
package/dist/index.js CHANGED
@@ -91,6 +91,17 @@ var DocumentsResource = class {
91
91
  );
92
92
  return r.documents;
93
93
  }
94
+ /**
95
+ * Rename a document.
96
+ * @param id - The document ID.
97
+ * @param name - The new display name.
98
+ */
99
+ rename(id, name) {
100
+ return this.req(`/collections/${this.slug}/documents/${id}`, {
101
+ method: "PATCH",
102
+ body: JSON.stringify({ name })
103
+ });
104
+ }
94
105
  /**
95
106
  * Delete a document and all its chunks from this collection.
96
107
  * @param id - The document ID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ragpack-js",
3
- "version": "0.1.2",
3
+ "version": "1.0.0",
4
4
  "description": "TypeScript client for the Ragpack self-hosted RAG engine",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",