@memori.ai/memori-api-client
Advanced tools
Comparing version 4.1.3 to 4.2.0
## [4.2.0](https://github.com/memori-ai/memori-api-client/compare/v4.1.3...v4.2.0) (2024-05-03) | ||
### Features | ||
* add functions apis ([9a9a8ba](https://github.com/memori-ai/memori-api-client/commit/9a9a8bafbf8d75c2421e27ff539482204f43f265)) | ||
## [4.1.3](https://github.com/memori-ai/memori-api-client/compare/v4.1.2...v4.1.3) (2024-04-30) | ||
@@ -4,0 +11,0 @@ |
@@ -5,3 +5,3 @@ "use strict"; | ||
const index_1 = tslib_1.__importDefault(require("../index")); | ||
const client = (0, index_1.default)('https://backend-staging.memori.ai'); | ||
const client = (0, index_1.default)('https://backend.memori.ai'); | ||
describe('backend/analysis api', () => { | ||
@@ -8,0 +8,0 @@ it('works on analysis apis', async () => { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const index_1 = tslib_1.__importDefault(require("../index")); | ||
const client = (0, index_1.default)('https://backend-staging.memori.ai'); | ||
const client = (0, index_1.default)('https://backend.memori.ai'); | ||
describe('backend/process api', () => { | ||
@@ -8,0 +8,0 @@ it('works on process apis', async () => { |
declare const _default: (apiUrl: string) => { | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
functions: { | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
}; | ||
getTopics: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
@@ -3,0 +41,0 @@ count: number; |
@@ -23,2 +23,3 @@ "use strict"; | ||
const topics_1 = tslib_1.__importDefault(require("./engine/topics")); | ||
const functions_1 = tslib_1.__importDefault(require("./engine/functions")); | ||
exports.default = (apiUrl) => ({ | ||
@@ -63,3 +64,5 @@ correlationPairs: (0, correlationPairs_1.default)(apiUrl), | ||
...(0, topics_1.default)(apiUrl), | ||
functions: (0, functions_1.default)(apiUrl), | ||
...(0, functions_1.default)(apiUrl), | ||
}); | ||
//# sourceMappingURL=engine.js.map |
@@ -12,2 +12,40 @@ declare const api: (hostname?: string) => { | ||
}; | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
functions: { | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
}; | ||
getTopics: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
@@ -14,0 +52,0 @@ count: number; |
@@ -635,2 +635,24 @@ export declare type Error = { | ||
}; | ||
export type FunctionParameter = { | ||
parameterID?: string; | ||
name: string; | ||
description: string; | ||
parameterType: 'string' | 'number' | 'integer' | 'boolean'; | ||
possibleValues?: string[]; | ||
required?: boolean; | ||
}; | ||
export type Function = { | ||
functionID?: string; | ||
functionType: 'Internal' | 'WebHook'; | ||
name: string; | ||
description: string; | ||
parameters?: FunctionParameter[]; | ||
webHook: string; | ||
httpMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; | ||
httpHeaders?: { | ||
[key: string]: string; | ||
}; | ||
httpQueryStringTemplate?: string; | ||
httpBodyTemplate?: string; | ||
}; | ||
export type CustomWord = { | ||
@@ -637,0 +659,0 @@ customWordID: string; |
import memori from '../index'; | ||
const client = memori('https://backend-staging.memori.ai'); | ||
const client = memori('https://backend.memori.ai'); | ||
describe('backend/analysis api', () => { | ||
@@ -4,0 +4,0 @@ it('works on analysis apis', async () => { |
import memori from '../index'; | ||
const client = memori('https://backend-staging.memori.ai'); | ||
const client = memori('https://backend.memori.ai'); | ||
describe('backend/process api', () => { | ||
@@ -4,0 +4,0 @@ it('works on process apis', async () => { |
declare const _default: (apiUrl: string) => { | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
functions: { | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
}; | ||
getTopics: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
@@ -3,0 +41,0 @@ count: number; |
@@ -20,2 +20,3 @@ import correlationPairs from './engine/correlationPairs'; | ||
import topics from './engine/topics'; | ||
import functions from './engine/functions'; | ||
export default (apiUrl) => ({ | ||
@@ -60,3 +61,5 @@ correlationPairs: correlationPairs(apiUrl), | ||
...topics(apiUrl), | ||
functions: functions(apiUrl), | ||
...functions(apiUrl), | ||
}); | ||
//# sourceMappingURL=engine.js.map |
@@ -12,2 +12,40 @@ declare const api: (hostname?: string) => { | ||
}; | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
functions: { | ||
getAllFunctions: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunctionsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & { | ||
count: number; | ||
functions: import("./types").Function[]; | ||
}>; | ||
getFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec & { | ||
function: import("./types").Function; | ||
}>; | ||
patchFunction: (sessionId: string, func: Partial<import("./types").Function> & { | ||
functionID: string; | ||
}) => Promise<import("./types").ResponseSpec>; | ||
deleteFunction: (sessionId: string, functionID: string) => Promise<import("./types").ResponseSpec>; | ||
createFunction: (sessionId: string, func: import("./types").Function) => Promise<import("./types").ResponseSpec & { | ||
functionID: string; | ||
}>; | ||
}; | ||
getTopics: (sessionId: string) => Promise<import("./types").ResponseSpec & { | ||
@@ -14,0 +52,0 @@ count: number; |
@@ -635,2 +635,24 @@ export declare type Error = { | ||
}; | ||
export type FunctionParameter = { | ||
parameterID?: string; | ||
name: string; | ||
description: string; | ||
parameterType: 'string' | 'number' | 'integer' | 'boolean'; | ||
possibleValues?: string[]; | ||
required?: boolean; | ||
}; | ||
export type Function = { | ||
functionID?: string; | ||
functionType: 'Internal' | 'WebHook'; | ||
name: string; | ||
description: string; | ||
parameters?: FunctionParameter[]; | ||
webHook: string; | ||
httpMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; | ||
httpHeaders?: { | ||
[key: string]: string; | ||
}; | ||
httpQueryStringTemplate?: string; | ||
httpBodyTemplate?: string; | ||
}; | ||
export type CustomWord = { | ||
@@ -637,0 +659,0 @@ customWordID: string; |
{ | ||
"version": "4.1.3", | ||
"version": "4.2.0", | ||
"name": "@memori.ai/memori-api-client", | ||
@@ -4,0 +4,0 @@ "description": "React library to integrate a Memori in your app or website", |
import memori from '../index'; | ||
const client = memori('https://backend-staging.memori.ai'); | ||
const client = memori('https://backend.memori.ai'); | ||
@@ -5,0 +5,0 @@ describe('backend/analysis api', () => { |
import memori from '../index'; | ||
const client = memori('https://backend-staging.memori.ai'); | ||
const client = memori('https://backend.memori.ai'); | ||
@@ -5,0 +5,0 @@ describe('backend/process api', () => { |
@@ -20,2 +20,3 @@ import correlationPairs from './engine/correlationPairs'; | ||
import topics from './engine/topics'; | ||
import functions from './engine/functions'; | ||
@@ -61,2 +62,4 @@ export default (apiUrl: string) => ({ | ||
...topics(apiUrl), | ||
functions: functions(apiUrl), | ||
...functions(apiUrl), | ||
}); |
@@ -1040,2 +1040,88 @@ export declare type Error = { | ||
export type FunctionParameter = { | ||
/** | ||
* Function Parameter object ID. | ||
*/ | ||
parameterID?: string; | ||
/** | ||
* Name of the Function Parameter object. | ||
*/ | ||
name: string; | ||
/** | ||
* Description of the Function Parameter object. The description is provided to the generative AI to help it understand the purpose of the parameter. | ||
*/ | ||
description: string; | ||
/** | ||
* Parameter type, e.g. "string", "number", "integer", "boolean". | ||
* Currently supported types are: | ||
* - string: string value | ||
* - number: floating point value | ||
* - integer: integer value | ||
* - boolean: boolean value | ||
*/ | ||
parameterType: 'string' | 'number' | 'integer' | 'boolean'; | ||
/** | ||
* Optional list of possible values of the parameter. If empty or null, the parameter accepts any value of the specified type. | ||
*/ | ||
possibleValues?: string[]; | ||
/** | ||
* Whether the parameter is required or not. Default is not required. | ||
*/ | ||
required?: boolean; | ||
}; | ||
export type Function = { | ||
/** | ||
* Function object ID. | ||
*/ | ||
functionID?: string; | ||
/** | ||
* Function type, e.g. Internal or WebHook. | ||
* Internal functions are a limited subset implemented internally, | ||
* while WebHook intents perform an external HTTP call to the specified web hook, using the specified templates. | ||
*/ | ||
functionType: 'Internal' | 'WebHook'; | ||
/** | ||
* Name of the Function object. | ||
*/ | ||
name: string; | ||
/** | ||
* Description of the Function object. The description is provided to the generative AI to help it understand the purpose of the function. | ||
*/ | ||
description: string; | ||
/** | ||
* List of its Function Parameter objects. May be empty. | ||
*/ | ||
parameters?: FunctionParameter[]; | ||
/** | ||
* HTTP URL of the web hook to be called when the function is invoked, up to the path part. | ||
* The query string part is specified separately. | ||
* It may include the value of function parameters using the syntax {parameter}, where "parameter" is the parameter name. | ||
* E.g.: http://example.com/{param}/something. | ||
*/ | ||
webHook: string; | ||
/** | ||
* HTTP method to be used when calling the web hook, e.g. "GET", "POST" etc. | ||
*/ | ||
httpMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; | ||
/** | ||
* Optional set of HTTP headers to be passed to the web hook. | ||
*/ | ||
httpHeaders?: { [key: string]: string }; | ||
/** | ||
* Template of the HTTP query string to be passed to the web hook. | ||
* It may include the value of function parameters using the syntax {parameter}, where "parameter" is the parameter name. | ||
* E.g.: param1={param1}¶m2={param2}. | ||
*/ | ||
httpQueryStringTemplate?: string; | ||
/** | ||
* Template of the HTTP request body to be passed to the web hook. | ||
* It may be in any format (JSON, XML etc.), and may include the value of function parameters using the syntax {parameter}, | ||
* where "parameter" is the parameter name. | ||
* E.g.: { "param1": "{param1}", "param2": "{param2}" }, | ||
* or: <request><param1>{param1}</param1><param2>{param2}</param2></request>. | ||
*/ | ||
httpBodyTemplate?: string; | ||
}; | ||
export type CustomWord = { | ||
@@ -1042,0 +1128,0 @@ customWordID: string; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
799726
508
15676