You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will expose a set of CRUD endpoints like `/api/model/TodoList/findMany`, `/api/model/TodoList/create`, etc. You can find more details [here](https://zenstack.dev/docs/reference/server-adapters/api-handlers/rpc).
349
+
This will expose a set of CRUD endpoints like `/api/model/TodoList/findMany`, `/api/model/TodoList/create`, etc. You can find more details [here](https://zenstack.dev/docs/2.x/reference/server-adapters/api-handlers/rpc).
350
350
351
-
Although we can call these APIs with `fetch` directly, a much easier way is to leverage ZenStack's [TanStack Query plugin](https://zenstack.dev/docs/reference/plugins/tanstack-query) to generate client-side hooks.
351
+
Although we can call these APIs with `fetch` directly, a much easier way is to leverage ZenStack's [TanStack Query plugin](https://zenstack.dev/docs/2.x/reference/plugins/tanstack-query) to generate client-side hooks.
352
352
353
353
```bash
354
354
npminstall @zenstackhq/tanstack-query
@@ -434,7 +434,7 @@ type Auth {
434
434
}
435
435
```
436
436
437
-
Now, we're ready to write the policy rules. You can find more information about access policies [here](https://zenstack.dev/docs/the-complete-guide/part1/access-policy/).
437
+
Now, we're ready to write the policy rules. You can find more information about access policies [here](https://zenstack.dev/docs/2.x/the-complete-guide/part1/access-policy/).
Then we can create the database schema. Please note that we're creating a **schema.zmodel** file (as a replacement of "schema.prisma"). The [ZModel language](/docs/the-complete-guide/part1/zmodel) is a superset of Prisma schema language, allowing you to model both the data schema and access control policies. In this section, we'll only focus on the data modeling part.
108
+
Then we can create the database schema. Please note that we're creating a **schema.zmodel** file (as a replacement of "schema.prisma"). The [ZModel language](/docs/2.x/the-complete-guide/part1/zmodel) is a superset of Prisma schema language, allowing you to model both the data schema and access control policies. In this section, we'll only focus on the data modeling part.
Copy file name to clipboardExpand all lines: blog/code-as-doc/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ I will walk you through the steps of how to create this tool.
105
105
106
106
Like many wonderful tools in the web development world, ZenStack adopts a plugin-based architecture. At the core of the system is the ZModel schema, around which features are implemented as plugins. Let's create a plugin to generate a markdown for a ZModel so it can be easily adopted by others.
107
107
108
-
> For brevity, we'll focus on core parts. See the [ZenStack documentation](https://zenstack.dev/docs/the-complete-guide/part2/writing-plugins) for complete plugin development details.
108
+
> For brevity, we'll focus on core parts. See the [ZenStack documentation](https://zenstack.dev/docs/2.x/the-complete-guide/part2/writing-plugins) for complete plugin development details.
109
109
>
110
110
111
111
A plugin is simply a Node.js module that has the two parts:
Copy file name to clipboardExpand all lines: blog/custom-attributes.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,7 @@ So as Dan Abramov said in the [React Documentary](https://youtu.be/8pDqJVdNa44?t
196
196
197
197
# Custom attributes of ZenStack
198
198
199
-
[ZenStack](https://zenstack.dev/?utm_campaign=devto&utm_medium=organic&utm_content=custom_attribute) is the toolkit that supercharges Prisma with a powerful access control layer and unleashes its full potential for full-stack development. Its schema file [ZModel](https://zenstack.dev/docs/reference/zmodel-language) is a superset of Prisma schema.
199
+
[ZenStack](https://zenstack.dev/?utm_campaign=devto&utm_medium=organic&utm_content=custom_attribute) is the toolkit that supercharges Prisma with a powerful access control layer and unleashes its full potential for full-stack development. Its schema file [ZModel](https://zenstack.dev/docs/2.x/reference/zmodel-language) is a superset of Prisma schema.
200
200
201
201
Regardless of ZenStack, the above Prisma file is supposed to be looks like below ideally:
202
202
@@ -212,7 +212,7 @@ model User {
212
212
213
213
Actually, that’s exactly what the ZModel would be. You can find it in our example code:
Copy file name to clipboardExpand all lines: blog/form-validation/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ model Signup {
81
81
A few quick notes:
82
82
- We used attributes like `@email` and `@endsWith` to attach validation rules to fields.
83
83
- We also used the model-level attribute `@@validate` to express validation rules involving multiple fields and conditions.
84
-
- The `@@allow` attribute grants "create" and "read" access to the table. By default, all operations are denied. Access control is not a focus of this post, but you can learn more [here](https://zenstack.dev/docs/the-complete-guide/part1/access-policy/) if interested.
84
+
- The `@@allow` attribute grants "create" and "read" access to the table. By default, all operations are denied. Access control is not a focus of this post, but you can learn more [here](https://zenstack.dev/docs/2.x/the-complete-guide/part1/access-policy/) if interested.
85
85
86
86
Run the following commands to generate a Prisma schema and synchronize it to the database:
Is it useful, or can it be confusing (as it looks the same as relation filters)? Let us know by leaving a comment below. You can also learn more about this feature in the [official guide](https://zenstack.dev/docs/guides/typing-json).
169
+
Is it useful, or can it be confusing (as it looks the same as relation filters)? Let us know by leaving a comment below. You can also learn more about this feature in the [official guide](https://zenstack.dev/docs/2.x/guides/typing-json).
Copy file name to clipboardExpand all lines: blog/modern-sql-dx/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ There have been many security concerns about using cloud-based databases directl
34
34
35
35
Beneath the simple surface, cloud database providers have been working hard to automate many things for you:
36
36
37
-
- Scaling up and down? Don’t worry about it. When idle, the services can shrink to [literally zero CPU usage](https://neon.tech/docs/reference/glossary#scale-to-zero) and rapidly scale up as traffic surges.
37
+
- Scaling up and down? Don’t worry about it. When idle, the services can shrink to [literally zero CPU usage](https://neon.tech/docs/2.x/reference/glossary#scale-to-zero) and rapidly scale up as traffic surges.
38
38
- Bottomless storage, so running out of disk space is never a worry anymore.
39
39
- Sharding has always been a headache to manage and used to require lots of application code changes. Now, it can be achieved in a [much less intrusive way](https://planetscale.com/docs/concepts/sharding).
40
40
- Not proficient with managing indexes? The services monitor query patterns and auto-tune indexes for you.
Copy file name to clipboardExpand all lines: blog/nest-api/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -325,7 +325,7 @@ export class AppModule implements NestModule {
325
325
}
326
326
```
327
327
328
-
That's it! Now we have a complete set of RESTful CRUD APIs at "/api/zen" that conforms to the [JSON:API](https://jsonapi.org/) specification, and the access policies fully protect the APIs. The API provides rich filtering and relation-fetching capabilities. The following are some examples; you can find more details [here](https://zenstack.dev/docs/reference/server-adapters/api-handlers/rest#endpoints-and-features).
328
+
That's it! Now we have a complete set of RESTful CRUD APIs at "/api/zen" that conforms to the [JSON:API](https://jsonapi.org/) specification, and the access policies fully protect the APIs. The API provides rich filtering and relation-fetching capabilities. The following are some examples; you can find more details [here](https://zenstack.dev/docs/2.x/reference/server-adapters/api-handlers/rest#endpoints-and-features).
0 commit comments