@nexys/user-management-sdk 0.1.0 → 0.1.2
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 +1 -3
- package/dist/client.js +1 -5
- package/dist/type.js +12 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type Locale, type Profile, type SSOService, type UserAdmin, Permission } from "./type";
|
|
2
|
+
export declare const redirectUrl: (ssoService: SSOService) => string;
|
|
2
3
|
declare class AuthClient {
|
|
3
4
|
apiBasename: string;
|
|
4
5
|
constructor(apiBasename: string);
|
|
5
|
-
authSSOUrl2: (service: SSOService) => Promise<{
|
|
6
|
-
url: string;
|
|
7
|
-
}>;
|
|
8
6
|
authSSOUrl: (service: SSOService, params?: Partial<{
|
|
9
7
|
isSignup: boolean;
|
|
10
8
|
redirectUrl: string;
|
package/dist/client.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { paramsToString } from "./utils";
|
|
2
2
|
// auth stuff
|
|
3
3
|
const headers = { "content-type": "application/json" };
|
|
4
|
-
const redirectUrl = (ssoService) => [window.location.origin, "auth", "sso", ssoService, "redirect"].join("/");
|
|
4
|
+
export const redirectUrl = (ssoService) => [window.location.origin, "auth", "sso", ssoService, "redirect"].join("/");
|
|
5
5
|
class AuthClient {
|
|
6
6
|
apiBasename;
|
|
7
7
|
constructor(apiBasename) {
|
|
8
8
|
this.apiBasename = apiBasename;
|
|
9
9
|
}
|
|
10
|
-
authSSOUrl2 = async (service) => {
|
|
11
|
-
const response = await fetch(`${this.apiBasename}/auth/oauth/${service}/url?redirectUrl=${encodeURIComponent(redirectUrl(service))}`);
|
|
12
|
-
return response.json();
|
|
13
|
-
};
|
|
14
10
|
authSSOUrl = async (service, params) => {
|
|
15
11
|
const url = `${this.apiBasename}/auth/oauth/${service}/url?${paramsToString(params)}`;
|
|
16
12
|
const response = await fetch(url);
|
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 = {}));
|