blendsdk 5.33.0 → 5.34.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 +13 -15
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -35,12 +35,15 @@ npm install blendsdk
|
|
|
35
35
|
### Web API with Express 5
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
|
-
import {
|
|
38
|
+
import { WebApplication, RouteBuilder } from "blendsdk/webafx";
|
|
39
39
|
|
|
40
|
-
const app = new
|
|
40
|
+
const app = new WebApplication({
|
|
41
|
+
port: 3000,
|
|
42
|
+
name: "my-api",
|
|
43
|
+
});
|
|
41
44
|
|
|
42
|
-
app.
|
|
43
|
-
RouteBuilder.get("/hello"
|
|
45
|
+
app.route(
|
|
46
|
+
RouteBuilder.get("/hello").handler((_req, res) => {
|
|
44
47
|
res.json({ message: "Hello from BlendSDK!" });
|
|
45
48
|
})
|
|
46
49
|
);
|
|
@@ -48,11 +51,10 @@ app.addRoute(
|
|
|
48
51
|
await app.start();
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
### SQL
|
|
54
|
+
### SQL Expression Building
|
|
52
55
|
|
|
53
56
|
```typescript
|
|
54
57
|
import { query } from "blendsdk/expression";
|
|
55
|
-
import { SelectStatement } from "blendsdk/dbcore";
|
|
56
58
|
|
|
57
59
|
// Build a type-safe WHERE clause
|
|
58
60
|
const filter = query()
|
|
@@ -62,24 +64,20 @@ const filter = query()
|
|
|
62
64
|
.field("age")
|
|
63
65
|
.gte(18);
|
|
64
66
|
|
|
65
|
-
//
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
.where(filter);
|
|
69
|
-
|
|
70
|
-
const { sql, parameters } = stmt.compile();
|
|
71
|
-
// sql: SELECT id, name, email FROM users WHERE status = $1 AND age >= $2
|
|
67
|
+
// Compile to parameterized SQL
|
|
68
|
+
const { sql, parameters } = filter.compile();
|
|
69
|
+
// sql: "status" = $1 AND "age" >= $2
|
|
72
70
|
// parameters: ["active", 18]
|
|
73
71
|
```
|
|
74
72
|
|
|
75
73
|
### Utilities
|
|
76
74
|
|
|
77
75
|
```typescript
|
|
78
|
-
import {
|
|
76
|
+
import { isNullOrUndef, isString } from "blendsdk/stdlib";
|
|
79
77
|
|
|
80
78
|
const value: unknown = getUserInput();
|
|
81
79
|
|
|
82
|
-
if (!
|
|
80
|
+
if (!isNullOrUndef(value) && isString(value)) {
|
|
83
81
|
console.log("Got a string:", value);
|
|
84
82
|
}
|
|
85
83
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blendsdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.34.0",
|
|
4
4
|
"description": "Enterprise-grade TypeScript SDK for web applications, database operations, caching, pub/sub, email, i18n, and code generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -77,18 +77,18 @@
|
|
|
77
77
|
"zod": "^4.0.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@blendsdk/stdlib": "5.
|
|
81
|
-
"@blendsdk/cmdline": "5.
|
|
82
|
-
"@blendsdk/expression": "5.
|
|
83
|
-
"@blendsdk/dbcore": "5.
|
|
84
|
-
"@blendsdk/postgresql": "5.
|
|
85
|
-
"@blendsdk/webafx": "5.
|
|
86
|
-
"@blendsdk/webafx-cache": "5.
|
|
87
|
-
"@blendsdk/webafx-mailer": "5.
|
|
88
|
-
"@blendsdk/webafx-auth": "5.
|
|
89
|
-
"@blendsdk/i18n": "5.
|
|
90
|
-
"@blendsdk/webafx-i18n": "5.
|
|
91
|
-
"@blendsdk/codegen": "5.
|
|
80
|
+
"@blendsdk/stdlib": "5.34.0",
|
|
81
|
+
"@blendsdk/cmdline": "5.34.0",
|
|
82
|
+
"@blendsdk/expression": "5.34.0",
|
|
83
|
+
"@blendsdk/dbcore": "5.34.0",
|
|
84
|
+
"@blendsdk/postgresql": "5.34.0",
|
|
85
|
+
"@blendsdk/webafx": "5.34.0",
|
|
86
|
+
"@blendsdk/webafx-cache": "5.34.0",
|
|
87
|
+
"@blendsdk/webafx-mailer": "5.34.0",
|
|
88
|
+
"@blendsdk/webafx-auth": "5.34.0",
|
|
89
|
+
"@blendsdk/i18n": "5.34.0",
|
|
90
|
+
"@blendsdk/webafx-i18n": "5.34.0",
|
|
91
|
+
"@blendsdk/codegen": "5.34.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"typescript": "^5.6.0",
|