-
-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathstdlib.zmodel
More file actions
671 lines (567 loc) · 22.4 KB
/
stdlib.zmodel
File metadata and controls
671 lines (567 loc) · 22.4 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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
/**
* Enum representing referential integrity related actions
* @see https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/referential-actions
*/
enum ReferentialAction {
/**
* Used with "onDelete": deleting a referenced record will trigger the deletion of referencing record.
* Used with "onUpdate": updates the relation scalar fields if the referenced scalar fields of the dependent record are updated.
*/
Cascade
/**
* Used with "onDelete": prevents the deletion if any referencing records exist.
* Used with "onUpdate": prevents the identifier of a referenced record from being changed.
*/
Restrict
/**
* Similar to 'Restrict', the difference between the two is dependent on the database being used.
*/
NoAction
/**
* Used with "onDelete": the scalar field of the referencing object will be set to NULL.
* Used with "onUpdate": when updating the identifier of a referenced object, the scalar fields of the referencing objects will be set to NULL.
*/
SetNull
/**
* Used with "onDelete": the scalar field of the referencing object will be set to the fields default value.
* Used with "onUpdate": the scalar field of the referencing object will be set to the fields default value.
*/
SetDefault
}
/**
* Enum representing all possible field types
*/
enum AttributeTargetField {
StringField
IntField
BigIntField
FloatField
DecimalField
BooleanField
DateTimeField
JsonField
BytesField
ModelField
TypeDefField
ListField
}
/**
* Indicates the expression context a function can be used.
*/
enum ExpressionContext {
// used in @default
DefaultValue
// used in @@allow and @@deny
AccessPolicy
// used in @@validate
ValidationRule
// used in @@index
Index
}
/**
* Reads value from an environment variable.
*/
function env(name: String): String {
}
/**
* Gets current date-time (as DateTime type).
*/
function now(): DateTime {
} @@@expressionContext([DefaultValue, AccessPolicy, ValidationRule])
/**
* Generates a globally unique identifier based on the UUID specs.
*/
function uuid(version: Int?, format: String?): String {
} @@@expressionContext([DefaultValue])
/**
* Generates a globally unique identifier based on the CUID spec.
*/
function cuid(version: Int?, format: String?): String {
} @@@expressionContext([DefaultValue])
/**
* Generates an identifier based on the nanoid spec.
*/
function nanoid(length: Int?, format: String?): String {
} @@@expressionContext([DefaultValue])
/**
* Generates an identifier based on the ulid spec.
*/
function ulid(format: String?): String {
} @@@expressionContext([DefaultValue])
/**
* Creates a sequence of integers in the underlying database and assign the incremented
* values to the ID values of the created records based on the sequence.
*/
function autoincrement(): Int {
} @@@expressionContext([DefaultValue])
/**
* Represents default values that cannot be expressed in the Prisma schema (such as random()).
*/
function dbgenerated(expr: String?): Any {
} @@@expressionContext([DefaultValue])
/**
* Checks if the field value contains the search string. By default, the search is case-sensitive, and
* "LIKE" operator is used to match. If `caseInSensitive` is true, "ILIKE" operator is used if
* supported, otherwise it still falls back to "LIKE" and delivers whatever the database's
* behavior is.
*/
function contains(field: String, search: String, caseInSensitive: Boolean?): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
// /**
// * If the field value matches the search condition with [full-text-search](https://www.prisma.io/docs/concepts/components/prisma-client/full-text-search). Need to enable "fullTextSearch" preview feature to use.
// */
// function search(field: String, search: String): Boolean {
// } @@@expressionContext([AccessPolicy])
/**
* Checks the field value starts with the search string. By default, the search is case-sensitive, and
* "LIKE" operator is used to match. If `caseInSensitive` is true, "ILIKE" operator is used if
* supported, otherwise it still falls back to "LIKE" and delivers whatever the database's
* behavior is.
*/
function startsWith(field: String, search: String, caseInSensitive: Boolean?): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
/**
* Checks if the field value ends with the search string. By default, the search is case-sensitive, and
* "LIKE" operator is used to match. If `caseInSensitive` is true, "ILIKE" operator is used if
* supported, otherwise it still falls back to "LIKE" and delivers whatever the database's
* behavior is.
*/
function endsWith(field: String, search: String, caseInSensitive: Boolean?): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
/**
* Checks if the list field has the given search value
*/
function has(field: Any[], search: Any): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
/**
* Checks if the list field has at least one element of the search list
*/
function hasSome(field: Any[], search: Any[]): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
/**
* Checks if the list field has every element of the search list
*/
function hasEvery(field: Any[], search: Any[]): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
/**
* Checks if the list field is empty
*/
function isEmpty(field: Any[]): Boolean {
} @@@expressionContext([AccessPolicy, ValidationRule])
/**
* Marks an attribute to be only applicable to certain field types.
*/
attribute @@@targetField(_ targetField: AttributeTargetField[])
/**
* Marks an attribute to be used for data validation.
*/
attribute @@@validation()
/**
* Indicates the expression context a function can be used.
*/
attribute @@@expressionContext(_ context: ExpressionContext[])
/**
* Indicates an attribute is directly supported by the Prisma schema.
*/
attribute @@@prisma()
/**
* Provides hint for auto-completion.
*/
attribute @@@completionHint(_ values: String[])
/**
* Indicates that the attribute can only be applied once to a declaration.
*/
attribute @@@once()
/**
* Defines a single-field ID on the model.
*
* @param map: The name of the underlying primary key constraint in the database.
* @param length: Allows you to specify a maximum length for the subpart of the value to be indexed.
* @param sort: Allows you to specify in what order the entries of the ID are stored in the database. The available options are Asc and Desc.
* @param clustered: Defines whether the ID is clustered or non-clustered. Defaults to true.
*/
attribute @id(map: String?, length: Int?, sort: SortOrder?, clustered: Boolean?) @@@prisma @@@once
/**
* Defines a default value for a field.
* @param value: An expression (e.g. 5, true, now(), auth()).
*/
attribute @default(_ value: ContextType, map: String?) @@@prisma
/**
* Defines a unique constraint for this field.
*
* @param length: Allows you to specify a maximum length for the subpart of the value to be indexed.
* @param sort: Allows you to specify in what order the entries of the constraint are stored in the database. The available options are Asc and Desc.
* @param clustered: Boolean Defines whether the constraint is clustered or non-clustered. Defaults to false.
*/
attribute @unique(map: String?, length: Int?, sort: SortOrder?, clustered: Boolean?) @@@prisma @@@once
/**
* Defines a multi-field ID (composite ID) on the model.
*
* @param fields: A list of field names - for example, [firstname, lastname]
* @param name: The name that Prisma Client will expose for the argument covering all fields, e.g. fullName in fullName: { firstName: "First", lastName: "Last"}
* @param map: The name of the underlying primary key constraint in the database.
* @param length: Allows you to specify a maximum length for the subpart of the value to be indexed.
* @param sort: Allows you to specify in what order the entries of the ID are stored in the database. The available options are Asc and Desc.
* @param clustered: Defines whether the ID is clustered or non-clustered. Defaults to true.
*/
attribute @@id(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: SortOrder?, clustered: Boolean?) @@@prisma @@@once
/**
* Defines a compound unique constraint for the specified fields.
*
* @param fields: A list of field names - for example, [firstname, lastname]. Fields must be mandatory.
* @param name: The name of the unique combination of fields - defaults to fieldName1_fieldName2_fieldName3
* @param length: Allows you to specify a maximum length for the subpart of the value to be indexed.
* @param sort: Allows you to specify in what order the entries of the constraint are stored in the database. The available options are Asc and Desc.
* @param clustered: Boolean Defines whether the constraint is clustered or non-clustered. Defaults to false.
*/
attribute @@unique(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: SortOrder?, clustered: Boolean?) @@@prisma
/**
* Index types
*/
enum IndexType {
BTree
Hash
Gist
Gin
SpGist
Brin
}
/**
* Operator class for index
*/
enum IndexOperatorClass {
// GIN
ArrayOps
JsonbOps
JsonbPathOps
// Gist
InetOps
// SpGist
TextOps
// BRIN
BitMinMaxOps
VarBitMinMaxOps
BpcharBloomOps
BpcharMinMaxOps
ByteaBloomOps
ByteaMinMaxOps
DateBloomOps
DateMinMaxOps
DateMinMaxMultiOps
Float4BloomOps
Float4MinMaxOps
Float4MinMaxMultiOps
Float8BloomOps
Float8MinMaxOps
Float8MinMaxMultiOps
InetInclusionOps
InetBloomOps
InetMinMaxOps
InetMinMaxMultiOps
Int2BloomOps
Int2MinMaxOps
Int2MinMaxMultiOps
Int4BloomOps
Int4MinMaxOps
Int4MinMaxMultiOps
Int8BloomOps
Int8MinMaxOps
Int8MinMaxMultiOps
NumericBloomOps
NumericMinMaxOps
NumericMinMaxMultiOps
OidBloomOps
OidMinMaxOps
OidMinMaxMultiOps
TextBloomOps
TextMinMaxOps
TextMinMaxMultiOps
TimestampBloomOps
TimestampMinMaxOps
TimestampMinMaxMultiOps
TimestampTzBloomOps
TimestampTzMinMaxOps
TimestampTzMinMaxMultiOps
TimeBloomOps
TimeMinMaxOps
TimeMinMaxMultiOps
TimeTzBloomOps
TimeTzMinMaxOps
TimeTzMinMaxMultiOps
UuidBloomOps
UuidMinMaxOps
UuidMinMaxMultiOps
}
/**
* Index sort order
*/
enum SortOrder {
Asc
Desc
}
/**
* Defines an index in the database.
*
* @params fields: A list of field names - for example, [firstname, lastname]
* @params name: The name that Prisma Client will expose for the argument covering all fields, e.g. fullName in fullName: { firstName: "First", lastName: "Last"}
* @params map: The name of the index in the underlying database (Prisma generates an index name that respects identifier length limits if you do not specify a name. Prisma uses the following naming convention: tablename.field1_field2_field3_unique)
* @params length: Allows you to specify a maximum length for the subpart of the value to be indexed.
* @params sort: Allows you to specify in what order the entries of the index or constraint are stored in the database. The available options are asc and desc.
* @params clustered: Defines whether the index is clustered or non-clustered. Defaults to false.
* @params type: Allows you to specify an index access method. Defaults to BTree.
*/
attribute @@index(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: SortOrder?, clustered: Boolean?, type: IndexType?) @@@prisma
/**
* Defines meta information about the relation.
*
* @param name: Sometimes (e.g. to disambiguate a relation) Defines the name of the relationship. In an m-n-relation, it also determines the name of the underlying relation table.
* @param fields: A list of fields of the current model
* @param references: A list of fields of the model on the other side of the relation
* @param map: Defines a custom name for the foreign key in the database.
* @param onUpdate: Defines the referential action to perform when a referenced entry in the referenced model is being updated.
* @param onDelete: Defines the referential action to perform when a referenced entry in the referenced model is being deleted.
*/
attribute @relation(_ name: String?, fields: FieldReference[]?, references: TransitiveFieldReference[]?, onDelete: ReferentialAction?, onUpdate: ReferentialAction?, map: String?) @@@prisma
/**
* Maps a field name or enum value from the schema to a column with a different name in the database.
*
* @param name: The database column name.
*/
attribute @map(_ name: String) @@@prisma
/**
* Maps the schema model name to a table with a different name, or an enum name to a different underlying enum in the database.
*
* @param name: The database column name.
*/
attribute @@map(_ name: String) @@@prisma
/**
* Exclude a field from the ORM Client (for example, a field that you do not want Prisma users to update).
* The field is still recognized by database schema migrations.
*/
attribute @ignore() @@@prisma
/**
* Exclude a model from the ORM Client (for example, a model that you do not want Prisma users to update).
* The model is still recognized by database schema migrations.
*/
attribute @@ignore() @@@prisma
/**
* Indicates that the field should be omitted by default when read with an ORM client. The omission can be
* overridden in options passed to create `ZenStackClient`, or at query time by explicitly passing in an
* `omit` clause. The attribute is only effective for ORM query APIs, not for query-builder APIs.
*/
attribute @omit()
/**
* Automatically stores the time when a record was last updated.
*
* @param ignore: A list of field names that are not considered when the ORM client is determining whether any
* updates have been made to a record. An update that only contains ignored fields does not change the
* timestamp.
*/
attribute @updatedAt(ignore: FieldReference[]?) @@@targetField([DateTimeField]) @@@prisma
/**
* Add full text index (MySQL only).
*/
attribute @@fulltext(_ fields: FieldReference[], map: String?) @@@prisma
// String type modifiers
attribute @db.Text() @@@targetField([StringField]) @@@prisma
attribute @db.Char(_ x: Int?) @@@targetField([StringField]) @@@prisma
attribute @db.VarChar(_ x: Any?) @@@targetField([StringField]) @@@prisma
attribute @db.Bit(_ x: Int?) @@@targetField([StringField, BooleanField, BytesField]) @@@prisma
attribute @db.VarBit(_ x: Int?) @@@targetField([StringField]) @@@prisma
attribute @db.Uuid() @@@targetField([StringField]) @@@prisma
attribute @db.Xml() @@@targetField([StringField]) @@@prisma
attribute @db.Inet() @@@targetField([StringField]) @@@prisma
attribute @db.Citext() @@@targetField([StringField]) @@@prisma
attribute @db.TinyText() @@@targetField([StringField]) @@@prisma
attribute @db.MediumText() @@@targetField([StringField]) @@@prisma
attribute @db.LongText() @@@targetField([StringField]) @@@prisma
// Boolean type modifiers
attribute @db.Boolean() @@@targetField([BooleanField]) @@@prisma
// Int type modifiers
attribute @db.Int() @@@targetField([IntField]) @@@prisma
attribute @db.Integer() @@@targetField([IntField]) @@@prisma
attribute @db.SmallInt() @@@targetField([IntField]) @@@prisma
attribute @db.Oid() @@@targetField([IntField]) @@@prisma
attribute @db.UnsignedInt() @@@targetField([IntField]) @@@prisma
attribute @db.UnsignedSmallInt() @@@targetField([IntField]) @@@prisma
attribute @db.MediumInt() @@@targetField([IntField]) @@@prisma
attribute @db.UnsignedMediumInt() @@@targetField([IntField]) @@@prisma
attribute @db.TinyInt(_ length: Int?) @@@targetField([IntField]) @@@prisma
attribute @db.UnsignedTinyInt(_ length: Int?) @@@targetField([IntField]) @@@prisma
attribute @db.Year() @@@targetField([IntField]) @@@prisma
// BigInt type modifiers
attribute @db.BigInt() @@@targetField([BigIntField]) @@@prisma
attribute @db.UnsignedBigInt() @@@targetField([BigIntField]) @@@prisma
// Float/Decimal type modifiers
attribute @db.DoublePrecision() @@@targetField([FloatField, DecimalField]) @@@prisma
attribute @db.Real() @@@targetField([FloatField, DecimalField]) @@@prisma
attribute @db.Decimal(_ p: Int?, _ s: Int?) @@@targetField([FloatField, DecimalField]) @@@prisma
attribute @db.Money() @@@targetField([FloatField, DecimalField]) @@@prisma
attribute @db.Float() @@@targetField([FloatField]) @@@prisma
attribute @db.Double() @@@targetField([FloatField]) @@@prisma
// DateTime type modifiers
attribute @db.Timestamp(_ x: Int?) @@@targetField([DateTimeField]) @@@prisma
attribute @db.Timestamptz(_ x: Int?) @@@targetField([DateTimeField]) @@@prisma
attribute @db.Date() @@@targetField([DateTimeField]) @@@prisma
attribute @db.Time(_ x: Int?) @@@targetField([DateTimeField]) @@@prisma
attribute @db.Timetz(_ x: Int?) @@@targetField([DateTimeField]) @@@prisma
attribute @db.DateTime(_ x: Int?) @@@targetField([DateTimeField]) @@@prisma
// Json type modifiers
attribute @db.Json() @@@targetField([JsonField]) @@@prisma
attribute @db.JsonB() @@@targetField([JsonField]) @@@prisma
// Bytes type modifiers
attribute @db.ByteA() @@@targetField([BytesField]) @@@prisma
attribute @db.LongBlob() @@@targetField([BytesField]) @@@prisma
attribute @db.Binary(_ n: Int?) @@@targetField([BytesField]) @@@prisma
attribute @db.VarBinary(_ n: Int?) @@@targetField([BytesField]) @@@prisma
attribute @db.TinyBlob() @@@targetField([BytesField]) @@@prisma
attribute @db.Blob() @@@targetField([BytesField]) @@@prisma
attribute @db.MediumBlob() @@@targetField([BytesField]) @@@prisma
/**
* Specifies the schema to use in a multi-schema PostgreSQL database.
*
* @param map: The name of the database schema.
*/
attribute @@schema(_ map: String) @@@prisma
//////////////////////////////////////////////
// Begin validation attributes and functions
//////////////////////////////////////////////
/**
* Validates length of a string field or list field.
*/
attribute @length(_ min: Int?, _ max: Int?, _ message: String?) @@@targetField([StringField, ListField]) @@@validation
/**
* Validates a string field value starts with the given text.
*/
attribute @startsWith(_ text: String, _ message: String?) @@@targetField([StringField]) @@@validation
/**
* Validates a string field value ends with the given text.
*/
attribute @endsWith(_ text: String, _ message: String?) @@@targetField([StringField]) @@@validation
/**
* Validates a string field value contains the given text.
*/
attribute @contains(_ text: String, _ message: String?) @@@targetField([StringField]) @@@validation
/**
* Validates a string field value matches a regex.
*/
attribute @regex(_ regex: String, _ message: String?) @@@targetField([StringField]) @@@validation
/**
* Validates a string field value is a valid email address.
*/
attribute @email(_ message: String?) @@@targetField([StringField]) @@@validation
/**
* Validates a string field value is a valid ISO datetime.
*/
attribute @datetime(_ message: String?) @@@targetField([StringField]) @@@validation
/**
* Validates a string field value is a valid url.
*/
attribute @url(_ message: String?) @@@targetField([StringField]) @@@validation
/**
* Trims whitespaces from the start and end of the string.
*/
attribute @trim() @@@targetField([StringField]) @@@validation
/**
* Transform entire string toLowerCase.
*/
attribute @lower() @@@targetField([StringField]) @@@validation
/**
* Transform entire string toUpperCase.
*/
attribute @upper() @@@targetField([StringField]) @@@validation
/**
* Validates a number field is greater than the given value.
*/
attribute @gt(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
/**
* Validates a number field is greater than or equal to the given value.
*/
attribute @gte(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
/**
* Validates a number field is less than the given value.
*/
attribute @lt(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
/**
* Validates a number field is less than or equal to the given value.
*/
attribute @lte(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
/**
* Validates the entity with a complex condition.
*/
attribute @@validate(_ value: Boolean, _ message: String?, _ path: String[]?) @@@validation
/**
* Returns the length of a string field or a list field.
*/
function length(field: Any): Int {
} @@@expressionContext([ValidationRule])
/**
* Validates a string field value matches a regex pattern.
*/
function regex(field: String, pattern: String): Boolean {
} @@@expressionContext([ValidationRule])
/**
* Validates a string field value is a valid email address.
*/
function isEmail(field: String): Boolean {
} @@@expressionContext([ValidationRule])
/**
* Validates a string field value is a valid ISO datetime.
*/
function isDateTime(field: String): Boolean {
} @@@expressionContext([ValidationRule])
/**
* Validates a string field value is a valid url.
*/
function isUrl(field: String): Boolean {
} @@@expressionContext([ValidationRule])
//////////////////////////////////////////////
// End validation attributes and functions
//////////////////////////////////////////////
/**
* A utility attribute to allow passthrough of arbitrary attribute text to the generated Prisma schema.
*/
attribute @prisma.passthrough(_ text: String)
/**
* A utility attribute to allow passthrough of arbitrary attribute text to the generated Prisma schema.
*/
attribute @@prisma.passthrough(_ text: String)
/**
* Marks a model to be a delegate. Used for implementing polymorphism.
*/
attribute @@delegate(_ discriminator: FieldReference)
/**
* Used for specifying operator classes for GIN index.
*/
function raw(value: String): Any {
} @@@expressionContext([Index])
/**
* Marks a field to be strong-typed JSON.
*/
attribute @json() @@@targetField([TypeDefField])
/**
* Marks a field to be computed.
*/
attribute @computed()
/**
* Gets the current login user.
*/
function auth(): Any {
} @@@expressionContext([DefaultValue, AccessPolicy])
/**
* Used to specify the model for resolving `auth()` function call in access policies. A Zmodel
* can have at most one model with this attribute. By default, the model named "User" is used.
*/
attribute @@auth()
/**
* Attaches arbitrary metadata to a model or type def.
*/
attribute @@meta(_ name: String, _ value: Any)
/**
* Attaches arbitrary metadata to a field.
*/
attribute @meta(_ name: String, _ value: Any)
/**
* Marks an attribute as deprecated.
*/
attribute @@@deprecated(_ message: String)