Skip to content

Commit 49f169a

Browse files
authored
Merge pull request #39 from supermemoryai/release-please--branches--main--changes--next--components--supermemory
release: 3.9.0
2 parents 0ba7fd6 + f42fa88 commit 49f169a

File tree

15 files changed

+304
-42
lines changed

15 files changed

+304
-42
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.8.0"
2+
".": "3.9.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 18
1+
configured_endpoints: 19
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ebd5e757d0e76cb83013e01a1e0bb3dba62beb83b2a2ffa28d148ea032e96fd0.yml
33
openapi_spec_hash: f930474a6ad230545154244045cc602e
4-
config_hash: a478b24249ee4f53abfb5787ca4daf8b
4+
config_hash: ec08a36e60458b4d83e71798a8043484

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 3.9.0 (2025-11-26)
4+
5+
Full Changelog: [v3.8.0...v3.9.0](https://github.com/supermemoryai/sdk-ts/compare/v3.8.0...v3.9.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([940b068](https://github.com/supermemoryai/sdk-ts/commit/940b06806de3d609bb0801cce104b22f7033299d))
10+
* **api:** manual updates ([ff15d92](https://github.com/supermemoryai/sdk-ts/commit/ff15d92b91ec2e7b6a199a2fd8d5370555e9b3b7))
11+
* **api:** manual updates ([d02b088](https://github.com/supermemoryai/sdk-ts/commit/d02b08837dc74c91a630e61ee70409bab098782c))
12+
* **api:** manual updates ([a31ae09](https://github.com/supermemoryai/sdk-ts/commit/a31ae09c27f09ed0b24536686c56d4b0386f38c1))
13+
* **api:** manual updates ([5ff6ed1](https://github.com/supermemoryai/sdk-ts/commit/5ff6ed14d0a676cbe13a9b90555635bb6f973a8e))
14+
* **api:** manual updates ([d4edc7f](https://github.com/supermemoryai/sdk-ts/commit/d4edc7f04328a5fcd7ffcc63ecc1df1f6075ceb1))
15+
* **api:** manual updates ([91034cb](https://github.com/supermemoryai/sdk-ts/commit/91034cb9935031ad5db877c67571e1f22cb4ed68))
16+
* **api:** manual updates ([c40f02f](https://github.com/supermemoryai/sdk-ts/commit/c40f02f508f51de9c9b364d4d04e2641012df541))
17+
* **api:** manual updates ([bea6e27](https://github.com/supermemoryai/sdk-ts/commit/bea6e278b1d55a26ff7bc0686648df215e339de5))
18+
319
## 3.8.0 (2025-11-25)
420

521
Full Changelog: [v3.7.0...v3.8.0](https://github.com/supermemoryai/sdk-ts/compare/v3.7.0...v3.8.0)

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const client = new Supermemory({
4343
apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
4444
});
4545

46-
const params: Supermemory.MemoryAddParams = { content: 'content' };
47-
const response: Supermemory.MemoryAddResponse = await client.memories.add(params);
46+
const params: Supermemory.AddParams = { content: 'content' };
47+
const response: Supermemory.AddResponse = await client.add(params);
4848
```
4949

5050
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -86,7 +86,7 @@ a subclass of `APIError` will be thrown:
8686

8787
<!-- prettier-ignore -->
8888
```ts
89-
const response = await client.memories.add({ content: 'content' }).catch(async (err) => {
89+
const response = await client.add({ content: 'content' }).catch(async (err) => {
9090
if (err instanceof Supermemory.APIError) {
9191
console.log(err.status); // 400
9292
console.log(err.name); // BadRequestError
@@ -126,7 +126,7 @@ const client = new Supermemory({
126126
});
127127

128128
// Or, configure per-request:
129-
await client.memories.add({ content: 'content' }, {
129+
await client.add({ content: 'content' }, {
130130
maxRetries: 5,
131131
});
132132
```
@@ -143,7 +143,7 @@ const client = new Supermemory({
143143
});
144144

145145
// Override per-request:
146-
await client.memories.add({ content: 'content' }, {
146+
await client.add({ content: 'content' }, {
147147
timeout: 5 * 1000,
148148
});
149149
```
@@ -166,11 +166,11 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
166166
```ts
167167
const client = new Supermemory();
168168

169-
const response = await client.memories.add({ content: 'content' }).asResponse();
169+
const response = await client.add({ content: 'content' }).asResponse();
170170
console.log(response.headers.get('X-My-Header'));
171171
console.log(response.statusText); // access the underlying Response object
172172

173-
const { data: response, response: raw } = await client.memories.add({ content: 'content' }).withResponse();
173+
const { data: response, response: raw } = await client.add({ content: 'content' }).withResponse();
174174
console.log(raw.headers.get('X-My-Header'));
175175
console.log(response.id);
176176
```

api.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# Shared
1+
# Supermemory
22

33
Types:
44

5-
- <code><a href="./src/resources/shared.ts">And</a></code>
6-
- <code><a href="./src/resources/shared.ts">Or</a></code>
5+
- <code><a href="./src/resources/top-level.ts">AddResponse</a></code>
6+
- <code><a href="./src/resources/top-level.ts">ProfileResponse</a></code>
7+
8+
Methods:
9+
10+
- <code title="post /v3/documents">client.<a href="./src/index.ts">add</a>({ ...params }) -> AddResponse</code>
11+
- <code title="post /v4/profile">client.<a href="./src/index.ts">profile</a>({ ...params }) -> ProfileResponse</code>
712

813
# Memories
914

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supermemory",
3-
"version": "3.8.0",
3+
"version": "3.9.0",
44
"description": "The official TypeScript library for the Supermemory API",
55
"author": "Supermemory <[email protected]>",
66
"types": "dist/index.d.ts",

src/client.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { VERSION } from './version';
1515
import * as Errors from './core/error';
1616
import * as Uploads from './core/uploads';
1717
import * as API from './resources/index';
18+
import * as TopLevelAPI from './resources/top-level';
19+
import { AddParams, AddResponse, ProfileParams, ProfileResponse } from './resources/top-level';
1820
import { APIPromise } from './core/api-promise';
1921
import {
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;
785804
export 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
}

src/resources/documents.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../core/resource';
4-
import * as Shared from './shared';
54
import { APIPromise } from '../core/api-promise';
65
import { type Uploadable } from '../core/uploads';
76
import { buildHeaders } from '../internal/headers';
@@ -415,7 +414,7 @@ export interface DocumentListParams {
415414
/**
416415
* Optional filters to apply to the search. Can be a JSON string or Query object.
417416
*/
418-
filters?: Shared.Or | Shared.And;
417+
filters?: DocumentListParams.Or | DocumentListParams.And;
419418

420419
/**
421420
* Whether to include the content field in the response. Warning: This can make
@@ -444,6 +443,22 @@ export interface DocumentListParams {
444443
sort?: 'createdAt' | 'updatedAt';
445444
}
446445

446+
export namespace DocumentListParams {
447+
/**
448+
* OR
449+
*/
450+
export interface Or {
451+
OR: Array<unknown>;
452+
}
453+
454+
/**
455+
* AND
456+
*/
457+
export interface And {
458+
AND: Array<unknown>;
459+
}
460+
}
461+
447462
export interface DocumentAddParams {
448463
/**
449464
* The content to extract and process into a document. This can be a URL to a

src/resources/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export * from './shared';
43
export {
54
Connections,
65
type ConnectionCreateResponse,
@@ -57,3 +56,4 @@ export {
5756
type SettingGetResponse,
5857
type SettingUpdateParams,
5958
} from './settings';
59+
export { type AddResponse, type ProfileResponse, type AddParams, type ProfileParams } from './top-level';

src/resources/memories.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../core/resource';
4-
import * as Shared from './shared';
54
import { APIPromise } from '../core/api-promise';
65
import { type Uploadable } from '../core/uploads';
76
import { buildHeaders } from '../internal/headers';
@@ -412,7 +411,7 @@ export interface MemoryListParams {
412411
/**
413412
* Optional filters to apply to the search. Can be a JSON string or Query object.
414413
*/
415-
filters?: Shared.Or | Shared.And;
414+
filters?: MemoryListParams.Or | MemoryListParams.And;
416415

417416
/**
418417
* Whether to include the content field in the response. Warning: This can make
@@ -441,6 +440,22 @@ export interface MemoryListParams {
441440
sort?: 'createdAt' | 'updatedAt';
442441
}
443442

443+
export namespace MemoryListParams {
444+
/**
445+
* OR
446+
*/
447+
export interface Or {
448+
OR: Array<unknown>;
449+
}
450+
451+
/**
452+
* AND
453+
*/
454+
export interface And {
455+
AND: Array<unknown>;
456+
}
457+
}
458+
444459
export interface MemoryAddParams {
445460
/**
446461
* The content to extract and process into a document. This can be a URL to a

0 commit comments

Comments
 (0)