curtain-web-api 1.0.29 → 1.0.30
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="pouchdb-core" />
|
|
2
1
|
import { User } from "./curtain-user";
|
|
3
2
|
export declare const replacer: (key: any, value: any) => any;
|
|
4
3
|
export declare const reviver: (key: any, value: any) => any;
|
|
@@ -14,11 +13,11 @@ export declare class CurtainWebAPI {
|
|
|
14
13
|
axiosInstance: import("axios").AxiosInstance;
|
|
15
14
|
baseURL: string;
|
|
16
15
|
constructor(baseURL?: string);
|
|
17
|
-
login(username: string, password: string): Promise<
|
|
16
|
+
login(username: string, password: string): Promise<User>;
|
|
18
17
|
getUserInfo(): Promise<User>;
|
|
19
18
|
logout(): Promise<void>;
|
|
20
19
|
refresh(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
21
|
-
ORCIDLogin(authorizationCode: string, redirectURI: string): Promise<
|
|
20
|
+
ORCIDLogin(authorizationCode: string, redirectURI: string): Promise<User>;
|
|
22
21
|
checkIfRefreshTokenExpired(): boolean;
|
|
23
22
|
deleteCurtainLink(curtainLinkID: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
24
23
|
putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -139,7 +139,9 @@ class CurtainWebAPI {
|
|
|
139
139
|
this.user.access_token = response.data.access;
|
|
140
140
|
this.user.refresh_token = response.data.refresh;
|
|
141
141
|
this.user.loginStatus = true;
|
|
142
|
-
return this.user.saveIntoDB()
|
|
142
|
+
return this.user.saveIntoDB().then((response) => {
|
|
143
|
+
return this.getUserInfo();
|
|
144
|
+
});
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
getUserInfo() {
|
|
@@ -188,7 +190,9 @@ class CurtainWebAPI {
|
|
|
188
190
|
this.user.refresh_token = response.data.refresh;
|
|
189
191
|
this.user.loginStatus = true;
|
|
190
192
|
console.log(this.user.loginStatus);
|
|
191
|
-
return this.user.saveIntoDB()
|
|
193
|
+
return this.user.saveIntoDB().then((response) => {
|
|
194
|
+
return this.getUserInfo();
|
|
195
|
+
});
|
|
192
196
|
});
|
|
193
197
|
}
|
|
194
198
|
checkIfRefreshTokenExpired() {
|
|
@@ -96,7 +96,7 @@ class User {
|
|
|
96
96
|
access_token: this.access_token,
|
|
97
97
|
refresh_token: this.refresh_token,
|
|
98
98
|
username: this.username,
|
|
99
|
-
loginStatus:
|
|
99
|
+
loginStatus: true,
|
|
100
100
|
isStaff: this.isStaff,
|
|
101
101
|
id: this.id,
|
|
102
102
|
totalCurtain: this.totalCurtain,
|
|
@@ -118,7 +118,7 @@ class User {
|
|
|
118
118
|
access_token: this.access_token,
|
|
119
119
|
refresh_token: this.refresh_token,
|
|
120
120
|
username: this.username,
|
|
121
|
-
loginStatus:
|
|
121
|
+
loginStatus: true,
|
|
122
122
|
isStaff: this.isStaff,
|
|
123
123
|
id: this.id,
|
|
124
124
|
totalCurtain: this.totalCurtain,
|
package/package.json
CHANGED
|
@@ -117,7 +117,9 @@ export class CurtainWebAPI {
|
|
|
117
117
|
this.user.access_token = response.data.access;
|
|
118
118
|
this.user.refresh_token = response.data.refresh;
|
|
119
119
|
this.user.loginStatus = true;
|
|
120
|
-
return this.user.saveIntoDB()
|
|
120
|
+
return this.user.saveIntoDB().then((response) => {
|
|
121
|
+
return this.getUserInfo()
|
|
122
|
+
})
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -172,7 +174,9 @@ export class CurtainWebAPI {
|
|
|
172
174
|
this.user.refresh_token = response.data.refresh;
|
|
173
175
|
this.user.loginStatus = true;
|
|
174
176
|
console.log(this.user.loginStatus)
|
|
175
|
-
return this.user.saveIntoDB()
|
|
177
|
+
return this.user.saveIntoDB().then((response) => {
|
|
178
|
+
return this.getUserInfo()
|
|
179
|
+
})
|
|
176
180
|
})
|
|
177
181
|
}
|
|
178
182
|
|
|
@@ -104,7 +104,7 @@ export class User {
|
|
|
104
104
|
access_token: this.access_token,
|
|
105
105
|
refresh_token: this.refresh_token,
|
|
106
106
|
username: this.username,
|
|
107
|
-
loginStatus:
|
|
107
|
+
loginStatus: true,
|
|
108
108
|
isStaff: this.isStaff,
|
|
109
109
|
id: this.id,
|
|
110
110
|
totalCurtain: this.totalCurtain,
|
|
@@ -125,7 +125,7 @@ export class User {
|
|
|
125
125
|
access_token: this.access_token,
|
|
126
126
|
refresh_token: this.refresh_token,
|
|
127
127
|
username: this.username,
|
|
128
|
-
loginStatus:
|
|
128
|
+
loginStatus: true,
|
|
129
129
|
isStaff: this.isStaff,
|
|
130
130
|
id: this.id,
|
|
131
131
|
totalCurtain: this.totalCurtain,
|