curtain-web-api 1.0.75 → 1.0.76
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/.idea/.name +0 -0
- package/.idea/compiler.xml +0 -0
- package/.idea/copilot.data.migration.agent.xml +0 -0
- package/.idea/copilot.data.migration.ask.xml +0 -0
- package/.idea/copilot.data.migration.ask2agent.xml +0 -0
- package/.idea/copilot.data.migration.edit.xml +0 -0
- package/.idea/curtain-web-api.iml +0 -0
- package/.idea/modules.xml +0 -0
- package/.idea/vcs.xml +0 -0
- package/README.md +0 -0
- package/build/classes/curtain-api.d.ts +32 -0
- package/build/classes/curtain-api.js +56 -0
- package/build/classes/curtain-encryption.d.ts +0 -0
- package/build/classes/curtain-encryption.js +0 -0
- package/build/classes/curtain-login.d.ts +0 -0
- package/build/classes/curtain-login.js +0 -0
- package/build/classes/curtain-user.d.ts +0 -0
- package/build/classes/curtain-user.js +0 -0
- package/build/index.d.ts +0 -0
- package/build/index.js +0 -0
- package/build/utilities.d.ts +0 -0
- package/build/utilities.js +0 -0
- package/package.json +1 -1
- package/src/classes/curtain-api.ts +91 -0
- package/src/classes/curtain-encryption.ts +0 -0
- package/src/classes/curtain-user.ts +0 -0
- package/src/index.ts +0 -0
- package/src/tests/curtain-login.spec.ts +0 -0
- package/src/tests/utilities.spec.ts +0 -0
- package/src/utilities.ts +0 -0
- package/tsconfig.json +0 -0
package/.idea/.name
CHANGED
|
File without changes
|
package/.idea/compiler.xml
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.idea/modules.xml
CHANGED
|
File without changes
|
package/.idea/vcs.xml
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
|
@@ -11,6 +11,8 @@ export interface SiteProperties {
|
|
|
11
11
|
jwt_refresh_token_lifetime_days: number;
|
|
12
12
|
jwt_remember_me_access_token_lifetime_days: number;
|
|
13
13
|
jwt_remember_me_refresh_token_lifetime_days: number;
|
|
14
|
+
umami_website_id?: string;
|
|
15
|
+
umami_url?: string;
|
|
14
16
|
}
|
|
15
17
|
export interface CurtainChunkedUploadStatus {
|
|
16
18
|
id: string;
|
|
@@ -121,6 +123,30 @@ export interface AddCurtainToCollection {
|
|
|
121
123
|
curtain_id?: number;
|
|
122
124
|
link_id?: string;
|
|
123
125
|
}
|
|
126
|
+
export interface DataCiteAlternateIdentifier {
|
|
127
|
+
alternateIdentifier: string;
|
|
128
|
+
alternateIdentifierType: string;
|
|
129
|
+
}
|
|
130
|
+
export interface DataCiteCollectionMetadata {
|
|
131
|
+
collection_id: number;
|
|
132
|
+
collection_name: string;
|
|
133
|
+
collection_description: string;
|
|
134
|
+
main_session: {
|
|
135
|
+
curtain_id: number | null;
|
|
136
|
+
link_id: string | null;
|
|
137
|
+
};
|
|
138
|
+
sessions: Array<{
|
|
139
|
+
curtain_id: number;
|
|
140
|
+
link_id: string;
|
|
141
|
+
data_url: string;
|
|
142
|
+
}>;
|
|
143
|
+
}
|
|
144
|
+
export interface ParsedDataCiteData {
|
|
145
|
+
mainSessionUrl?: string;
|
|
146
|
+
alternativeSessionUrls: string[];
|
|
147
|
+
collectionMetadataUrl?: string;
|
|
148
|
+
collectionMetadata?: DataCiteCollectionMetadata;
|
|
149
|
+
}
|
|
124
150
|
export declare class CurtainWebAPI {
|
|
125
151
|
loginURL: string;
|
|
126
152
|
logoutURL: string;
|
|
@@ -182,6 +208,12 @@ export declare class CurtainWebAPI {
|
|
|
182
208
|
}, any, {}>>;
|
|
183
209
|
updateDataCite(id: number, data: any): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
184
210
|
deleteDataCite(id: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
211
|
+
parseDataCiteAlternateIdentifiers(alternateIdentifiers: DataCiteAlternateIdentifier[]): Promise<ParsedDataCiteData>;
|
|
212
|
+
loadDataCiteSession(url: string): Promise<any>;
|
|
213
|
+
loadAllDataCiteSessions(parsedData: ParsedDataCiteData): Promise<{
|
|
214
|
+
main?: any;
|
|
215
|
+
alternatives: any[];
|
|
216
|
+
}>;
|
|
185
217
|
changeDataCiteStatus(id: number, status: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
186
218
|
lockDataCite(id: number, lock: boolean): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
187
219
|
getKinaseLibraryProxy(sequence: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
@@ -623,6 +623,62 @@ export class CurtainWebAPI {
|
|
|
623
623
|
headers["Accept"] = "application/json";
|
|
624
624
|
return this.axiosInstance.delete(this.baseURL + "datacite/" + id + "/", { headers: headers, responseType: "json" });
|
|
625
625
|
}
|
|
626
|
+
async parseDataCiteAlternateIdentifiers(alternateIdentifiers) {
|
|
627
|
+
const result = {
|
|
628
|
+
alternativeSessionUrls: []
|
|
629
|
+
};
|
|
630
|
+
for (const identifier of alternateIdentifiers) {
|
|
631
|
+
switch (identifier.alternateIdentifierType) {
|
|
632
|
+
case "Curtain Main Session Data":
|
|
633
|
+
result.mainSessionUrl = identifier.alternateIdentifier;
|
|
634
|
+
break;
|
|
635
|
+
case "Curtain Alternative Session Data":
|
|
636
|
+
result.alternativeSessionUrls.push(identifier.alternateIdentifier);
|
|
637
|
+
break;
|
|
638
|
+
case "Curtain Collection Metadata":
|
|
639
|
+
result.collectionMetadataUrl = identifier.alternateIdentifier;
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (result.collectionMetadataUrl) {
|
|
644
|
+
try {
|
|
645
|
+
const response = await this.axiosInstance.get(result.collectionMetadataUrl);
|
|
646
|
+
result.collectionMetadata = response.data;
|
|
647
|
+
}
|
|
648
|
+
catch (error) {
|
|
649
|
+
console.error("Failed to fetch collection metadata:", error);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return result;
|
|
653
|
+
}
|
|
654
|
+
async loadDataCiteSession(url) {
|
|
655
|
+
try {
|
|
656
|
+
const response = await this.axiosInstance.get(url);
|
|
657
|
+
return response.data;
|
|
658
|
+
}
|
|
659
|
+
catch (error) {
|
|
660
|
+
console.error("Failed to load session data:", error);
|
|
661
|
+
throw error;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
async loadAllDataCiteSessions(parsedData) {
|
|
665
|
+
const result = {
|
|
666
|
+
alternatives: []
|
|
667
|
+
};
|
|
668
|
+
if (parsedData.mainSessionUrl) {
|
|
669
|
+
result.main = await this.loadDataCiteSession(parsedData.mainSessionUrl);
|
|
670
|
+
}
|
|
671
|
+
for (const url of parsedData.alternativeSessionUrls) {
|
|
672
|
+
try {
|
|
673
|
+
const data = await this.loadDataCiteSession(url);
|
|
674
|
+
result.alternatives.push(data);
|
|
675
|
+
}
|
|
676
|
+
catch (error) {
|
|
677
|
+
console.error(`Failed to load alternative session from ${url}:`, error);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return result;
|
|
681
|
+
}
|
|
626
682
|
changeDataCiteStatus(id, status) {
|
|
627
683
|
let headers = new AxiosHeaders();
|
|
628
684
|
headers["Accept"] = "application/json";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/index.d.ts
CHANGED
|
File without changes
|
package/build/index.js
CHANGED
|
File without changes
|
package/build/utilities.d.ts
CHANGED
|
File without changes
|
package/build/utilities.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -39,6 +39,8 @@ export interface SiteProperties {
|
|
|
39
39
|
jwt_refresh_token_lifetime_days: number;
|
|
40
40
|
jwt_remember_me_access_token_lifetime_days: number;
|
|
41
41
|
jwt_remember_me_refresh_token_lifetime_days: number;
|
|
42
|
+
umami_website_id?: string;
|
|
43
|
+
umami_url?: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export interface CurtainChunkedUploadStatus {
|
|
@@ -162,6 +164,33 @@ export interface AddCurtainToCollection {
|
|
|
162
164
|
link_id?: string;
|
|
163
165
|
}
|
|
164
166
|
|
|
167
|
+
export interface DataCiteAlternateIdentifier {
|
|
168
|
+
alternateIdentifier: string;
|
|
169
|
+
alternateIdentifierType: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface DataCiteCollectionMetadata {
|
|
173
|
+
collection_id: number;
|
|
174
|
+
collection_name: string;
|
|
175
|
+
collection_description: string;
|
|
176
|
+
main_session: {
|
|
177
|
+
curtain_id: number | null;
|
|
178
|
+
link_id: string | null;
|
|
179
|
+
};
|
|
180
|
+
sessions: Array<{
|
|
181
|
+
curtain_id: number;
|
|
182
|
+
link_id: string;
|
|
183
|
+
data_url: string;
|
|
184
|
+
}>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface ParsedDataCiteData {
|
|
188
|
+
mainSessionUrl?: string;
|
|
189
|
+
alternativeSessionUrls: string[];
|
|
190
|
+
collectionMetadataUrl?: string;
|
|
191
|
+
collectionMetadata?: DataCiteCollectionMetadata;
|
|
192
|
+
}
|
|
193
|
+
|
|
165
194
|
export class CurtainWebAPI {
|
|
166
195
|
loginURL: string = "";
|
|
167
196
|
logoutURL: string = "";
|
|
@@ -821,6 +850,68 @@ export class CurtainWebAPI {
|
|
|
821
850
|
return this.axiosInstance.delete(this.baseURL + "datacite/" + id + "/", {headers: headers, responseType: "json"})
|
|
822
851
|
}
|
|
823
852
|
|
|
853
|
+
async parseDataCiteAlternateIdentifiers(alternateIdentifiers: DataCiteAlternateIdentifier[]): Promise<ParsedDataCiteData> {
|
|
854
|
+
const result: ParsedDataCiteData = {
|
|
855
|
+
alternativeSessionUrls: []
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
for (const identifier of alternateIdentifiers) {
|
|
859
|
+
switch (identifier.alternateIdentifierType) {
|
|
860
|
+
case "Curtain Main Session Data":
|
|
861
|
+
result.mainSessionUrl = identifier.alternateIdentifier;
|
|
862
|
+
break;
|
|
863
|
+
case "Curtain Alternative Session Data":
|
|
864
|
+
result.alternativeSessionUrls.push(identifier.alternateIdentifier);
|
|
865
|
+
break;
|
|
866
|
+
case "Curtain Collection Metadata":
|
|
867
|
+
result.collectionMetadataUrl = identifier.alternateIdentifier;
|
|
868
|
+
break;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
if (result.collectionMetadataUrl) {
|
|
873
|
+
try {
|
|
874
|
+
const response = await this.axiosInstance.get<DataCiteCollectionMetadata>(result.collectionMetadataUrl);
|
|
875
|
+
result.collectionMetadata = response.data;
|
|
876
|
+
} catch (error) {
|
|
877
|
+
console.error("Failed to fetch collection metadata:", error);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
return result;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
async loadDataCiteSession(url: string): Promise<any> {
|
|
885
|
+
try {
|
|
886
|
+
const response = await this.axiosInstance.get(url);
|
|
887
|
+
return response.data;
|
|
888
|
+
} catch (error) {
|
|
889
|
+
console.error("Failed to load session data:", error);
|
|
890
|
+
throw error;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
async loadAllDataCiteSessions(parsedData: ParsedDataCiteData): Promise<{main?: any, alternatives: any[]}> {
|
|
895
|
+
const result: {main?: any, alternatives: any[]} = {
|
|
896
|
+
alternatives: []
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
if (parsedData.mainSessionUrl) {
|
|
900
|
+
result.main = await this.loadDataCiteSession(parsedData.mainSessionUrl);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
for (const url of parsedData.alternativeSessionUrls) {
|
|
904
|
+
try {
|
|
905
|
+
const data = await this.loadDataCiteSession(url);
|
|
906
|
+
result.alternatives.push(data);
|
|
907
|
+
} catch (error) {
|
|
908
|
+
console.error(`Failed to load alternative session from ${url}:`, error);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
return result;
|
|
913
|
+
}
|
|
914
|
+
|
|
824
915
|
changeDataCiteStatus(id: number, status: string) {
|
|
825
916
|
let headers = new AxiosHeaders()
|
|
826
917
|
headers["Accept"] = "application/json"
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/utilities.ts
CHANGED
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|