@softr/sdk 0.0.68 → 0.0.69-alpha.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/dist/auth/methods/profile.d.ts +26 -0
- package/dist/auth/methods/profile.js +52 -0
- package/dist/auth/methods/utils.d.ts +1 -1
- package/dist/auth/platform.js +9 -2
- package/dist/auth/server.d.ts +2 -0
- package/dist/auth/server.js +2 -0
- package/dist/auth/session.js +11 -1
- package/dist/auth/user.d.ts +4 -0
- package/dist/auth/user.js +3 -1
- package/dist/default-error-overlay.d.ts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/package.js +1 -1
- package/dist/pwa.d.ts +2 -2
- package/package.json +1 -1
- package/skills/softr-sdk/SKILL.md +1 -1
- package/skills/softr-sdk/auth/SKILL.md +29 -10
- package/skills/softr-sdk/charts-and-metrics/SKILL.md +1 -1
- package/skills/softr-sdk/current-user/SKILL.md +3 -1
- package/skills/softr-sdk/file-uploads/SKILL.md +1 -1
- package/skills/softr-sdk/formatting/SKILL.md +1 -1
- package/skills/softr-sdk/integrations/SKILL.md +1 -1
- package/skills/softr-sdk/mcp/SKILL.md +1 -1
- package/skills/softr-sdk/pwa/SKILL.md +1 -1
- package/skills/softr-sdk/record-mutations/SKILL.md +1 -1
- package/skills/softr-sdk/record-queries/SKILL.md +1 -1
- package/skills/softr-sdk/region-visibility/SKILL.md +1 -1
- package/skills/softr-sdk/routes-and-visibility/SKILL.md +1 -1
- package/skills/softr-sdk/workflows/SKILL.md +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { User } from "../user.js";
|
|
2
|
+
import { AuthError, Result } from "./utils.js";
|
|
3
|
+
|
|
4
|
+
//#region src/auth/methods/profile.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Changes the signed-in visitor's own name, photo, or both. A field left out
|
|
8
|
+
* stays as it is, and `avatar: null` removes the photo.
|
|
9
|
+
*
|
|
10
|
+
* The photo can change only where `user.avatarEditable` is true. Elsewhere a
|
|
11
|
+
* photo answers `avatarNotSupported`, so hide the photo controls instead.
|
|
12
|
+
*
|
|
13
|
+
* Answers with the visitor as they are now. The page keeps showing what it
|
|
14
|
+
* loaded until its route context loads again, so call `router.invalidate()`
|
|
15
|
+
* after a success.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const result = await auth.updateProfile({ fullName: 'Ann Lee' })
|
|
19
|
+
* const result = await auth.updateProfile({ avatar: file })
|
|
20
|
+
*/
|
|
21
|
+
declare function updateProfile(changes: {
|
|
22
|
+
fullName?: string;
|
|
23
|
+
avatar?: File | null;
|
|
24
|
+
}): Promise<Result<User, AuthError>>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { updateProfile };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { assert, panic } from "../../assertions.js";
|
|
2
|
+
import { sessionConfig } from "../config.js";
|
|
3
|
+
import { clearSessionData, readSessionToken } from "../session.js";
|
|
4
|
+
import { makePlatform } from "../platform.js";
|
|
5
|
+
import { authError } from "./utils.js";
|
|
6
|
+
|
|
7
|
+
//#region src/auth/methods/profile.ts
|
|
8
|
+
/**
|
|
9
|
+
* Changes the signed-in visitor's own name, photo, or both. A field left out
|
|
10
|
+
* stays as it is, and `avatar: null` removes the photo.
|
|
11
|
+
*
|
|
12
|
+
* The photo can change only where `user.avatarEditable` is true. Elsewhere a
|
|
13
|
+
* photo answers `avatarNotSupported`, so hide the photo controls instead.
|
|
14
|
+
*
|
|
15
|
+
* Answers with the visitor as they are now. The page keeps showing what it
|
|
16
|
+
* loaded until its route context loads again, so call `router.invalidate()`
|
|
17
|
+
* after a success.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const result = await auth.updateProfile({ fullName: 'Ann Lee' })
|
|
21
|
+
* const result = await auth.updateProfile({ avatar: file })
|
|
22
|
+
*/
|
|
23
|
+
async function updateProfile(changes) {
|
|
24
|
+
assert(changes.fullName !== void 0 || changes.avatar !== void 0, "updateProfile needs a name or a photo to change");
|
|
25
|
+
const token = readSessionToken();
|
|
26
|
+
if (token === null) return authError("notAuthenticated", "Nobody is signed in.");
|
|
27
|
+
const form = new FormData();
|
|
28
|
+
if (changes.fullName !== void 0) form.set("fullName", changes.fullName);
|
|
29
|
+
if (changes.avatar === null) form.set("removeAvatar", "true");
|
|
30
|
+
if (changes.avatar) form.set("avatar", changes.avatar);
|
|
31
|
+
const result = await makePlatform(sessionConfig().applicationId).updateProfile(token, form);
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
switch (result.status) {
|
|
34
|
+
case 400: return authError("invalidName", result.message);
|
|
35
|
+
case 401: return authError("notAuthenticated", result.message);
|
|
36
|
+
case 409: return authError("avatarNotSupported", result.message);
|
|
37
|
+
case 413: return authError("fileTooLarge", result.message);
|
|
38
|
+
case 415: return authError("notAnImage", result.message);
|
|
39
|
+
case 429: return authError("tooManyAttempts", result.message);
|
|
40
|
+
}
|
|
41
|
+
if (result.status >= 500) panic(`Expected the profile to update, but got ${result.status}: ` + result.message);
|
|
42
|
+
throw new Error(`${result.message}. Check SOFTR_APPLICATION_ID.`);
|
|
43
|
+
}
|
|
44
|
+
clearSessionData();
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
data: result.data
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { updateProfile };
|
|
@@ -10,6 +10,6 @@ type AuthError = {
|
|
|
10
10
|
code: AuthErrorCode;
|
|
11
11
|
message: string;
|
|
12
12
|
};
|
|
13
|
-
type AuthErrorCode = "invalidCredentials" | "tooManyAttempts" | "emailTaken" | "invalidDetails" | "invalidCode" | "notAuthenticated" | "emailDomainNotAllowed" | "linkExpired";
|
|
13
|
+
type AuthErrorCode = "invalidCredentials" | "tooManyAttempts" | "emailTaken" | "invalidDetails" | "invalidCode" | "notAuthenticated" | "emailDomainNotAllowed" | "linkExpired" | "invalidName" | "fileTooLarge" | "notAnImage" | "avatarNotSupported";
|
|
14
14
|
//#endregion
|
|
15
15
|
export { AuthError, Result };
|
package/dist/auth/platform.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { panic } from "../assertions.js";
|
|
1
|
+
import { assert, panic } from "../assertions.js";
|
|
2
2
|
import { fetch } from "../fetch.js";
|
|
3
3
|
import { permissionsSchema } from "./permissions.js";
|
|
4
4
|
import { sessionConfig } from "./config.js";
|
|
@@ -267,6 +267,11 @@ function makePlatform(applicationId) {
|
|
|
267
267
|
token,
|
|
268
268
|
json: { code }
|
|
269
269
|
}, z.null()),
|
|
270
|
+
updateProfile: (token, form) => request(`/v1/vibe/applications/${applicationId}/users/me/profile`, {
|
|
271
|
+
method: "PATCH",
|
|
272
|
+
token,
|
|
273
|
+
form
|
|
274
|
+
}, userSchema),
|
|
270
275
|
signOut: (token) => request(`/v1/applications/${applicationId}/users/sign-out`, {
|
|
271
276
|
method: "POST",
|
|
272
277
|
token
|
|
@@ -275,6 +280,7 @@ function makePlatform(applicationId) {
|
|
|
275
280
|
}
|
|
276
281
|
const errorSchema = z.object({ message: z.string() });
|
|
277
282
|
async function request(path, init, schema, parse = (response$1) => response$1.json()) {
|
|
283
|
+
assert(init.json === void 0 || init.form === void 0, "A platform request carries a JSON body or a form, not both");
|
|
278
284
|
const response = await fetch(`${await platformApiUrl()}${path}`, {
|
|
279
285
|
method: init.method,
|
|
280
286
|
headers: {
|
|
@@ -282,7 +288,8 @@ async function request(path, init, schema, parse = (response$1) => response$1.js
|
|
|
282
288
|
...init.json === void 0 ? {} : { "content-type": "application/json" },
|
|
283
289
|
...init.token ? { authorization: `Bearer ${init.token}` } : {}
|
|
284
290
|
},
|
|
285
|
-
...init.json === void 0 ? {} : { body: JSON.stringify(init.json) }
|
|
291
|
+
...init.json === void 0 ? {} : { body: JSON.stringify(init.json) },
|
|
292
|
+
...init.form === void 0 ? {} : { body: init.form }
|
|
286
293
|
});
|
|
287
294
|
if (!response.ok) {
|
|
288
295
|
const error = errorSchema.safeParse(await response.json().catch(() => null));
|
package/dist/auth/server.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { checkPasswordLink, requestPasswordReset, setPasswordWithLink } from "./
|
|
|
6
6
|
import { settings } from "./methods/settings.js";
|
|
7
7
|
import { confirmSignUp, signUp } from "./methods/signup.js";
|
|
8
8
|
import { signInWithGoogle } from "./methods/social.js";
|
|
9
|
+
import { updateProfile } from "./methods/profile.js";
|
|
9
10
|
import { currentUserRow } from "./current-user-row.js";
|
|
10
11
|
import "@tanstack/react-start/server-only";
|
|
11
12
|
|
|
@@ -34,6 +35,7 @@ declare const auth: {
|
|
|
34
35
|
resetAuthenticator: typeof resetAuthenticator;
|
|
35
36
|
removeAuthenticator: typeof removeAuthenticator;
|
|
36
37
|
settings: typeof settings;
|
|
38
|
+
updateProfile: typeof updateProfile;
|
|
37
39
|
currentUserRow: typeof currentUserRow;
|
|
38
40
|
};
|
|
39
41
|
//#endregion
|
package/dist/auth/server.js
CHANGED
|
@@ -6,6 +6,7 @@ import { signIn, signOut } from "./methods/password.js";
|
|
|
6
6
|
import { checkPasswordLink, requestPasswordReset, setPasswordWithLink } from "./methods/passwordLink.js";
|
|
7
7
|
import { confirmSignUp, signUp } from "./methods/signup.js";
|
|
8
8
|
import { signInWithGoogle } from "./methods/social.js";
|
|
9
|
+
import { updateProfile } from "./methods/profile.js";
|
|
9
10
|
import { currentUserRow } from "./current-user-row.js";
|
|
10
11
|
import "@tanstack/react-start/server-only";
|
|
11
12
|
|
|
@@ -33,6 +34,7 @@ const auth = {
|
|
|
33
34
|
resetAuthenticator,
|
|
34
35
|
removeAuthenticator,
|
|
35
36
|
settings,
|
|
37
|
+
updateProfile,
|
|
36
38
|
currentUserRow
|
|
37
39
|
};
|
|
38
40
|
|
package/dist/auth/session.js
CHANGED
|
@@ -118,6 +118,16 @@ function clearSession() {
|
|
|
118
118
|
PENDING_AUTH
|
|
119
119
|
]);
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Drops the cached visitor and leaves the session signed in, so the next
|
|
123
|
+
* request needing a visitor re-reads one from the platform.
|
|
124
|
+
*
|
|
125
|
+
* For a mutation to what the visitor's own record holds — their name, their
|
|
126
|
+
* groups — which the cache would otherwise answer stale for up to five minutes.
|
|
127
|
+
*/
|
|
128
|
+
function clearSessionData() {
|
|
129
|
+
clearCookies([SESSION_DATA]);
|
|
130
|
+
}
|
|
121
131
|
const standInToken = new AsyncLocalStorage();
|
|
122
132
|
const sessionDataSchema = z.object({
|
|
123
133
|
user: userSchema.nullable(),
|
|
@@ -210,4 +220,4 @@ function openEnvelope(raw, purpose) {
|
|
|
210
220
|
}
|
|
211
221
|
|
|
212
222
|
//#endregion
|
|
213
|
-
export { clearPendingAuth, clearSession, makePendingAuthCookie, makeSessionDataCookie, makeSessionTokenCookie, readPendingAuthToken, readSessionData, readSessionToken, withSessionToken };
|
|
223
|
+
export { clearPendingAuth, clearSession, clearSessionData, makePendingAuthCookie, makeSessionDataCookie, makeSessionTokenCookie, readPendingAuthToken, readSessionData, readSessionToken, withSessionToken };
|
package/dist/auth/user.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ type User = {
|
|
|
19
19
|
email: string;
|
|
20
20
|
fullName: string;
|
|
21
21
|
userGroupIds: Array<SoftrUserGroupId>;
|
|
22
|
+
/** Their photo, or `null` when they have none. Show their initials then. */
|
|
23
|
+
avatarUrl: string | null;
|
|
24
|
+
/** Whether `auth.updateProfile` can change their photo in this app. */
|
|
25
|
+
avatarEditable: boolean;
|
|
22
26
|
};
|
|
23
27
|
//#endregion
|
|
24
28
|
export { SoftrUserGroupId, SoftrUserGroups, User };
|
package/dist/auth/user.js
CHANGED
|
@@ -5,7 +5,9 @@ const userSchema = z.object({
|
|
|
5
5
|
id: z.string(),
|
|
6
6
|
email: z.string(),
|
|
7
7
|
fullName: z.string(),
|
|
8
|
-
userGroupIds: z.array(z.string())
|
|
8
|
+
userGroupIds: z.array(z.string()),
|
|
9
|
+
avatarUrl: z.string().nullable().default(null),
|
|
10
|
+
avatarEditable: z.boolean().default(false)
|
|
9
11
|
});
|
|
10
12
|
|
|
11
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/default-error-overlay.d.ts
|
|
4
4
|
type Props = {
|
|
@@ -8,6 +8,6 @@ type Props = {
|
|
|
8
8
|
declare function DefaultErrorOverlay({
|
|
9
9
|
error,
|
|
10
10
|
reset
|
|
11
|
-
}: Props):
|
|
11
|
+
}: Props): react4.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { DefaultErrorOverlay };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatasourceAction } from "./action.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _tanstack_react_start0 from "@tanstack/react-start";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
5
5
|
|
|
@@ -31,6 +31,6 @@ type SoftrMcpOptions = {
|
|
|
31
31
|
* ],
|
|
32
32
|
* }))
|
|
33
33
|
*/
|
|
34
|
-
declare function softrMcpMiddleware(options?: SoftrMcpOptions):
|
|
34
|
+
declare function softrMcpMiddleware(options?: SoftrMcpOptions): _tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { softrMcpMiddleware };
|
package/dist/package.js
CHANGED
package/dist/pwa.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react5 from "react";
|
|
2
2
|
import "@tanstack/react-start";
|
|
3
3
|
|
|
4
4
|
//#region src/pwa.d.ts
|
|
@@ -23,7 +23,7 @@ import "@tanstack/react-start";
|
|
|
23
23
|
* )
|
|
24
24
|
* }
|
|
25
25
|
*/
|
|
26
|
-
declare function SoftrPwaHead():
|
|
26
|
+
declare function SoftrPwaHead(): react5.FunctionComponentElement<react5.FragmentProps>;
|
|
27
27
|
type PwaPlatform = "ios" | "android" | "desktop";
|
|
28
28
|
type PwaInstall = {
|
|
29
29
|
available: false;
|
package/package.json
CHANGED
|
@@ -7,19 +7,18 @@ description: >-
|
|
|
7
7
|
sign-in (verifyAuthenticator, startAuthenticatorSetup,
|
|
8
8
|
confirmAuthenticatorSetup, skipAuthenticatorSetup) and the ones that change an
|
|
9
9
|
authenticator from a settings page (sendAuthenticatorResetCode,
|
|
10
|
-
resetAuthenticator, removeAuthenticator), the
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
and
|
|
14
|
-
with and its
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
signing in.
|
|
10
|
+
resetAuthenticator, removeAuthenticator), updateProfile for the visitor's own
|
|
11
|
+
name and photo, the emailed password links (requestPasswordReset,
|
|
12
|
+
checkPasswordLink, setPasswordWithLink), and getAuthSettings,
|
|
13
|
+
AuthSettingsProvider and useAuthSettings for which sign-in and sign-up methods
|
|
14
|
+
the app has enabled. Covers the Result shape they answer with and its error
|
|
15
|
+
codes (invalidCredentials, emailTaken, notAuthenticated, notAnImage and the
|
|
16
|
+
rest), the two-step sign-up, why a successful sign-in does not always mean the
|
|
17
|
+
visitor is signed in, and toReturnPath for where to land after signing in.
|
|
19
18
|
metadata:
|
|
20
19
|
type: sub-skill
|
|
21
20
|
library: softr-sdk
|
|
22
|
-
library_version: 0.0.
|
|
21
|
+
library_version: 0.0.69-alpha.0
|
|
23
22
|
---
|
|
24
23
|
|
|
25
24
|
**Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
|
|
@@ -82,6 +81,12 @@ Changing an authenticator from a settings page:
|
|
|
82
81
|
| `auth.resetAuthenticator({ code })` | Unpairs the app, so a new one can be enrolled |
|
|
83
82
|
| `auth.removeAuthenticator({ code })` | Turns the authenticator off |
|
|
84
83
|
|
|
84
|
+
Changing the visitor's own profile:
|
|
85
|
+
|
|
86
|
+
| Call | Does |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `auth.updateProfile({ fullName?, avatar? })` | Changes their name, their photo, or both. `avatar: null` removes the photo |
|
|
89
|
+
|
|
85
90
|
## Setup
|
|
86
91
|
|
|
87
92
|
`auth` is server-only, so every call sits inside a `createServerFn` handler:
|
|
@@ -451,6 +456,20 @@ All three need a signed-in visitor and answer `notAuthenticated` when there is n
|
|
|
451
456
|
|
|
452
457
|
After a reset, enrol the new app with `startAuthenticatorSetup` and `confirmAuthenticatorSetup`, which is also where the new backup codes come from. After a removal, an app that requires an authenticator asks the visitor to set one up again on their next sign-in.
|
|
453
458
|
|
|
459
|
+
### Changing the visitor's name and photo
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
const result = await auth.updateProfile({ fullName: 'Ann Lee' })
|
|
463
|
+
const result = await auth.updateProfile({ avatar: file }) // a File from an <input type="file">
|
|
464
|
+
const result = await auth.updateProfile({ avatar: null }) // removes the photo
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
It answers with the updated `User`. Pass the file through a server function that takes `FormData`. The photo must be a PNG, JPEG or GIF of at most 5 MB, or it answers `notAnImage` or `fileTooLarge`. A blank or unacceptable name answers `invalidName`.
|
|
468
|
+
|
|
469
|
+
Only some apps can store a photo. Show the photo controls only when `user.avatarEditable` is true; elsewhere a photo answers `avatarNotSupported`.
|
|
470
|
+
|
|
471
|
+
The page keeps showing the old name and photo until its route context loads again, so call `router.invalidate()` after a success.
|
|
472
|
+
|
|
454
473
|
## References
|
|
455
474
|
|
|
456
475
|
- [current-user/SKILL.md](../current-user/SKILL.md): reading the visitor these calls establish
|
|
@@ -12,7 +12,7 @@ description: >-
|
|
|
12
12
|
metadata:
|
|
13
13
|
type: sub-skill
|
|
14
14
|
library: softr-sdk
|
|
15
|
-
library_version: 0.0.
|
|
15
|
+
library_version: 0.0.69-alpha.0
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 0.0.
|
|
12
|
+
library_version: 0.0.69-alpha.0
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
# The current user
|
|
@@ -31,6 +31,8 @@ type User = {
|
|
|
31
31
|
email: string
|
|
32
32
|
fullName: string
|
|
33
33
|
userGroupIds: Array<SoftrUserGroupId> // the app's own group ids
|
|
34
|
+
avatarUrl: string | null // their photo; show their initials when null
|
|
35
|
+
avatarEditable: boolean // whether auth.updateProfile can change the photo
|
|
34
36
|
}
|
|
35
37
|
```
|
|
36
38
|
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 0.0.
|
|
13
|
+
library_version: 0.0.69-alpha.0
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `upload` lives on `@softr/sdk/server` and runs inside server functions. `useFileUpload` and `FileItem` live on `@softr/sdk` and run in components. `FileAttachment` comes from `@softr/sdk` and can be imported anywhere.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 0.0.
|
|
13
|
+
library_version: 0.0.69-alpha.0
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `integration` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineIntegration` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 0.0.
|
|
12
|
+
library_version: 0.0.69-alpha.0
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `softrMcpMiddleware` lives on `@softr/sdk` and is registered once, in `src/start.ts`. The actions you hand it are the same `defineQuery` / `defineMutation` values the app's own pages use — declared wherever they already live, not duplicated for MCP.
|
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
metadata:
|
|
12
12
|
type: sub-skill
|
|
13
13
|
library: softr-sdk
|
|
14
|
-
library_version: 0.0.
|
|
14
|
+
library_version: 0.0.69-alpha.0
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
metadata:
|
|
14
14
|
type: sub-skill
|
|
15
15
|
library: softr-sdk
|
|
16
|
-
library_version: 0.0.
|
|
16
|
+
library_version: 0.0.69-alpha.0
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
**Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. The same holds for any helper that calls `ds`: declare it inside the handler. A function at module level that calls `ds` keeps the server-only import in the browser bundle, and every page stops loading until it moves. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
|
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
metadata:
|
|
14
14
|
type: sub-skill
|
|
15
15
|
library: softr-sdk
|
|
16
|
-
library_version: 0.0.
|
|
16
|
+
library_version: 0.0.69-alpha.0
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
**Boundary.** `defineVisibility`, the access functions and the error predicates come from `@softr/sdk` and work anywhere.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 0.0.
|
|
12
|
+
library_version: 0.0.69-alpha.0
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
**Boundary.** `workflow` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineWorkflow` and every type come from `@softr/sdk` and can be imported anywhere.
|