@memori.ai/memori-api-client 2.0.0 → 2.1.1

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,20 @@
1
1
 
2
2
 
3
+ ## [2.1.1](https://github.com/memori-ai/memori-api-client/compare/v2.1.0...v2.1.1) (2023-04-14)
4
+
5
+
6
+ ### Maintenance
7
+
8
+ * setup types for build ([d7e7203](https://github.com/memori-ai/memori-api-client/commit/d7e7203f5d2cd3b93e5ca1889147703c218231eb))
9
+ * setup types for build ([2527080](https://github.com/memori-ai/memori-api-client/commit/25270801e8d777ee03d8a3577213609fc8d841ef))
10
+
11
+ ## [2.1.0](https://github.com/memori-ai/memori-api-client/compare/v2.0.0...v2.1.0) (2023-04-14)
12
+
13
+
14
+ ### Features
15
+
16
+ * add new memori and user attributes ([40e6d16](https://github.com/memori-ai/memori-api-client/commit/40e6d16a56912a5add579ed5ad5245fce8ff0eea))
17
+
3
18
  ## [2.0.0](https://github.com/memori-ai/memori-api-client/compare/v1.2.0...v2.0.0) (2023-03-25)
4
19
 
5
20
 
@@ -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"}
package/dist/types.d.ts CHANGED
@@ -49,6 +49,8 @@ export declare type Memori = {
49
49
  publishedInTheMetaverse?: boolean;
50
50
  metaverseEnvironment?: string;
51
51
  exposed?: boolean;
52
+ ageRescrition?: number;
53
+ nsfw?: boolean;
52
54
  disableR2R3Loop?: boolean;
53
55
  disableR4Loop?: boolean;
54
56
  disableR5Loop?: boolean;
@@ -116,6 +118,10 @@ export declare type User = {
116
118
  couponCode?: string;
117
119
  paying?: boolean;
118
120
  notificationPrefs?: NotificationPrefs[];
121
+ birthDate?: string;
122
+ age?: number;
123
+ tnCAndPPAccepted?: boolean;
124
+ tnCAndPPAcceptanceDate?: string;
119
125
  };
120
126
  export declare type IntegrationResource = {
121
127
  name: string;
@@ -169,36 +175,45 @@ export interface UploadFile<T = any> {
169
175
  xhr?: T;
170
176
  preview?: string;
171
177
  }
172
- export declare type TenantConfig = {
178
+ export type TenantConfig = {
173
179
  name: string;
174
180
  showNewUser: boolean;
175
181
  requirePosition: boolean;
176
182
  feedbackURL?: string;
177
183
  };
178
- export declare type Tenant = {
179
- id: string;
180
- theme: string;
181
- config: TenantConfig;
184
+ export type TenantBase = {
185
+ tenantID?: string;
186
+ name?: string;
187
+ description?: string;
188
+ logoURL?: string;
189
+ adminCount?: number;
190
+ userCount?: number;
191
+ memoriCount?: number;
182
192
  disableRegistration?: boolean;
183
193
  maxMemoriPerAdmin?: number;
184
194
  maxMemoriPerUser?: number;
185
195
  maxTotalMemori?: number;
186
- memoriCount?: number;
187
196
  maxAdmins?: number;
188
- adminCount?: number;
189
197
  maxUsers?: number;
190
- userCount?: number;
191
- usersCanCreateMemori?: boolean;
192
- usersCanAccessAPI?: boolean;
193
- usersCanEditIntegrations?: boolean;
194
- usersCanEditDynamicIntents?: boolean;
195
- usersCanEditMemoriChaining?: boolean;
196
198
  maxFreeSessions?: number;
197
199
  maxFreeSessionsPerUser?: number;
198
200
  nonFreeSessionCost?: number;
199
201
  maxCompletions?: number;
200
202
  maxCompletionsPerUser?: number;
201
203
  paying?: boolean;
204
+ usersCanCreateMemori?: boolean;
205
+ usersCanAccessAPI?: boolean;
206
+ usersCanEditIntegrations?: boolean;
207
+ usersCanEditDynamicIntents?: boolean;
208
+ usersCanEditMemoriChaining?: boolean;
209
+ usersCanRunSnippets?: boolean;
210
+ creationTimestamp?: string;
211
+ lastChangeTimestamp?: string;
212
+ };
213
+ export type Tenant = TenantBase & {
214
+ id: string;
215
+ theme: string;
216
+ config: TenantConfig;
202
217
  };
203
218
  export declare type OpenSession = {
204
219
  memoriID: string;
@@ -210,6 +225,8 @@ export declare type OpenSession = {
210
225
  [key: string]: string;
211
226
  };
212
227
  initialQuestion?: string;
228
+ forceCloseSessions?: boolean;
229
+ birthDate?: string;
213
230
  };
214
231
  export declare type MemoriSession = {
215
232
  sessionID: string;
@@ -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/esm/types.d.ts CHANGED
@@ -49,6 +49,8 @@ export declare type Memori = {
49
49
  publishedInTheMetaverse?: boolean;
50
50
  metaverseEnvironment?: string;
51
51
  exposed?: boolean;
52
+ ageRescrition?: number;
53
+ nsfw?: boolean;
52
54
  disableR2R3Loop?: boolean;
53
55
  disableR4Loop?: boolean;
54
56
  disableR5Loop?: boolean;
@@ -116,6 +118,10 @@ export declare type User = {
116
118
  couponCode?: string;
117
119
  paying?: boolean;
118
120
  notificationPrefs?: NotificationPrefs[];
121
+ birthDate?: string;
122
+ age?: number;
123
+ tnCAndPPAccepted?: boolean;
124
+ tnCAndPPAcceptanceDate?: string;
119
125
  };
120
126
  export declare type IntegrationResource = {
121
127
  name: string;
@@ -169,36 +175,45 @@ export interface UploadFile<T = any> {
169
175
  xhr?: T;
170
176
  preview?: string;
171
177
  }
172
- export declare type TenantConfig = {
178
+ export type TenantConfig = {
173
179
  name: string;
174
180
  showNewUser: boolean;
175
181
  requirePosition: boolean;
176
182
  feedbackURL?: string;
177
183
  };
178
- export declare type Tenant = {
179
- id: string;
180
- theme: string;
181
- config: TenantConfig;
184
+ export type TenantBase = {
185
+ tenantID?: string;
186
+ name?: string;
187
+ description?: string;
188
+ logoURL?: string;
189
+ adminCount?: number;
190
+ userCount?: number;
191
+ memoriCount?: number;
182
192
  disableRegistration?: boolean;
183
193
  maxMemoriPerAdmin?: number;
184
194
  maxMemoriPerUser?: number;
185
195
  maxTotalMemori?: number;
186
- memoriCount?: number;
187
196
  maxAdmins?: number;
188
- adminCount?: number;
189
197
  maxUsers?: number;
190
- userCount?: number;
191
- usersCanCreateMemori?: boolean;
192
- usersCanAccessAPI?: boolean;
193
- usersCanEditIntegrations?: boolean;
194
- usersCanEditDynamicIntents?: boolean;
195
- usersCanEditMemoriChaining?: boolean;
196
198
  maxFreeSessions?: number;
197
199
  maxFreeSessionsPerUser?: number;
198
200
  nonFreeSessionCost?: number;
199
201
  maxCompletions?: number;
200
202
  maxCompletionsPerUser?: number;
201
203
  paying?: boolean;
204
+ usersCanCreateMemori?: boolean;
205
+ usersCanAccessAPI?: boolean;
206
+ usersCanEditIntegrations?: boolean;
207
+ usersCanEditDynamicIntents?: boolean;
208
+ usersCanEditMemoriChaining?: boolean;
209
+ usersCanRunSnippets?: boolean;
210
+ creationTimestamp?: string;
211
+ lastChangeTimestamp?: string;
212
+ };
213
+ export type Tenant = TenantBase & {
214
+ id: string;
215
+ theme: string;
216
+ config: TenantConfig;
202
217
  };
203
218
  export declare type OpenSession = {
204
219
  memoriID: string;
@@ -210,6 +225,8 @@ export declare type OpenSession = {
210
225
  [key: string]: string;
211
226
  };
212
227
  initialQuestion?: string;
228
+ forceCloseSessions?: boolean;
229
+ birthDate?: string;
213
230
  };
214
231
  export declare type MemoriSession = {
215
232
  sessionID: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "2.1.1",
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",
@@ -20,7 +20,7 @@
20
20
  "author": "Memori Srl",
21
21
  "main": "dist/index.js",
22
22
  "module": "esm/index.js",
23
- "types": "dist/index.d.ts",
23
+ "types": "dist/types.d.ts",
24
24
  "files": [
25
25
  "dist",
26
26
  "esm",
@@ -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
  });
@@ -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?: number;
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 = {