@memori.ai/memori-api-client 0.4.1 → 0.4.3

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.1",
2
+ "version": "0.4.3",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -25,16 +25,23 @@ export default (apiUrl: string) => ({
25
25
  /**
26
26
  * Lists paginated Memory objects.
27
27
  * @param {string} sessionId The session ID
28
+ * @param {number} from The starting index
29
+ * @param {number} howMany The number of items to return
30
+ * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS
28
31
  */
29
32
  getMemoriesPaginated: async (
30
33
  sessionId: string,
31
34
  from: number,
32
- howMany: number
35
+ howMany: number,
36
+ type?: 'ALL' | 'CONTENTS' | 'DEFAULTS'
33
37
  ) =>
34
- apiFetcher(`/Memories/${sessionId}/${from}/${howMany}`, {
35
- method: 'GET',
36
- apiUrl,
37
- }) as Promise<
38
+ apiFetcher(
39
+ `/Memories/${sessionId}/${from}/${howMany}${type ? `/${type}` : ''}`,
40
+ {
41
+ method: 'GET',
42
+ apiUrl,
43
+ }
44
+ ) as Promise<
38
45
  ResponseSpec & {
39
46
  count: number;
40
47
  memories: Memory[];
@@ -29,7 +29,7 @@ export default (apiUrl: string) => ({
29
29
  getUnansweredQuestionsPaginated: async (
30
30
  sessionId: string,
31
31
  from: number,
32
- howMany: string
32
+ howMany: number
33
33
  ) =>
34
34
  apiFetcher(`/UnansweredQuestions/${sessionId}/${from}/${howMany}`, {
35
35
  method: 'GET',