-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsnapshot.test.ts.snap
More file actions
374 lines (263 loc) · 10.2 KB
/
snapshot.test.ts.snap
File metadata and controls
374 lines (263 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`documentation plugin: snapshot > snapshot: full representative schema output > enums/Role.md 1`] = `
"\`\`\`
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: schema.zmodel · Generated: <REDACTED> //
//////////////////////////////////////////////////////////////////////////////////////////////
\`\`\`
[Index](../index.md) / [Enums](../index.md#enums) / \`Role\`
# Role <kbd>Enum</kbd>
> User roles in the system.
**Defined in:** \`<REDACTED>.zmodel\`
<details>
<summary>Declaration · <REDACTED>.zmodel</code></summary>
\`\`\`prisma
enum Role {
ADMIN
USER
}
\`\`\`
</details>
<a id="values"></a>
## 🏷️ Values
> Possible values for this enumeration.
| Value | Description |
| --- | --- |
| \`ADMIN\` | Administrator with full access |
| \`USER\` | Standard user |
<a id="used-by"></a>
## 📍 Used By
> Models and fields that reference this type.
- [User](../models/User.md) — [\`role\`](../models/User.md#field-role)
\`\`\`mermaid
classDiagram
class Role {
<<enumeration>>
ADMIN
USER
}
User --> Role : role
\`\`\`
---
<a id="references"></a>
## 📚 References
- [ZModel enums — ZenStack documentation](https://zenstack.dev/docs/reference/zmodel/enum)
"
`;
exports[`documentation plugin: snapshot > snapshot: full representative schema output > index.md 1`] = `
"\`\`\`
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: schema.zmodel · Generated: <REDACTED> //
//////////////////////////////////////////////////////////////////////////////////////////////
\`\`\`
# Schema Documentation
This documentation describes a [ZModel](https://zenstack.dev/docs/reference/zmodel/overview) schema — the data modeling language used by [ZenStack](https://zenstack.dev/).
> 2 models · 1 enum
[Models](#models) · [Enums](#enums) · [Relationships](./relationships.md)
<a id="models"></a>
## 🗃️ Models
- [Post](./models/Post.md) — A blog post.
- [User](./models/User.md) — Represents a registered user.
<a id="enums"></a>
## 🏷️ Enums
- [Role](./enums/Role.md) — User roles in the system.
<a id="see-also"></a>
## 📎 See Also
- [Relationships](./relationships.md)
---
<details>
<summary>Generation Stats</summary>
| Metric | Value |
| --- | --- |
| **Files** | 5 |
| **Duration** | <REDACTED> ms |
| **Source** | \`schema.zmodel\` |
| **Generated** | <REDACTED> |
</details>
"
`;
exports[`documentation plugin: snapshot > snapshot: full representative schema output > models/Post.md 1`] = `
"\`\`\`
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: schema.zmodel · Generated: <REDACTED> //
//////////////////////////////////////////////////////////////////////////////////////////////
\`\`\`
[Index](../index.md) / [Models](../index.md#models) / \`Post\`
# 🗃️ Post <kbd>Model</kbd>
> A blog post.
**Category:** Content · **Defined in:** \`<REDACTED>.zmodel\`
---
<details>
<summary>Declaration · <REDACTED>.zmodel</code></summary>
\`\`\`prisma
model Post {
id String @id @default(cuid())
title String
content String?
author User @relation(fields: [authorId], references: [id])
authorId String
@@meta('doc:category', 'Content')
}
\`\`\`
</details>
> **On this page:** [Fields](#fields) · [Relationships](#relationships)
<a id="fields"></a>
## 📋 Fields
> All fields defined on this entity, including inherited fields from mixins and parent models.
| Field | Type | Required | Default | Attributes | Source | Description |
| --- | --- | --- | --- | --- | --- | --- |
| <a id="field-id"></a>\`id\` | \`String\` | Yes | \`cuid()\` | \`@id\` | — | — |
| <a id="field-title"></a>\`title\` | \`String\` | Yes | — | — | — | The post title. |
| <a id="field-content"></a>\`content\` | \`String?\` | No | — | — | — | — |
| <a id="field-author"></a>\`author\` | [User](./User.md) | Yes | — | \`@relation(fields: [authorId], references: [id])\` | — | — |
| <a id="field-authorId"></a>\`authorId\` | \`String\` | Yes | — | — | — | — |
<a id="relationships"></a>
## 🔗 Relationships
> Foreign key relationships to other models in the schema.
| Field | Related Model | Type |
| --- | --- | --- |
| \`author\` | [User](./User.md) | Many→One |
\`\`\`mermaid
erDiagram
Post {
String id PK
String title
String content
String authorId FK
}
User {
String id
String email
String name
Role role
}
Post }o--|| User : "author"
\`\`\`
---
<a id="references"></a>
## 📚 References
- [ZModel models — ZenStack documentation](https://zenstack.dev/docs/reference/zmodel/model)
---
Next: [User](./User.md)
"
`;
exports[`documentation plugin: snapshot > snapshot: full representative schema output > models/User.md 1`] = `
"\`\`\`
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: schema.zmodel · Generated: <REDACTED> //
//////////////////////////////////////////////////////////////////////////////////////////////
\`\`\`
[Index](../index.md) / [Models](../index.md#models) / \`User\`
# 🗃️ User <kbd>Model</kbd>
> Represents a registered user.
**Category:** Identity · **Since:** 1.0 · **Defined in:** \`<REDACTED>.zmodel\`
---
<details>
<summary>Declaration · <REDACTED>.zmodel</code></summary>
\`\`\`prisma
model User {
id String @id @default(cuid())
email String @unique @email
name String
role Role
posts Post[]
@@allow('read', true)
@@deny('delete', true)
@@index([email])
@@meta('doc:category', 'Identity')
@@meta('doc:since', '1.0')
}
\`\`\`
</details>
> **On this page:** [Fields](#fields) · [Relationships](#relationships) · [Access Policies](#access-policies) · [Indexes](#indexes) · [Validation Rules](#validation-rules)
<a id="fields"></a>
## 📋 Fields
> All fields defined on this entity, including inherited fields from mixins and parent models.
| Field | Type | Required | Default | Attributes | Source | Description |
| --- | --- | --- | --- | --- | --- | --- |
| <a id="field-id"></a>\`id\` | \`String\` | Yes | \`cuid()\` | \`@id\` | — | — |
| <a id="field-email"></a>\`email\` | \`String\` | Yes | — | \`@unique\`, \`@email\` | — | User's email address. |
| <a id="field-name"></a>\`name\` | \`String\` | Yes | — | — | — | Display name shown in the UI. |
| <a id="field-role"></a>\`role\` | [Role](../enums/Role.md) | Yes | — | — | — | — |
| <a id="field-posts"></a>\`posts\` | [Post](./Post.md)[] | No | — | — | — | — |
<a id="relationships"></a>
## 🔗 Relationships
> Foreign key relationships to other models in the schema.
| Field | Related Model | Type |
| --- | --- | --- |
| \`posts\` | [Post](./Post.md) | One→Many |
\`\`\`mermaid
erDiagram
User {
String id PK
String email UK
String name
Role role
}
Post {
String id
String title
String content
String authorId
}
User ||--o{ Post : "posts"
\`\`\`
<a id="access-policies"></a>
## 🔐 Access Policies
> ZenStack access control rules that determine who can read, create, update, or delete records.
> [!IMPORTANT]
> Operations are **denied by default**. \`@@allow\` rules grant access; \`@@deny\` rules override any allow.
| Operation | Rule | Effect |
| --- | --- | --- |
| read | \`true\` | Allow |
| delete | \`true\` | Deny |
<a id="indexes"></a>
## 📇 Indexes
> Database indexes defined on this model for query performance.
| Fields | Type |
| --- | --- |
| \`[email]\` | Index |
<a id="validation-rules"></a>
## ✅ Validation Rules
> Field-level and model-level validation constraints enforced at the ORM layer.
| Field | Rule |
| --- | --- |
| \`email\` | \`@email\` |
---
<a id="references"></a>
## 📚 References
- [ZModel models — ZenStack documentation](https://zenstack.dev/docs/reference/zmodel/model)
---
Previous: [Post](./Post.md)
"
`;
exports[`documentation plugin: snapshot > snapshot: full representative schema output > relationships.md 1`] = `
"\`\`\`
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: schema.zmodel · Generated: <REDACTED> //
//////////////////////////////////////////////////////////////////////////////////////////////
\`\`\`
[Index](./index.md) / Relationships
# Relationships
## Cross-Reference
| Model | Field | Related Model | Type |
| --- | --- | --- | --- |
| [User](./models/User.md) | posts | [Post](./models/Post.md) | One→Many |
| [Post](./models/Post.md) | author | [User](./models/User.md) | Many→One |
## Entity Relationship Diagram
\`\`\`mermaid
erDiagram
User ||--o{ Post : "posts"
\`\`\`
"
`;