shred-api-client 1.1.1 → 1.1.2
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/api/User.api.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { User, UserAPISchema } from "../model/User.schema";
|
|
|
3
3
|
declare class UserAPI implements UserAPISchema {
|
|
4
4
|
private clientHTTP;
|
|
5
5
|
constructor();
|
|
6
|
+
createUser(email: string, name: string, newPassword: string, newPasswordConfirmation: string, profession: string | null, invitationCode: string | null): Promise<any>;
|
|
6
7
|
getUserInfo(context: Context): Promise<User>;
|
|
7
8
|
}
|
|
8
9
|
export default UserAPI;
|
package/dist/api/User.api.js
CHANGED
|
@@ -9,6 +9,19 @@ class UserAPI {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.clientHTTP = new HTTPClient_1.default();
|
|
11
11
|
}
|
|
12
|
+
async createUser(email, name, newPassword, newPasswordConfirmation, profession, invitationCode) {
|
|
13
|
+
const endpointData = User_schema_1.UserEndpoints.CreateUser;
|
|
14
|
+
const data = await this.clientHTTP.makeRequest(endpointData.uri, endpointData.method, {
|
|
15
|
+
email,
|
|
16
|
+
name,
|
|
17
|
+
newPassword,
|
|
18
|
+
newPasswordConfirmation,
|
|
19
|
+
profession,
|
|
20
|
+
invitationCode,
|
|
21
|
+
}, null, true //Use legacy api (old endpoints)
|
|
22
|
+
);
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
12
25
|
async getUserInfo(context) {
|
|
13
26
|
const endpointData = User_schema_1.UserEndpoints.GetUserInfo;
|
|
14
27
|
const data = await this.clientHTTP.makeRequest(endpointData.uri, endpointData.method, null, context, true //Use legacy api (old endpoints)
|
|
@@ -3,6 +3,7 @@ import { Subscription } from "./Subscription.schema";
|
|
|
3
3
|
import { Tenant } from "./Tenant.schema";
|
|
4
4
|
interface UserAPISchema {
|
|
5
5
|
getUserInfo: (context: Context) => Promise<User>;
|
|
6
|
+
createUser: (email: string, name: string, newPassword: string, newPasswordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
|
|
6
7
|
}
|
|
7
8
|
declare const UserEndpoints: {
|
|
8
9
|
GetUserInfo: {
|
|
@@ -13,6 +14,10 @@ declare const UserEndpoints: {
|
|
|
13
14
|
uri: string;
|
|
14
15
|
method: string;
|
|
15
16
|
};
|
|
17
|
+
CreateUser: {
|
|
18
|
+
uri: string;
|
|
19
|
+
method: string;
|
|
20
|
+
};
|
|
16
21
|
};
|
|
17
22
|
type Preferences = {
|
|
18
23
|
primaryColor?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import Context from "./../model/Context";
|
|
2
2
|
export default class HTTPClient {
|
|
3
|
-
makeRequest(uri: string, method: string, data: any, context?: Context, useLegacyApi?: boolean): Promise<any>;
|
|
3
|
+
makeRequest(uri: string, method: string, data: any, context?: Context | null, useLegacyApi?: boolean): Promise<any>;
|
|
4
4
|
}
|