shred-api-client 1.11.1 → 1.11.3
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
|
@@ -6,6 +6,8 @@ declare class UserAPI implements UserAPISchema {
|
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
8
|
deleteAccount(ctx: Context): Promise<boolean>;
|
|
9
|
+
createIntegrationToken(ctx: Context): Promise<string>;
|
|
10
|
+
getIntegrationToken(ctx: Context): Promise<string | null>;
|
|
9
11
|
sendValidationCode(email: string): Promise<boolean>;
|
|
10
12
|
changePassword(email: string, pass: string, passConfirm: string, code: number): Promise<boolean>;
|
|
11
13
|
changeEmail(ctx: Context, email: string, code: number): Promise<boolean>;
|
package/dist/api/User.api.js
CHANGED
|
@@ -15,6 +15,16 @@ class UserAPI {
|
|
|
15
15
|
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, null, ctx);
|
|
16
16
|
return data.success;
|
|
17
17
|
}
|
|
18
|
+
async createIntegrationToken(ctx) {
|
|
19
|
+
const endpointData = User_schema_1.UserEndpoints.CreateToken;
|
|
20
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, ctx);
|
|
21
|
+
return data.token;
|
|
22
|
+
}
|
|
23
|
+
async getIntegrationToken(ctx) {
|
|
24
|
+
const endpointData = User_schema_1.UserEndpoints.GetIntegrationToken;
|
|
25
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, ctx);
|
|
26
|
+
return data.token;
|
|
27
|
+
}
|
|
18
28
|
async sendValidationCode(email) {
|
|
19
29
|
const endpointData = User_schema_1.UserEndpoints.SendValidationCode;
|
|
20
30
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?email=${email}`, endpointData.method);
|
|
@@ -12,6 +12,8 @@ interface UserAPISchema {
|
|
|
12
12
|
setup: (context: Context) => Promise<boolean>;
|
|
13
13
|
getBindedUsers: (ctx: Context) => Promise<User[]>;
|
|
14
14
|
deleteAccount: (ctx: Context) => Promise<boolean>;
|
|
15
|
+
getIntegrationToken: (ctx: Context) => Promise<string | null>;
|
|
16
|
+
createIntegrationToken: (ctx: Context) => Promise<string>;
|
|
15
17
|
createUser: (email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
|
|
16
18
|
}
|
|
17
19
|
declare const UserEndpoints: {
|
|
@@ -39,6 +41,14 @@ declare const UserEndpoints: {
|
|
|
39
41
|
uri: string;
|
|
40
42
|
method: string;
|
|
41
43
|
};
|
|
44
|
+
GetIntegrationToken: {
|
|
45
|
+
uri: string;
|
|
46
|
+
method: string;
|
|
47
|
+
};
|
|
48
|
+
CreateToken: {
|
|
49
|
+
uri: string;
|
|
50
|
+
method: string;
|
|
51
|
+
};
|
|
42
52
|
ConfirmCode: {
|
|
43
53
|
uri: string;
|
|
44
54
|
method: string;
|
|
@@ -26,6 +26,14 @@ const UserEndpoints = {
|
|
|
26
26
|
uri: "/accounts/public/email/avaliable",
|
|
27
27
|
method: "GET",
|
|
28
28
|
},
|
|
29
|
+
GetIntegrationToken: {
|
|
30
|
+
uri: "/accounts/user/getToken/",
|
|
31
|
+
method: "GET",
|
|
32
|
+
},
|
|
33
|
+
CreateToken: {
|
|
34
|
+
uri: "/accounts/user/createToken/",
|
|
35
|
+
method: "POST",
|
|
36
|
+
},
|
|
29
37
|
ConfirmCode: {
|
|
30
38
|
uri: "/accounts/public/email/validate",
|
|
31
39
|
method: "POST",
|