@memori.ai/memori-api-client 5.6.0 → 6.0.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,16 @@
1
1
 
2
2
 
3
+ ## [6.0.0](https://github.com/memori-ai/memori-api-client/compare/v5.6.0...v6.0.0) (2025-03-07)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * tenant types from backend, remove customizations from dashboard + add alias
9
+
10
+ ### Changes
11
+
12
+ * tenant types from backend, remove customizations from dashboard + add alias ([a2d50d9](https://github.com/memori-ai/memori-api-client/commit/a2d50d9bbcafcda5d60fbe9fb7754dc4d07c1b57))
13
+
3
14
  ## [5.6.0](https://github.com/memori-ai/memori-api-client/compare/v5.5.1...v5.6.0) (2025-02-28)
4
15
 
5
16
 
@@ -1,17 +1,20 @@
1
- import { ResponseSpec, TenantBase } from '../types';
1
+ import { ResponseSpec, Tenant } from '../types';
2
2
  declare const _default: (apiUrl: string) => {
3
3
  healthCheck: () => Promise<ResponseSpec>;
4
4
  getTenantConfig: (tenantName: string) => Promise<ResponseSpec & {
5
- tenant: TenantBase;
5
+ tenant: Tenant;
6
+ }>;
7
+ getTenant: (tenantName: string) => Promise<ResponseSpec & {
8
+ tenant: Tenant;
6
9
  }>;
7
10
  getTenantList: (authToken: string) => Promise<ResponseSpec & {
8
- tenants: TenantBase[];
11
+ tenants: Tenant[];
9
12
  }>;
10
- createTenant: (authToken: string, name: string, tenant: Partial<TenantBase>) => Promise<ResponseSpec & {
11
- tenant: TenantBase;
13
+ createTenant: (authToken: string, name: string, tenant: Partial<Tenant>) => Promise<ResponseSpec & {
14
+ tenant: Tenant;
12
15
  }>;
13
- patchTenant: (authToken: string, name: string, tenant: Partial<TenantBase>) => Promise<ResponseSpec & {
14
- tenant: TenantBase;
16
+ patchTenant: (authToken: string, name: string, tenant: Partial<Tenant>) => Promise<ResponseSpec & {
17
+ tenant: Tenant;
15
18
  }>;
16
19
  };
17
20
  export default _default;
@@ -7,6 +7,7 @@ exports.default = (apiUrl) => ({
7
7
  method: 'GET',
8
8
  }),
9
9
  getTenantConfig: (tenantName) => (0, apiFetcher_1.apiFetcher)(`/Tenant/${tenantName}`, { apiUrl }),
10
+ getTenant: (tenantName) => (0, apiFetcher_1.apiFetcher)(`/Tenant/${tenantName}`, { apiUrl }),
10
11
  getTenantList: (authToken) => (0, apiFetcher_1.apiFetcher)(`/Tenants/${authToken}`, {
11
12
  apiUrl,
12
13
  method: 'GET',
@@ -1 +1 @@
1
- {"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/backend/tenant.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAIlC,WAAW,EAAE,GAAG,EAAE,CAChB,IAAA,uBAAU,EAAC,cAAc,EAAE;QACzB,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAA0B;IAM7B,eAAe,EAAE,CAAC,UAAkB,EAAE,EAAE,CACtC,IAAA,uBAAU,EAAC,WAAW,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAI7C;IAMH,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CACnC,IAAA,uBAAU,EAAC,YAAY,SAAS,EAAE,EAAE;QAClC,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAAsD;IASzD,YAAY,EAAE,CACZ,SAAiB,EACjB,IAAY,EACZ,MAA2B,EAC3B,EAAE,CACF,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM;KACb,CAIA;IASH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,MAA2B,EAAE,EAAE,CAC5E,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,MAAM;KACb,CAIA;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/backend/tenant.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAIlC,WAAW,EAAE,GAAG,EAAE,CAChB,IAAA,uBAAU,EAAC,cAAc,EAAE;QACzB,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAA0B;IAQ7B,eAAe,EAAE,CAAC,UAAkB,EAAE,EAAE,CACtC,IAAA,uBAAU,EAAC,WAAW,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAI7C;IAMH,SAAS,EAAE,CAAC,UAAkB,EAAE,EAAE,CAChC,IAAA,uBAAU,EAAC,WAAW,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAI7C;IAMH,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CACnC,IAAA,uBAAU,EAAC,YAAY,SAAS,EAAE,EAAE;QAClC,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAAkD;IASrD,YAAY,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,MAAuB,EAAE,EAAE,CACzE,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM;KACb,CAIA;IASH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,MAAuB,EAAE,EAAE,CACxE,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,MAAM;KACb,CAIA;CACJ,CAAC,CAAC"}
@@ -5,10 +5,10 @@ const index_1 = tslib_1.__importDefault(require("../index"));
5
5
  const client = (0, index_1.default)('https://backend.memori.ai');
6
6
  describe('backend/tenant api', () => {
7
7
  it('works on tenant apis', async () => {
8
- expect(await client.backend.tenant.getTenantConfig('www.aisuru.com')).not.toBeNull();
8
+ expect(await client.backend.tenant.getTenant('www.aisuru.com')).not.toBeNull();
9
9
  });
10
10
  it('works on tenant apis with shorthand version', async () => {
11
- expect(await client.backend.getTenantConfig('www.aisuru.com')).not.toBeNull();
11
+ expect(await client.backend.getTenant('www.aisuru.com')).not.toBeNull();
12
12
  });
13
13
  });
14
14
  //# sourceMappingURL=tenant.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenant.test.js","sourceRoot":"","sources":["../../src/backend/tenant.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAC9D,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,CACvD,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"tenant.test.js","sourceRoot":"","sources":["../../src/backend/tenant.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CACxD,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/backend.d.ts CHANGED
@@ -1,16 +1,19 @@
1
1
  declare const backendAPI: (apiUrl: string) => {
2
2
  healthCheck: () => Promise<import("./types").ResponseSpec>;
3
3
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
4
- tenant: import("./types").TenantBase;
4
+ tenant: import("./types").Tenant;
5
+ }>;
6
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
7
+ tenant: import("./types").Tenant;
5
8
  }>;
6
9
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
7
- tenants: import("./types").TenantBase[];
10
+ tenants: import("./types").Tenant[];
8
11
  }>;
9
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
10
- tenant: import("./types").TenantBase;
12
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
13
+ tenant: import("./types").Tenant;
11
14
  }>;
12
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
13
- tenant: import("./types").TenantBase;
15
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
16
+ tenant: import("./types").Tenant;
14
17
  }>;
15
18
  postOutcome: (authToken: string, outcomeCode: string) => Promise<import("./types").ResponseSpec>;
16
19
  getUserBadges: (authToken: string) => Promise<import("./types").ResponseSpec & {
@@ -501,16 +504,19 @@ declare const backendAPI: (apiUrl: string) => {
501
504
  tenant: {
502
505
  healthCheck: () => Promise<import("./types").ResponseSpec>;
503
506
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
504
- tenant: import("./types").TenantBase;
507
+ tenant: import("./types").Tenant;
508
+ }>;
509
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
510
+ tenant: import("./types").Tenant;
505
511
  }>;
506
512
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
507
- tenants: import("./types").TenantBase[];
513
+ tenants: import("./types").Tenant[];
508
514
  }>;
509
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
510
- tenant: import("./types").TenantBase;
515
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
516
+ tenant: import("./types").Tenant;
511
517
  }>;
512
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
513
- tenant: import("./types").TenantBase;
518
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
519
+ tenant: import("./types").Tenant;
514
520
  }>;
