@protobase/client 0.25.1 → 0.25.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/auth-types.d.ts +4 -1
- package/dist/auth.js +3 -1
- package/package.json +3 -3
package/dist/auth-types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PluginRef } from "./types.js";
|
|
2
|
+
import { Locale } from "@protobase/schema/internal";
|
|
2
3
|
//#region src/auth-types.d.ts
|
|
3
4
|
export type AuthUser = {
|
|
4
5
|
id: string;
|
|
@@ -34,7 +35,8 @@ export type SamlSignIn = {
|
|
|
34
35
|
* `sendSignUpCode`); `socialProviders` the ids of the sign-in providers, for example
|
|
35
36
|
* `github`; `platformSignIn` the one of them the platform adds; `samlProviders` the app's SAML identity providers; `staffSignIn` the operator provider's name when its staff
|
|
36
37
|
* can sign in as people; `organizations` when the app has them; `anonymous` when visitors may browse what the project's
|
|
37
|
-
* anonymous role reads without signing in; `plugins` those the app loads before anyone signs in
|
|
38
|
+
* anonymous role reads without signing in; `plugins` those the app loads before anyone signs in; `locale` the language
|
|
39
|
+
* the app sets for everyone, which the screens before `/meta` are in.
|
|
38
40
|
*/
|
|
39
41
|
export type SetupStatus = {
|
|
40
42
|
needsAdmin: boolean;
|
|
@@ -57,6 +59,7 @@ export type SetupStatus = {
|
|
|
57
59
|
};
|
|
58
60
|
anonymous?: boolean;
|
|
59
61
|
plugins?: PluginRef[];
|
|
62
|
+
locale?: Locale;
|
|
60
63
|
};
|
|
61
64
|
/** A role with its label; `membership` when a member can hold it, `grants` the other roles its holders may give. */
|
|
62
65
|
export type RoleLabel = {
|
package/dist/auth.js
CHANGED
|
@@ -7,6 +7,7 @@ import { usersClient } from "./users.js";
|
|
|
7
7
|
import { signInFlows } from "./sign-in-flows.js";
|
|
8
8
|
import { signInPolicyClient } from "./sign-in-policy.js";
|
|
9
9
|
import { staffSignInClient } from "./staff-sign-in.js";
|
|
10
|
+
import { isLocale } from "@protobase/schema/internal";
|
|
10
11
|
//#region src/auth.ts
|
|
11
12
|
/** The expiry of a JWT in milliseconds, read from its payload (the signature is the server's business). */
|
|
12
13
|
const tokenExpiry = (token) => {
|
|
@@ -82,7 +83,8 @@ const createAuthSession = (options = {}) => {
|
|
|
82
83
|
...body.passkeyDomains && { passkeyDomains: body.passkeyDomains },
|
|
83
84
|
...body.organizations && { organizations: body.organizations },
|
|
84
85
|
...body.anonymous && { anonymous: true },
|
|
85
|
-
...body.plugins && body.plugins.length > 0 && { plugins: body.plugins }
|
|
86
|
+
...body.plugins && body.plugins.length > 0 && { plugins: body.plugins },
|
|
87
|
+
...isLocale(body.locale) && { locale: body.locale }
|
|
86
88
|
};
|
|
87
89
|
},
|
|
88
90
|
/** The signed-in user from the session cookie, or `undefined`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/client",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.3",
|
|
4
4
|
"description": "Typed fetch client for the Protobase REST API.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@better-auth/passkey": "^1.7.7",
|
|
33
|
-
"@protobase/layout": "0.25.
|
|
34
|
-
"@protobase/schema": "0.25.
|
|
33
|
+
"@protobase/layout": "0.25.3",
|
|
34
|
+
"@protobase/schema": "0.25.3",
|
|
35
35
|
"@simplewebauthn/browser": "^13.3.0",
|
|
36
36
|
"better-auth": "^1.7.7"
|
|
37
37
|
}
|