@nexys/user-management-sdk 0.1.5 → 0.1.7
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/client.d.ts +5 -0
- package/dist/client.js +7 -0
- package/dist/request.js +4 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -76,6 +76,11 @@ declare class AuthClient {
|
|
|
76
76
|
uuid: string;
|
|
77
77
|
name: string;
|
|
78
78
|
}>;
|
|
79
|
+
tenantDetail: (uuid: string) => Promise<{
|
|
80
|
+
uuid: string;
|
|
81
|
+
name: string;
|
|
82
|
+
dateAdded: string;
|
|
83
|
+
}>;
|
|
79
84
|
loadAvailableProviders: () => Promise<Array<{
|
|
80
85
|
service: SSOService;
|
|
81
86
|
name: string;
|
package/dist/client.js
CHANGED
|
@@ -93,6 +93,13 @@ class AuthClient {
|
|
|
93
93
|
data,
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
+
tenantDetail = async (uuid) => {
|
|
97
|
+
return this.makeRequest({
|
|
98
|
+
path: "/instance/detail",
|
|
99
|
+
method: "POST",
|
|
100
|
+
data: { uuid },
|
|
101
|
+
});
|
|
102
|
+
};
|
|
96
103
|
loadAvailableProviders = async () => {
|
|
97
104
|
return this.makeRequest({
|
|
98
105
|
path: "/auth/oauth/providers",
|
package/dist/request.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { paramsToString } from "./utils";
|
|
1
|
+
import { paramsToString } from "./utils.js";
|
|
2
2
|
export const makeRequest = (apiBasename, headers = { "content-type": "application/json" }) => async ({ path, data, queryParams, method = "GET", }) => {
|
|
3
3
|
const queryParamsString = queryParams
|
|
4
4
|
? "?" + paramsToString(queryParams)
|
|
@@ -9,9 +9,11 @@ export const makeRequest = (apiBasename, headers = { "content-type": "applicatio
|
|
|
9
9
|
headers,
|
|
10
10
|
method,
|
|
11
11
|
body,
|
|
12
|
+
credentials: "include", // Include cookies in requests
|
|
12
13
|
});
|
|
13
14
|
if (response.ok) {
|
|
14
15
|
return response.json();
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
// Await the JSON before rejecting so the error is the actual object, not a Promise
|
|
18
|
+
return Promise.reject(await response.json());
|
|
17
19
|
};
|