@memori.ai/memori-api-client 0.1.0 → 0.2.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/README.md +20 -16
- package/dist/apiFetcher.d.ts +0 -7
- package/dist/backend/memori.d.ts +3 -1
- package/dist/backend.d.ts +6 -2
- package/dist/engine/contextVars.d.ts +32 -0
- package/dist/engine.d.ts +21 -19
- package/dist/index.d.ts +27 -21
- package/dist/memori-api-client.cjs.development.js +61 -166
- package/dist/memori-api-client.cjs.development.js.map +1 -1
- package/dist/memori-api-client.cjs.production.min.js +1 -1
- package/dist/memori-api-client.cjs.production.min.js.map +1 -1
- package/dist/memori-api-client.esm.js +62 -167
- package/dist/memori-api-client.esm.js.map +1 -1
- package/dist/speech.d.ts +3 -0
- package/package.json +1 -1
- package/src/apiFetcher.ts +1 -8
- package/src/backend/memori.ts +4 -1
- package/src/engine/contextVars.ts +54 -0
- package/src/engine.ts +3 -6
- package/src/speech.ts +3 -2
- package/dist/engine/memori.d.ts +0 -30
- package/dist/engine/webhooks.d.ts +0 -21
- package/src/engine/memori.ts +0 -51
- package/src/engine/webhooks.ts +0 -32
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npm install @memori.ai/memori-api-client
|
|
|
20
20
|
|
|
21
21
|
Every method has JSDoc annotations with usage and description and typings information.
|
|
22
22
|
|
|
23
|
-
See
|
|
23
|
+
See examples for [Node (TypeScript)](https://github.com/memori-ai/examples/blob/main/ts-sdk/index.ts) and [React](https://github.com/memori-ai/examples/blob/main/react-ts-with-api-client/src/App.tsx).
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
import memoriApiClient from '@memori.ai/memori-api-client';
|
|
@@ -52,8 +52,25 @@ memori.constants.allowedMediaTypes; // list of allowed media types in asset uplo
|
|
|
52
52
|
memori.constants.anonTag; // tag for anonymous users
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
### Asset
|
|
56
|
+
|
|
57
|
+
There is a helper method parsing media urls from the DB, handling different cases
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
const memori = memoriApiClient('https://backend.memori.ai');
|
|
61
|
+
|
|
62
|
+
memori.asset.getResourceUrl({
|
|
63
|
+
type: 'avatar',
|
|
64
|
+
resourceURI: '768b9654-e781-4c3c-81fa-ae1529d1bfbe.png',
|
|
65
|
+
mediaType: 'image/png',
|
|
66
|
+
sessionId: 'be2e4a44-890b-483b-a26a-f6e122f36e2b',
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
55
70
|
### TTS
|
|
56
71
|
|
|
72
|
+
> Experimental
|
|
73
|
+
|
|
57
74
|
Bundled with this client there is a TTS utility that can be used to synthesize text to speech.
|
|
58
75
|
|
|
59
76
|
```ts
|
|
@@ -79,6 +96,8 @@ speech.stopSpeaking();
|
|
|
79
96
|
|
|
80
97
|
### STT
|
|
81
98
|
|
|
99
|
+
> Experimental
|
|
100
|
+
|
|
82
101
|
There is also a speech recognition utility.
|
|
83
102
|
|
|
84
103
|
```ts
|
|
@@ -94,21 +113,6 @@ speech.isRecognizing();
|
|
|
94
113
|
speech.stopRecognizing();
|
|
95
114
|
```
|
|
96
115
|
|
|
97
|
-
### Asset
|
|
98
|
-
|
|
99
|
-
There is a helper method parsing media urls from the DB, handling different cases
|
|
100
|
-
|
|
101
|
-
```ts
|
|
102
|
-
const memori = memoriApiClient('https://backend.memori.ai');
|
|
103
|
-
|
|
104
|
-
memori.asset.getResourceUrl({
|
|
105
|
-
type: 'avatar',
|
|
106
|
-
resourceURI: '768b9654-e781-4c3c-81fa-ae1529d1bfbe.png',
|
|
107
|
-
mediaType: 'image/png',
|
|
108
|
-
sessionId: 'be2e4a44-890b-483b-a26a-f6e122f36e2b',
|
|
109
|
-
});
|
|
110
|
-
```
|
|
111
|
-
|
|
112
116
|
## Development
|
|
113
117
|
|
|
114
118
|
To run TSDX, use:
|
package/dist/apiFetcher.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export declare const fetcher: (path: string, opts: {
|
|
2
|
-
apiUrl: string;
|
|
3
|
-
method?: string;
|
|
4
|
-
body?: object;
|
|
5
|
-
headers?: object;
|
|
6
|
-
}) => Promise<any>;
|
|
7
|
-
export declare const devFetcher: (data: any) => Promise<any>;
|
|
8
1
|
export declare const apiFetcher: (path: string, opts: {
|
|
9
2
|
apiUrl: string;
|
|
10
3
|
method?: string;
|
package/dist/backend/memori.d.ts
CHANGED
|
@@ -71,7 +71,9 @@ declare const _default: (apiUrl: string) => {
|
|
|
71
71
|
* @param memori - The Memori object
|
|
72
72
|
* @returns The created Memori object
|
|
73
73
|
*/
|
|
74
|
-
updateMemori: (authToken: string, memori: Memori
|
|
74
|
+
updateMemori: (authToken: string, memori: Partial<Memori> & {
|
|
75
|
+
memoriID: string;
|
|
76
|
+
}) => Promise<ResponseSpec & {
|
|
75
77
|
memori: Memori;
|
|
76
78
|
}>;
|
|
77
79
|
/**
|
package/dist/backend.d.ts
CHANGED
|
@@ -103,7 +103,9 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
103
103
|
createMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec & {
|
|
104
104
|
memori: import("./types").Memori;
|
|
105
105
|
}>;
|
|
106
|
-
updateMemori: (authToken: string, memori: import("./types").Memori
|
|
106
|
+
updateMemori: (authToken: string, memori: Partial<import("./types").Memori> & {
|
|
107
|
+
memoriID: string;
|
|
108
|
+
}) => Promise<import("./types").ResponseSpec & {
|
|
107
109
|
memori: import("./types").Memori;
|
|
108
110
|
}>;
|
|
109
111
|
deleteMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec>;
|
|
@@ -165,7 +167,9 @@ declare const backendAPI: (apiUrl: string) => {
|
|
|
165
167
|
createMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec & {
|
|
166
168
|
memori: import("./types").Memori;
|
|
167
169
|
}>;
|
|
168
|
-
updateMemori: (authToken: string, memori: import("./types").Memori
|
|
170
|
+
updateMemori: (authToken: string, memori: Partial<import("./types").Memori> & {
|
|
171
|
+
memoriID: string;
|
|
172
|
+
}) => Promise<import("./types").ResponseSpec & {
|
|
169
173
|
memori: import("./types").Memori;
|
|
170
174
|
}>;
|
|
171
175
|
deleteMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ResponseSpec } from '../types';
|
|
2
|
+
declare const _default: (apiUrl: string) => {
|
|
3
|
+
/**
|
|
4
|
+
* Gets a list of currently known context variables.
|
|
5
|
+
* @param {string} sessionId The session ID
|
|
6
|
+
*/
|
|
7
|
+
getContextVars: (sessionId: string) => Promise<ResponseSpec & {
|
|
8
|
+
[variable: string]: string[];
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Gets a list of currently known context variable names.
|
|
12
|
+
* @param {string} sessionId The session ID
|
|
13
|
+
*/
|
|
14
|
+
getContextVarNames: (sessionId: string) => Promise<ResponseSpec & {
|
|
15
|
+
contextVarNames: string[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* /memori/v2/ContextVarValues/{strSessionID}/{contextVarName}
|
|
19
|
+
* @param {string} sessionId The session ID
|
|
20
|
+
* @param {string} contextVarName The name of the context variable
|
|
21
|
+
*/
|
|
22
|
+
getContextVarValues: (sessionId: string, contextVarName: string) => Promise<ResponseSpec & {
|
|
23
|
+
contextVarName: string;
|
|
24
|
+
contextVarValues: string[];
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
/****************************
|
|
28
|
+
* *
|
|
29
|
+
* ContextVars *
|
|
30
|
+
* *
|
|
31
|
+
****************************/
|
|
32
|
+
export default _default;
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
declare const _default: (apiUrl: string) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
3
|
+
[variable: string]: string[];
|
|
4
|
+
}>;
|
|
5
|
+
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
6
|
+
contextVarNames: string[];
|
|
7
|
+
}>;
|
|
8
|
+
getContextVarValues: (sessionId: string, contextVarName: string) => Promise<import("./types").ResponseSpec & {
|
|
9
|
+
contextVarName: string;
|
|
10
|
+
contextVarValues: string[];
|
|
11
|
+
}>;
|
|
12
|
+
contextVars: {
|
|
13
|
+
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
14
|
+
[variable: string]: string[];
|
|
15
|
+
}>;
|
|
16
|
+
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
17
|
+
contextVarNames: string[];
|
|
18
|
+
}>;
|
|
19
|
+
getContextVarValues: (sessionId: string, contextVarName: string) => Promise<import("./types").ResponseSpec & {
|
|
20
|
+
contextVarName: string;
|
|
21
|
+
contextVarValues: string[];
|
|
22
|
+
}>;
|
|
7
23
|
};
|
|
8
24
|
getUnansweredQuestions: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
9
25
|
unansweredQuestions: import("./types").UnansweredQuestion[];
|
|
@@ -139,20 +155,6 @@ declare const _default: (apiUrl: string) => {
|
|
|
139
155
|
}>;
|
|
140
156
|
getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
141
157
|
};
|
|
142
|
-
postMemori: (memori: Partial<Pick<import("./types").Memori, "name" | "password" | "recoveryTokens" | "newPassword" | "ownerUserID" | "ownerTenantName" | "memoriConfigurationID" | "description" | "engineMemoriID" | "isGiver" | "isReceiver" | "giverTag" | "giverPIN" | "privacyType" | "secretToken" | "minimumNumberOfRecoveryTokens" | "totalNumberOfRecoveryTokens" | "avatarURL" | "coverURL" | "needsPosition" | "voiceType" | "culture" | "publishedInTheMetaverse" | "metaverseEnvironment" | "properties" | "creationTimestamp" | "lastChangeTimestamp" | "integrations" | "sentInvitations" | "receivedInvitations" | "categories" | "ownerUserName">>) => Promise<import("./types").ResponseSpec>;
|
|
143
|
-
patchMemori: (memori: Partial<import("./types").Memori> & {
|
|
144
|
-
memoriID: string;
|
|
145
|
-
}) => Promise<import("./types").ResponseSpec>;
|
|
146
|
-
deleteMemori: (memoriId: string) => Promise<import("./types").ResponseSpec>;
|
|
147
|
-
postSearchMemori: () => Promise<import("./types").ResponseSpec>;
|
|
148
|
-
memori: {
|
|
149
|
-
postMemori: (memori: Partial<Pick<import("./types").Memori, "name" | "password" | "recoveryTokens" | "newPassword" | "ownerUserID" | "ownerTenantName" | "memoriConfigurationID" | "description" | "engineMemoriID" | "isGiver" | "isReceiver" | "giverTag" | "giverPIN" | "privacyType" | "secretToken" | "minimumNumberOfRecoveryTokens" | "totalNumberOfRecoveryTokens" | "avatarURL" | "coverURL" | "needsPosition" | "voiceType" | "culture" | "publishedInTheMetaverse" | "metaverseEnvironment" | "properties" | "creationTimestamp" | "lastChangeTimestamp" | "integrations" | "sentInvitations" | "receivedInvitations" | "categories" | "ownerUserName">>) => Promise<import("./types").ResponseSpec>;
|
|
150
|
-
patchMemori: (memori: Partial<import("./types").Memori> & {
|
|
151
|
-
memoriID: string;
|
|
152
|
-
}) => Promise<import("./types").ResponseSpec>;
|
|
153
|
-
deleteMemori: (memoriId: string) => Promise<import("./types").ResponseSpec>;
|
|
154
|
-
postSearchMemori: () => Promise<import("./types").ResponseSpec>;
|
|
155
|
-
};
|
|
156
158
|
getMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
157
159
|
deleteMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
158
160
|
getMedium: (sessionId: string, memoryId: string, mediumId: string) => Promise<import("./types").ResponseSpec>;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,11 +12,27 @@ declare const api: (hostname?: string | undefined) => {
|
|
|
12
12
|
asset: {
|
|
13
13
|
getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
16
|
+
[variable: string]: string[];
|
|
17
|
+
}>;
|
|
18
|
+
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
19
|
+
contextVarNames: string[];
|
|
20
|
+
}>;
|
|
21
|
+
getContextVarValues: (sessionId: string, contextVarName: string) => Promise<import("./types").ResponseSpec & {
|
|
22
|
+
contextVarName: string;
|
|
23
|
+
contextVarValues: string[];
|
|
24
|
+
}>;
|
|
25
|
+
contextVars: {
|
|
26
|
+
getContextVars: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
27
|
+
[variable: string]: string[];
|
|
28
|
+
}>;
|
|
29
|
+
getContextVarNames: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
30
|
+
contextVarNames: string[];
|
|
31
|
+
}>;
|
|
32
|
+
getContextVarValues: (sessionId: string, contextVarName: string) => Promise<import("./types").ResponseSpec & {
|
|
33
|
+
contextVarName: string;
|
|
34
|
+
contextVarValues: string[];
|
|
35
|
+
}>;
|
|
20
36
|
};
|
|
21
37
|
getUnansweredQuestions: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
22
38
|
unansweredQuestions: import("./types").UnansweredQuestion[];
|
|
@@ -152,20 +168,6 @@ declare const api: (hostname?: string | undefined) => {
|
|
|
152
168
|
}>;
|
|
153
169
|
getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
154
170
|
};
|
|
155
|
-
postMemori: (memori: Partial<Pick<import("./types").Memori, "creationTimestamp" | "lastChangeTimestamp" | "name" | "password" | "recoveryTokens" | "newPassword" | "ownerUserID" | "ownerTenantName" | "memoriConfigurationID" | "description" | "engineMemoriID" | "isGiver" | "isReceiver" | "giverTag" | "giverPIN" | "privacyType" | "secretToken" | "minimumNumberOfRecoveryTokens" | "totalNumberOfRecoveryTokens" | "avatarURL" | "coverURL" | "needsPosition" | "voiceType" | "culture" | "publishedInTheMetaverse" | "metaverseEnvironment" | "properties" | "integrations" | "sentInvitations" | "receivedInvitations" | "categories" | "ownerUserName">>) => Promise<import("./types").ResponseSpec>;
|
|
156
|
-
patchMemori: (memori: Partial<import("./types").Memori> & {
|
|
157
|
-
memoriID: string;
|
|
158
|
-
}) => Promise<import("./types").ResponseSpec>;
|
|
159
|
-
deleteMemori: (memoriId: string) => Promise<import("./types").ResponseSpec>;
|
|
160
|
-
postSearchMemori: () => Promise<import("./types").ResponseSpec>;
|
|
161
|
-
memori: {
|
|
162
|
-
postMemori: (memori: Partial<Pick<import("./types").Memori, "creationTimestamp" | "lastChangeTimestamp" | "name" | "password" | "recoveryTokens" | "newPassword" | "ownerUserID" | "ownerTenantName" | "memoriConfigurationID" | "description" | "engineMemoriID" | "isGiver" | "isReceiver" | "giverTag" | "giverPIN" | "privacyType" | "secretToken" | "minimumNumberOfRecoveryTokens" | "totalNumberOfRecoveryTokens" | "avatarURL" | "coverURL" | "needsPosition" | "voiceType" | "culture" | "publishedInTheMetaverse" | "metaverseEnvironment" | "properties" | "integrations" | "sentInvitations" | "receivedInvitations" | "categories" | "ownerUserName">>) => Promise<import("./types").ResponseSpec>;
|
|
163
|
-
patchMemori: (memori: Partial<import("./types").Memori> & {
|
|
164
|
-
memoriID: string;
|
|
165
|
-
}) => Promise<import("./types").ResponseSpec>;
|
|
166
|
-
deleteMemori: (memoriId: string) => Promise<import("./types").ResponseSpec>;
|
|
167
|
-
postSearchMemori: () => Promise<import("./types").ResponseSpec>;
|
|
168
|
-
};
|
|
169
171
|
getMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
170
172
|
deleteMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
171
173
|
getMedium: (sessionId: string, memoryId: string, mediumId: string) => Promise<import("./types").ResponseSpec>;
|
|
@@ -411,7 +413,9 @@ declare const api: (hostname?: string | undefined) => {
|
|
|
411
413
|
createMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec & {
|
|
412
414
|
memori: import("./types").Memori;
|
|
413
415
|
}>;
|
|
414
|
-
updateMemori: (authToken: string, memori: import("./types").Memori
|
|
416
|
+
updateMemori: (authToken: string, memori: Partial<import("./types").Memori> & {
|
|
417
|
+
memoriID: string;
|
|
418
|
+
}) => Promise<import("./types").ResponseSpec & {
|
|
415
419
|
memori: import("./types").Memori;
|
|
416
420
|
}>;
|
|
417
421
|
deleteMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec>;
|
|
@@ -473,7 +477,9 @@ declare const api: (hostname?: string | undefined) => {
|
|
|
473
477
|
createMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec & {
|
|
474
478
|
memori: import("./types").Memori;
|
|
475
479
|
}>;
|
|
476
|
-
updateMemori: (authToken: string, memori: import("./types").Memori
|
|
480
|
+
updateMemori: (authToken: string, memori: Partial<import("./types").Memori> & {
|
|
481
|
+
memoriID: string;
|
|
482
|
+
}) => Promise<import("./types").ResponseSpec & {
|
|
477
483
|
memori: import("./types").Memori;
|
|
478
484
|
}>;
|
|
479
485
|
deleteMemori: (authToken: string, memori: import("./types").Memori) => Promise<import("./types").ResponseSpec>;
|
|
@@ -409,7 +409,7 @@ var getApiUrl = function getApiUrl(hostname) {
|
|
|
409
409
|
return hostname ? new URL(hostname.startsWith('http') ? hostname : "https://" + hostname).origin.replace('http://', 'https://') : 'https://backend.memori.ai';
|
|
410
410
|
};
|
|
411
411
|
|
|
412
|
-
var
|
|
412
|
+
var apiFetcher = function apiFetcher(path, opts) {
|
|
413
413
|
return fetch$1("" + opts.apiUrl + path, _extends({}, opts, {
|
|
414
414
|
body: opts != null && opts.body ? JSON.stringify(opts.body) : undefined,
|
|
415
415
|
mode: 'cors',
|
|
@@ -422,10 +422,6 @@ var fetcher = function fetcher(path, opts) {
|
|
|
422
422
|
return res.json();
|
|
423
423
|
});
|
|
424
424
|
};
|
|
425
|
-
var devFetcher = function devFetcher(data) {
|
|
426
|
-
return Promise.resolve(data);
|
|
427
|
-
};
|
|
428
|
-
var apiFetcher = process.env.CI === 'true' || "development" === 'test' ? devFetcher : fetcher;
|
|
429
425
|
|
|
430
426
|
var memori = (function (apiUrl) {
|
|
431
427
|
return {
|
|
@@ -2187,137 +2183,6 @@ var media = (function (apiUrl) {
|
|
|
2187
2183
|
};
|
|
2188
2184
|
});
|
|
2189
2185
|
|
|
2190
|
-
/******************
|
|
2191
|
-
* *
|
|
2192
|
-
* Memori *
|
|
2193
|
-
* *
|
|
2194
|
-
******************/
|
|
2195
|
-
|
|
2196
|
-
var memori$1 = (function (apiUrl) {
|
|
2197
|
-
return {
|
|
2198
|
-
/**
|
|
2199
|
-
* Registration of a new Memori object.
|
|
2200
|
-
* @param {Memori} memori - The Memori object
|
|
2201
|
-
*/
|
|
2202
|
-
postMemori: function () {
|
|
2203
|
-
var _postMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(memori) {
|
|
2204
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2205
|
-
while (1) {
|
|
2206
|
-
switch (_context.prev = _context.next) {
|
|
2207
|
-
case 0:
|
|
2208
|
-
return _context.abrupt("return", apiFetcher("/Memori", {
|
|
2209
|
-
method: 'POST',
|
|
2210
|
-
apiUrl: apiUrl,
|
|
2211
|
-
body: memori
|
|
2212
|
-
}));
|
|
2213
|
-
|
|
2214
|
-
case 1:
|
|
2215
|
-
case "end":
|
|
2216
|
-
return _context.stop();
|
|
2217
|
-
}
|
|
2218
|
-
}
|
|
2219
|
-
}, _callee);
|
|
2220
|
-
}));
|
|
2221
|
-
|
|
2222
|
-
function postMemori(_x) {
|
|
2223
|
-
return _postMemori.apply(this, arguments);
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
return postMemori;
|
|
2227
|
-
}(),
|
|
2228
|
-
|
|
2229
|
-
/**
|
|
2230
|
-
* Updates an existing Memori object.
|
|
2231
|
-
* @param {Memori} memori - The Memori object
|
|
2232
|
-
*/
|
|
2233
|
-
patchMemori: function () {
|
|
2234
|
-
var _patchMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(memori) {
|
|
2235
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2236
|
-
while (1) {
|
|
2237
|
-
switch (_context2.prev = _context2.next) {
|
|
2238
|
-
case 0:
|
|
2239
|
-
return _context2.abrupt("return", apiFetcher("/Memori/" + memori.memoriID, {
|
|
2240
|
-
method: 'PATCH',
|
|
2241
|
-
apiUrl: apiUrl,
|
|
2242
|
-
body: memori
|
|
2243
|
-
}));
|
|
2244
|
-
|
|
2245
|
-
case 1:
|
|
2246
|
-
case "end":
|
|
2247
|
-
return _context2.stop();
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
}, _callee2);
|
|
2251
|
-
}));
|
|
2252
|
-
|
|
2253
|
-
function patchMemori(_x2) {
|
|
2254
|
-
return _patchMemori.apply(this, arguments);
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
return patchMemori;
|
|
2258
|
-
}(),
|
|
2259
|
-
|
|
2260
|
-
/**
|
|
2261
|
-
* Deletes an existing Memori object.
|
|
2262
|
-
* @param {string} memoriId The Memori object ID
|
|
2263
|
-
*/
|
|
2264
|
-
deleteMemori: function () {
|
|
2265
|
-
var _deleteMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(memoriId) {
|
|
2266
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2267
|
-
while (1) {
|
|
2268
|
-
switch (_context3.prev = _context3.next) {
|
|
2269
|
-
case 0:
|
|
2270
|
-
return _context3.abrupt("return", apiFetcher("/Memori/" + memoriId, {
|
|
2271
|
-
method: 'DELETE',
|
|
2272
|
-
apiUrl: apiUrl
|
|
2273
|
-
}));
|
|
2274
|
-
|
|
2275
|
-
case 1:
|
|
2276
|
-
case "end":
|
|
2277
|
-
return _context3.stop();
|
|
2278
|
-
}
|
|
2279
|
-
}
|
|
2280
|
-
}, _callee3);
|
|
2281
|
-
}));
|
|
2282
|
-
|
|
2283
|
-
function deleteMemori(_x3) {
|
|
2284
|
-
return _deleteMemori.apply(this, arguments);
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
return deleteMemori;
|
|
2288
|
-
}(),
|
|
2289
|
-
|
|
2290
|
-
/**
|
|
2291
|
-
* Lists Memori objects, with optional filtering.
|
|
2292
|
-
*/
|
|
2293
|
-
postSearchMemori: function () {
|
|
2294
|
-
var _postSearchMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
2295
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2296
|
-
while (1) {
|
|
2297
|
-
switch (_context4.prev = _context4.next) {
|
|
2298
|
-
case 0:
|
|
2299
|
-
return _context4.abrupt("return", apiFetcher("/SearchMemori", {
|
|
2300
|
-
method: 'GET',
|
|
2301
|
-
apiUrl: apiUrl
|
|
2302
|
-
}));
|
|
2303
|
-
|
|
2304
|
-
case 1:
|
|
2305
|
-
case "end":
|
|
2306
|
-
return _context4.stop();
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
}, _callee4);
|
|
2310
|
-
}));
|
|
2311
|
-
|
|
2312
|
-
function postSearchMemori() {
|
|
2313
|
-
return _postSearchMemori.apply(this, arguments);
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
return postSearchMemori;
|
|
2317
|
-
}()
|
|
2318
|
-
};
|
|
2319
|
-
});
|
|
2320
|
-
|
|
2321
2186
|
/********************
|
|
2322
2187
|
* *
|
|
2323
2188
|
* Memories *
|
|
@@ -3267,24 +3132,25 @@ var unansweredQuestions = (function (apiUrl) {
|
|
|
3267
3132
|
};
|
|
3268
3133
|
});
|
|
3269
3134
|
|
|
3270
|
-
|
|
3271
|
-
*
|
|
3272
|
-
*
|
|
3273
|
-
*
|
|
3274
|
-
|
|
3135
|
+
/****************************
|
|
3136
|
+
* *
|
|
3137
|
+
* ContextVars *
|
|
3138
|
+
* *
|
|
3139
|
+
****************************/
|
|
3275
3140
|
|
|
3276
|
-
var
|
|
3141
|
+
var contextVars = (function (apiUrl) {
|
|
3277
3142
|
return {
|
|
3278
3143
|
/**
|
|
3279
|
-
*
|
|
3144
|
+
* Gets a list of currently known context variables.
|
|
3145
|
+
* @param {string} sessionId The session ID
|
|
3280
3146
|
*/
|
|
3281
|
-
|
|
3282
|
-
var
|
|
3147
|
+
getContextVars: function () {
|
|
3148
|
+
var _getContextVars = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sessionId) {
|
|
3283
3149
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3284
3150
|
while (1) {
|
|
3285
3151
|
switch (_context.prev = _context.next) {
|
|
3286
3152
|
case 0:
|
|
3287
|
-
return _context.abrupt("return", apiFetcher("/
|
|
3153
|
+
return _context.abrupt("return", apiFetcher("/ContextVars/" + sessionId, {
|
|
3288
3154
|
method: 'GET',
|
|
3289
3155
|
apiUrl: apiUrl
|
|
3290
3156
|
}));
|
|
@@ -3297,27 +3163,24 @@ var webhooks = (function (apiUrl) {
|
|
|
3297
3163
|
}, _callee);
|
|
3298
3164
|
}));
|
|
3299
3165
|
|
|
3300
|
-
function
|
|
3301
|
-
return
|
|
3166
|
+
function getContextVars(_x) {
|
|
3167
|
+
return _getContextVars.apply(this, arguments);
|
|
3302
3168
|
}
|
|
3303
3169
|
|
|
3304
|
-
return
|
|
3170
|
+
return getContextVars;
|
|
3305
3171
|
}(),
|
|
3306
3172
|
|
|
3307
3173
|
/**
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
*/
|
|
3314
|
-
postTestIntent: function () {
|
|
3315
|
-
var _postTestIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3174
|
+
* Gets a list of currently known context variable names.
|
|
3175
|
+
* @param {string} sessionId The session ID
|
|
3176
|
+
*/
|
|
3177
|
+
getContextVarNames: function () {
|
|
3178
|
+
var _getContextVarNames = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(sessionId) {
|
|
3316
3179
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3317
3180
|
while (1) {
|
|
3318
3181
|
switch (_context2.prev = _context2.next) {
|
|
3319
3182
|
case 0:
|
|
3320
|
-
return _context2.abrupt("return", apiFetcher("/
|
|
3183
|
+
return _context2.abrupt("return", apiFetcher("/ContextVarNames/" + sessionId, {
|
|
3321
3184
|
method: 'GET',
|
|
3322
3185
|
apiUrl: apiUrl
|
|
3323
3186
|
}));
|
|
@@ -3330,11 +3193,42 @@ var webhooks = (function (apiUrl) {
|
|
|
3330
3193
|
}, _callee2);
|
|
3331
3194
|
}));
|
|
3332
3195
|
|
|
3333
|
-
function
|
|
3334
|
-
return
|
|
3196
|
+
function getContextVarNames(_x2) {
|
|
3197
|
+
return _getContextVarNames.apply(this, arguments);
|
|
3335
3198
|
}
|
|
3336
3199
|
|
|
3337
|
-
return
|
|
3200
|
+
return getContextVarNames;
|
|
3201
|
+
}(),
|
|
3202
|
+
|
|
3203
|
+
/**
|
|
3204
|
+
* /memori/v2/ContextVarValues/{strSessionID}/{contextVarName}
|
|
3205
|
+
* @param {string} sessionId The session ID
|
|
3206
|
+
* @param {string} contextVarName The name of the context variable
|
|
3207
|
+
*/
|
|
3208
|
+
getContextVarValues: function () {
|
|
3209
|
+
var _getContextVarValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sessionId, contextVarName) {
|
|
3210
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3211
|
+
while (1) {
|
|
3212
|
+
switch (_context3.prev = _context3.next) {
|
|
3213
|
+
case 0:
|
|
3214
|
+
return _context3.abrupt("return", apiFetcher("/ContextVarValues/" + sessionId + "/" + contextVarName, {
|
|
3215
|
+
method: 'GET',
|
|
3216
|
+
apiUrl: apiUrl
|
|
3217
|
+
}));
|
|
3218
|
+
|
|
3219
|
+
case 1:
|
|
3220
|
+
case "end":
|
|
3221
|
+
return _context3.stop();
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
}, _callee3);
|
|
3225
|
+
}));
|
|
3226
|
+
|
|
3227
|
+
function getContextVarValues(_x3, _x4) {
|
|
3228
|
+
return _getContextVarValues.apply(this, arguments);
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
return getContextVarValues;
|
|
3338
3232
|
}()
|
|
3339
3233
|
};
|
|
3340
3234
|
});
|
|
@@ -3353,8 +3247,6 @@ var engine = (function (apiUrl) {
|
|
|
3353
3247
|
}, localizationKeys(apiUrl), {
|
|
3354
3248
|
media: media(apiUrl)
|
|
3355
3249
|
}, media(apiUrl), {
|
|
3356
|
-
memori: memori$1(apiUrl)
|
|
3357
|
-
}, memori$1(apiUrl), {
|
|
3358
3250
|
memories: memories(apiUrl)
|
|
3359
3251
|
}, memories(apiUrl), {
|
|
3360
3252
|
nlp: nlp(apiUrl)
|
|
@@ -3371,8 +3263,8 @@ var engine = (function (apiUrl) {
|
|
|
3371
3263
|
}, stats(apiUrl), {
|
|
3372
3264
|
unansweredQuestions: unansweredQuestions(apiUrl)
|
|
3373
3265
|
}, unansweredQuestions(apiUrl), {
|
|
3374
|
-
|
|
3375
|
-
},
|
|
3266
|
+
contextVars: contextVars(apiUrl)
|
|
3267
|
+
}, contextVars(apiUrl));
|
|
3376
3268
|
});
|
|
3377
3269
|
|
|
3378
3270
|
var allowedMediaTypes = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'text/plain', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/pdf', 'video/mp4', 'video/avi', 'audio/mpeg3', 'audio/wav', 'audio/mpeg', 'video/mpeg', 'model/gltf-binary'];
|
|
@@ -3457,6 +3349,10 @@ var getCultureCodeByLanguage = function getCultureCodeByLanguage(lang) {
|
|
|
3457
3349
|
|
|
3458
3350
|
return voice;
|
|
3459
3351
|
};
|
|
3352
|
+
/**
|
|
3353
|
+
* EXPERIMENTAL
|
|
3354
|
+
*/
|
|
3355
|
+
|
|
3460
3356
|
|
|
3461
3357
|
var speech = function speech(AZURE_COGNITIVE_SERVICES_TTS_KEY, DEBUG) {
|
|
3462
3358
|
if (DEBUG === void 0) {
|
|
@@ -3464,7 +3360,6 @@ var speech = function speech(AZURE_COGNITIVE_SERVICES_TTS_KEY, DEBUG) {
|
|
|
3464
3360
|
}
|
|
3465
3361
|
|
|
3466
3362
|
return function (lang, voiceType) {
|
|
3467
|
-
speechSdk.Recognizer.enableTelemetry(false);
|
|
3468
3363
|
var speechConfig = speechSdk.SpeechConfig.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY, 'eastus');
|
|
3469
3364
|
var speechSynthesizer;
|
|
3470
3365
|
var audioDestination;
|