@nexys/user-management-sdk 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/client.d.ts +6 -1
- package/dist/client.js +8 -1
- package/dist/context.d.ts +2 -2
- package/dist/type.js +12 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Locale, type Profile, type SSOService, type UserAdmin, Permission } from "./type";
|
|
1
|
+
import { type Locale, type Profile, type SSOService, type UserAdmin, Permission } from "./type.js";
|
|
2
2
|
export declare const redirectUrl: (ssoService: SSOService) => string;
|
|
3
3
|
declare class AuthClient {
|
|
4
4
|
apiBasename: string;
|
|
@@ -36,5 +36,10 @@ declare class AuthClient {
|
|
|
36
36
|
uuid: string;
|
|
37
37
|
name: string;
|
|
38
38
|
}>;
|
|
39
|
+
loadAvailableProviders: () => Promise<Array<{
|
|
40
|
+
service: SSOService;
|
|
41
|
+
name: string;
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
}>>;
|
|
39
44
|
}
|
|
40
45
|
export default AuthClient;
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { paramsToString } from "./utils";
|
|
1
|
+
import { paramsToString } from "./utils.js";
|
|
2
2
|
// auth stuff
|
|
3
3
|
const headers = { "content-type": "application/json" };
|
|
4
4
|
export const redirectUrl = (ssoService) => [window.location.origin, "auth", "sso", ssoService, "redirect"].join("/");
|
|
@@ -66,5 +66,12 @@ class AuthClient {
|
|
|
66
66
|
return Promise.reject(response.json());
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
+
loadAvailableProviders = async () => {
|
|
70
|
+
const response = await fetch(this.apiBasename + "/napi/auth/oauth/providers");
|
|
71
|
+
if (response.ok) {
|
|
72
|
+
return response.json();
|
|
73
|
+
}
|
|
74
|
+
return Promise.reject(response.json());
|
|
75
|
+
};
|
|
69
76
|
}
|
|
70
77
|
export default AuthClient;
|
package/dist/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ReactNode } from "react";
|
|
2
|
-
import AuthClient from "./client";
|
|
3
|
-
import type { Locale, Permission, Profile } from "./type";
|
|
2
|
+
import AuthClient from "./client.js";
|
|
3
|
+
import type { Locale, Permission, Profile } from "./type.js";
|
|
4
4
|
export type AuthContextType = {
|
|
5
5
|
profile: Profile;
|
|
6
6
|
permissions: Permission[];
|
package/dist/type.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var UserStatus;
|
|
2
|
+
(function (UserStatus) {
|
|
3
|
+
UserStatus[UserStatus["active"] = 1] = "active";
|
|
4
|
+
UserStatus[UserStatus["inactive"] = 2] = "inactive";
|
|
5
|
+
UserStatus[UserStatus["pending"] = 3] = "pending";
|
|
6
|
+
})(UserStatus || (UserStatus = {}));
|
|
7
|
+
export var Permission;
|
|
8
|
+
(function (Permission) {
|
|
9
|
+
Permission[Permission["app"] = 1] = "app";
|
|
10
|
+
Permission[Permission["admin"] = 2] = "admin";
|
|
11
|
+
Permission[Permission["superadmin"] = 3] = "superadmin";
|
|
12
|
+
})(Permission || (Permission = {}));
|