curtain-web-api 1.0.68 → 1.0.70
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.
|
@@ -34,6 +34,8 @@ export interface CurtainChunkedUploadRequest {
|
|
|
34
34
|
encrypted?: boolean;
|
|
35
35
|
expiry_duration?: number;
|
|
36
36
|
enable?: boolean;
|
|
37
|
+
curtain_id?: number;
|
|
38
|
+
link_id?: string;
|
|
37
39
|
}
|
|
38
40
|
export interface CurtainChunkedUploadResponse {
|
|
39
41
|
id: string;
|
|
@@ -48,6 +50,8 @@ export interface CurtainChunkedUploadCompletionRequest {
|
|
|
48
50
|
encrypted?: boolean;
|
|
49
51
|
expiry_duration?: number;
|
|
50
52
|
enable?: boolean;
|
|
53
|
+
curtain_id?: number;
|
|
54
|
+
link_id?: string;
|
|
51
55
|
}
|
|
52
56
|
export interface CurtainChunkedUploadCompletionResponse {
|
|
53
57
|
curtain?: any;
|
|
@@ -109,7 +113,7 @@ export declare class CurtainWebAPI {
|
|
|
109
113
|
getUserInfo(): Promise<User>;
|
|
110
114
|
logout(): Promise<void>;
|
|
111
115
|
refresh(): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
112
|
-
ORCIDLogin(authorizationCode: string, redirectURI: string): Promise<User>;
|
|
116
|
+
ORCIDLogin(authorizationCode: string, redirectURI: string, remember_me?: boolean): Promise<User>;
|
|
113
117
|
checkIfRefreshTokenExpired(): boolean;
|
|
114
118
|
deleteCurtainLink(curtainLinkID: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
115
119
|
putSettings(settings: any, enable?: boolean, description?: string, sessionType?: string, encryption?: CurtainEncryption, permanent?: boolean, expiry_duration?: number, onUploadProgress?: any): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
@@ -170,6 +174,8 @@ export declare class CurtainWebAPI {
|
|
|
170
174
|
enable?: boolean;
|
|
171
175
|
upload_session_id?: string;
|
|
172
176
|
onProgress?: (progress: number) => void;
|
|
177
|
+
curtain_id?: number;
|
|
178
|
+
link_id?: string;
|
|
173
179
|
}): Promise<CurtainChunkedUploadCompletionResponse>;
|
|
174
180
|
getAnnouncements(limit?: number, offset?: number): Promise<import("axios").AxiosResponse<{
|
|
175
181
|
count: number;
|
|
@@ -160,13 +160,13 @@ export class CurtainWebAPI {
|
|
|
160
160
|
return response;
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
ORCIDLogin(authorizationCode, redirectURI) {
|
|
163
|
+
ORCIDLogin(authorizationCode, redirectURI, remember_me = false) {
|
|
164
164
|
let headers = new AxiosHeaders();
|
|
165
165
|
headers["Accept"] = "application/json";
|
|
166
166
|
headers["Content-Type"] = "application/json";
|
|
167
167
|
return this.user.loadFromDB().then((response) => {
|
|
168
168
|
console.log(this.user);
|
|
169
|
-
return this.axiosInstance.post(this.orcidLoginURL, JSON.stringify({ "auth_token": authorizationCode, "redirect_uri": redirectURI }), { headers: headers, responseType: "json" }).then((response) => {
|
|
169
|
+
return this.axiosInstance.post(this.orcidLoginURL, JSON.stringify({ "auth_token": authorizationCode, "redirect_uri": redirectURI, "remember_me": remember_me }), { headers: headers, responseType: "json" }).then((response) => {
|
|
170
170
|
return this.user.saveIntoDB(response.data.access, response.data.refresh).then((response) => {
|
|
171
171
|
console.log(this.user);
|
|
172
172
|
return this.getUserInfo();
|
|
@@ -708,6 +708,12 @@ export class CurtainWebAPI {
|
|
|
708
708
|
if (request?.enable !== undefined) {
|
|
709
709
|
formData.append('enable', request.enable.toString());
|
|
710
710
|
}
|
|
711
|
+
if (request?.curtain_id !== undefined) {
|
|
712
|
+
formData.append('curtain_id', request.curtain_id.toString());
|
|
713
|
+
}
|
|
714
|
+
if (request?.link_id) {
|
|
715
|
+
formData.append('link_id', request.link_id);
|
|
716
|
+
}
|
|
711
717
|
let headers = new AxiosHeaders();
|
|
712
718
|
headers["Accept"] = "application/json";
|
|
713
719
|
return this.axiosInstance.put(`${this.baseURL}curtain-chunked-upload/${uploadId}/`, formData, { headers: headers });
|
|
@@ -741,7 +747,9 @@ export class CurtainWebAPI {
|
|
|
741
747
|
permanent: options?.permanent,
|
|
742
748
|
encrypted: options?.encrypted,
|
|
743
749
|
expiry_duration: options?.expiry_duration,
|
|
744
|
-
enable: options?.enable
|
|
750
|
+
enable: options?.enable,
|
|
751
|
+
curtain_id: options?.curtain_id,
|
|
752
|
+
link_id: options?.link_id
|
|
745
753
|
});
|
|
746
754
|
resolve(completionResponse.data);
|
|
747
755
|
}
|
|
@@ -760,7 +768,9 @@ export class CurtainWebAPI {
|
|
|
760
768
|
permanent: options?.permanent,
|
|
761
769
|
encrypted: options?.encrypted,
|
|
762
770
|
expiry_duration: options?.expiry_duration,
|
|
763
|
-
enable: options?.enable
|
|
771
|
+
enable: options?.enable,
|
|
772
|
+
curtain_id: options?.curtain_id,
|
|
773
|
+
link_id: options?.link_id
|
|
764
774
|
});
|
|
765
775
|
resolve(completionResponse.data);
|
|
766
776
|
}
|
package/package.json
CHANGED
|
@@ -64,6 +64,8 @@ export interface CurtainChunkedUploadRequest {
|
|
|
64
64
|
encrypted?: boolean;
|
|
65
65
|
expiry_duration?: number;
|
|
66
66
|
enable?: boolean;
|
|
67
|
+
curtain_id?: number;
|
|
68
|
+
link_id?: string;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
export interface CurtainChunkedUploadResponse {
|
|
@@ -80,6 +82,8 @@ export interface CurtainChunkedUploadCompletionRequest {
|
|
|
80
82
|
encrypted?: boolean;
|
|
81
83
|
expiry_duration?: number;
|
|
82
84
|
enable?: boolean;
|
|
85
|
+
curtain_id?: number;
|
|
86
|
+
link_id?: string;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
export interface CurtainChunkedUploadCompletionResponse {
|
|
@@ -277,14 +281,14 @@ export class CurtainWebAPI {
|
|
|
277
281
|
});
|
|
278
282
|
}
|
|
279
283
|
|
|
280
|
-
ORCIDLogin(authorizationCode: string, redirectURI: string){
|
|
284
|
+
ORCIDLogin(authorizationCode: string, redirectURI: string, remember_me: boolean = false){
|
|
281
285
|
let headers = new AxiosHeaders();
|
|
282
286
|
headers["Accept"] = "application/json";
|
|
283
287
|
headers["Content-Type"] = "application/json";
|
|
284
288
|
return this.user.loadFromDB().then(
|
|
285
289
|
(response) => {
|
|
286
290
|
console.log(this.user)
|
|
287
|
-
return this.axiosInstance.post(this.orcidLoginURL, JSON.stringify({"auth_token": authorizationCode, "redirect_uri": redirectURI}), {headers: headers, responseType:"json"}).then((response) => {
|
|
291
|
+
return this.axiosInstance.post(this.orcidLoginURL, JSON.stringify({"auth_token": authorizationCode, "redirect_uri": redirectURI, "remember_me": remember_me}), {headers: headers, responseType:"json"}).then((response) => {
|
|
288
292
|
return this.user.saveIntoDB(response.data.access, response.data.refresh).then((response) => {
|
|
289
293
|
console.log(this.user)
|
|
290
294
|
return this.getUserInfo()
|
|
@@ -888,6 +892,12 @@ export class CurtainWebAPI {
|
|
|
888
892
|
if (request?.enable !== undefined) {
|
|
889
893
|
formData.append('enable', request.enable.toString());
|
|
890
894
|
}
|
|
895
|
+
if (request?.curtain_id !== undefined) {
|
|
896
|
+
formData.append('curtain_id', request.curtain_id.toString());
|
|
897
|
+
}
|
|
898
|
+
if (request?.link_id) {
|
|
899
|
+
formData.append('link_id', request.link_id);
|
|
900
|
+
}
|
|
891
901
|
|
|
892
902
|
let headers = new AxiosHeaders();
|
|
893
903
|
headers["Accept"] = "application/json";
|
|
@@ -912,6 +922,8 @@ export class CurtainWebAPI {
|
|
|
912
922
|
enable?: boolean;
|
|
913
923
|
upload_session_id?: string;
|
|
914
924
|
onProgress?: (progress: number) => void;
|
|
925
|
+
curtain_id?: number;
|
|
926
|
+
link_id?: string;
|
|
915
927
|
}
|
|
916
928
|
): Promise<CurtainChunkedUploadCompletionResponse> {
|
|
917
929
|
return new Promise(async (resolve, reject) => {
|
|
@@ -939,7 +951,9 @@ export class CurtainWebAPI {
|
|
|
939
951
|
permanent: options?.permanent,
|
|
940
952
|
encrypted: options?.encrypted,
|
|
941
953
|
expiry_duration: options?.expiry_duration,
|
|
942
|
-
enable: options?.enable
|
|
954
|
+
enable: options?.enable,
|
|
955
|
+
curtain_id: options?.curtain_id,
|
|
956
|
+
link_id: options?.link_id
|
|
943
957
|
});
|
|
944
958
|
resolve(completionResponse.data);
|
|
945
959
|
} catch (error) {
|
|
@@ -958,7 +972,9 @@ export class CurtainWebAPI {
|
|
|
958
972
|
permanent: options?.permanent,
|
|
959
973
|
encrypted: options?.encrypted,
|
|
960
974
|
expiry_duration: options?.expiry_duration,
|
|
961
|
-
enable: options?.enable
|
|
975
|
+
enable: options?.enable,
|
|
976
|
+
curtain_id: options?.curtain_id,
|
|
977
|
+
link_id: options?.link_id
|
|
962
978
|
});
|
|
963
979
|
resolve(completionResponse.data);
|
|
964
980
|
} catch (error) {
|