@lockerpm/desktop-service 2.4.0 → 2.4.1
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/lib/cjs/services/api.service.js +14 -13
- package/lib/cjs/types/services/api.service.d.ts +1 -1
- package/lib/cjs/types/services/api.service.d.ts.map +1 -1
- package/lib/esm/services/api.service.js +14 -13
- package/lib/esm/types/services/api.service.d.ts +1 -1
- package/lib/esm/types/services/api.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -34,12 +34,14 @@ class ApiService {
|
|
|
34
34
|
this.sessionToken = '';
|
|
35
35
|
}
|
|
36
36
|
// -------------------------------- NO AUTH --------------------------------
|
|
37
|
-
|
|
37
|
+
// TODO: if service is only built by CyStack, then this base API must be fixed
|
|
38
|
+
async getReleases(os) {
|
|
38
39
|
try {
|
|
39
|
-
const url = `${this.baseUrl}/cystack_platform/pm/
|
|
40
|
+
const url = `${this.baseUrl}/cystack_platform/pm/releases`;
|
|
40
41
|
const res = await axios_1.default.get(url, {
|
|
41
42
|
params: {
|
|
42
|
-
|
|
43
|
+
client_id: 'desktop',
|
|
44
|
+
os,
|
|
43
45
|
},
|
|
44
46
|
headers: this.#getHeaders(),
|
|
45
47
|
});
|
|
@@ -48,32 +50,31 @@ class ApiService {
|
|
|
48
50
|
return data;
|
|
49
51
|
}
|
|
50
52
|
catch (error) {
|
|
51
|
-
if (error.response?.status === 404) {
|
|
52
|
-
throw new errors_1.ServiceError('1002', error);
|
|
53
|
-
}
|
|
54
53
|
throw new errors_1.ServiceError('1000', error);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
//
|
|
58
|
-
async
|
|
56
|
+
// -------------------------------- AUTH --------------------------------
|
|
57
|
+
async getPasswordlessCredentials(email) {
|
|
58
|
+
const headers = this.token ? this.#getAuthHeaders() : this.#getHeaders();
|
|
59
59
|
try {
|
|
60
|
-
const url = `${this.baseUrl}/cystack_platform/pm/
|
|
60
|
+
const url = `${this.baseUrl}/cystack_platform/pm/passwordless/credential`;
|
|
61
61
|
const res = await axios_1.default.get(url, {
|
|
62
62
|
params: {
|
|
63
|
-
|
|
64
|
-
os,
|
|
63
|
+
email,
|
|
65
64
|
},
|
|
66
|
-
headers
|
|
65
|
+
headers,
|
|
67
66
|
});
|
|
68
67
|
const data = res.data;
|
|
69
68
|
this.#logDebug({ url, method: 'GET', data });
|
|
70
69
|
return data;
|
|
71
70
|
}
|
|
72
71
|
catch (error) {
|
|
72
|
+
if (error.response?.status === 404) {
|
|
73
|
+
throw new errors_1.ServiceError('1002', error);
|
|
74
|
+
}
|
|
73
75
|
throw new errors_1.ServiceError('1000', error);
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
|
-
// -------------------------------- AUTH --------------------------------
|
|
77
78
|
async getPreloginInfo() {
|
|
78
79
|
const headers = this.#getAuthHeaders();
|
|
79
80
|
try {
|
|
@@ -19,8 +19,8 @@ export declare class ApiService {
|
|
|
19
19
|
setToken(token: string): void;
|
|
20
20
|
setSessionToken(token: string): void;
|
|
21
21
|
clearSessionToken(): void;
|
|
22
|
-
getPasswordlessCredentials(email: string): Promise<GetPublicPwlCredentialResponse>;
|
|
23
22
|
getReleases(os: OS): Promise<GetReleasesResponse>;
|
|
23
|
+
getPasswordlessCredentials(email: string): Promise<GetPublicPwlCredentialResponse>;
|
|
24
24
|
getPreloginInfo(): Promise<GetPreloginResponse>;
|
|
25
25
|
setPasswordlessCredential(params: {
|
|
26
26
|
credentialId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.service.d.ts","sourceRoot":"","sources":["../../../../src/services/api.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB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B;IAOX,WAAW,CAAC,EAAE,EAAE,EAAE;IAoBlB,0BAA0B,CAAC,KAAK,EAAE,MAAM;IAqBxC,eAAe;IAiBf,yBAAyB,CAAC,MAAM,EAAE;QACtC,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,gBAAgB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB;gBAiByB,MAAM;;IAQ1B,4BAA4B;IAmB5B,iCAAiC;IAkBjC,+BAA+B,CAAC,OAAO,EAAE,kBAAkB;YAQpC,MAAM;;IAM7B,kCAAkC,CAAC,EAAE,EAAE,MAAM;IAY7C,kCAAkC,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB;CAuCpF"}
|
|
@@ -28,12 +28,14 @@ export class ApiService {
|
|
|
28
28
|
this.sessionToken = '';
|
|
29
29
|
}
|
|
30
30
|
// -------------------------------- NO AUTH --------------------------------
|
|
31
|
-
|
|
31
|
+
// TODO: if service is only built by CyStack, then this base API must be fixed
|
|
32
|
+
async getReleases(os) {
|
|
32
33
|
try {
|
|
33
|
-
const url = `${this.baseUrl}/cystack_platform/pm/
|
|
34
|
+
const url = `${this.baseUrl}/cystack_platform/pm/releases`;
|
|
34
35
|
const res = await axios.get(url, {
|
|
35
36
|
params: {
|
|
36
|
-
|
|
37
|
+
client_id: 'desktop',
|
|
38
|
+
os,
|
|
37
39
|
},
|
|
38
40
|
headers: this.#getHeaders(),
|
|
39
41
|
});
|
|
@@ -42,32 +44,31 @@ export class ApiService {
|
|
|
42
44
|
return data;
|
|
43
45
|
}
|
|
44
46
|
catch (error) {
|
|
45
|
-
if (error.response?.status === 404) {
|
|
46
|
-
throw new ServiceError('1002', error);
|
|
47
|
-
}
|
|
48
47
|
throw new ServiceError('1000', error);
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
//
|
|
52
|
-
async
|
|
50
|
+
// -------------------------------- AUTH --------------------------------
|
|
51
|
+
async getPasswordlessCredentials(email) {
|
|
52
|
+
const headers = this.token ? this.#getAuthHeaders() : this.#getHeaders();
|
|
53
53
|
try {
|
|
54
|
-
const url = `${this.baseUrl}/cystack_platform/pm/
|
|
54
|
+
const url = `${this.baseUrl}/cystack_platform/pm/passwordless/credential`;
|
|
55
55
|
const res = await axios.get(url, {
|
|
56
56
|
params: {
|
|
57
|
-
|
|
58
|
-
os,
|
|
57
|
+
email,
|
|
59
58
|
},
|
|
60
|
-
headers
|
|
59
|
+
headers,
|
|
61
60
|
});
|
|
62
61
|
const data = res.data;
|
|
63
62
|
this.#logDebug({ url, method: 'GET', data });
|
|
64
63
|
return data;
|
|
65
64
|
}
|
|
66
65
|
catch (error) {
|
|
66
|
+
if (error.response?.status === 404) {
|
|
67
|
+
throw new ServiceError('1002', error);
|
|
68
|
+
}
|
|
67
69
|
throw new ServiceError('1000', error);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
|
-
// -------------------------------- AUTH --------------------------------
|
|
71
72
|
async getPreloginInfo() {
|
|
72
73
|
const headers = this.#getAuthHeaders();
|
|
73
74
|
try {
|
|
@@ -19,8 +19,8 @@ export declare class ApiService {
|
|
|
19
19
|
setToken(token: string): void;
|
|
20
20
|
setSessionToken(token: string): void;
|
|
21
21
|
clearSessionToken(): void;
|
|
22
|
-
getPasswordlessCredentials(email: string): Promise<GetPublicPwlCredentialResponse>;
|
|
23
22
|
getReleases(os: OS): Promise<GetReleasesResponse>;
|
|
23
|
+
getPasswordlessCredentials(email: string): Promise<GetPublicPwlCredentialResponse>;
|
|
24
24
|
getPreloginInfo(): Promise<GetPreloginResponse>;
|
|
25
25
|
setPasswordlessCredential(params: {
|
|
26
26
|
credentialId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.service.d.ts","sourceRoot":"","sources":["../../../../src/services/api.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAIpC,qBAAa,UAAU;;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;gBAItB,MAAM,EAAE;QAClB,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,UAAU,CAAA;QAClB,OAAO,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KACpC;IASD,QAAQ,CAAC,KAAK,EAAE,MAAM;IAOtB,eAAe,CAAC,KAAK,EAAE,MAAM;IAI7B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"api.service.d.ts","sourceRoot":"","sources":["../../../../src/services/api.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,6BAA6B,CAAA;AAIpC,qBAAa,UAAU;;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;gBAItB,MAAM,EAAE;QAClB,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,UAAU,CAAA;QAClB,OAAO,CAAC,EAAE;YAAE,CAAC,GAAG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