515
521
  };
516
522
  };
package/dist/index.d.ts CHANGED
@@ -715,16 +715,19 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
715
715
  backend: {
716
716
  healthCheck: () => Promise<import("./types").ResponseSpec>;
717
717
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
718
- tenant: import("./types").TenantBase;
718
+ tenant: import("./types").Tenant;
719
+ }>;
720
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
721
+ tenant: import("./types").Tenant;
719
722
  }>;
720
723
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
721
- tenants: import("./types").TenantBase[];
724
+ tenants: import("./types").Tenant[];
722
725
  }>;
723
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
724
- tenant: import("./types").TenantBase;
726
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
727
+ tenant: import("./types").Tenant;
725
728
  }>;
726
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
727
- tenant: import("./types").TenantBase;
729
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
730
+ tenant: import("./types").Tenant;
728
731
  }>;
729
732
  postOutcome: (authToken: string, outcomeCode: string) => Promise<import("./types").ResponseSpec>;
730
733
  getUserBadges: (authToken: string) => Promise<import("./types").ResponseSpec & {
@@ -1215,16 +1218,19 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
1215
1218
  tenant: {
1216
1219
  healthCheck: () => Promise<import("./types").ResponseSpec>;
1217
1220
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
1218
- tenant: import("./types").TenantBase;
1221
+ tenant: import("./types").Tenant;
1222
+ }>;
1223
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
1224
+ tenant: import("./types").Tenant;
1219
1225
  }>;
