@memori.ai/memori-api-client
Advanced tools
Comparing version 2.6.0 to 2.6.1
## [2.6.1](https://github.com/memori-ai/memori-api-client/compare/v2.6.0...v2.6.1) (2023-12-08) | ||
### Maintenance | ||
* add endpoints as constants ([de513a2](https://github.com/memori-ai/memori-api-client/commit/de513a2662c163f3ad0181c1406d7f9da0dd72b7)) | ||
## [2.6.0](https://github.com/memori-ai/memori-api-client/compare/v2.5.0...v2.6.0) (2023-12-08) | ||
@@ -4,0 +11,0 @@ |
@@ -1,4 +0,9 @@ | ||
import * as constants from './constants'; | ||
declare const api: (hostname?: string) => { | ||
constants: typeof constants; | ||
constants: { | ||
HOSTNAME: string; | ||
BACKEND_URL: string; | ||
ENGINE_URL: string; | ||
allowedMediaTypes: string[]; | ||
anonTag: "👤"; | ||
}; | ||
asset: { | ||
@@ -5,0 +10,0 @@ getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string; |
@@ -11,7 +11,14 @@ "use strict"; | ||
const apiUrl = (0, getApiUrl_1.getApiUrl)(hostname); | ||
const engineUrl = `${apiUrl}/memori/v2`; | ||
const backendUrl = `${apiUrl}/api/v2`; | ||
return { | ||
backend: (0, backend_1.default)(`${apiUrl}/api/v2`), | ||
...(0, engine_1.default)(`${apiUrl}/memori/v2`), | ||
constants, | ||
asset: (0, asset_1.default)(`${apiUrl}/api/v2`), | ||
backend: (0, backend_1.default)(backendUrl), | ||
...(0, engine_1.default)(engineUrl), | ||
constants: { | ||
...constants, | ||
HOSTNAME: apiUrl, | ||
BACKEND_URL: backendUrl, | ||
ENGINE_URL: engineUrl, | ||
}, | ||
asset: (0, asset_1.default)(backendUrl), | ||
}; | ||
@@ -18,0 +25,0 @@ }; |
@@ -1,4 +0,9 @@ | ||
import * as constants from './constants'; | ||
declare const api: (hostname?: string) => { | ||
constants: typeof constants; | ||
constants: { | ||
HOSTNAME: string; | ||
BACKEND_URL: string; | ||
ENGINE_URL: string; | ||
allowedMediaTypes: string[]; | ||
anonTag: "👤"; | ||
}; | ||
asset: { | ||
@@ -5,0 +10,0 @@ getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string; |
@@ -8,7 +8,14 @@ import { getApiUrl } from './helpers/getApiUrl'; | ||
const apiUrl = getApiUrl(hostname); | ||
const engineUrl = `${apiUrl}/memori/v2`; | ||
const backendUrl = `${apiUrl}/api/v2`; | ||
return { | ||
backend: backend(`${apiUrl}/api/v2`), | ||
...engine(`${apiUrl}/memori/v2`), | ||
constants, | ||
asset: asset(`${apiUrl}/api/v2`), | ||
backend: backend(backendUrl), | ||
...engine(engineUrl), | ||
constants: { | ||
...constants, | ||
HOSTNAME: apiUrl, | ||
BACKEND_URL: backendUrl, | ||
ENGINE_URL: engineUrl, | ||
}, | ||
asset: asset(backendUrl), | ||
}; | ||
@@ -15,0 +22,0 @@ }; |
{ | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"name": "@memori.ai/memori-api-client", | ||
@@ -4,0 +4,0 @@ "description": "React library to integrate a Memori in your app or website", |
@@ -58,2 +58,10 @@ # memori-api-client | ||
Endpoint passed during initialization: | ||
```ts | ||
memori.constants.HOSTNAME; // host name of the API, parameter of the constructor | ||
memori.constants.BACKEND_URL; | ||
memori.constants.ENGINE_URL; | ||
``` | ||
### Asset | ||
@@ -60,0 +68,0 @@ |
@@ -9,8 +9,15 @@ import { getApiUrl } from './helpers/getApiUrl'; | ||
const apiUrl = getApiUrl(hostname); | ||
const engineUrl = `${apiUrl}/memori/v2`; | ||
const backendUrl = `${apiUrl}/api/v2`; | ||
return { | ||
backend: backend(`${apiUrl}/api/v2`), | ||
...engine(`${apiUrl}/memori/v2`), | ||
constants, | ||
asset: asset(`${apiUrl}/api/v2`), | ||
backend: backend(backendUrl), | ||
...engine(engineUrl), | ||
constants: { | ||
...constants, | ||
HOSTNAME: apiUrl, | ||
BACKEND_URL: backendUrl, | ||
ENGINE_URL: engineUrl, | ||
}, | ||
asset: asset(backendUrl), | ||
}; | ||
@@ -17,0 +24,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
697689
13357
83