@memori.ai/memori-api-client 1.0.0 → 1.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/CHANGELOG.md +23 -0
- package/dist/backend/memori.d.ts +21 -1
- package/dist/backend/user.d.ts +2 -2
- package/dist/memori-api-client.cjs.development.js +30 -4
- 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 +30 -4
- package/dist/memori-api-client.esm.js.map +1 -1
- package/dist/types.d.ts +6 -2
- package/package.json +1 -1
- package/src/backend/memori.ts +51 -1
- package/src/backend/user.ts +2 -2
- package/src/helpers/getApiUrl.ts +2 -3
- package/src/types.ts +6 -2
|
@@ -399,7 +399,7 @@ function _extends() {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
var getApiUrl = function getApiUrl(hostname) {
|
|
402
|
-
return hostname ? new URL(hostname.startsWith('http') ? hostname : "https://" + hostname).origin
|
|
402
|
+
return hostname ? new URL(hostname.startsWith('http') ? hostname : "https://" + hostname).origin : 'https://backend.memori.ai';
|
|
403
403
|
};
|
|
404
404
|
|
|
405
405
|
var apiFetcher = function apiFetcher(path, opts) {
|
|
@@ -462,12 +462,38 @@ var memori = (function (apiUrl) {
|
|
|
462
462
|
});
|
|
463
463
|
},
|
|
464
464
|
|
|
465
|
+
/**
|
|
466
|
+
* Gets a list of Memori objects owned by the specified user.
|
|
467
|
+
* @param {string} tenantName - The name of the tenant
|
|
468
|
+
* @param {string} userID - The user name
|
|
469
|
+
* @param {string=} authToken - The login token
|
|
470
|
+
* @returns A list of Memori objects
|
|
471
|
+
*/
|
|
472
|
+
getUserByIDMemoriList: function getUserByIDMemoriList(tenantName, userID, authToken) {
|
|
473
|
+
return apiFetcher("/UserMemoriByID/" + tenantName + "/" + userID + (authToken ? "/" + authToken : ''), {
|
|
474
|
+
apiUrl: apiUrl
|
|
475
|
+
});
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Gets a list of Memori objects owned by the specified user.
|
|
480
|
+
* @param {string} tenantName - The name of the tenant
|
|
481
|
+
* @param {string} userName - The user name
|
|
482
|
+
* @param {string=} authToken - The login token
|
|
483
|
+
* @returns A list of Memori objects
|
|
484
|
+
*/
|
|
485
|
+
getUserMemoriList: function getUserMemoriList(tenantName, userName, authToken) {
|
|
486
|
+
return apiFetcher("/UserMemori/" + tenantName + "/" + userName + (authToken ? "/" + authToken : ''), {
|
|
487
|
+
apiUrl: apiUrl
|
|
488
|
+
});
|
|
489
|
+
},
|
|
490
|
+
|
|
465
491
|
/**
|
|
466
492
|
* Gets a list of Memori objects for the currently logged in User.
|
|
467
493
|
* @param authToken - The login token
|
|
468
494
|
* @returns A list of Memori objects
|
|
469
495
|
*/
|
|
470
|
-
|
|
496
|
+
getMemoriList: function getMemoriList(authToken) {
|
|
471
497
|
return apiFetcher("/Memori/" + authToken, {
|
|
472
498
|
apiUrl: apiUrl
|
|
473
499
|
});
|
|
@@ -636,7 +662,7 @@ var user = (function (apiUrl) {
|
|
|
636
662
|
* @param user - The user object
|
|
637
663
|
* @returns The created user object
|
|
638
664
|
*/
|
|
639
|
-
|
|
665
|
+
userSignUp: function userSignUp(user) {
|
|
640
666
|
return apiFetcher('/User', {
|
|
641
667
|
apiUrl: apiUrl,
|
|
642
668
|
body: user,
|
|
@@ -649,7 +675,7 @@ var user = (function (apiUrl) {
|
|
|
649
675
|
* @param user - The user object
|
|
650
676
|
* @returns The created user object
|
|
651
677
|
*/
|
|
652
|
-
|
|
678
|
+
userConfirmSignUp: function userConfirmSignUp(user) {
|
|
653
679
|
return apiFetcher('/UserConfirm', {
|
|
654
680
|
apiUrl: apiUrl,
|
|
655
681
|
body: user,
|