@@ -15,6 +15,8 @@ import { VERSION } from './version';
1515import * as Errors from './core/error' ;
1616import * as Uploads from './core/uploads' ;
1717import * as API from './resources/index' ;
18+ import * as TopLevelAPI from './resources/top-level' ;
19+ import { AddParams , AddResponse , ProfileParams , ProfileResponse } from './resources/top-level' ;
1820import { APIPromise } from './core/api-promise' ;
1921import {
2022 ConnectionCreateParams ,
@@ -253,6 +255,23 @@ export class Supermemory {
253255 return this . baseURL !== 'https://api.supermemory.ai' ;
254256 }
255257
258+ /**
259+ * Add a document with any content type (text, url, file, etc.) and metadata
260+ */
261+ add ( body : TopLevelAPI . AddParams , options ?: RequestOptions ) : APIPromise < TopLevelAPI . AddResponse > {
262+ return this . post ( '/v3/documents' , { body, ...options } ) ;
263+ }
264+
265+ /**
266+ * Get user profile with optional search results
267+ */
268+ profile (
269+ body : TopLevelAPI . ProfileParams ,
270+ options ?: RequestOptions ,
271+ ) : APIPromise < TopLevelAPI . ProfileResponse > {
272+ return this . post ( '/v4/profile' , { body, ...options } ) ;
273+ }
274+
256275 protected defaultQuery ( ) : Record < string , string | undefined > | undefined {
257276 return this . _options . defaultQuery ;
258277 }
@@ -785,6 +804,13 @@ Supermemory.Connections = Connections;
785804export declare namespace Supermemory {
786805 export type RequestOptions = Opts . RequestOptions ;
787806
807+ export {
808+ type AddResponse as AddResponse ,
809+ type ProfileResponse as ProfileResponse ,
810+ type AddParams as AddParams ,
811+ type ProfileParams as ProfileParams ,
812+ } ;
813+
788814 export {
789815 Memories as Memories ,
790816 type MemoryUpdateResponse as MemoryUpdateResponse ,
@@ -845,7 +871,4 @@ export declare namespace Supermemory {
845871 type ConnectionImportParams as ConnectionImportParams ,
846872 type ConnectionListDocumentsParams as ConnectionListDocumentsParams ,
847873 } ;
848-
849- export type And = API . And ;
850- export type Or = API . Or ;
851874}
0 commit comments