curtain-web-api 1.0.66 → 1.0.67
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/build/classes/curtain-api.d.ts +34 -0
- package/build/classes/curtain-api.js +38 -0
- package/build/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/classes/curtain-api.ts +67 -0
- package/src/index.ts +5 -1
|
@@ -66,6 +66,28 @@ export interface Announcement {
|
|
|
66
66
|
dismissible: boolean;
|
|
67
67
|
is_visible: boolean;
|
|
68
68
|
}
|
|
69
|
+
export interface PermanentLinkRequest {
|
|
70
|
+
id: number;
|
|
71
|
+
curtain: number;
|
|
72
|
+
curtain_link_id: string;
|
|
73
|
+
requested_by: number;
|
|
74
|
+
requested_by_username: string;
|
|
75
|
+
request_type: 'permanent' | 'extend';
|
|
76
|
+
requested_expiry_months?: number;
|
|
77
|
+
status: 'pending' | 'approved' | 'rejected';
|
|
78
|
+
reason?: string;
|
|
79
|
+
requested_at: string;
|
|
80
|
+
reviewed_at?: string;
|
|
81
|
+
reviewed_by?: number;
|
|
82
|
+
reviewed_by_username?: string;
|
|
83
|
+
admin_notes?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface CreatePermanentLinkRequest {
|
|
86
|
+
curtain: number;
|
|
87
|
+
request_type: 'permanent' | 'extend';
|
|
88
|
+
requested_expiry_months?: number;
|
|
89
|
+
reason?: string;
|
|
90
|
+
}
|
|
69
91
|
export declare class CurtainWebAPI {
|
|
70
92
|
loginURL: string;
|
|
71
93
|
logoutURL: string;
|
|
@@ -149,4 +171,16 @@ export declare class CurtainWebAPI {
|
|
|
149
171
|
count: number;
|
|
150
172
|
results: Announcement[];
|
|
151
173
|
}, any, {}>>;
|
|
174
|
+
createPermanentLinkRequest(request: CreatePermanentLinkRequest): Promise<import("axios").AxiosResponse<PermanentLinkRequest, any, {}>>;
|
|
175
|
+
getPermanentLinkRequests(limit?: number, offset?: number, status?: string, curtain?: number): Promise<import("axios").AxiosResponse<{
|
|
176
|
+
count: number;
|
|
177
|
+
results: PermanentLinkRequest[];
|
|
178
|
+
}, any, {}>>;
|
|
179
|
+
getPermanentLinkRequest(id: number): Promise<import("axios").AxiosResponse<PermanentLinkRequest, any, {}>>;
|
|
180
|
+
approvePermanentLinkRequest(id: number): Promise<import("axios").AxiosResponse<{
|
|
181
|
+
message: string;
|
|
182
|
+
}, any, {}>>;
|
|
183
|
+
rejectPermanentLinkRequest(id: number, admin_notes?: string): Promise<import("axios").AxiosResponse<{
|
|
184
|
+
message: string;
|
|
185
|
+
}, any, {}>>;
|
|
152
186
|
}
|
|
@@ -806,4 +806,42 @@ export class CurtainWebAPI {
|
|
|
806
806
|
params.append("offset", offset.toString());
|
|
807
807
|
return this.axiosInstance.get(this.baseURL + "announcements/", { headers: headers, params: params, responseType: "json" });
|
|
808
808
|
}
|
|
809
|
+
createPermanentLinkRequest(request) {
|
|
810
|
+
let headers = new AxiosHeaders();
|
|
811
|
+
headers["Accept"] = "application/json";
|
|
812
|
+
headers["Content-Type"] = "application/json";
|
|
813
|
+
return this.axiosInstance.post(this.baseURL + "permanent-link-requests/", request, { headers: headers, responseType: "json" });
|
|
814
|
+
}
|
|
815
|
+
getPermanentLinkRequests(limit = 10, offset = 0, status, curtain) {
|
|
816
|
+
let headers = new AxiosHeaders();
|
|
817
|
+
headers["Accept"] = "application/json";
|
|
818
|
+
let params = new URLSearchParams();
|
|
819
|
+
params.append("limit", limit.toString());
|
|
820
|
+
params.append("offset", offset.toString());
|
|
821
|
+
if (status) {
|
|
822
|
+
params.append("status", status);
|
|
823
|
+
}
|
|
824
|
+
if (curtain) {
|
|
825
|
+
params.append("curtain", curtain.toString());
|
|
826
|
+
}
|
|
827
|
+
return this.axiosInstance.get(this.baseURL + "permanent-link-requests/", { headers: headers, params: params, responseType: "json" });
|
|
828
|
+
}
|
|
829
|
+
getPermanentLinkRequest(id) {
|
|
830
|
+
let headers = new AxiosHeaders();
|
|
831
|
+
headers["Accept"] = "application/json";
|
|
832
|
+
return this.axiosInstance.get(this.baseURL + "permanent-link-requests/" + id + "/", { headers: headers, responseType: "json" });
|
|
833
|
+
}
|
|
834
|
+
approvePermanentLinkRequest(id) {
|
|
835
|
+
let headers = new AxiosHeaders();
|
|
836
|
+
headers["Accept"] = "application/json";
|
|
837
|
+
headers["Content-Type"] = "application/json";
|
|
838
|
+
return this.axiosInstance.post(this.baseURL + "permanent-link-requests/" + id + "/approve/", {}, { headers: headers, responseType: "json" });
|
|
839
|
+
}
|
|
840
|
+
rejectPermanentLinkRequest(id, admin_notes) {
|
|
841
|
+
let headers = new AxiosHeaders();
|
|
842
|
+
headers["Accept"] = "application/json";
|
|
843
|
+
headers["Content-Type"] = "application/json";
|
|
844
|
+
const data = admin_notes ? { admin_notes } : {};
|
|
845
|
+
return this.axiosInstance.post(this.baseURL + "permanent-link-requests/" + id + "/reject/", data, { headers: headers, responseType: "json" });
|
|
846
|
+
}
|
|
809
847
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CurtainWebAPI, replacer, reviver, SiteProperties, CurtainChunkedUploadStatus, CurtainChunkedUploadRequest, CurtainChunkedUploadResponse, CurtainChunkedUploadCompletionRequest, CurtainChunkedUploadCompletionResponse, Announcement } from "./classes/curtain-api";
|
|
1
|
+
import { CurtainWebAPI, replacer, reviver, SiteProperties, CurtainChunkedUploadStatus, CurtainChunkedUploadRequest, CurtainChunkedUploadResponse, CurtainChunkedUploadCompletionRequest, CurtainChunkedUploadCompletionResponse, Announcement, PermanentLinkRequest, CreatePermanentLinkRequest } from "./classes/curtain-api";
|
|
2
2
|
import { User } from "./classes/curtain-user";
|
|
3
3
|
import { getProteomicsData, getPrideData, getEBIAlpha, getInteractomeAtlas, getStringDBInteractions } from "./utilities";
|
|
4
4
|
import { importKey, importPrivateKey, exportPrivateKey, exportKeyString, exportPublicKey, importPublicKey, CurtainEncryption, generateKeyPair, encryptDataRSA, decryptDataRSA, loadFromLocalStorage, saveToLocalStorage, pemToArrayBuffer, base64ToArrayBuffer, arrayBufferToBase64String, removeLines, encryptAESData, decryptAESData, encryptAESKey, decryptAESKey, generateAESKey, exportAESKey, importAESKey } from "./classes/curtain-encryption";
|
|
5
5
|
import PouchDB from "pouchdb";
|
|
6
|
-
export { CurtainWebAPI, User, getProteomicsData, getPrideData, getEBIAlpha, getInteractomeAtlas, getStringDBInteractions, replacer, reviver, SiteProperties, CurtainChunkedUploadStatus, CurtainChunkedUploadRequest, CurtainChunkedUploadResponse, CurtainChunkedUploadCompletionRequest, CurtainChunkedUploadCompletionResponse, Announcement, importKey, importPrivateKey, exportPrivateKey, exportKeyString, exportPublicKey, importPublicKey, CurtainEncryption, generateKeyPair, encryptDataRSA, decryptDataRSA, loadFromLocalStorage, saveToLocalStorage, pemToArrayBuffer, base64ToArrayBuffer, arrayBufferToBase64String, removeLines, encryptAESData, decryptAESData, encryptAESKey, decryptAESKey, generateAESKey, exportAESKey, importAESKey, PouchDB };
|
|
6
|
+
export { CurtainWebAPI, User, getProteomicsData, getPrideData, getEBIAlpha, getInteractomeAtlas, getStringDBInteractions, replacer, reviver, SiteProperties, CurtainChunkedUploadStatus, CurtainChunkedUploadRequest, CurtainChunkedUploadResponse, CurtainChunkedUploadCompletionRequest, CurtainChunkedUploadCompletionResponse, Announcement, PermanentLinkRequest, CreatePermanentLinkRequest, importKey, importPrivateKey, exportPrivateKey, exportKeyString, exportPublicKey, importPublicKey, CurtainEncryption, generateKeyPair, encryptDataRSA, decryptDataRSA, loadFromLocalStorage, saveToLocalStorage, pemToArrayBuffer, base64ToArrayBuffer, arrayBufferToBase64String, removeLines, encryptAESData, decryptAESData, encryptAESKey, decryptAESKey, generateAESKey, exportAESKey, importAESKey, PouchDB };
|
package/package.json
CHANGED
|
@@ -101,6 +101,30 @@ export interface Announcement {
|
|
|
101
101
|
is_visible: boolean;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
export interface PermanentLinkRequest {
|
|
105
|
+
id: number;
|
|
106
|
+
curtain: number;
|
|
107
|
+
curtain_link_id: string;
|
|
108
|
+
requested_by: number;
|
|
109
|
+
requested_by_username: string;
|
|
110
|
+
request_type: 'permanent' | 'extend';
|
|
111
|
+
requested_expiry_months?: number;
|
|
112
|
+
status: 'pending' | 'approved' | 'rejected';
|
|
113
|
+
reason?: string;
|
|
114
|
+
requested_at: string;
|
|
115
|
+
reviewed_at?: string;
|
|
116
|
+
reviewed_by?: number;
|
|
117
|
+
reviewed_by_username?: string;
|
|
118
|
+
admin_notes?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface CreatePermanentLinkRequest {
|
|
122
|
+
curtain: number;
|
|
123
|
+
request_type: 'permanent' | 'extend';
|
|
124
|
+
requested_expiry_months?: number;
|
|
125
|
+
reason?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
104
128
|
export class CurtainWebAPI {
|
|
105
129
|
loginURL: string = "";
|
|
106
130
|
logoutURL: string = "";
|
|
@@ -980,5 +1004,48 @@ export class CurtainWebAPI {
|
|
|
980
1004
|
params.append("offset", offset.toString());
|
|
981
1005
|
return this.axiosInstance.get<{count: number, results: Announcement[]}>(this.baseURL + "announcements/", {headers: headers, params: params, responseType: "json"});
|
|
982
1006
|
}
|
|
1007
|
+
|
|
1008
|
+
createPermanentLinkRequest(request: CreatePermanentLinkRequest) {
|
|
1009
|
+
let headers = new AxiosHeaders();
|
|
1010
|
+
headers["Accept"] = "application/json";
|
|
1011
|
+
headers["Content-Type"] = "application/json";
|
|
1012
|
+
return this.axiosInstance.post<PermanentLinkRequest>(this.baseURL + "permanent-link-requests/", request, {headers: headers, responseType: "json"});
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
getPermanentLinkRequests(limit: number = 10, offset: number = 0, status?: string, curtain?: number) {
|
|
1016
|
+
let headers = new AxiosHeaders();
|
|
1017
|
+
headers["Accept"] = "application/json";
|
|
1018
|
+
let params = new URLSearchParams();
|
|
1019
|
+
params.append("limit", limit.toString());
|
|
1020
|
+
params.append("offset", offset.toString());
|
|
1021
|
+
if (status) {
|
|
1022
|
+
params.append("status", status);
|
|
1023
|
+
}
|
|
1024
|
+
if (curtain) {
|
|
1025
|
+
params.append("curtain", curtain.toString());
|
|
1026
|
+
}
|
|
1027
|
+
return this.axiosInstance.get<{count: number, results: PermanentLinkRequest[]}>(this.baseURL + "permanent-link-requests/", {headers: headers, params: params, responseType: "json"});
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
getPermanentLinkRequest(id: number) {
|
|
1031
|
+
let headers = new AxiosHeaders();
|
|
1032
|
+
headers["Accept"] = "application/json";
|
|
1033
|
+
return this.axiosInstance.get<PermanentLinkRequest>(this.baseURL + "permanent-link-requests/" + id + "/", {headers: headers, responseType: "json"});
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
approvePermanentLinkRequest(id: number) {
|
|
1037
|
+
let headers = new AxiosHeaders();
|
|
1038
|
+
headers["Accept"] = "application/json";
|
|
1039
|
+
headers["Content-Type"] = "application/json";
|
|
1040
|
+
return this.axiosInstance.post<{message: string}>(this.baseURL + "permanent-link-requests/" + id + "/approve/", {}, {headers: headers, responseType: "json"});
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
rejectPermanentLinkRequest(id: number, admin_notes?: string) {
|
|
1044
|
+
let headers = new AxiosHeaders();
|
|
1045
|
+
headers["Accept"] = "application/json";
|
|
1046
|
+
headers["Content-Type"] = "application/json";
|
|
1047
|
+
const data = admin_notes ? {admin_notes} : {};
|
|
1048
|
+
return this.axiosInstance.post<{message: string}>(this.baseURL + "permanent-link-requests/" + id + "/reject/", data, {headers: headers, responseType: "json"});
|
|
1049
|
+
}
|
|
983
1050
|
}
|
|
984
1051
|
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
CurtainChunkedUploadResponse,
|
|
9
9
|
CurtainChunkedUploadCompletionRequest,
|
|
10
10
|
CurtainChunkedUploadCompletionResponse,
|
|
11
|
-
Announcement
|
|
11
|
+
Announcement,
|
|
12
|
+
PermanentLinkRequest,
|
|
13
|
+
CreatePermanentLinkRequest
|
|
12
14
|
} from "./classes/curtain-api";
|
|
13
15
|
import {User} from "./classes/curtain-user";
|
|
14
16
|
import {getProteomicsData, getPrideData, getEBIAlpha, getInteractomeAtlas, getStringDBInteractions} from "./utilities";
|
|
@@ -55,6 +57,8 @@ export {
|
|
|
55
57
|
CurtainChunkedUploadCompletionRequest,
|
|
56
58
|
CurtainChunkedUploadCompletionResponse,
|
|
57
59
|
Announcement,
|
|
60
|
+
PermanentLinkRequest,
|
|
61
|
+
CreatePermanentLinkRequest,
|
|
58
62
|
importKey,
|
|
59
63
|
importPrivateKey,
|
|
60
64
|
exportPrivateKey,
|