@softr/sdk 1.4.3 → 1.5.1
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/CHANGELOG.md +14 -0
- package/dist/auth/methods/code.d.ts +2 -3
- package/dist/auth/methods/code.js +4 -4
- package/dist/auth/methods/signInMethod.d.ts +27 -0
- package/dist/auth/methods/signInMethod.js +51 -0
- package/dist/auth/methods/utils.d.ts +1 -1
- package/dist/auth/platform.js +12 -0
- package/dist/auth/server.d.ts +2 -0
- package/dist/auth/server.js +2 -0
- package/dist/package.js +1 -1
- package/package.json +1 -1
- package/skills/softr-sdk/SKILL.md +1 -1
- package/skills/softr-sdk/ai/SKILL.md +1 -1
- package/skills/softr-sdk/auth/SKILL.md +6 -7
- package/skills/softr-sdk/charts-and-metrics/SKILL.md +1 -1
- package/skills/softr-sdk/current-user/SKILL.md +1 -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 +5 -1
- package/skills/softr-sdk/mcp/SKILL.md +1 -1
- package/skills/softr-sdk/push-notifications/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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @softr/sdk
|
|
2
2
|
|
|
3
|
+
## 1.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The `integrations` skill lists the base URLs of Microsoft Planner, Tally, Trello and Typeform.
|
|
8
|
+
|
|
9
|
+
## 1.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- `auth.sendSignInCode` fails as `noAccount` when no account has the email, and as `accountDeactivated` for a deactivated account, instead of succeeding without sending anything. Action: on the login page, send the code from the email step and say so there, and point the visitor to sign-up on `noAccount` where the app has it. Open the code inputs only once the code is sent.
|
|
14
|
+
- `auth.signInMethod({ email })` says whether an email has an account, and which ways in work for it. Action: on a login page that asks for the email first, go to the step for the first of `methods`, or say there is no account, instead of always asking for a password. On a `password` method with `passwordSet` false, the account has no password yet: say so and link to the password reset.
|
|
15
|
+
- Codes Softr emails, for sign-in, sign-up and a second factor, are six digits. Action: give code fields `inputMode="numeric"` and `autoComplete="one-time-code"`, and accept digits only.
|
|
16
|
+
|
|
3
17
|
## 1.4.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,9 +7,8 @@ import { AuthError, Result } from "./utils.js";
|
|
|
7
7
|
* Emails a one-time sign-in code, for an app that signs people in with a code
|
|
8
8
|
* rather than a password.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* way.
|
|
10
|
+
* An address with no account fails as `noAccount`, and a deactivated one as
|
|
11
|
+
* `accountDeactivated`, so the visitor is not left waiting for an email.
|
|
13
12
|
*/
|
|
14
13
|
declare function sendSignInCode(details: {
|
|
15
14
|
email: string;
|
|
@@ -6,19 +6,19 @@ import { clearPendingAuth, makePendingAuthCookie, makeSessionDataCookie, makeSes
|
|
|
6
6
|
import { authError } from "./utils.js";
|
|
7
7
|
|
|
8
8
|
//#region src/auth/methods/code.ts
|
|
9
|
+
const SEND_CODE_ERRORS = new Map([["No account exists for this email.", "noAccount"], ["This account is deactivated. Please contact the application owner.", "accountDeactivated"]]);
|
|
9
10
|
/**
|
|
10
11
|
* Emails a one-time sign-in code, for an app that signs people in with a code
|
|
11
12
|
* rather than a password.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* way.
|
|
14
|
+
* An address with no account fails as `noAccount`, and a deactivated one as
|
|
15
|
+
* `accountDeactivated`, so the visitor is not left waiting for an email.
|
|
16
16
|
*/
|
|
17
17
|
async function sendSignInCode(details) {
|
|
18
18
|
const result = await makePlatform(sessionConfig().applicationId).sendSignInCode(details.email);
|
|
19
19
|
if (!result.ok) {
|
|
20
20
|
if (result.status === 429) return authError("tooManyAttempts", result.message);
|
|
21
|
-
if (result.status === 400) return authError("invalidDetails", result.message);
|
|
21
|
+
if (result.status === 400) return authError(SEND_CODE_ERRORS.get(result.message) ?? "invalidDetails", result.message);
|
|
22
22
|
if (result.status >= 500) panic(`Expected the sign-in code to be emailed, but got ${result.status}: ` + result.message);
|
|
23
23
|
throw new Error(`${result.message}. Check SOFTR_APPLICATION_ID and that the app signs people in with an emailed code.`);
|
|
24
24
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AuthError, Result } from "./utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/auth/methods/signInMethod.d.ts
|
|
4
|
+
type SignInMethod = "password" | "emailCode" | "google" | "sso";
|
|
5
|
+
/**
|
|
6
|
+
* How a visitor with this email signs in, for a login page that asks for the
|
|
7
|
+
* email first and routes from there.
|
|
8
|
+
*
|
|
9
|
+
* `account` is `none` when the email has no account, and `deactivated` for a
|
|
10
|
+
* deactivated one. For an `active` account, `methods` lists what the app
|
|
11
|
+
* offers and also works for that account, in the order to prefer them.
|
|
12
|
+
* `passwordSet` is false when the account has no password yet: `password` is
|
|
13
|
+
* then listed after the methods that work right away, and the visitor sets
|
|
14
|
+
* one through the password reset first. `methods` can be empty when nothing
|
|
15
|
+
* the app offers works for the account.
|
|
16
|
+
*
|
|
17
|
+
* It tells anyone who asks whether an email has an account.
|
|
18
|
+
*/
|
|
19
|
+
declare function signInMethod(details: {
|
|
20
|
+
email: string;
|
|
21
|
+
}): Promise<Result<{
|
|
22
|
+
account: "none" | "deactivated" | "active";
|
|
23
|
+
methods: SignInMethod[];
|
|
24
|
+
passwordSet: boolean;
|
|
25
|
+
}, AuthError>>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { signInMethod };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { panic } from "../../assertions.js";
|
|
2
|
+
import { sessionConfig } from "../config.js";
|
|
3
|
+
import { makePlatform } from "../platform.js";
|
|
4
|
+
import { authError } from "./utils.js";
|
|
5
|
+
|
|
6
|
+
//#region src/auth/methods/signInMethod.ts
|
|
7
|
+
const METHODS = {
|
|
8
|
+
PASSWORD: "password",
|
|
9
|
+
EMAIL_CODE: "emailCode",
|
|
10
|
+
GOOGLE: "google",
|
|
11
|
+
SSO: "sso"
|
|
12
|
+
};
|
|
13
|
+
const ACCOUNTS = {
|
|
14
|
+
NONE: "none",
|
|
15
|
+
DEACTIVATED: "deactivated",
|
|
16
|
+
ACTIVE: "active"
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* How a visitor with this email signs in, for a login page that asks for the
|
|
20
|
+
* email first and routes from there.
|
|
21
|
+
*
|
|
22
|
+
* `account` is `none` when the email has no account, and `deactivated` for a
|
|
23
|
+
* deactivated one. For an `active` account, `methods` lists what the app
|
|
24
|
+
* offers and also works for that account, in the order to prefer them.
|
|
25
|
+
* `passwordSet` is false when the account has no password yet: `password` is
|
|
26
|
+
* then listed after the methods that work right away, and the visitor sets
|
|
27
|
+
* one through the password reset first. `methods` can be empty when nothing
|
|
28
|
+
* the app offers works for the account.
|
|
29
|
+
*
|
|
30
|
+
* It tells anyone who asks whether an email has an account.
|
|
31
|
+
*/
|
|
32
|
+
async function signInMethod(details) {
|
|
33
|
+
const result = await makePlatform(sessionConfig().applicationId).signInMethod(details);
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
if (result.status === 429) return authError("tooManyAttempts", result.message);
|
|
36
|
+
if (result.status === 400) return authError("invalidDetails", result.message);
|
|
37
|
+
if (result.status >= 500) panic(`Expected to learn how that email signs in, but got ${result.status}: ` + result.message);
|
|
38
|
+
throw new Error(`${result.message}. Check SOFTR_APPLICATION_ID.`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
data: {
|
|
43
|
+
account: ACCOUNTS[result.data.account],
|
|
44
|
+
methods: result.data.methods.flatMap((method) => Object.hasOwn(METHODS, method) ? [METHODS[method]] : []),
|
|
45
|
+
passwordSet: result.data.passwordSet
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { signInMethod };
|
|
@@ -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" | "invalidName" | "fileTooLarge" | "notAnImage" | "avatarNotSupported";
|
|
13
|
+
type AuthErrorCode = "invalidCredentials" | "tooManyAttempts" | "emailTaken" | "invalidDetails" | "invalidCode" | "noAccount" | "accountDeactivated" | "notAuthenticated" | "emailDomainNotAllowed" | "linkExpired" | "invalidName" | "fileTooLarge" | "notAnImage" | "avatarNotSupported";
|
|
14
14
|
//#endregion
|
|
15
15
|
export { AuthError, Result };
|
package/dist/auth/platform.js
CHANGED
|
@@ -128,6 +128,18 @@ function makePlatform(applicationId) {
|
|
|
128
128
|
method: "POST",
|
|
129
129
|
json: { email }
|
|
130
130
|
}, z.null()),
|
|
131
|
+
signInMethod: (body) => request(`/v1/vibe/applications/${applicationId}/users/sign-in-method`, {
|
|
132
|
+
method: "POST",
|
|
133
|
+
json: body
|
|
134
|
+
}, z.object({
|
|
135
|
+
account: z.enum([
|
|
136
|
+
"NONE",
|
|
137
|
+
"DEACTIVATED",
|
|
138
|
+
"ACTIVE"
|
|
139
|
+
]),
|
|
140
|
+
methods: z.array(z.string()),
|
|
141
|
+
passwordSet: z.boolean()
|
|
142
|
+
})),
|
|
131
143
|
signInWithCode: (credentials) => request(`/v1/vibe/applications/${applicationId}/users/tokens/with-code${withAttributes}`, {
|
|
132
144
|
method: "POST",
|
|
133
145
|
json: credentials
|
package/dist/auth/server.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { signInWithMagicLink } from "./methods/magicLink.js";
|
|
|
5
5
|
import { signIn, signOut } from "./methods/password.js";
|
|
6
6
|
import { checkPasswordLink, requestPasswordReset, setPasswordWithLink } from "./methods/passwordLink.js";
|
|
7
7
|
import { settings } from "./methods/settings.js";
|
|
8
|
+
import { signInMethod } from "./methods/signInMethod.js";
|
|
8
9
|
import { discoverSso } from "./methods/sso.js";
|
|
9
10
|
import { confirmSignUp, signUp } from "./methods/signup.js";
|
|
10
11
|
import { signInWithGoogle } from "./methods/social.js";
|
|
@@ -22,6 +23,7 @@ declare const auth: {
|
|
|
22
23
|
signOut: typeof signOut;
|
|
23
24
|
signUp: typeof signUp;
|
|
24
25
|
confirmSignUp: typeof confirmSignUp;
|
|
26
|
+
signInMethod: typeof signInMethod;
|
|
25
27
|
sendSignInCode: typeof sendSignInCode;
|
|
26
28
|
signInWithCode: typeof signInWithCode;
|
|
27
29
|
signInWithGoogle: typeof signInWithGoogle;
|
package/dist/auth/server.js
CHANGED
|
@@ -5,6 +5,7 @@ import { resendEmailCode, verifyEmailCode } from "./methods/emailCode2fa.js";
|
|
|
5
5
|
import { signInWithMagicLink } from "./methods/magicLink.js";
|
|
6
6
|
import { signIn, signOut } from "./methods/password.js";
|
|
7
7
|
import { checkPasswordLink, requestPasswordReset, setPasswordWithLink } from "./methods/passwordLink.js";
|
|
8
|
+
import { signInMethod } from "./methods/signInMethod.js";
|
|
8
9
|
import { discoverSso } from "./methods/sso.js";
|
|
9
10
|
import { confirmSignUp, signUp } from "./methods/signup.js";
|
|
10
11
|
import { signInWithGoogle } from "./methods/social.js";
|
|
@@ -21,6 +22,7 @@ const auth = {
|
|
|
21
22
|
signOut,
|
|
22
23
|
signUp,
|
|
23
24
|
confirmSignUp,
|
|
25
|
+
signInMethod,
|
|
24
26
|
sendSignInCode,
|
|
25
27
|
signInWithCode,
|
|
26
28
|
signInWithGoogle,
|
package/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
metadata:
|
|
14
14
|
type: sub-skill
|
|
15
15
|
library: softr-sdk
|
|
16
|
-
library_version: 1.
|
|
16
|
+
library_version: 1.5.1
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
**Boundary.** `ai` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineAiAction` and every type come 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: 1.
|
|
13
|
+
library_version: 1.5.1
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
|
|
@@ -30,6 +30,7 @@ Signing in:
|
|
|
30
30
|
| Call | Does |
|
|
31
31
|
| --- | --- |
|
|
32
32
|
| `auth.signIn({ email, password })` | Signs a visitor in with an email and password |
|
|
33
|
+
| `auth.signInMethod({ email })` | Says whether an email has an account, and which ways in work for it |
|
|
33
34
|
| `auth.sendSignInCode({ email })` | Emails a one-time sign-in code |
|
|
34
35
|
| `auth.signInWithCode({ email, code })` | Signs a visitor in with that code |
|
|
35
36
|
| `auth.signInWithGoogle({ email, token, fullName? })` | Signs a visitor in with a Google id token the browser obtained, creating the account the first time |
|
|
@@ -129,6 +130,7 @@ type AuthErrorCode =
|
|
|
129
130
|
| 'emailTaken' // signUp, confirmSignUp: that email already has an account
|
|
130
131
|
| 'invalidDetails' // signUp, sendSignInCode, setPasswordWithLink: details Softr rejected
|
|
131
132
|
| 'invalidCode' // any call that takes a code: wrong or expired
|
|
133
|
+
| 'noAccount' | 'accountDeactivated' // sendSignInCode: no account has that email, or it is deactivated
|
|
132
134
|
| 'notAuthenticated' // a call that needs a signed-in visitor, made by one who is not
|
|
133
135
|
| 'emailDomainNotAllowed' // signUp, signInWithGoogle: the app lets only some email domains sign up, and this is not one
|
|
134
136
|
| 'linkExpired' // checkPasswordLink, setPasswordWithLink: the link is used, expired or no longer valid
|
|
@@ -271,11 +273,9 @@ if (answer.outcome.status === 'emailCodeRequired') {
|
|
|
271
273
|
await navigate({ href: target })
|
|
272
274
|
```
|
|
273
275
|
|
|
274
|
-
Four exits: a message for the form to render, the emailed-code step, the authenticator step, the return target.
|
|
276
|
+
Four exits: a message for the form to render, the emailed-code step, the authenticator step, the return target. A server function that throws `redirect` needs the hook. Call the imported function directly and the throw never reaches the router, so a successful sign-in leaves the visitor on the form.
|
|
275
277
|
|
|
276
|
-
A
|
|
277
|
-
|
|
278
|
-
A login page is a `NON_LOGGED_IN_USERS` route, which is what keeps an already-signed-in visitor off it. See [routes-and-visibility](../routes-and-visibility/SKILL.md).
|
|
278
|
+
A login page is a `NON_LOGGED_IN_USERS` route, which is what keeps an already-signed-in visitor off it. See [routes-and-visibility](../routes-and-visibility/SKILL.md). A login page that asks for the email first passes it to `auth.signInMethod` and goes to the step for the first of `methods`. On an `account` of `none` or `deactivated`, or no `methods`, it says so instead of asking for a password. When it reaches `password` and `passwordSet` is false, it says the account has no password yet and links to the password reset, where the visitor sets one, instead of asking for a password.
|
|
279
279
|
|
|
280
280
|
### Sign in with an emailed code
|
|
281
281
|
|
|
@@ -284,12 +284,11 @@ For an app that signs people in with a code instead of a password.
|
|
|
284
284
|
```ts
|
|
285
285
|
// Step 1: emails the code.
|
|
286
286
|
const sent = await auth.sendSignInCode({ email })
|
|
287
|
-
|
|
288
287
|
// Step 2: same two-armed result as signIn.
|
|
289
288
|
const result = await auth.signInWithCode({ email, code })
|
|
290
289
|
```
|
|
291
290
|
|
|
292
|
-
Step one succeeds
|
|
291
|
+
Every code Softr emails, for sign-in, sign-up or a second factor, is six digits. Give the code field `inputMode="numeric"` and `autoComplete="one-time-code"`, and accept digits only. Step one fails as `noAccount` when no account has that email, and as `accountDeactivated` for a deactivated one. Say so, so the visitor is not left waiting for an email that never comes. Send it from the email step and open the code inputs only once it succeeds, so these errors land under the email field, not under inputs for a code that was never sent. Where the app has sign-up, point them there on `noAccount`. When the builder asks not to reveal who has an account, the server function treats every failure except `tooManyAttempts` as success and returns exactly what a real send returns. That covers an SSO account too, which fails as `invalidDetails` while the app offers SSO. The page then says "if an account exists for this email, we sent it a code", and never calls `auth.signInMethod`. Changing only the wording is not enough: the server function's response is visible in the browser.
|
|
293
292
|
|
|
294
293
|
### Sign in with Google
|
|
295
294
|
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.
|
|
13
|
+
library_version: 1.5.1
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**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.
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
metadata:
|
|
8
8
|
type: sub-skill
|
|
9
9
|
library: softr-sdk
|
|
10
|
-
library_version: 1.
|
|
10
|
+
library_version: 1.5.1
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
**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.
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
metadata:
|
|
8
8
|
type: sub-skill
|
|
9
9
|
library: softr-sdk
|
|
10
|
-
library_version: 1.
|
|
10
|
+
library_version: 1.5.1
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
**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.
|
|
@@ -196,6 +196,7 @@ Match the `integrationType` from the attached integrations section to find the b
|
|
|
196
196
|
| LINKUP | `https://api.linkup.so` |
|
|
197
197
|
| LOOPS | `https://app.loops.so` |
|
|
198
198
|
| MESSAGE_BIRD | `https://rest.messagebird.com` |
|
|
199
|
+
| MICROSOFT_PLANNER | `https://graph.microsoft.com` |
|
|
199
200
|
| MISTRAL_AI | `https://api.mistral.ai` |
|
|
200
201
|
| OPEN_AI | `https://api.openai.com` |
|
|
201
202
|
| OUTLOOK | `https://graph.microsoft.com` |
|
|
@@ -208,9 +209,12 @@ Match the `integrationType` from the attached integrations section to find the b
|
|
|
208
209
|
| SLACK | `https://slack.com/api` |
|
|
209
210
|
| SMARTLEAD | `https://server.smartlead.ai` |
|
|
210
211
|
| STRIPE | `https://api.stripe.com` |
|
|
212
|
+
| TALLY | `https://api.tally.so` |
|
|
211
213
|
| TELEGRAM | `https://api.telegram.org` |
|
|
212
214
|
| TINYURL | `https://api.tinyurl.com` |
|
|
215
|
+
| TRELLO | `https://api.trello.com` |
|
|
213
216
|
| TWILIO | `https://api.twilio.com` |
|
|
217
|
+
| TYPEFORM | `https://api.typeform.com` |
|
|
214
218
|
| XERO | `https://api.xero.com` |
|
|
215
219
|
| ZOOM | `https://api.zoom.us` |
|
|
216
220
|
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.
|
|
12
|
+
library_version: 1.5.1
|
|
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.
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
metadata:
|
|
11
11
|
type: sub-skill
|
|
12
12
|
library: softr-sdk
|
|
13
|
-
library_version: 1.
|
|
13
|
+
library_version: 1.5.1
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
**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.
|
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
metadata:
|
|
12
12
|
type: sub-skill
|
|
13
13
|
library: softr-sdk
|
|
14
|
-
library_version: 1.
|
|
14
|
+
library_version: 1.5.1
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
**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.
|
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
metadata:
|
|
10
10
|
type: sub-skill
|
|
11
11
|
library: softr-sdk
|
|
12
|
-
library_version: 1.
|
|
12
|
+
library_version: 1.5.1
|
|
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.
|