@beamarco/auth-sdk 0.1.0
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/README.md +163 -0
- package/dist/client.d.ts +59 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +149 -0
- package/dist/components/ProtectedRoute.d.ts +13 -0
- package/dist/components/ProtectedRoute.d.ts.map +1 -0
- package/dist/components/ProtectedRoute.js +21 -0
- package/dist/components/SignIn.d.ts +87 -0
- package/dist/components/SignIn.d.ts.map +1 -0
- package/dist/components/SignIn.js +149 -0
- package/dist/components/SignInButton.d.ts +13 -0
- package/dist/components/SignInButton.d.ts.map +1 -0
- package/dist/components/SignInButton.js +14 -0
- package/dist/components/SignUp.d.ts +79 -0
- package/dist/components/SignUp.d.ts.map +1 -0
- package/dist/components/SignUp.js +143 -0
- package/dist/components/SignUpButton.d.ts +13 -0
- package/dist/components/SignUpButton.d.ts.map +1 -0
- package/dist/components/SignUpButton.js +14 -0
- package/dist/components/SignedIn.d.ts +9 -0
- package/dist/components/SignedIn.d.ts.map +1 -0
- package/dist/components/SignedIn.js +13 -0
- package/dist/components/SignedOut.d.ts +9 -0
- package/dist/components/SignedOut.d.ts.map +1 -0
- package/dist/components/SignedOut.js +13 -0
- package/dist/components/UserButton.d.ts +13 -0
- package/dist/components/UserButton.d.ts.map +1 -0
- package/dist/components/UserButton.js +64 -0
- package/dist/context.d.ts +29 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +88 -0
- package/dist/hooks.d.ts +13 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +22 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/package.json +56 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User object returned from auth-service
|
|
3
|
+
*/
|
|
4
|
+
export interface User {
|
|
5
|
+
id: string;
|
|
6
|
+
loginId: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
cellphone?: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
tenants?: TenantMember[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Tenant membership
|
|
14
|
+
*/
|
|
15
|
+
export interface TenantMember {
|
|
16
|
+
tenant: {
|
|
17
|
+
id: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
};
|
|
20
|
+
userRole?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for BeamarAuthProvider
|
|
24
|
+
*/
|
|
25
|
+
export interface BeamarAuthConfig {
|
|
26
|
+
/** Base URL of the auth-service API (e.g. https://auth.creztu.com) */
|
|
27
|
+
apiUrl: string;
|
|
28
|
+
/** Application name for multi-tenant (e.g. GOMEDI, developers-portal) */
|
|
29
|
+
appName: string;
|
|
30
|
+
/** Google OAuth client ID for Sign In with Google */
|
|
31
|
+
googleClientId?: string;
|
|
32
|
+
/** Optional callback URL after password reset */
|
|
33
|
+
parentUrl?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Login with email/password
|
|
37
|
+
*/
|
|
38
|
+
export interface LoginCredentials {
|
|
39
|
+
email: string;
|
|
40
|
+
password: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Register with email/password
|
|
44
|
+
*/
|
|
45
|
+
export interface RegisterCredentials {
|
|
46
|
+
email: string;
|
|
47
|
+
password: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Google OAuth credential from @react-oauth/google
|
|
51
|
+
*/
|
|
52
|
+
export interface GoogleCredential {
|
|
53
|
+
credential: string;
|
|
54
|
+
clientId: string;
|
|
55
|
+
}
|
|
56
|
+
export declare class AuthError extends Error {
|
|
57
|
+
statusCode?: number | undefined;
|
|
58
|
+
code?: string | undefined;
|
|
59
|
+
constructor(message: string, statusCode?: number | undefined, code?: string | undefined);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,SAAU,SAAQ,KAAK;IAGzB,UAAU,CAAC,EAAE,MAAM;IACnB,IAAI,CAAC,EAAE,MAAM;gBAFpB,OAAO,EAAE,MAAM,EACR,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,IAAI,CAAC,EAAE,MAAM,YAAA;CAKvB"}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@beamarco/auth-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Beamar Auth SDK - Embed authentication like Clerk in your React apps",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"ci": "npm install && npm run build",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": ">=17.0.0",
|
|
26
|
+
"react-dom": ">=17.0.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@react-oauth/google": "^0.11.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/react": "^18.2.0",
|
|
33
|
+
"react": "^18.2.0",
|
|
34
|
+
"react-dom": "^18.2.0",
|
|
35
|
+
"typescript": "^5.3.0"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"auth",
|
|
39
|
+
"beamar",
|
|
40
|
+
"react",
|
|
41
|
+
"authentication"
|
|
42
|
+
],
|
|
43
|
+
"author": "Beamar",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/beamarco/beamar-auth-sdk.git"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/beamarco/beamar-auth-sdk/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/beamarco/beamar-auth-sdk#readme",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
}
|
|
56
|
+
}
|