1220
1226
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
1221
- tenants: import("./types").TenantBase[];
1227
+ tenants: import("./types").Tenant[];
1222
1228
  }>;
1223
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
1224
- tenant: import("./types").TenantBase;
1229
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
1230
+ tenant: import("./types").Tenant;
1225
1231
  }>;
1226
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
1227
- tenant: import("./types").TenantBase;
1232
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
1233
+ tenant: import("./types").Tenant;
1228
1234
  }>;
1229
1235
  };
1230
1236
  };
package/dist/types.d.ts CHANGED
@@ -283,19 +283,15 @@ export interface UploadFile<T = any> {
283
283
  xhr?: T;
284
284
  preview?: string;
285
285
  }
286
- export declare type TenantConfig = {
287
- name: string;
288
- showNewUser: boolean;
289
- requirePosition: boolean;
290
- showVirtualSpaces?: boolean;
291
- };
292
- export declare type TenantBase = {
286
+ export declare type Tenant = {
293
287
  tenantID?: string;
294
288
  name?: string;
289
+ aliases?: string[];
295
290
  description?: string;
296
291
  logoURL?: string;
297
292
  adminEmail?: string;
298
- aliases?: string[];
293
+ theme?: string;
294
+ feedbackURL?: string;
299
295
  adminCount?: number;
300
296
  userCount?: number;
301
297
  memoriCount?: number;
@@ -308,26 +304,21 @@ export declare type TenantBase = {
308
304
  maxFreeSessions?: number;
309
305
  maxFreeSessionsPerUser?: number;
310
306
  nonFreeSessionCost?: number;
311
- maxImportSize?: number;
312
- maxImportSizePerUser?: number;
313
307
  maxCompletions?: number;
314
308
  maxCompletionsPerUser?: number;
309
+ maxImportSize?: number;
310
+ maxImportSizePerUser?: number;
315
311
  paying?: boolean;
316
312
  enableUserMemoriCreation?: boolean;
317
313
  enableBoardOfExperts?: boolean;
318
314
  enableDCMIntegration?: boolean;
319
315
  enableBadges?: boolean;
320
- enableVirtualSpaces?: boolean;
321
316
  enableDeepThought?: boolean;
317
+ enableVirtualSpaces?: boolean;
322
318
  billingDelegation?: boolean;
323
319
  creationTimestamp?: string;
324
320
  lastChangeTimestamp?: string;
325
321
  };
326
- export declare type Tenant = TenantBase & {
327
- id: string;
328
- theme: string;
329
- config: TenantConfig;
330
- };
331
322
  export declare type LocalizationKeyContent = {
332
323
  key: string;
333
324
  value: string;
@@ -1,17 +1,20 @@
1
- import { ResponseSpec, TenantBase } from '../types';
1
+ import { ResponseSpec, Tenant } from '../types';
2
2
  declare const _default: (apiUrl: string) => {
3
3
  healthCheck: () => Promise<ResponseSpec>;
4
4
  getTenantConfig: (tenantName: string) => Promise<ResponseSpec & {
5
- tenant: TenantBase;
5
+ tenant: Tenant;
6
+ }>;
7
+ getTenant: (tenantName: string) => Promise<ResponseSpec & {
8
+ tenant: Tenant;
6
9
  }>;
7
10
  getTenantList: (authToken: string) => Promise<ResponseSpec & {
8
- tenants: TenantBase[];
11
+ tenants: Tenant[];
9
12
  }>;
10
- createTenant: (authToken: string, name: string, tenant: Partial<TenantBase>) => Promise<ResponseSpec & {
11
- tenant: TenantBase;
13
+ createTenant: (authToken: string, name: string, tenant: Partial<Tenant>) => Promise<ResponseSpec & {
14
+ tenant: Tenant;
12
15
  }>;
13
- patchTenant: (authToken: string, name: string, tenant: Partial<TenantBase>) => Promise<ResponseSpec & {
14
- tenant: TenantBase;
16
+ patchTenant: (authToken: string, name: string, tenant: Partial<Tenant>) => Promise<ResponseSpec & {
17
+ tenant: Tenant;
15
18
  }>;
16
19
  };
17
20
  export default _default;
@@ -5,6 +5,7 @@ export default (apiUrl) => ({
5
5
  method: 'GET',
6
6
  }),
7
7
  getTenantConfig: (tenantName) => apiFetcher(`/Tenant/${tenantName}`, { apiUrl }),
8
+ getTenant: (tenantName) => apiFetcher(`/Tenant/${tenantName}`, { apiUrl }),
8
9
  getTenantList: (authToken) => apiFetcher(`/Tenants/${authToken}`, {
9
10
  apiUrl,
10
11
  method: 'GET',
@@ -1 +1 @@
1
- {"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/backend/tenant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAIlC,WAAW,EAAE,GAAG,EAAE,CAChB,UAAU,CAAC,cAAc,EAAE;QACzB,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAA0B;IAM7B,eAAe,EAAE,CAAC,UAAkB,EAAE,EAAE,CACtC,UAAU,CAAC,WAAW,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAI7C;IAMH,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CACnC,UAAU,CAAC,YAAY,SAAS,EAAE,EAAE;QAClC,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAAsD;IASzD,YAAY,EAAE,CACZ,SAAiB,EACjB,IAAY,EACZ,MAA2B,EAC3B,EAAE,CACF,UAAU,CAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM;KACb,CAIA;IASH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,MAA2B,EAAE,EAAE,CAC5E,UAAU,CAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,MAAM;KACb,CAIA;CACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/backend/tenant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAIlC,WAAW,EAAE,GAAG,EAAE,CAChB,UAAU,CAAC,cAAc,EAAE;QACzB,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAA0B;IAQ7B,eAAe,EAAE,CAAC,UAAkB,EAAE,EAAE,CACtC,UAAU,CAAC,WAAW,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAI7C;IAMH,SAAS,EAAE,CAAC,UAAkB,EAAE,EAAE,CAChC,UAAU,CAAC,WAAW,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAI7C;IAMH,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CACnC,UAAU,CAAC,YAAY,SAAS,EAAE,EAAE;QAClC,MAAM;QACN,MAAM,EAAE,KAAK;KACd,CAAkD;IASrD,YAAY,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,MAAuB,EAAE,EAAE,CACzE,UAAU,CAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM;KACb,CAIA;IASH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAAY,EAAE,MAAuB,EAAE,EAAE,CACxE,UAAU,CAAC,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE;QACzC,MAAM;QACN,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,MAAM;KACb,CAIA;CACJ,CAAC,CAAC"}
@@ -2,10 +2,10 @@ import memori from '../index';
2
2
  const client = memori('https://backend.memori.ai');
3
3
  describe('backend/tenant api', () => {
4
4
  it('works on tenant apis', async () => {
5
- expect(await client.backend.tenant.getTenantConfig('www.aisuru.com')).not.toBeNull();
5
+ expect(await client.backend.tenant.getTenant('www.aisuru.com')).not.toBeNull();
6
6
  });
7
7
  it('works on tenant apis with shorthand version', async () => {
8
- expect(await client.backend.getTenantConfig('www.aisuru.com')).not.toBeNull();
8
+ expect(await client.backend.getTenant('www.aisuru.com')).not.toBeNull();
9
9
  });
10
10
  });
11
11
  //# sourceMappingURL=tenant.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenant.test.js","sourceRoot":"","sources":["../../src/backend/tenant.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAC9D,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,CACvD,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"tenant.test.js","sourceRoot":"","sources":["../../src/backend/tenant.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CACxD,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/esm/backend.d.ts CHANGED
@@ -1,16 +1,19 @@
1
1
  declare const backendAPI: (apiUrl: string) => {
2
2
  healthCheck: () => Promise<import("./types").ResponseSpec>;
3
3
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
4
- tenant: import("./types").TenantBase;
4
+ tenant: import("./types").Tenant;
5
+ }>;
6
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
7
+ tenant: import("./types").Tenant;
5
8
  }>;
6
9
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
7
- tenants: import("./types").TenantBase[];
10
+ tenants: import("./types").Tenant[];
8
11
  }>;
9
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
10
- tenant: import("./types").TenantBase;
12
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
13
+ tenant: import("./types").Tenant;
11
14
  }>;
12
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
13
- tenant: import("./types").TenantBase;
15
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
16
+ tenant: import("./types").Tenant;
14
17
  }>;
15
18
  postOutcome: (authToken: string, outcomeCode: string) => Promise<import("./types").ResponseSpec>;
16
19
  getUserBadges: (authToken: string) => Promise<import("./types").ResponseSpec & {
@@ -501,16 +504,19 @@ declare const backendAPI: (apiUrl: string) => {
501
504
  tenant: {
502
505
  healthCheck: () => Promise<import("./types").ResponseSpec>;
503
506
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
504
- tenant: import("./types").TenantBase;
507
+ tenant: import("./types").Tenant;
508
+ }>;
509
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
510
+ tenant: import("./types").Tenant;
505
511
  }>;
506
512
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
507
- tenants: import("./types").TenantBase[];
513
+ tenants: import("./types").Tenant[];
508
514
  }>;
509
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
510
- tenant: import("./types").TenantBase;
515
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
516
+ tenant: import("./types").Tenant;
511
517
  }>;
512
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
513
- tenant: import("./types").TenantBase;
518
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
519
+ tenant: import("./types").Tenant;
514
520
  }>;
515
521
  };
