@memori.ai/memori-api-client 0.1.0 → 0.1.1
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/dist/apiFetcher.d.ts +0 -7
- package/dist/engine.d.ts +0 -20
- package/dist/index.d.ts +0 -20
- package/dist/memori-api-client.cjs.development.js +2 -213
- 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 +2 -213
- package/dist/memori-api-client.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/apiFetcher.ts +1 -8
- package/src/engine.ts +0 -6
- 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/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/engine.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
declare const _default: (apiUrl: string) => {
|
|
2
|
-
postTestSlot: () => Promise<import("./types").ResponseSpec>;
|
|
3
|
-
postTestIntent: () => Promise<import("./types").ResponseSpec>;
|
|
4
|
-
webhooks: {
|
|
5
|
-
postTestSlot: () => Promise<import("./types").ResponseSpec>;
|
|
6
|
-
postTestIntent: () => Promise<import("./types").ResponseSpec>;
|
|
7
|
-
};
|
|
8
2
|
getUnansweredQuestions: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
9
3
|
unansweredQuestions: import("./types").UnansweredQuestion[];
|
|
10
4
|
}>;
|
|
@@ -139,20 +133,6 @@ declare const _default: (apiUrl: string) => {
|
|
|
139
133
|
}>;
|
|
140
134
|
getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
141
135
|
};
|
|
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
136
|
getMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
157
137
|
deleteMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
158
138
|
getMedium: (sessionId: string, memoryId: string, mediumId: string) => Promise<import("./types").ResponseSpec>;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,12 +12,6 @@ declare const api: (hostname?: string | undefined) => {
|
|
|
12
12
|
asset: {
|
|
13
13
|
getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
|
|
14
14
|
};
|
|
15
|
-
postTestSlot: () => Promise<import("./types").ResponseSpec>;
|
|
16
|
-
postTestIntent: () => Promise<import("./types").ResponseSpec>;
|
|
17
|
-
webhooks: {
|
|
18
|
-
postTestSlot: () => Promise<import("./types").ResponseSpec>;
|
|
19
|
-
postTestIntent: () => Promise<import("./types").ResponseSpec>;
|
|
20
|
-
};
|
|
21
15
|
getUnansweredQuestions: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
22
16
|
unansweredQuestions: import("./types").UnansweredQuestion[];
|
|
23
17
|
}>;
|
|
@@ -152,20 +146,6 @@ declare const api: (hostname?: string | undefined) => {
|
|
|
152
146
|
}>;
|
|
153
147
|
getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
154
148
|
};
|
|
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
149
|
getMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
170
150
|
deleteMedia: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
|
|
171
151
|
getMedium: (sessionId: string, memoryId: string, mediumId: string) => 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,78 +3132,6 @@ var unansweredQuestions = (function (apiUrl) {
|
|
|
3267
3132
|
};
|
|
3268
3133
|
});
|
|
3269
3134
|
|
|
3270
|
-
/********************
|
|
3271
|
-
* *
|
|
3272
|
-
* WebHooks *
|
|
3273
|
-
* *
|
|
3274
|
-
********************/
|
|
3275
|
-
|
|
3276
|
-
var webhooks = (function (apiUrl) {
|
|
3277
|
-
return {
|
|
3278
|
-
/**
|
|
3279
|
-
* Returns test slot values. Currently available test slots are:<ul><li><code>number</code>: integer numbers between 1 and 10</li><li><code>letter</code>: uppercase letters between A and Z</li><li><code>greek_letter</code>: capitalized Greek letters between Alpha and Omega</li></ul>
|
|
3280
|
-
*/
|
|
3281
|
-
postTestSlot: function () {
|
|
3282
|
-
var _postTestSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3283
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3284
|
-
while (1) {
|
|
3285
|
-
switch (_context.prev = _context.next) {
|
|
3286
|
-
case 0:
|
|
3287
|
-
return _context.abrupt("return", apiFetcher("/TestSlot", {
|
|
3288
|
-
method: 'GET',
|
|
3289
|
-
apiUrl: apiUrl
|
|
3290
|
-
}));
|
|
3291
|
-
|
|
3292
|
-
case 1:
|
|
3293
|
-
case "end":
|
|
3294
|
-
return _context.stop();
|
|
3295
|
-
}
|
|
3296
|
-
}
|
|
3297
|
-
}, _callee);
|
|
3298
|
-
}));
|
|
3299
|
-
|
|
3300
|
-
function postTestSlot() {
|
|
3301
|
-
return _postTestSlot.apply(this, arguments);
|
|
3302
|
-
}
|
|
3303
|
-
|
|
3304
|
-
return postTestSlot;
|
|
3305
|
-
}(),
|
|
3306
|
-
|
|
3307
|
-
/**
|
|
3308
|
-
* Returns test intent results. Currently available test intents are:<ul><li><code>ECHO</code>: emits the intent utterance as-is.</li><li><code>COMBINE_LETTER_AND_NUMBER</code>: requires a letter slot and a number slot,
|
|
3309
|
-
emits the content of the two slots in justaxposition, e.g. "A10".</li><li><code>DATE_RANGE</code>: requires a date slot, emits the date range indicated
|
|
3310
|
-
by the date slot in the format "yyyy/MM/dd - yyyy/MM/dd".</li><li><code>AUTOINCREMENT</code>: returns a progressive number that increments by 1
|
|
3311
|
-
each time the intent is called.</li><li><code>FIBONACCI</code>: returns the next element of the Fibonacci series, using
|
|
3312
|
-
context variables to store the series progression.</li></ul>
|
|
3313
|
-
*/
|
|
3314
|
-
postTestIntent: function () {
|
|
3315
|
-
var _postTestIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3316
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3317
|
-
while (1) {
|
|
3318
|
-
switch (_context2.prev = _context2.next) {
|
|
3319
|
-
case 0:
|
|
3320
|
-
return _context2.abrupt("return", apiFetcher("/TestIntent", {
|
|
3321
|
-
method: 'GET',
|
|
3322
|
-
apiUrl: apiUrl
|
|
3323
|
-
}));
|
|
3324
|
-
|
|
3325
|
-
case 1:
|
|
3326
|
-
case "end":
|
|
3327
|
-
return _context2.stop();
|
|
3328
|
-
}
|
|
3329
|
-
}
|
|
3330
|
-
}, _callee2);
|
|
3331
|
-
}));
|
|
3332
|
-
|
|
3333
|
-
function postTestIntent() {
|
|
3334
|
-
return _postTestIntent.apply(this, arguments);
|
|
3335
|
-
}
|
|
3336
|
-
|
|
3337
|
-
return postTestIntent;
|
|
3338
|
-
}()
|
|
3339
|
-
};
|
|
3340
|
-
});
|
|
3341
|
-
|
|
3342
3135
|
var engine = (function (apiUrl) {
|
|
3343
3136
|
return _extends({
|
|
3344
3137
|
correlationPairs: correlationPairs(apiUrl)
|
|
@@ -3353,8 +3146,6 @@ var engine = (function (apiUrl) {
|
|
|
3353
3146
|
}, localizationKeys(apiUrl), {
|
|
3354
3147
|
media: media(apiUrl)
|
|
3355
3148
|
}, media(apiUrl), {
|
|
3356
|
-
memori: memori$1(apiUrl)
|
|
3357
|
-
}, memori$1(apiUrl), {
|
|
3358
3149
|
memories: memories(apiUrl)
|
|
3359
3150
|
}, memories(apiUrl), {
|
|
3360
3151
|
nlp: nlp(apiUrl)
|
|
@@ -3370,9 +3161,7 @@ var engine = (function (apiUrl) {
|
|
|
3370
3161
|
stats: stats(apiUrl)
|
|
3371
3162
|
}, stats(apiUrl), {
|
|
3372
3163
|
unansweredQuestions: unansweredQuestions(apiUrl)
|
|
3373
|
-
}, unansweredQuestions(apiUrl)
|
|
3374
|
-
webhooks: webhooks(apiUrl)
|
|
3375
|
-
}, webhooks(apiUrl));
|
|
3164
|
+
}, unansweredQuestions(apiUrl));
|
|
3376
3165
|
});
|
|
3377
3166
|
|
|
3378
3167
|
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'];
|