@@ -52,12 +52,7 @@ const client = new Zeroentropy({
5252});
5353
5454async  function  main() {
55-   const :  Zeroentropy .DocumentAddParams  =  {
56-     collection_name: ' example_collection' 
57-     content: { type: ' text' ' Example Content' 
58-     path: ' my_document.txt' 
59-   };
60-   const :  Zeroentropy .DocumentAddResponse  =  await  client .documents .add (params );
55+   const :  Zeroentropy .StatusGetStatusResponse  =  await  client .status .getStatus ();
6156}
6257
6358main ();
@@ -74,21 +69,15 @@ a subclass of `APIError` will be thrown:
7469<!--  prettier-ignore --> 
7570``` ts 
7671async  function  main() {
77-   const =  await  client .documents 
78-     .add ({
79-       collection_name: ' example_collection' 
80-       content: { type: ' text' ' Example Content' 
81-       path: ' my_document.txt' 
82-     })
83-     .catch (async  (err ) =>  {
84-       if  (err  instanceof  Zeroentropy .APIError ) {
85-         console .log (err .status ); //  400
86-         console .log (err .name ); //  BadRequestError
87-         console .log (err .headers ); //  {server: 'nginx', ...}
88-       } else  {
89-         throw  err ;
90-       }
91-     });
72+   const =  await  client .status .getStatus ().catch (async  (err ) =>  {
73+     if  (err  instanceof  Zeroentropy .APIError ) {
74+       console .log (err .status ); //  400
75+       console .log (err .name ); //  BadRequestError
76+       console .log (err .headers ); //  {server: 'nginx', ...}
77+     } else  {
78+       throw  err ;
79+     }
80+   });
9281}
9382
9483main ();
@@ -123,7 +112,7 @@ const client = new Zeroentropy({
123112});
124113
125114//  Or, configure per-request:
126- await  client .documents . add ({ collection_name :   ' example_collection ' , content :  { type :   ' text ' , text :   ' Example Content '  }, path :   ' my_document.txt '  },  {
115+ await  client .status . getStatus ( {
127116  maxRetries:  5 ,
128117});
129118``` 
@@ -140,7 +129,7 @@ const client = new Zeroentropy({
140129});
141130
142131//  Override per-request:
143- await  client .documents . add ({ collection_name:  ' example_collection ' , content: { type:  ' text ' , text:  ' Example Content '  }, path:  ' my_document.txt '  },  {
132+ await  client .status . getStatus ( {
144133  timeout: 5  *  1000 ,
145134});
146135``` 
@@ -194,25 +183,13 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
194183``` ts 
195184const =  new  Zeroentropy ();
196185
197- const =  await  client .documents 
198-   .add ({
199-     collection_name: ' example_collection' 
200-     content: { type: ' text' ' Example Content' 
201-     path: ' my_document.txt' 
202-   })
203-   .asResponse ();
186+ const =  await  client .status .getStatus ().asResponse ();
204187console .log (response .headers .get (' X-My-Header' 
205188console .log (response .statusText ); //  access the underlying Response object
206189
207- const data : response, response : raw } =  await  client .documents 
208-   .add ({
209-     collection_name: ' example_collection' 
210-     content: { type: ' text' ' Example Content' 
211-     path: ' my_document.txt' 
212-   })
213-   .withResponse ();
190+ const data : response, response : raw } =  await  client .status .getStatus ().withResponse ();
214191console .log (raw .headers .get (' X-My-Header' 
215- console .log (response .message );
192+ console .log (response .num_documents );
216193``` 
217194
218195### Making custom/undocumented requests  
@@ -316,16 +293,9 @@ const client = new Zeroentropy({
316293});
317294
318295//  Override per-request:
319- await  client .documents .add (
320-   {
321-     collection_name: ' example_collection' 
322-     content: { type: ' text' ' Example Content' 
323-     path: ' my_document.txt' 
324-   },
325-   {
326-     httpAgent: new  http .Agent ({ keepAlive: false  }),
327-   },
328- );
296+ await  client .status .getStatus ({
297+   httpAgent: new  http .Agent ({ keepAlive: false  }),
298+ });
329299``` 
330300
331301## Semantic versioning  
0 commit comments