@virusis/api-client 0.1.1 → 0.1.3
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/dist/generated/index.d.ts +9 -0
- package/dist/generated/index.js +53 -9
- package/package.json +5 -5
|
@@ -277,6 +277,10 @@ export interface IAuthClient extends IEntity {
|
|
|
277
277
|
* @return OK
|
|
278
278
|
*/
|
|
279
279
|
forgotPassword(email?: string | undefined, signal?: AbortSignal): Promise<any>;
|
|
280
|
+
/**
|
|
281
|
+
* @return OK
|
|
282
|
+
*/
|
|
283
|
+
csrfToken(signal?: AbortSignal): Promise<any>;
|
|
280
284
|
}
|
|
281
285
|
export declare class AuthClient extends BaseApiClient implements IAuthClient {
|
|
282
286
|
private http;
|
|
@@ -321,6 +325,11 @@ export declare class AuthClient extends BaseApiClient implements IAuthClient {
|
|
|
321
325
|
*/
|
|
322
326
|
forgotPassword(email?: string | undefined, signal?: AbortSignal): Promise<any>;
|
|
323
327
|
protected processForgotPassword(response: Response): Promise<any>;
|
|
328
|
+
/**
|
|
329
|
+
* @return OK
|
|
330
|
+
*/
|
|
331
|
+
csrfToken(signal?: AbortSignal): Promise<any>;
|
|
332
|
+
protected processCsrfToken(response: Response): Promise<any>;
|
|
324
333
|
}
|
|
325
334
|
export interface IBaseUserDevicesClient extends IEntity {
|
|
326
335
|
/**
|
package/dist/generated/index.js
CHANGED
|
@@ -897,7 +897,8 @@ export class AuthClient extends BaseApiClient {
|
|
|
897
897
|
;
|
|
898
898
|
if (status === 200) {
|
|
899
899
|
return response.text().then((_responseText) => {
|
|
900
|
-
|
|
900
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
901
|
+
return result200;
|
|
901
902
|
});
|
|
902
903
|
}
|
|
903
904
|
else if (status !== 200 && status !== 204) {
|
|
@@ -936,7 +937,8 @@ export class AuthClient extends BaseApiClient {
|
|
|
936
937
|
;
|
|
937
938
|
if (status === 200) {
|
|
938
939
|
return response.text().then((_responseText) => {
|
|
939
|
-
|
|
940
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
941
|
+
return result200;
|
|
940
942
|
});
|
|
941
943
|
}
|
|
942
944
|
else if (status !== 200 && status !== 204) {
|
|
@@ -975,7 +977,8 @@ export class AuthClient extends BaseApiClient {
|
|
|
975
977
|
;
|
|
976
978
|
if (status === 200) {
|
|
977
979
|
return response.text().then((_responseText) => {
|
|
978
|
-
|
|
980
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
981
|
+
return result200;
|
|
979
982
|
});
|
|
980
983
|
}
|
|
981
984
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1014,7 +1017,8 @@ export class AuthClient extends BaseApiClient {
|
|
|
1014
1017
|
;
|
|
1015
1018
|
if (status === 200) {
|
|
1016
1019
|
return response.text().then((_responseText) => {
|
|
1017
|
-
|
|
1020
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1021
|
+
return result200;
|
|
1018
1022
|
});
|
|
1019
1023
|
}
|
|
1020
1024
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1053,7 +1057,8 @@ export class AuthClient extends BaseApiClient {
|
|
|
1053
1057
|
;
|
|
1054
1058
|
if (status === 200) {
|
|
1055
1059
|
return response.text().then((_responseText) => {
|
|
1056
|
-
|
|
1060
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1061
|
+
return result200;
|
|
1057
1062
|
});
|
|
1058
1063
|
}
|
|
1059
1064
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1092,7 +1097,43 @@ export class AuthClient extends BaseApiClient {
|
|
|
1092
1097
|
;
|
|
1093
1098
|
if (status === 200) {
|
|
1094
1099
|
return response.text().then((_responseText) => {
|
|
1095
|
-
|
|
1100
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1101
|
+
return result200;
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
else if (status !== 200 && status !== 204) {
|
|
1105
|
+
return response.text().then((_responseText) => {
|
|
1106
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
return Promise.resolve(null);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* @return OK
|
|
1113
|
+
*/
|
|
1114
|
+
csrfToken(signal) {
|
|
1115
|
+
let url_ = this.baseUrl + "/api/Auth/CsrfToken";
|
|
1116
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1117
|
+
let options_ = {
|
|
1118
|
+
method: "GET",
|
|
1119
|
+
signal,
|
|
1120
|
+
headers: {}
|
|
1121
|
+
};
|
|
1122
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
1123
|
+
return this.processCsrfToken(_response);
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
processCsrfToken(response) {
|
|
1127
|
+
const status = response.status;
|
|
1128
|
+
let _headers = {};
|
|
1129
|
+
if (response.headers && response.headers.forEach) {
|
|
1130
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1131
|
+
}
|
|
1132
|
+
;
|
|
1133
|
+
if (status === 200) {
|
|
1134
|
+
return response.text().then((_responseText) => {
|
|
1135
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1136
|
+
return result200;
|
|
1096
1137
|
});
|
|
1097
1138
|
}
|
|
1098
1139
|
else if (status !== 200 && status !== 204) {
|
|
@@ -18173,7 +18214,8 @@ export class TrialAuthClient extends BaseApiClient {
|
|
|
18173
18214
|
;
|
|
18174
18215
|
if (status === 200) {
|
|
18175
18216
|
return response.text().then((_responseText) => {
|
|
18176
|
-
|
|
18217
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
18218
|
+
return result200;
|
|
18177
18219
|
});
|
|
18178
18220
|
}
|
|
18179
18221
|
else if (status !== 200 && status !== 204) {
|
|
@@ -18212,7 +18254,8 @@ export class TrialAuthClient extends BaseApiClient {
|
|
|
18212
18254
|
;
|
|
18213
18255
|
if (status === 200) {
|
|
18214
18256
|
return response.text().then((_responseText) => {
|
|
18215
|
-
|
|
18257
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
18258
|
+
return result200;
|
|
18216
18259
|
});
|
|
18217
18260
|
}
|
|
18218
18261
|
else if (status !== 200 && status !== 204) {
|
|
@@ -18251,7 +18294,8 @@ export class TrialAuthClient extends BaseApiClient {
|
|
|
18251
18294
|
;
|
|
18252
18295
|
if (status === 200) {
|
|
18253
18296
|
return response.text().then((_responseText) => {
|
|
18254
|
-
|
|
18297
|
+
const result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
18298
|
+
return result200;
|
|
18255
18299
|
});
|
|
18256
18300
|
}
|
|
18257
18301
|
else if (status !== 200 && status !== 204) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virusis/api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"build": "tsc -p tsconfig.json",
|
|
30
30
|
"test": "vitest run",
|
|
31
31
|
"ci": "npm run generate && npm run build && npm test",
|
|
32
|
-
"release": "npm run ci && npm publish --access=
|
|
32
|
+
"release": "npm run ci && npm publish --access=public",
|
|
33
33
|
"pack:local": "node -e \"require('fs').mkdirSync('packages',{recursive:true});\" && npm pack --pack-destination ./packages",
|
|
34
34
|
"fetch:spec": "node scripts/fetch-spec.mjs",
|
|
35
|
-
"gen:python": "npm run fetch:spec && npx openapi-generator-cli generate -g python -i specs/openapi.json -o out/python --package-name virusis_api_client",
|
|
36
|
-
"gen:flutter": "npm run fetch:spec && npx openapi-generator-cli generate -g dart-dio
|
|
35
|
+
"gen:python": "npm run fetch:spec && npx @openapitools/openapi-generator-cli generate -g python -i specs/openapi.json -o out/python --package-name virusis_api_client",
|
|
36
|
+
"gen:flutter": "npm run fetch:spec && npx @openapitools/openapi-generator-cli generate -g dart-dio -i specs/openapi.json -o out/flutter --additional-properties=pubName=virusis_api_client",
|
|
37
37
|
"gen:all": "npm run gen:python && npm run gen:flutter",
|
|
38
38
|
"version:auto": "standard-version --skip.tag --skip.commit"
|
|
39
39
|
},
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"openapi-generator-cli": "^1.0.0",
|
|
45
44
|
"rxjs": "^7.8.2"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
47
|
+
"@openapitools/openapi-generator-cli": "^7.6.0",
|
|
48
48
|
"standard-version": "^9.5.0",
|
|
49
49
|
"typescript": "^5.4.0",
|
|
50
50
|
"vitest": "^4.0.15"
|