@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/dist/types.d.ts CHANGED
@@ -123,25 +123,29 @@ export declare type User = {
123
123
  admin?: boolean;
124
124
  superAdmin?: boolean;
125
125
  verificationCode?: string;
126
+ dontSendInvitationEmail?: boolean;
126
127
  flowID?: string;
127
128
  newsletterSubscribed?: boolean;
128
129
  maxMemori?: number;
129
- maxCompletions?: number;
130
+ numMemori?: number;
130
131
  canCreateMemori?: boolean;
131
132
  canAccessAPI?: boolean;
132
133
  canRunSnippets?: boolean;
133
134
  canEditIntegrations?: boolean;
134
135
  canEditDynamicIntents?: boolean;
135
136
  canEditMemoriChaining?: boolean;
137
+ monthSessions?: number;
138
+ monthValidSessions?: number;
136
139
  maxFreeSessions?: number;
137
140
  nonFreeSessionCost?: number;
141
+ monthCompletions?: number;
142
+ maxCompletions?: number;
138
143
  creationTimestamp?: string;
139
144
  lastChangeTimestamp?: string;
140
145
  referral?: string;
141
146
  couponCode?: string;
142
147
  paying?: boolean;
143
148
  notificationPrefs?: NotificationPrefs[];
144
- dontSendInvitationEmail?: boolean;
145
149
  };
146
150
  export declare type IntegrationResource = {
147
151
  name: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0",
2
+ "version": "1.1.0",
3
3
  "name": "@memori.ai/memori-api-client",
4
4
  "description": "React library to integrate a Memori in your app or website",
5
5
  "license": "Apache-2.0",
@@ -58,12 +58,62 @@ export default (apiUrl: string) => ({
58
58
  }
59
59
  >,
60
60
 
61
+ /**
62
+ * Gets a list of Memori objects owned by the specified user.
63
+ * @param {string} tenantName - The name of the tenant
64
+ * @param {string} userID - The user name
65
+ * @param {string=} authToken - The login token
66
+ * @returns A list of Memori objects
67
+ */
68
+ getUserByIDMemoriList: (
69
+ tenantName: string,
70
+ userID: string,
71
+ authToken?: string
72
+ ) =>
73
+ apiFetcher(
74
+ `/UserMemoriByID/${tenantName}/${userID}${
75
+ authToken ? `/${authToken}` : ''
76
+ }`,
77
+ {
78
+ apiUrl,
79
+ }
80
+ ) as Promise<
81
+ ResponseSpec & {
82
+ memori: Memori[];
83
+ }
84
+ >,
85
+
86
+ /**
87
+ * Gets a list of Memori objects owned by the specified user.
88
+ * @param {string} tenantName - The name of the tenant
89
+ * @param {string} userName - The user name
90
+ * @param {string=} authToken - The login token
91
+ * @returns A list of Memori objects
92
+ */
93
+ getUserMemoriList: (
94
+ tenantName: string,
95
+ userName: string,
96
+ authToken?: string
97
+ ) =>
98
+ apiFetcher(
99
+ `/UserMemori/${tenantName}/${userName}${
100
+ authToken ? `/${authToken}` : ''
101
+ }`,
102
+ {
103
+ apiUrl,
104
+ }
105
+ ) as Promise<
106
+ ResponseSpec & {
107
+ memori: Memori[];
108
+ }
109
+ >,
110
+
61
111
  /**
62
112
  * Gets a list of Memori objects for the currently logged in User.
63
113
  * @param authToken - The login token
64
114
  * @returns A list of Memori objects
65
115
  */
66
- getUserMemoriList: (authToken: string) =>
116
+ getMemoriList: (authToken: string) =>
67
117
  apiFetcher(`/Memori/${authToken}`, {
68
118
  apiUrl,
69
119
  }) as Promise<
@@ -7,7 +7,7 @@ export default (apiUrl: string) => ({
7
7
  * @param user - The user object
8
8
  * @returns The created user object
9
9
  */
10
- userSignIn: (user: User) =>
10
+ userSignUp: (user: User) =>
11
11
  apiFetcher('/User', {
12
12
  apiUrl,
13
13
  body: user,
@@ -19,7 +19,7 @@ export default (apiUrl: string) => ({
19
19
  * @param user - The user object
20
20
  * @returns The created user object
21
21
  */
22
- userConfirmSignIn: (user: User) =>
22
+ userConfirmSignUp: (user: User) =>
23
23
  apiFetcher('/UserConfirm', {
24
24
  apiUrl,
25
25
  body: user,
@@ -1,6 +1,5 @@
1
1
  export const getApiUrl = (hostname?: string) =>
2
2
  hostname
3
- ? new URL(
4
- hostname.startsWith('http') ? hostname : `https://${hostname}`
5
- ).origin.replace('http://', 'https://')
3
+ ? new URL(hostname.startsWith('http') ? hostname : `https://${hostname}`)
4
+ .origin
6
5
  : 'https://backend.memori.ai';
package/src/types.ts CHANGED
@@ -125,25 +125,29 @@ export declare type User = {
125
125
  admin?: boolean;
126
126
  superAdmin?: boolean;
127
127
  verificationCode?: string;
128
+ dontSendInvitationEmail?: boolean;
128
129
  flowID?: string;
129
130
  newsletterSubscribed?: boolean;
130
131
  maxMemori?: number;
131
- maxCompletions?: number;
132
+ numMemori?: number;
132
133
  canCreateMemori?: boolean;
133
134
  canAccessAPI?: boolean;
134
135
  canRunSnippets?: boolean;
135
136
  canEditIntegrations?: boolean;
136
137
  canEditDynamicIntents?: boolean;
137
138
  canEditMemoriChaining?: boolean;
139
+ monthSessions?: number;
140
+ monthValidSessions?: number;
138
141
  maxFreeSessions?: number;
139
142
  nonFreeSessionCost?: number;
143
+ monthCompletions?: number;
144
+ maxCompletions?: number;
140
145
  creationTimestamp?: string;
141
146
  lastChangeTimestamp?: string;
142
147
  referral?: string;
143
148
  couponCode?: string;
144
149
  paying?: boolean;
145
150
  notificationPrefs?: NotificationPrefs[];
146
- dontSendInvitationEmail?: boolean;
147
151
  };
148
152
 
149
153
  export declare type IntegrationResource = {