@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
|
@@ -403,7 +403,7 @@ var getApiUrl = function getApiUrl(hostname) {
|
|
|
403
403
|
return hostname ? new URL(hostname.startsWith('http') ? hostname : "https://" + hostname).origin.replace('http://', 'https://') : 'https://backend.memori.ai';
|
|
404
404
|
};
|
|
405
405
|
|
|
406
|
-
var
|
|
406
|
+
var apiFetcher = function apiFetcher(path, opts) {
|
|
407
407
|
return fetch$1("" + opts.apiUrl + path, _extends({}, opts, {
|
|
408
408
|
body: opts != null && opts.body ? JSON.stringify(opts.body) : undefined,
|
|
409
409
|
mode: 'cors',
|
|
@@ -416,10 +416,6 @@ var fetcher = function fetcher(path, opts) {
|
|
|
416
416
|
return res.json();
|
|
417
417
|
});
|
|
418
418
|
};
|
|
419
|
-
var devFetcher = function devFetcher(data) {
|
|
420
|
-
return Promise.resolve(data);
|
|
421
|
-
};
|
|
422
|
-
var apiFetcher = process.env.CI === 'true' || process.env.NODE_ENV === 'test' ? devFetcher : fetcher;
|
|
423
419
|
|
|
424
420
|
var memori = (function (apiUrl) {
|
|
425
421
|
return {
|
|
@@ -2181,137 +2177,6 @@ var media = (function (apiUrl) {
|
|
|
2181
2177
|
};
|
|
2182
2178
|
});
|
|
2183
2179
|
|
|
2184
|
-
/******************
|
|
2185
|
-
* *
|
|
2186
|
-
* Memori *
|
|
2187
|
-
* *
|
|
2188
|
-
******************/
|
|
2189
|
-
|
|
2190
|
-
var memori$1 = (function (apiUrl) {
|
|
2191
|
-
return {
|
|
2192
|
-
/**
|
|
2193
|
-
* Registration of a new Memori object.
|
|
2194
|
-
* @param {Memori} memori - The Memori object
|
|
2195
|
-
*/
|
|
2196
|
-
postMemori: function () {
|
|
2197
|
-
var _postMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(memori) {
|
|
2198
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2199
|
-
while (1) {
|
|
2200
|
-
switch (_context.prev = _context.next) {
|
|
2201
|
-
case 0:
|
|
2202
|
-
return _context.abrupt("return", apiFetcher("/Memori", {
|
|
2203
|
-
method: 'POST',
|
|
2204
|
-
apiUrl: apiUrl,
|
|
2205
|
-
body: memori
|
|
2206
|
-
}));
|
|
2207
|
-
|
|
2208
|
-
case 1:
|
|
2209
|
-
case "end":
|
|
2210
|
-
return _context.stop();
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2213
|
-
}, _callee);
|
|
2214
|
-
}));
|
|
2215
|
-
|
|
2216
|
-
function postMemori(_x) {
|
|
2217
|
-
return _postMemori.apply(this, arguments);
|
|
2218
|
-
}
|
|
2219
|
-
|
|
2220
|
-
return postMemori;
|
|
2221
|
-
}(),
|
|
2222
|
-
|
|
2223
|
-
/**
|
|
2224
|
-
* Updates an existing Memori object.
|
|
2225
|
-
* @param {Memori} memori - The Memori object
|
|
2226
|
-
*/
|
|
2227
|
-
patchMemori: function () {
|
|
2228
|
-
var _patchMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(memori) {
|
|
2229
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2230
|
-
while (1) {
|
|
2231
|
-
switch (_context2.prev = _context2.next) {
|
|
2232
|
-
case 0:
|
|
2233
|
-
return _context2.abrupt("return", apiFetcher("/Memori/" + memori.memoriID, {
|
|
2234
|
-
method: 'PATCH',
|
|
2235
|
-
apiUrl: apiUrl,
|
|
2236
|
-
body: memori
|
|
2237
|
-
}));
|
|
2238
|
-
|
|
2239
|
-
case 1:
|
|
2240
|
-
case "end":
|
|
2241
|
-
return _context2.stop();
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
}, _callee2);
|
|
2245
|
-
}));
|
|
2246
|
-
|
|
2247
|
-
function patchMemori(_x2) {
|
|
2248
|
-
return _patchMemori.apply(this, arguments);
|
|
2249
|
-
}
|
|
2250
|
-
|
|
2251
|
-
return patchMemori;
|
|
2252
|
-
}(),
|
|
2253
|
-
|
|
2254
|
-
/**
|
|
2255
|
-
* Deletes an existing Memori object.
|
|
2256
|
-
* @param {string} memoriId The Memori object ID
|
|
2257
|
-
*/
|
|
2258
|
-
deleteMemori: function () {
|
|
2259
|
-
var _deleteMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(memoriId) {
|
|
2260
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2261
|
-
while (1) {
|
|
2262
|
-
switch (_context3.prev = _context3.next) {
|
|
2263
|
-
case 0:
|
|
2264
|
-
return _context3.abrupt("return", apiFetcher("/Memori/" + memoriId, {
|
|
2265
|
-
method: 'DELETE',
|
|
2266
|
-
apiUrl: apiUrl
|
|
2267
|
-
}));
|
|
2268
|
-
|
|
2269
|
-
case 1:
|
|
2270
|
-
case "end":
|
|
2271
|
-
return _context3.stop();
|
|
2272
|
-
}
|
|
2273
|
-
}
|
|
2274
|
-
}, _callee3);
|
|
2275
|
-
}));
|
|
2276
|
-
|
|
2277
|
-
function deleteMemori(_x3) {
|
|
2278
|
-
return _deleteMemori.apply(this, arguments);
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
return deleteMemori;
|
|
2282
|
-
}(),
|
|
2283
|
-
|
|
2284
|
-
/**
|
|
2285
|
-
* Lists Memori objects, with optional filtering.
|
|
2286
|
-
*/
|
|
2287
|
-
postSearchMemori: function () {
|
|
2288
|
-
var _postSearchMemori = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
2289
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2290
|
-
while (1) {
|
|
2291
|
-
switch (_context4.prev = _context4.next) {
|
|
2292
|
-
case 0:
|
|
2293
|
-
return _context4.abrupt("return", apiFetcher("/SearchMemori", {
|
|
2294
|
-
method: 'GET',
|
|
2295
|
-
apiUrl: apiUrl
|
|
2296
|
-
}));
|
|
2297
|
-
|
|
2298
|
-
case 1:
|
|
2299
|
-
case "end":
|
|
2300
|
-
return _context4.stop();
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
}, _callee4);
|
|
2304
|
-
}));
|
|
2305
|
-
|
|
2306
|
-
function postSearchMemori() {
|
|
2307
|
-
return _postSearchMemori.apply(this, arguments);
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
return postSearchMemori;
|
|
2311
|
-
}()
|
|
2312
|
-
};
|
|
2313
|
-
});
|
|
2314
|
-
|
|
2315
2180
|
/********************
|
|
2316
2181
|
* *
|
|
2317
2182
|
* Memories *
|
|
@@ -3261,78 +3126,6 @@ var unansweredQuestions = (function (apiUrl) {
|
|
|
3261
3126
|
};
|
|
3262
3127
|
});
|
|
3263
3128
|
|
|
3264
|
-
/********************
|
|
3265
|
-
* *
|
|
3266
|
-
* WebHooks *
|
|
3267
|
-
* *
|
|
3268
|
-
********************/
|
|
3269
|
-
|
|
3270
|
-
var webhooks = (function (apiUrl) {
|
|
3271
|
-
return {
|
|
3272
|
-
/**
|
|
3273
|
-
* 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>
|
|
3274
|
-
*/
|
|
3275
|
-
postTestSlot: function () {
|
|
3276
|
-
var _postTestSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3277
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3278
|
-
while (1) {
|
|
3279
|
-
switch (_context.prev = _context.next) {
|
|
3280
|
-
case 0:
|
|
3281
|
-
return _context.abrupt("return", apiFetcher("/TestSlot", {
|
|
3282
|
-
method: 'GET',
|
|
3283
|
-
apiUrl: apiUrl
|
|
3284
|
-
}));
|
|
3285
|
-
|
|
3286
|
-
case 1:
|
|
3287
|
-
case "end":
|
|
3288
|
-
return _context.stop();
|
|
3289
|
-
}
|
|
3290
|
-
}
|
|
3291
|
-
}, _callee);
|
|
3292
|
-
}));
|
|
3293
|
-
|
|
3294
|
-
function postTestSlot() {
|
|
3295
|
-
return _postTestSlot.apply(this, arguments);
|
|
3296
|
-
}
|
|
3297
|
-
|
|
3298
|
-
return postTestSlot;
|
|
3299
|
-
}(),
|
|
3300
|
-
|
|
3301
|
-
/**
|
|
3302
|
-
* 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,
|
|
3303
|
-
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
|
|
3304
|
-
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
|
|
3305
|
-
each time the intent is called.</li><li><code>FIBONACCI</code>: returns the next element of the Fibonacci series, using
|
|
3306
|
-
context variables to store the series progression.</li></ul>
|
|
3307
|
-
*/
|
|
3308
|
-
postTestIntent: function () {
|
|
3309
|
-
var _postTestIntent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3310
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3311
|
-
while (1) {
|
|
3312
|
-
switch (_context2.prev = _context2.next) {
|
|
3313
|
-
case 0:
|
|
3314
|
-
return _context2.abrupt("return", apiFetcher("/TestIntent", {
|
|
3315
|
-
method: 'GET',
|
|
3316
|
-
apiUrl: apiUrl
|
|
3317
|
-
}));
|
|
3318
|
-
|
|
3319
|
-
case 1:
|
|
3320
|
-
case "end":
|
|
3321
|
-
return _context2.stop();
|
|
3322
|
-
}
|
|
3323
|
-
}
|
|
3324
|
-
}, _callee2);
|
|
3325
|
-
}));
|
|
3326
|
-
|
|
3327
|
-
function postTestIntent() {
|
|
3328
|
-
return _postTestIntent.apply(this, arguments);
|
|
3329
|
-
}
|
|
3330
|
-
|
|
3331
|
-
return postTestIntent;
|
|
3332
|
-
}()
|
|
3333
|
-
};
|
|
3334
|
-
});
|
|
3335
|
-
|
|
3336
3129
|
var engine = (function (apiUrl) {
|
|
3337
3130
|
return _extends({
|
|
3338
3131
|
correlationPairs: correlationPairs(apiUrl)
|
|
@@ -3347,8 +3140,6 @@ var engine = (function (apiUrl) {
|
|
|
3347
3140
|
}, localizationKeys(apiUrl), {
|
|
3348
3141
|
media: media(apiUrl)
|
|
3349
3142
|
}, media(apiUrl), {
|
|
3350
|
-
memori: memori$1(apiUrl)
|
|
3351
|
-
}, memori$1(apiUrl), {
|
|
3352
3143
|
memories: memories(apiUrl)
|
|
3353
3144
|
}, memories(apiUrl), {
|
|
3354
3145
|
nlp: nlp(apiUrl)
|
|
@@ -3364,9 +3155,7 @@ var engine = (function (apiUrl) {
|
|
|
3364
3155
|
stats: stats(apiUrl)
|
|
3365
3156
|
}, stats(apiUrl), {
|
|
3366
3157
|
unansweredQuestions: unansweredQuestions(apiUrl)
|
|
3367
|
-
}, unansweredQuestions(apiUrl)
|
|
3368
|
-
webhooks: webhooks(apiUrl)
|
|
3369
|
-
}, webhooks(apiUrl));
|
|
3158
|
+
}, unansweredQuestions(apiUrl));
|
|
3370
3159
|
});
|
|
3371
3160
|
|
|
3372
3161
|
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'];
|