curtain-web-api 1.0.45 → 1.0.47

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.
@@ -45,4 +45,7 @@ export declare class CurtainWebAPI {
45
45
  getStatsSummary(lastNDays: number): Promise<import("axios").AxiosResponse<any, any>>;
46
46
  postEncryptionFactors(encryptedAESKey: string, encryptedIV: string, linkId: string): Promise<import("axios").AxiosResponse<any, any>>;
47
47
  getEncryptionFactors(linkId: string): Promise<import("axios").AxiosResponse<any, any>>;
48
+ createCurtainAPIKey(name: string): Promise<import("axios").AxiosResponse<any, any>>;
49
+ getCurtainAPIKeys(): Promise<import("axios").AxiosResponse<any, any>>;
50
+ deleteCurtainAPIKey(id: number): Promise<import("axios").AxiosResponse<any, any>>;
48
51
  }
@@ -105,7 +105,8 @@ class CurtainWebAPI {
105
105
  config.url === this.logoutURL ||
106
106
  config.url === this.userInfoURL ||
107
107
  config.url.startsWith(this.curtainURL) ||
108
- config.url.startsWith(this.baseURL + "data_filter_list/")) {
108
+ config.url.startsWith(this.baseURL + "data_filter_list/") ||
109
+ config.url.startsWith(this.baseURL + "api_key/")) {
109
110
  if (this.user.loginStatus) {
110
111
  config.headers["Authorization"] = "Bearer " + this.user.access_token;
111
112
  }
@@ -521,5 +522,23 @@ class CurtainWebAPI {
521
522
  return yield this.axiosInstance.get(this.baseURL + "curtain/" + linkId + "/get_encryption_factors/", { headers: headers, responseType: "json" });
522
523
  });
523
524
  }
525
+ createCurtainAPIKey(name) {
526
+ let headers = new axios_1.AxiosHeaders();
527
+ headers["Accept"] = "application/json";
528
+ headers["Content-Type"] = "application/json";
529
+ return this.axiosInstance.post(this.baseURL + "api_key/", { name: name }, { headers: headers, responseType: "json" });
530
+ }
531
+ getCurtainAPIKeys() {
532
+ let headers = new axios_1.AxiosHeaders();
533
+ headers["Accept"] = "application/json";
534
+ headers["Content-Type"] = "application/json";
535
+ return this.axiosInstance.get(this.baseURL + "api_key/", { headers: headers, responseType: "json" });
536
+ }
537
+ deleteCurtainAPIKey(id) {
538
+ let headers = new axios_1.AxiosHeaders();
539
+ headers["Accept"] = "application/json";
540
+ headers["Content-Type"] = "application/json";
541
+ return this.axiosInstance.delete(this.baseURL + "api_key/" + id + "/", { headers: headers, responseType: "json" });
542
+ }
524
543
  }
525
544
  exports.CurtainWebAPI = CurtainWebAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curtain-web-api",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -78,7 +78,8 @@ export class CurtainWebAPI {
78
78
  config.url === this.logoutURL ||
79
79
  config.url === this.userInfoURL ||
80
80
  config.url.startsWith(this.curtainURL) ||
81
- config.url.startsWith(this.baseURL + "data_filter_list/")) {
81
+ config.url.startsWith(this.baseURL + "data_filter_list/") ||
82
+ config.url.startsWith(this.baseURL + "api_key/")) {
82
83
  if (this.user.loginStatus) {
83
84
  config.headers["Authorization"] = "Bearer " + this.user.access_token;
84
85
  }
@@ -531,5 +532,26 @@ export class CurtainWebAPI {
531
532
  headers["Content-Type"] = "application/json";
532
533
  return await this.axiosInstance.get(this.baseURL + "curtain/" + linkId + "/get_encryption_factors/", {headers: headers, responseType: "json"})
533
534
  }
535
+
536
+ createCurtainAPIKey(name: string) {
537
+ let headers = new AxiosHeaders()
538
+ headers["Accept"] = "application/json"
539
+ headers["Content-Type"] = "application/json"
540
+ return this.axiosInstance.post(this.baseURL + "api_key/", {name: name}, {headers: headers, responseType: "json"})
541
+ }
542
+
543
+ getCurtainAPIKeys() {
544
+ let headers = new AxiosHeaders()
545
+ headers["Accept"] = "application/json"
546
+ headers["Content-Type"] = "application/json"
547
+ return this.axiosInstance.get(this.baseURL + "api_key/", {headers: headers, responseType: "json"})
548
+ }
549
+
550
+ deleteCurtainAPIKey(id: number) {
551
+ let headers = new AxiosHeaders()
552
+ headers["Accept"] = "application/json"
553
+ headers["Content-Type"] = "application/json"
554
+ return this.axiosInstance.delete(this.baseURL + "api_key/" + id + "/", {headers: headers, responseType: "json"})
555
+ }
534
556
  }
535
557