@memori.ai/memori-api-client 0.1.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/LICENSE +18 -0
- package/README.md +188 -0
- package/dist/apiFetcher.d.ts +13 -0
- package/dist/backend/asset.d.ts +44 -0
- package/dist/backend/integration.d.ts +55 -0
- package/dist/backend/invitation.d.ts +82 -0
- package/dist/backend/memori.d.ts +125 -0
- package/dist/backend/user.d.ts +109 -0
- package/dist/backend.d.ts +273 -0
- package/dist/constants.d.ts +2 -0
- package/dist/engine/correlationPairs.d.ts +20 -0
- package/dist/engine/dialog.d.ts +88 -0
- package/dist/engine/importExport.d.ts +34 -0
- package/dist/engine/intents.d.ts +65 -0
- package/dist/engine/localizationKeys.d.ts +50 -0
- package/dist/engine/media.d.ts +48 -0
- package/dist/engine/memori.d.ts +30 -0
- package/dist/engine/memories.d.ts +50 -0
- package/dist/engine/nlp.d.ts +25 -0
- package/dist/engine/people.d.ts +46 -0
- package/dist/engine/promptedQuestions.d.ts +37 -0
- package/dist/engine/search.d.ts +30 -0
- package/dist/engine/session.d.ts +28 -0
- package/dist/engine/stats.d.ts +25 -0
- package/dist/engine/unansweredQuestions.d.ts +22 -0
- package/dist/engine/webhooks.d.ts +21 -0
- package/dist/engine.d.ts +297 -0
- package/dist/helpers/asset.d.ts +20 -0
- package/dist/helpers/getApiUrl.d.ts +1 -0
- package/dist/index.d.ts +582 -0
- package/dist/index.js +8 -0
- package/dist/memori-api-client.cjs.development.js +3666 -0
- package/dist/memori-api-client.cjs.development.js.map +1 -0
- package/dist/memori-api-client.cjs.production.min.js +2 -0
- package/dist/memori-api-client.cjs.production.min.js.map +1 -0
- package/dist/memori-api-client.esm.js +3660 -0
- package/dist/memori-api-client.esm.js.map +1 -0
- package/dist/speech.d.ts +10 -0
- package/dist/types.d.ts +410 -0
- package/package.json +125 -0
- package/src/apiFetcher.ts +29 -0
- package/src/backend/asset.ts +86 -0
- package/src/backend/integration.ts +98 -0
- package/src/backend/invitation.ts +115 -0
- package/src/backend/memori.ts +223 -0
- package/src/backend/user.ts +186 -0
- package/src/backend.ts +20 -0
- package/src/constants.ts +21 -0
- package/src/engine/correlationPairs.ts +31 -0
- package/src/engine/dialog.ts +158 -0
- package/src/engine/importExport.ts +43 -0
- package/src/engine/intents.ts +116 -0
- package/src/engine/localizationKeys.ts +94 -0
- package/src/engine/media.ts +79 -0
- package/src/engine/memori.ts +51 -0
- package/src/engine/memories.ts +89 -0
- package/src/engine/nlp.ts +39 -0
- package/src/engine/people.ts +82 -0
- package/src/engine/promptedQuestions.ts +63 -0
- package/src/engine/search.ts +49 -0
- package/src/engine/session.ts +49 -0
- package/src/engine/stats.ts +44 -0
- package/src/engine/unansweredQuestions.ts +38 -0
- package/src/engine/webhooks.ts +32 -0
- package/src/engine.ts +51 -0
- package/src/helpers/asset.ts +52 -0
- package/src/helpers/getApiUrl.ts +6 -0
- package/src/index.ts +20 -0
- package/src/speech.ts +242 -0
- package/src/types.ts +440 -0
package/src/speech.ts
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import * as speechSdk from 'microsoft-cognitiveservices-speech-sdk';
|
|
2
|
+
|
|
3
|
+
const getTTSVoice = (lang: string, voiceType: 'MALE' | 'FEMALE'): string => {
|
|
4
|
+
let voice = '';
|
|
5
|
+
let voiceLang = lang.toUpperCase();
|
|
6
|
+
switch (voiceLang) {
|
|
7
|
+
case 'IT':
|
|
8
|
+
voice = `${
|
|
9
|
+
voiceType === 'MALE' ? 'it-IT-DiegoNeural' : 'it-IT-ElsaNeural'
|
|
10
|
+
}`;
|
|
11
|
+
break;
|
|
12
|
+
case 'DE':
|
|
13
|
+
voice = `${
|
|
14
|
+
voiceType === 'MALE' ? 'de-DE-ConradNeural' : 'de-DE-KatjaNeural'
|
|
15
|
+
}`;
|
|
16
|
+
break;
|
|
17
|
+
case 'EN':
|
|
18
|
+
voice = `${
|
|
19
|
+
voiceType === 'MALE' ? 'en-GB-RyanNeural' : 'en-GB-SoniaNeural'
|
|
20
|
+
}`;
|
|
21
|
+
break;
|
|
22
|
+
case 'ES':
|
|
23
|
+
voice = `${
|
|
24
|
+
voiceType === 'MALE' ? 'es-ES-AlvaroNeural' : 'es-ES-ElviraNeural'
|
|
25
|
+
}`;
|
|
26
|
+
break;
|
|
27
|
+
case 'FR':
|
|
28
|
+
voice = `${
|
|
29
|
+
voiceType === 'MALE' ? 'fr-FR-HenriNeural' : 'fr-FR-DeniseNeural'
|
|
30
|
+
}`;
|
|
31
|
+
break;
|
|
32
|
+
case 'PT':
|
|
33
|
+
voice = `${
|
|
34
|
+
voiceType === 'MALE' ? 'pt-PT-DuarteNeural' : 'pt-PT-RaquelNeural'
|
|
35
|
+
}`;
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
voice = `${
|
|
39
|
+
voiceType === 'MALE' ? 'it-IT-DiegoNeural' : 'it-IT-IsabellaNeural'
|
|
40
|
+
}`;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return voice;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const getCultureCodeByLanguage = (lang: string): string => {
|
|
47
|
+
let voice = '';
|
|
48
|
+
let voiceLang = lang.toUpperCase();
|
|
49
|
+
switch (voiceLang) {
|
|
50
|
+
case 'IT':
|
|
51
|
+
voice = 'it-IT';
|
|
52
|
+
break;
|
|
53
|
+
case 'DE':
|
|
54
|
+
voice = 'de-DE';
|
|
55
|
+
break;
|
|
56
|
+
case 'EN':
|
|
57
|
+
voice = 'en-US';
|
|
58
|
+
break;
|
|
59
|
+
case 'ES':
|
|
60
|
+
voice = 'es-ES';
|
|
61
|
+
break;
|
|
62
|
+
case 'FR':
|
|
63
|
+
voice = 'fr-FR';
|
|
64
|
+
break;
|
|
65
|
+
case 'PT':
|
|
66
|
+
voice = 'pt-PT';
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
voice = 'it-IT';
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
return voice;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const speech = (AZURE_COGNITIVE_SERVICES_TTS_KEY: string, DEBUG = false) => (
|
|
76
|
+
lang: string,
|
|
77
|
+
voiceType: 'FEMALE' | 'MALE'
|
|
78
|
+
) => {
|
|
79
|
+
speechSdk.Recognizer.enableTelemetry(false);
|
|
80
|
+
|
|
81
|
+
let speechConfig: speechSdk.SpeechConfig = speechSdk.SpeechConfig.fromSubscription(
|
|
82
|
+
AZURE_COGNITIVE_SERVICES_TTS_KEY,
|
|
83
|
+
'eastus'
|
|
84
|
+
);
|
|
85
|
+
let speechSynthesizer: speechSdk.SpeechSynthesizer | null;
|
|
86
|
+
let audioDestination: speechSdk.SpeakerAudioDestination;
|
|
87
|
+
|
|
88
|
+
audioDestination = new speechSdk.SpeakerAudioDestination();
|
|
89
|
+
let audioOutputConfig = speechSdk.AudioConfig.fromSpeakerOutput(
|
|
90
|
+
audioDestination
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
// https://docs.microsoft.com/it-it/azure/cognitive-services/speech-service/language-support#text-to-speech
|
|
94
|
+
speechConfig.speechSynthesisVoiceName = getTTSVoice(lang, voiceType);
|
|
95
|
+
|
|
96
|
+
let langCultureCode = getCultureCodeByLanguage(lang);
|
|
97
|
+
speechConfig.speechSynthesisLanguage = langCultureCode;
|
|
98
|
+
speechConfig.speechRecognitionLanguage = langCultureCode;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* speak
|
|
102
|
+
* @description Speaks the text using the speech synthesizer. (TTS)
|
|
103
|
+
* @param {string} text - The text to be synthesized.
|
|
104
|
+
* @param {func=} onAudioEnd - The callback to be invoked when the synthesized audio is finished.
|
|
105
|
+
*/
|
|
106
|
+
const speak = (
|
|
107
|
+
text: string,
|
|
108
|
+
onAudioEnd?: (sender: speechSdk.IPlayer) => void
|
|
109
|
+
) => {
|
|
110
|
+
stopSpeaking();
|
|
111
|
+
|
|
112
|
+
speechSynthesizer = new speechSdk.SpeechSynthesizer(
|
|
113
|
+
speechConfig,
|
|
114
|
+
audioOutputConfig
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
if (onAudioEnd) audioDestination.onAudioEnd = onAudioEnd;
|
|
118
|
+
|
|
119
|
+
speechSynthesizer.speakTextAsync(
|
|
120
|
+
text,
|
|
121
|
+
result => {
|
|
122
|
+
if (result) {
|
|
123
|
+
try {
|
|
124
|
+
if (DEBUG) console.log('speak result', result);
|
|
125
|
+
if (speechSynthesizer) {
|
|
126
|
+
speechSynthesizer.close();
|
|
127
|
+
speechSynthesizer = null;
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.error('speak error: ', e);
|
|
131
|
+
window.speechSynthesis.speak(new SpeechSynthesisUtterance(text));
|
|
132
|
+
}
|
|
133
|
+
} else if (DEBUG) {
|
|
134
|
+
console.log('speak no result', result);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
error => {
|
|
138
|
+
console.error('speak:', error);
|
|
139
|
+
window.speechSynthesis.speak(new SpeechSynthesisUtterance(text));
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* isSpeaking
|
|
146
|
+
* @description Returns true if the synthesizer is speaking.
|
|
147
|
+
* @returns {boolean}
|
|
148
|
+
*/
|
|
149
|
+
const isSpeaking = (): boolean => {
|
|
150
|
+
return !!speechSynthesizer;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* stopSpeaking
|
|
155
|
+
* @description Stops the speech synthesizer if it is synthesizing.
|
|
156
|
+
*/
|
|
157
|
+
const stopSpeaking = () => {
|
|
158
|
+
if (audioDestination) audioDestination.pause();
|
|
159
|
+
if (speechSynthesizer) {
|
|
160
|
+
speechSynthesizer.close();
|
|
161
|
+
speechSynthesizer = null;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const audioInputConfig = speechSdk.AudioConfig.fromDefaultMicrophoneInput();
|
|
166
|
+
let recognizer: speechSdk.SpeechRecognizer | null;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* recognize
|
|
170
|
+
* @description Starts the speech recognition.
|
|
171
|
+
* @param {func=} onRecognized - Callback method invoked when the speech is recognized with the text.
|
|
172
|
+
*/
|
|
173
|
+
const recognize = (onRecognized: (transcript: string) => void) => {
|
|
174
|
+
recognizer = new speechSdk.SpeechRecognizer(speechConfig, audioInputConfig);
|
|
175
|
+
|
|
176
|
+
recognizer.recognizing = (_s, e) => {
|
|
177
|
+
if (DEBUG) console.log(`RECOGNIZING: Text=${e.result.text}`);
|
|
178
|
+
};
|
|
179
|
+
recognizer.recognized = (_s, e) => {
|
|
180
|
+
if (e.result.reason === speechSdk.ResultReason.RecognizedSpeech) {
|
|
181
|
+
if (DEBUG) console.log(`RECOGNIZED: Text=${e.result.text}`);
|
|
182
|
+
onRecognized(e.result.text ?? '');
|
|
183
|
+
} else if (e.result.reason === speechSdk.ResultReason.NoMatch && DEBUG) {
|
|
184
|
+
console.log('NOMATCH: Speech could not be recognized.');
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
recognizer.canceled = (_s, e) => {
|
|
188
|
+
if (DEBUG) console.log(`CANCELED: Reason=${e.reason}`);
|
|
189
|
+
|
|
190
|
+
if (e.reason === speechSdk.CancellationReason.Error && DEBUG) {
|
|
191
|
+
console.log(`"CANCELED: ErrorCode=${e.errorCode}`);
|
|
192
|
+
console.log(`"CANCELED: ErrorDetails=${e.errorDetails}`);
|
|
193
|
+
console.log(
|
|
194
|
+
'CANCELED: Did you set the speech resource key and region values?'
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
stopRecognizing();
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
recognizer.sessionStopped = (_s, _e) => {
|
|
202
|
+
if (DEBUG) console.log('\n Session stopped event.');
|
|
203
|
+
if (recognizer) recognizer.stopContinuousRecognitionAsync();
|
|
204
|
+
};
|
|
205
|
+
recognizer.startContinuousRecognitionAsync();
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* isRecognizing
|
|
210
|
+
* @description Returns true if the recognizer is recognizing.
|
|
211
|
+
* @returns {boolean}
|
|
212
|
+
*/
|
|
213
|
+
const isRecognizing = (): boolean => {
|
|
214
|
+
return !!recognizer;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* stopRecognizing
|
|
219
|
+
* @description Stops the speech recognizer if it is recognizing.
|
|
220
|
+
* @param {func=} onStop - (optional) The callback to be invoked when the speech recognition is stopped.
|
|
221
|
+
*/
|
|
222
|
+
const stopRecognizing = (onStop?: () => void) => {
|
|
223
|
+
if (recognizer) {
|
|
224
|
+
recognizer.stopContinuousRecognitionAsync();
|
|
225
|
+
recognizer.close();
|
|
226
|
+
recognizer = null;
|
|
227
|
+
|
|
228
|
+
if (onStop) onStop();
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
return {
|
|
233
|
+
speak,
|
|
234
|
+
isSpeaking,
|
|
235
|
+
stopSpeaking,
|
|
236
|
+
recognize,
|
|
237
|
+
isRecognizing,
|
|
238
|
+
stopRecognizing,
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export default speech;
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
export declare type Error = {
|
|
2
|
+
code: number;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export declare type ResponseSpec = {
|
|
7
|
+
requestID: string;
|
|
8
|
+
requestDateTime: string;
|
|
9
|
+
resultCode: number;
|
|
10
|
+
resultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare type MemoriConfig = {
|
|
14
|
+
memoriConfigID: string;
|
|
15
|
+
useCase: string;
|
|
16
|
+
culture: string;
|
|
17
|
+
descriptions?: { [lang: string]: string };
|
|
18
|
+
dialogExamples?: { [lang: string]: string };
|
|
19
|
+
logoURL?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export declare type Memori = {
|
|
23
|
+
memoriID: string;
|
|
24
|
+
name: string;
|
|
25
|
+
password?: string;
|
|
26
|
+
recoveryTokens?: string[];
|
|
27
|
+
newPassword?: string;
|
|
28
|
+
ownerUserID?: string;
|
|
29
|
+
ownerTenantName?: string;
|
|
30
|
+
memoriConfigurationID: string;
|
|
31
|
+
description: string;
|
|
32
|
+
engineMemoriID?: string;
|
|
33
|
+
isGiver?: boolean;
|
|
34
|
+
isReceiver?: boolean;
|
|
35
|
+
giverTag?: string;
|
|
36
|
+
giverPIN?: string;
|
|
37
|
+
privacyType: 'PUBLIC' | 'PRIVATE' | 'SECRET';
|
|
38
|
+
secretToken?: string;
|
|
39
|
+
minimumNumberOfRecoveryTokens?: number;
|
|
40
|
+
totalNumberOfRecoveryTokens?: number;
|
|
41
|
+
avatarURL?: string;
|
|
42
|
+
coverURL?: string;
|
|
43
|
+
needsPosition?: boolean;
|
|
44
|
+
voiceType: string;
|
|
45
|
+
culture?: string;
|
|
46
|
+
publishedInTheMetaverse?: boolean;
|
|
47
|
+
metaverseEnvironment?: string;
|
|
48
|
+
properties?: { [key: string]: string };
|
|
49
|
+
creationTimestamp?: string;
|
|
50
|
+
lastChangeTimestamp?: string;
|
|
51
|
+
integrations?: Integration[];
|
|
52
|
+
sentInvitations?: Invitation[];
|
|
53
|
+
receivedInvitations?: Invitation[];
|
|
54
|
+
categories?: string[];
|
|
55
|
+
ownerUserName?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export declare type Venue = {
|
|
59
|
+
placeName: string;
|
|
60
|
+
latitude: number;
|
|
61
|
+
longitude: number;
|
|
62
|
+
uncertainty?: number;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export declare type User = {
|
|
66
|
+
tenant?: string;
|
|
67
|
+
userID?: string;
|
|
68
|
+
userName?: string;
|
|
69
|
+
password?: string;
|
|
70
|
+
newPassword?: string;
|
|
71
|
+
eMail?: string;
|
|
72
|
+
admin?: boolean;
|
|
73
|
+
superAdmin?: boolean;
|
|
74
|
+
verificationCode?: string;
|
|
75
|
+
flowID?: string;
|
|
76
|
+
newsletterSubscribed?: boolean;
|
|
77
|
+
maxMemori?: number;
|
|
78
|
+
canCreateMemori?: boolean;
|
|
79
|
+
canAccessAPI?: boolean;
|
|
80
|
+
canEditIntegrations?: boolean;
|
|
81
|
+
canEditDynamicIntents?: boolean;
|
|
82
|
+
canEditMemoriChaining?: boolean;
|
|
83
|
+
maxFreeSessions?: number;
|
|
84
|
+
creationTimestamp?: string;
|
|
85
|
+
lastChangeTimestamp?: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export declare type IntegrationResource = {
|
|
89
|
+
name: string;
|
|
90
|
+
url: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export declare type IntegrationType = 'GOOGLE' | 'ALEXA' | 'LANDING_EXPERIENCE';
|
|
94
|
+
|
|
95
|
+
export declare type Integration = {
|
|
96
|
+
integrationID?: string;
|
|
97
|
+
memoriID?: string;
|
|
98
|
+
type: IntegrationType;
|
|
99
|
+
state?:
|
|
100
|
+
| 'NEW'
|
|
101
|
+
| 'PROCESSING'
|
|
102
|
+
| 'DONE'
|
|
103
|
+
| 'REMOVED'
|
|
104
|
+
| 'ERROR'
|
|
105
|
+
| 'WAITING_MANUAL_ACTION'
|
|
106
|
+
| 'DRAFT'
|
|
107
|
+
| 'NOT_VALIDATED'
|
|
108
|
+
| 'PUBLISHED';
|
|
109
|
+
publish?: boolean;
|
|
110
|
+
deviceEmails?: string[];
|
|
111
|
+
invocationText?: string;
|
|
112
|
+
jobID?: string;
|
|
113
|
+
customData?: string;
|
|
114
|
+
resources?: IntegrationResource[];
|
|
115
|
+
creationTimestamp?: string | Date;
|
|
116
|
+
lastChangeTimestamp?: string | Date;
|
|
117
|
+
dataResult?: { [key: string]: any };
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export declare type PublicIntegrationListItem = {
|
|
121
|
+
integration: Integration;
|
|
122
|
+
memori: Memori;
|
|
123
|
+
memoriUser: User;
|
|
124
|
+
remoteMemoriId?: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export interface RcFile extends File {
|
|
128
|
+
readonly lastModifiedDate: string | Date;
|
|
129
|
+
uid: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare type UploadFileStatus =
|
|
133
|
+
| 'error'
|
|
134
|
+
| 'success'
|
|
135
|
+
| 'done'
|
|
136
|
+
| 'uploading'
|
|
137
|
+
| 'removed';
|
|
138
|
+
|
|
139
|
+
export interface UploadFile<T = any> {
|
|
140
|
+
uid: string;
|
|
141
|
+
size?: number;
|
|
142
|
+
name: string;
|
|
143
|
+
fileName?: string;
|
|
144
|
+
lastModified?: number;
|
|
145
|
+
lastModifiedDate?: string | Date;
|
|
146
|
+
url?: string;
|
|
147
|
+
status?: UploadFileStatus;
|
|
148
|
+
percent?: number;
|
|
149
|
+
thumbUrl?: string;
|
|
150
|
+
originFileObj?: RcFile;
|
|
151
|
+
response?: T;
|
|
152
|
+
error?: any;
|
|
153
|
+
linkProps?: any;
|
|
154
|
+
type?: string;
|
|
155
|
+
xhr?: T;
|
|
156
|
+
preview?: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export declare type TenantConfig = {
|
|
160
|
+
name: string;
|
|
161
|
+
showNewUser: boolean;
|
|
162
|
+
requirePosition: boolean;
|
|
163
|
+
feedbackURL?: string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export declare type Tenant = {
|
|
167
|
+
id: string;
|
|
168
|
+
theme: string;
|
|
169
|
+
config: TenantConfig;
|
|
170
|
+
disableRegistration?: boolean;
|
|
171
|
+
maxMemoriPerAdmin?: number;
|
|
172
|
+
maxMemoriPerUser?: number;
|
|
173
|
+
maxTotalMemori?: number;
|
|
174
|
+
maxAdmins?: number;
|
|
175
|
+
maxUsers?: number;
|
|
176
|
+
usersCanCreateMemori?: boolean;
|
|
177
|
+
usersCanAccessAPI?: boolean;
|
|
178
|
+
usersCanEditIntegrations?: boolean;
|
|
179
|
+
usersCanEditDynamicIntents?: boolean;
|
|
180
|
+
usersCanEditMemoriChaining?: boolean;
|
|
181
|
+
maxFreeSessions?: number;
|
|
182
|
+
maxFreeSessionsPerUser?: number;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export declare type OpenSession = {
|
|
186
|
+
memoriID: string;
|
|
187
|
+
password?: string;
|
|
188
|
+
recoveryTokens?: string[];
|
|
189
|
+
tag?: string;
|
|
190
|
+
pin?: string;
|
|
191
|
+
initialContextVars?: { [key: string]: string };
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export declare type MemoriSession = {
|
|
195
|
+
sessionID: string;
|
|
196
|
+
currentState: DialogState;
|
|
197
|
+
stats?: Stats;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export declare type Medium = {
|
|
201
|
+
mediumID: string;
|
|
202
|
+
url?: string;
|
|
203
|
+
content?: string;
|
|
204
|
+
mimeType: string;
|
|
205
|
+
title?: string;
|
|
206
|
+
properties?: { [key: string]: string };
|
|
207
|
+
creationTimestamp?: string;
|
|
208
|
+
creationName?: string;
|
|
209
|
+
lastChangeTimestamp?: string;
|
|
210
|
+
lastChangeName?: string;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export declare type Stats = {
|
|
214
|
+
totalReceivers: number;
|
|
215
|
+
receiversWithMemories: number;
|
|
216
|
+
totalMemories: number;
|
|
217
|
+
publicMemories: number;
|
|
218
|
+
memoriesWithMedia: number;
|
|
219
|
+
totalQuestions: number;
|
|
220
|
+
publicQuestions: number;
|
|
221
|
+
questionsWithMoreThanOneAnswer: number;
|
|
222
|
+
totalStories: number;
|
|
223
|
+
publicStories: number;
|
|
224
|
+
storiesWithDate: number;
|
|
225
|
+
storiesWithPlace: number;
|
|
226
|
+
storiesWithDateAndPlace: number;
|
|
227
|
+
unansweredQuestions: number;
|
|
228
|
+
successfulCorrelations: number;
|
|
229
|
+
failedCorrelations: number;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export declare type GamificationLevel = {
|
|
233
|
+
points: number;
|
|
234
|
+
badge: string;
|
|
235
|
+
pointsForCurrentBadge: number;
|
|
236
|
+
nextBadge: {
|
|
237
|
+
points: number;
|
|
238
|
+
badge: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export declare type EventLog = {
|
|
243
|
+
eventLogID: string;
|
|
244
|
+
timestamp: string;
|
|
245
|
+
eventType: string;
|
|
246
|
+
memoriID: string;
|
|
247
|
+
userAgent?: string;
|
|
248
|
+
ipAddress?: string;
|
|
249
|
+
memoryID?: string;
|
|
250
|
+
intentID?: string;
|
|
251
|
+
enteredText?: string;
|
|
252
|
+
receiverTag?: string;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export declare type UserLog = {
|
|
256
|
+
timestamp: string;
|
|
257
|
+
count: number;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export declare type UsersLog = {
|
|
261
|
+
timestamp: string;
|
|
262
|
+
countUsers: number;
|
|
263
|
+
countRecurrentUsers: number;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export declare type TranslatedHint = {
|
|
267
|
+
text: string;
|
|
268
|
+
originalText: string;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export declare type DialogState = {
|
|
272
|
+
state: string;
|
|
273
|
+
stateName: string;
|
|
274
|
+
previousState: string;
|
|
275
|
+
confidence?: number;
|
|
276
|
+
emission?: string;
|
|
277
|
+
acceptsTimeout?: boolean;
|
|
278
|
+
acceptsAbort?: boolean;
|
|
279
|
+
acceptsMedia?: boolean;
|
|
280
|
+
acceptsDate?: boolean;
|
|
281
|
+
acceptsPlace?: boolean;
|
|
282
|
+
acceptsTag?: boolean;
|
|
283
|
+
hints?: string[];
|
|
284
|
+
translatedHints?: TranslatedHint[];
|
|
285
|
+
currentTag?: string;
|
|
286
|
+
currentDate?: string;
|
|
287
|
+
currentPlaceName?: string;
|
|
288
|
+
currentLatitude?: number;
|
|
289
|
+
currentLongitude?: number;
|
|
290
|
+
currentUncertaintyKm?: number;
|
|
291
|
+
giverID?: string;
|
|
292
|
+
currentReceiverID?: string;
|
|
293
|
+
currentMemoryID?: string;
|
|
294
|
+
media?: Medium[];
|
|
295
|
+
knownTags?: { [key: string]: string };
|
|
296
|
+
contextVars?: { [key: string]: string };
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
export declare type Person = {
|
|
300
|
+
personID?: string;
|
|
301
|
+
personType: 'Giver' | 'Receiver';
|
|
302
|
+
name?: string;
|
|
303
|
+
information?: string;
|
|
304
|
+
pin: string;
|
|
305
|
+
tag: string;
|
|
306
|
+
creationTimestamp?: string;
|
|
307
|
+
creationName?: string;
|
|
308
|
+
lastChangeTimestamp?: string;
|
|
309
|
+
lastChangeName?: string;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export declare type PersonificationProfile = {
|
|
313
|
+
tag?: string;
|
|
314
|
+
pin?: string;
|
|
315
|
+
name?: string;
|
|
316
|
+
sessionID: string;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export declare type Invitation = {
|
|
320
|
+
invitationID?: string;
|
|
321
|
+
memoriID: string;
|
|
322
|
+
isInviter?: boolean;
|
|
323
|
+
isInvitee?: boolean;
|
|
324
|
+
text?: string;
|
|
325
|
+
destinationEMail: string;
|
|
326
|
+
destinationName: string;
|
|
327
|
+
tag: string;
|
|
328
|
+
pin: string;
|
|
329
|
+
type: string;
|
|
330
|
+
state?: 'PENDING' | 'ACCEPTED' | 'REJECTED';
|
|
331
|
+
creationTimestamp?: string;
|
|
332
|
+
lastChangeTimestamp?: string;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export declare type LocalizationKeyContent = {
|
|
336
|
+
key: string;
|
|
337
|
+
value: string;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export declare type LocalizationKey = LocalizationKeyContent & {
|
|
341
|
+
creationTimestamp?: string;
|
|
342
|
+
creationName?: string;
|
|
343
|
+
lastChangeTimestamp?: string;
|
|
344
|
+
lastChangeName?: string;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
export declare type Asset = {
|
|
348
|
+
assetID: string;
|
|
349
|
+
assetURL: string;
|
|
350
|
+
mimeType: string;
|
|
351
|
+
memoriID: string;
|
|
352
|
+
originalFileName?: string;
|
|
353
|
+
title?: string;
|
|
354
|
+
engineMemoryID?: string;
|
|
355
|
+
creationTimestamp: string;
|
|
356
|
+
lastChangeTimestamp: string;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
export declare type SearchQuery = {
|
|
360
|
+
text: string;
|
|
361
|
+
searchType?: 'Literal' | 'Semantic';
|
|
362
|
+
date?: string;
|
|
363
|
+
dateUncertaintyDays?: number;
|
|
364
|
+
placeName?: string;
|
|
365
|
+
placeLatitude?: number;
|
|
366
|
+
placeLongitude?: number;
|
|
367
|
+
placeUncertaintyKm?: number;
|
|
368
|
+
tag?: string;
|
|
369
|
+
ignoreLastRead?: boolean;
|
|
370
|
+
excludedMemoryIDs?: string[];
|
|
371
|
+
numberOfResults?: number;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
export declare type SearchMatches = {
|
|
375
|
+
confidence: number;
|
|
376
|
+
confidenceLevel?: 'LOW' | 'MEDIUM' | 'HIGH';
|
|
377
|
+
memory: Memory;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export declare type Answer = {
|
|
381
|
+
text: string;
|
|
382
|
+
preformatted?: boolean;
|
|
383
|
+
creationTimestamp?: string;
|
|
384
|
+
creationName?: string;
|
|
385
|
+
lastChangeTimestamp?: string;
|
|
386
|
+
lastChangeName?: string;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export declare type Memory = {
|
|
390
|
+
memoryID: string;
|
|
391
|
+
memoryType: string;
|
|
392
|
+
lastRead?: string;
|
|
393
|
+
readOccurrencies?: number;
|
|
394
|
+
receiverID?: string;
|
|
395
|
+
receiverTag?: string;
|
|
396
|
+
receiverName?: string;
|
|
397
|
+
media?: Medium[];
|
|
398
|
+
text?: string;
|
|
399
|
+
textVariants?: string[];
|
|
400
|
+
answers?: Answer[];
|
|
401
|
+
title?: string;
|
|
402
|
+
titleVariants?: string[];
|
|
403
|
+
date?: string;
|
|
404
|
+
dateUncertaintyDays?: number;
|
|
405
|
+
placeName?: string;
|
|
406
|
+
placeLatitude?: number;
|
|
407
|
+
placeLongitude?: number;
|
|
408
|
+
placeUncertaintyKm?: number;
|
|
409
|
+
preformatted?: boolean;
|
|
410
|
+
conclusive?: boolean;
|
|
411
|
+
help?: boolean;
|
|
412
|
+
notPickable?: boolean;
|
|
413
|
+
contextVarsToSet?: { [variable: string]: string };
|
|
414
|
+
contextVarsToMatch?: { [variable: string]: string };
|
|
415
|
+
creationTimestamp?: string;
|
|
416
|
+
creationName?: string;
|
|
417
|
+
lastChangeTimestamp?: string;
|
|
418
|
+
lastChangeName?: string;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
export declare type UnansweredQuestion = {
|
|
422
|
+
unansweredQuestionID?: string;
|
|
423
|
+
text: string;
|
|
424
|
+
occurrencies: number;
|
|
425
|
+
receiverID?: string;
|
|
426
|
+
receiverTag?: string;
|
|
427
|
+
receiverName?: string;
|
|
428
|
+
creationTimestamp?: string;
|
|
429
|
+
creationName?: string;
|
|
430
|
+
lastChangeTimestamp?: string;
|
|
431
|
+
lastChangeName?: string;
|
|
432
|
+
candidateAnswers?: SearchMatches[];
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
export declare type Message = {
|
|
436
|
+
text: string;
|
|
437
|
+
fromUser?: boolean;
|
|
438
|
+
media?: Medium[];
|
|
439
|
+
initial?: boolean;
|
|
440
|
+
};
|