@nexys/user-management-sdk 0.1.4 → 0.1.6

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 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
@@ -53,7 +53,7 @@ class AuthClient {
53
53
  };
54
54
  adminUserDelete = async (uuid) => {
55
55
  return this.makeRequest({
56
- path: "/admin/users/delete",
56
+ path: "/admin/user/delete",
57
57
  method: "POST",
58
58
  data: { uuid },
59
59
  });
@@ -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)
@@ -13,5 +13,6 @@ export const makeRequest = (apiBasename, headers = { "content-type": "applicatio
13
13
  if (response.ok) {
14
14
  return response.json();
15
15
  }
16
- return Promise.reject(response.json());
16
+ // Await the JSON before rejecting so the error is the actual object, not a Promise
17
+ return Promise.reject(await response.json());
17
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexys/user-management-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "description": "react client/sdk that faciliates connecting to the user management",
6
6
  "main": "dist/index.js",