516
522
  };
package/esm/index.d.ts CHANGED
@@ -715,16 +715,19 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
715
715
  backend: {
716
716
  healthCheck: () => Promise<import("./types").ResponseSpec>;
717
717
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
718
- tenant: import("./types").TenantBase;
718
+ tenant: import("./types").Tenant;
719
+ }>;
720
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
721
+ tenant: import("./types").Tenant;
719
722
  }>;
720
723
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
721
- tenants: import("./types").TenantBase[];
724
+ tenants: import("./types").Tenant[];
722
725
  }>;
723
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
724
- tenant: import("./types").TenantBase;
726
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
727
+ tenant: import("./types").Tenant;
725
728
  }>;
726
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
727
- tenant: import("./types").TenantBase;
729
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
730
+ tenant: import("./types").Tenant;
728
731
  }>;
729
732
  postOutcome: (authToken: string, outcomeCode: string) => Promise<import("./types").ResponseSpec>;
730
733
  getUserBadges: (authToken: string) => Promise<import("./types").ResponseSpec & {
@@ -1215,16 +1218,19 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
1215
1218
  tenant: {
1216
1219
  healthCheck: () => Promise<import("./types").ResponseSpec>;
1217
1220
  getTenantConfig: (tenantName: string) => Promise<import("./types").ResponseSpec & {
1218
- tenant: import("./types").TenantBase;
1221
+ tenant: import("./types").Tenant;
1222
+ }>;
1223
+ getTenant: (tenantName: string) => Promise<import("./types").ResponseSpec & {
1224
+ tenant: import("./types").Tenant;
1219
1225
  }>;
1220
1226
  getTenantList: (authToken: string) => Promise<import("./types").ResponseSpec & {
1221
- tenants: import("./types").TenantBase[];
1227
+ tenants: import("./types").Tenant[];
1222
1228
  }>;
1223
- createTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
1224
- tenant: import("./types").TenantBase;
1229
+ createTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
1230
+ tenant: import("./types").Tenant;
1225
1231
  }>;
1226
- patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").TenantBase>) => Promise<import("./types").ResponseSpec & {
1227
- tenant: import("./types").TenantBase;
1232
+ patchTenant: (authToken: string, name: string, tenant: Partial<import("./types").Tenant>) => Promise<import("./types").ResponseSpec & {
1233
+ tenant: import("./types").Tenant;
1228
1234
  }>;
1229
1235
  };
