@junobuild/core 5.1.0 → 5.2.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.
@@ -4,9 +4,9 @@
4
4
  export type DeprecatedNfid = 'nfid';
5
5
  /**
6
6
  * Type representing the authentication providers.
7
- * @typedef {('internet_identity' | 'nfid' | 'webauthn' | 'google')} Provider
7
+ * @typedef {('internet_identity' | 'nfid' | 'webauthn' | 'google' | 'github')} Provider
8
8
  */
9
- export type Provider = 'internet_identity' | DeprecatedNfid | 'webauthn' | 'google';
9
+ export type Provider = 'internet_identity' | DeprecatedNfid | 'webauthn' | 'google' | 'github';
10
10
  /**
11
11
  * Subset of authentication providers that do not include any provider-specific metadata.
12
12
  */
@@ -11,6 +11,7 @@ export type UserProvider = Provider | undefined;
11
11
  * Resolves to the appropriate structure based on the provider:
12
12
  * - `webauthn` → includes WebAuthn metadata.
13
13
  * - `google` → includes OpenID profile metadata.
14
+ * - `github` → includes OpenID profile metadata.
14
15
  * - `internet_identity` / `nfid` / `undefined` → no provider-specific metadata.
15
16
  *
16
17
  * @template P Authentication provider (defaults to all).
@@ -27,6 +28,12 @@ export type UserData<P extends UserProvider = UserProvider> = P extends 'webauth
27
28
  */
28
29
  provider: 'google';
29
30
  providerData: ProviderData<'openid'>;
31
+ } : P extends 'github' ? {
32
+ /**
33
+ * Sign-in via Github.
34
+ */
35
+ provider: 'github';
36
+ providerData: ProviderData<'openid'>;
30
37
  } : {
31
38
  /**
32
39
  * Sign-in via another provider. There is no absolute guarantee that the information can be set by the browser
@@ -17,3 +17,12 @@ export declare const isWebAuthnUser: (user: User) => user is User<"webauthn">;
17
17
  * @returns True if the user signed in via Google.
18
18
  */
19
19
  export declare const isGoogleUser: (user: User) => user is User<"google">;
20
+ /**
21
+ * Checks whether a user signed in using GitHub (OpenID).
22
+ *
23
+ * Acts as a type guard that narrows {@link User} to {@link User<'github'>}.
24
+ *
25
+ * @param user - The user object to check.
26
+ * @returns True if the user signed in via GitHub.
27
+ */
28
+ export declare const isGitHubUser: (user: User) => user is User<"github">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/core",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "JavaScript core client for Juno",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -52,10 +52,10 @@
52
52
  ],
53
53
  "homepage": "https://juno.build",
54
54
  "dependencies": {
55
- "@junobuild/auth": "^3",
55
+ "@junobuild/auth": "^4",
56
56
  "@junobuild/errors": "*",
57
- "@junobuild/ic-client": "^7.2",
58
- "@junobuild/storage": "^2.2",
57
+ "@junobuild/ic-client": "^8",
58
+ "@junobuild/storage": "^2.3",
59
59
  "@junobuild/utils": "*"
60
60
  },
61
61
  "peerDependencies": {