@memori.ai/memori-api-client 2.0.0 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
 
2
2
 
3
+ ## [2.1.0](https://github.com/memori-ai/memori-api-client/compare/v2.0.0...v2.1.0) (2023-04-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * add new memori and user attributes ([40e6d16](https://github.com/memori-ai/memori-api-client/commit/40e6d16a56912a5add579ed5ad5245fce8ff0eea))
9
+
3
10
  ## [2.0.0](https://github.com/memori-ai/memori-api-client/compare/v1.2.0...v2.0.0) (2023-03-25)
4
11
 
5
12
 
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const index_1 = tslib_1.__importDefault(require("../index"));
5
- const client = (0, index_1.default)('https://backend.memori.ai');
5
+ const client = (0, index_1.default)('https://backend-staging.memori.ai');
6
6
  describe('engine/search api', () => {
7
7
  it('works on search apis', async () => {
8
- expect(await client.search.postRandom('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
8
+ expect(await client.search.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
9
9
  });
10
10
  it('works on search apis with shorthand version', async () => {
11
- expect(await client.postRandom('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
11
+ expect(await client.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
12
12
  });
13
13
  });
14
14
  //# sourceMappingURL=search.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,sCAAsC,CAAC,CACvE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAChE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAG9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,mCAAmC,CAAC,CAAC;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CACzE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CAClE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import memori from '../index';
2
- const client = memori('https://backend.memori.ai');
2
+ const client = memori('https://backend-staging.memori.ai');
3
3
  describe('engine/search api', () => {
4
4
  it('works on search apis', async () => {
5
- expect(await client.search.postRandom('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
5
+ expect(await client.search.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
6
6
  });
7
7
  it('works on search apis with shorthand version', async () => {
8
- expect(await client.postRandom('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
8
+ expect(await client.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
9
9
  });
10
10
  });
11
11
  //# sourceMappingURL=search.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,sCAAsC,CAAC,CACvE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAChE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAG9B,MAAM,MAAM,GAAG,MAAM,CAAC,mCAAmC,CAAC,CAAC;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CACzE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CAClE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "2.1.0",
3
3
  "name": "@memori.ai/memori-api-client",
4
4
  "description": "React library to integrate a Memori in your app or website",
5
5
  "license": "Apache-2.0",
@@ -1,17 +1,18 @@
1
1
  import memori from '../index';
2
2
 
3
- const client = memori('https://backend.memori.ai');
3
+ // FIXME: switch back to production when backend fixes request processing issue
4
+ const client = memori('https://backend-staging.memori.ai');
4
5
 
5
6
  describe('engine/search api', () => {
6
7
  it('works on search apis', async () => {
7
8
  expect(
8
- await client.search.postRandom('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
9
+ await client.search.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
9
10
  ).not.toBeNull();
10
11
  });
11
12
 
12
13
  it('works on search apis with shorthand version', async () => {
13
14
  expect(
14
- await client.postRandom('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
15
+ await client.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
15
16
  ).not.toBeNull();
16
17
  });
17
18
  });
package/src/types.d.ts CHANGED
@@ -60,6 +60,8 @@ export declare type Memori = {
60
60
  publishedInTheMetaverse?: boolean;
61
61
  metaverseEnvironment?: string;
62
62
  exposed?: boolean;
63
+ ageRescrition?: number;
64
+ nsfw?: boolean;
63
65
  disableR2R3Loop?: boolean;
64
66
  disableR4Loop?: boolean;
65
67
  disableR5Loop?: boolean;
@@ -148,6 +150,10 @@ export declare type User = {
148
150
  couponCode?: string;
149
151
  paying?: boolean;
150
152
  notificationPrefs?: NotificationPrefs[];
153
+ birthDate?: string;
154
+ age?: integer;
155
+ tnCAndPPAccepted?: boolean;
156
+ tnCAndPPAcceptanceDate?: string;
151
157
  };
152
158
 
153
159
  export declare type IntegrationResource = {
@@ -221,37 +227,47 @@ export interface UploadFile<T = any> {
221
227
  preview?: string;
222
228
  }
223
229
 
224
- export declare type TenantConfig = {
230
+ export type TenantConfig = {
225
231
  name: string;
226
232
  showNewUser: boolean;
227
233
  requirePosition: boolean;
228
234
  feedbackURL?: string;
229
235
  };
230
236
 
231
- export declare type Tenant = {
232
- id: string;
233
- theme: string;
234
- config: TenantConfig;
237
+ export type TenantBase = {
238
+ tenantID?: string;
239
+ name?: string;
240
+ description?: string;
241
+ logoURL?: string;
242
+ adminCount?: number;
243
+ userCount?: number;
244
+ memoriCount?: number;
235
245
  disableRegistration?: boolean;
236
246
  maxMemoriPerAdmin?: number;
237
247
  maxMemoriPerUser?: number;
238
248
  maxTotalMemori?: number;
239
- memoriCount?: number;
240
249
  maxAdmins?: number;
241
- adminCount?: number;
242
250
  maxUsers?: number;
243
- userCount?: number;
244
- usersCanCreateMemori?: boolean;
245
- usersCanAccessAPI?: boolean;
246
- usersCanEditIntegrations?: boolean;
247
- usersCanEditDynamicIntents?: boolean;
248
- usersCanEditMemoriChaining?: boolean;
249
251
  maxFreeSessions?: number;
250
252
  maxFreeSessionsPerUser?: number;
251
253
  nonFreeSessionCost?: number;
252
254
  maxCompletions?: number;
253
255
  maxCompletionsPerUser?: number;
254
256
  paying?: boolean;
257
+ usersCanCreateMemori?: boolean;
258
+ usersCanAccessAPI?: boolean;
259
+ usersCanEditIntegrations?: boolean;
260
+ usersCanEditDynamicIntents?: boolean;
261
+ usersCanEditMemoriChaining?: boolean;
262
+ usersCanRunSnippets?: boolean;
263
+ creationTimestamp?: string;
264
+ lastChangeTimestamp?: string;
265
+ };
266
+
267
+ export type Tenant = TenantBase & {
268
+ id: string;
269
+ theme: string;
270
+ config: TenantConfig;
255
271
  };
256
272
 
257
273
  export declare type OpenSession = {
@@ -262,6 +278,8 @@ export declare type OpenSession = {
262
278
  pin?: string;
263
279
  initialContextVars?: { [key: string]: string };
264
280
  initialQuestion?: string;
281
+ forceCloseSessions?: boolean;
282
+ birthDate?: string;
265
283
  };
266
284
 
267
285
  export declare type MemoriSession = {