1230
1236
  };
package/esm/types.d.ts CHANGED
@@ -283,19 +283,15 @@ export interface UploadFile<T = any> {
283
283
  xhr?: T;
284
284
  preview?: string;
285
285
  }
286
- export declare type TenantConfig = {
287
- name: string;
288
- showNewUser: boolean;
289
- requirePosition: boolean;
290
- showVirtualSpaces?: boolean;
291
- };
292
- export declare type TenantBase = {
286
+ export declare type Tenant = {
293
287
  tenantID?: string;
294
288
  name?: string;
289
+ aliases?: string[];
295
290
  description?: string;
296
291
  logoURL?: string;
297
292
  adminEmail?: string;
298
- aliases?: string[];
293
+ theme?: string;
294
+ feedbackURL?: string;
299
295
  adminCount?: number;
300
296
  userCount?: number;
301
297
  memoriCount?: number;
@@ -308,26 +304,21 @@ export declare type TenantBase = {
308
304
  maxFreeSessions?: number;
309
305
  maxFreeSessionsPerUser?: number;
310
306
  nonFreeSessionCost?: number;
311
- maxImportSize?: number;
312
- maxImportSizePerUser?: number;
313
307
  maxCompletions?: number;
314
308
  maxCompletionsPerUser?: number;
309
+ maxImportSize?: number;
310
+ maxImportSizePerUser?: number;
315
311
  paying?: boolean;
316
312
  enableUserMemoriCreation?: boolean;
317
313
  enableBoardOfExperts?: boolean;
318
314
  enableDCMIntegration?: boolean;
319
315
  enableBadges?: boolean;
320
- enableVirtualSpaces?: boolean;
321
316
  enableDeepThought?: boolean;
317
+ enableVirtualSpaces?: boolean;
322
318
  billingDelegation?: boolean;
323
319
  creationTimestamp?: string;
324
320
  lastChangeTimestamp?: string;
325
321
  };
326
- export declare type Tenant = TenantBase & {
327
- id: string;
328
- theme: string;
329
- config: TenantConfig;
330
- };
331
322
  export declare type LocalizationKeyContent = {
332
323
  key: string;
333
324
  value: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.6.0",
2
+ "version": "6.0.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",
@@ -5,13 +5,11 @@ const client = memori('https://backend.memori.ai');
5
5
  describe('backend/tenant api', () => {
6
6
  it('works on tenant apis', async () => {
7
7
  expect(
8
- await client.backend.tenant.getTenantConfig('www.aisuru.com')
8
+ await client.backend.tenant.getTenant('www.aisuru.com')
9
9
  ).not.toBeNull();
10
10
  });
11
11
 
12
12
  it('works on tenant apis with shorthand version', async () => {
13
- expect(
14
- await client.backend.getTenantConfig('www.aisuru.com')
15
- ).not.toBeNull();
13
+ expect(await client.backend.getTenant('www.aisuru.com')).not.toBeNull();
16
14
  });
17
15
  });
@@ -1,4 +1,4 @@
1
- import { ResponseSpec, TenantBase } from '../types';
1
+ import { ResponseSpec, Tenant } from '../types';
2
2
  import { apiFetcher } from '../apiFetcher';
3
3
 
4
4
  export default (apiUrl: string) => ({
@@ -14,11 +14,24 @@ export default (apiUrl: string) => ({
14
14
  /**
15
15
  * Gets the details of a Tenant object.
16
16
  * @param tenantName - The name of the tenant
17
+ * @alias getTenant
18
+ * @deprecated
17
19
  */
18
20
  getTenantConfig: (tenantName: string) =>
19
21
  apiFetcher(`/Tenant/${tenantName}`, { apiUrl }) as Promise<
20
22
  ResponseSpec & {
21
- tenant: TenantBase;
23
+ tenant: Tenant;
24
+ }
25
+ >,
26
+
27
+ /**
28
+ * Gets the details of a Tenant object.
29
+ * @param tenantName - The name of the tenant
30
+ */
31
+ getTenant: (tenantName: string) =>
32
+ apiFetcher(`/Tenant/${tenantName}`, { apiUrl }) as Promise<
33
+ ResponseSpec & {
34
+ tenant: Tenant;
22
35
  }
23
36
  >,
24
37
 
@@ -30,7 +43,7 @@ export default (apiUrl: string) => ({
30
43
  apiFetcher(`/Tenants/${authToken}`, {
31
44
  apiUrl,
32
45
  method: 'GET',
33
- }) as Promise<ResponseSpec & { tenants: TenantBase[] }>,
46
+ }) as Promise<ResponseSpec & { tenants: Tenant[] }>,
34
47
 
35
48
  /**
36
49
  * Duplicates a Tenant object.
@@ -39,18 +52,14 @@ export default (apiUrl: string) => ({
39
52
  * @param {TenantBase} tenant
40
53
  * @returns The specifications of the new Tenant object
41
54
  */
42
- createTenant: (
43
- authToken: string,
44
- name: string,
45
- tenant: Partial<TenantBase>
46
- ) =>
55
+ createTenant: (authToken: string, name: string, tenant: Partial<Tenant>) =>
47
56
  apiFetcher(`/Tenant/${authToken}/${name}`, {
48
57
  apiUrl,
49
58
  method: 'POST',
50
59
  body: tenant,
51
60
  }) as Promise<
52
61
  ResponseSpec & {
53
- tenant: TenantBase;
62
+ tenant: Tenant;
54
63
  }
55
64
  >,
56
65
 
@@ -58,17 +67,17 @@ export default (apiUrl: string) => ({
58
67
  * Updates the details of a Tenant object.
59
68
  * @param {string} authToken - The login token
60
69
  * @param {string} name - The name of the Tenant to update
61
- * @param {TenantBase} tenant
70
+ * @param {Tenant} tenant
62
71
  * @returns The new specifications of the Tenant object
63
72
  */
64
- patchTenant: (authToken: string, name: string, tenant: Partial<TenantBase>) =>
73
+ patchTenant: (authToken: string, name: string, tenant: Partial<Tenant>) =>
65
74
  apiFetcher(`/Tenant/${authToken}/${name}`, {
66
75
  apiUrl,
67
76
  method: 'PATCH',
68
77
  body: tenant,
69
78
  }) as Promise<
70
79
  ResponseSpec & {
71
- tenant: TenantBase;
80
+ tenant: Tenant;
72
81
  }
73
82
  >,
74
83
  });
package/src/types.ts CHANGED
@@ -480,24 +480,15 @@ export interface UploadFile<T = any> {
480
480
  preview?: string;
481
481
  }
482
482
 
483
- export declare type TenantConfig = {
484
- name: string;
485
- showNewUser: boolean;
486
- requirePosition: boolean;
487
- showVirtualSpaces?: boolean;
488
- };
489
-
490
- export declare type TenantBase = {
483
+ export declare type Tenant = {
491
484
  tenantID?: string;
492
485
  name?: string;
486
+ aliases?: string[];
493
487
  description?: string;
494
488
  logoURL?: string;
495
489
  adminEmail?: string;
496
- /**
497
- * Additional Tenant names.
498
- * Usually host names, e.g. app.memorytwin.com.
499
- */
500
- aliases?: string[];
490
+ theme?: string;
491
+ feedbackURL?: string;
501
492
  adminCount?: number;
502
493
  userCount?: number;
503
494
  memoriCount?: number;
@@ -510,28 +501,22 @@ export declare type TenantBase = {
510
501
  maxFreeSessions?: number;
511
502
  maxFreeSessionsPerUser?: number;
512
503
  nonFreeSessionCost?: number;
513
- maxImportSize?: number;
514
- maxImportSizePerUser?: number;
515
504
  maxCompletions?: number;
516
505
  maxCompletionsPerUser?: number;
506
+ maxImportSize?: number;
507
+ maxImportSizePerUser?: number;
517
508
  paying?: boolean;
518
509
  enableUserMemoriCreation?: boolean;
519
510
  enableBoardOfExperts?: boolean;
520
511
  enableDCMIntegration?: boolean;
521
512
  enableBadges?: boolean;
522
- enableVirtualSpaces?: boolean;
523
513
  enableDeepThought?: boolean;
514
+ enableVirtualSpaces?: boolean;
524
515
  billingDelegation?: boolean;
525
516
  creationTimestamp?: string;
526
517
  lastChangeTimestamp?: string;
527
518
  };
528
519
 
529
- export declare type Tenant = TenantBase & {
530
- id: string;
531
- theme: string;
532
- config: TenantConfig;
533
- };
534
-
535
520
  export declare type LocalizationKeyContent = {
536
521
  key: string;
537
522
  value: string;
@@ -1874,13 +1859,13 @@ export declare type ConsumptionData = {
1874
1859
  export declare type MacroFunction = {
1875
1860
  name: string;
1876
1861
  descriptions: {
1877
- [key: string]: string;
1862
+ [key: string]: string;
1878
1863
  };
1879
1864
  macroParameters?: {
1880
- name: string;
1881
- descriptions: {
1882
- [key: string]: string;
1883
- };
1884
- obfuscated?: boolean;
1865
+ name: string;
1866
+ descriptions: {
1867
+ [key: string]: string;
1868
+ };
1869
+ obfuscated?: boolean;
1885
1870
  }[];
1886
1871
  };