Skip to content

Commit a3473ea

Browse files
authored
fix: Update start line of JsDoc comments in zmodel to start with two … (#428)
1 parent 159d025 commit a3473ea

File tree

3 files changed

+58
-58
lines changed

3 files changed

+58
-58
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
1+
/**
22
* Mark a data model to be ignored when generating OpenAPI specification.
33
*/
44
attribute @@openapi.ignore()
55

6-
/*
6+
/**
77
* Provide metadata for a data model for generating OpenAPI specification.
88
*/
99
attribute @@openapi.meta(_ meta: Object)

packages/schema/src/res/starter.zmodel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This is a sample model to get you started.
22
// Learn how to model you app: https://zenstack.dev/#/modeling-your-app.
33

4-
/*
4+
/**
55
* A sample data source using local sqlite db.
66
* See how to use a different db: https://zenstack.dev/#/zmodel-data-source.
77
*/
@@ -14,7 +14,7 @@ generator client {
1414
provider = "prisma-client-js"
1515
}
1616

17-
/*
17+
/**
1818
* User model
1919
*/
2020
model User {
@@ -30,7 +30,7 @@ model User {
3030
@@allow('all', auth() == this)
3131
}
3232

33-
/*
33+
/**
3434
* Post model
3535
*/
3636
model Post {

packages/schema/src/res/stdlib.zmodel

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
/*
1+
/**
22
* Enum representing referential integrity related actions
33
*/
44
enum ReferentialAction {
5-
/*
5+
/**
66
* Used with "onDelete": deleting a referenced record will trigger the deletion of referencing record.
77
* Used with "onUpdate": updates the relation scalar fields if the referenced scalar fields of the dependent record are updated.
88
*/
99
Cascade
1010

11-
/*
11+
/**
1212
* Used with "onDelete": prevents the deletion if any referencing records exist.
1313
* Used with "onUpdate": prevents the identifier of a referenced record from being changed.
1414
*/
1515
Restrict
1616

17-
/*
17+
/**
1818
* Similar to 'Restrict', the difference between the two is dependent on the database being used.
1919
* See details: https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions#noaction
2020
*/
2121
NoAction
2222

23-
/*
23+
/**
2424
* Used with "onDelete": the scalar field of the referencing object will be set to NULL.
2525
* Used with "onUpdate": when updating the identifier of a referenced object, the scalar fields of the referencing objects will be set to NULL.
2626
*/
2727
SetNull
2828

29-
/*
29+
/**
3030
* Used with "onDelete": the scalar field of the referencing object will be set to the fields default value.
3131
* Used with "onUpdate": the scalar field of the referencing object will be set to the fields default value.
3232
*/
3333
SetDefault
3434
}
3535

36-
/*
36+
/**
3737
* Enum representing all possible field types
3838
*/
3939
enum AttributeTargetField {
@@ -49,44 +49,44 @@ enum AttributeTargetField {
4949
ModelField
5050
}
5151

52-
/*
52+
/**
5353
* Reads value from an environment variable.
5454
*/
5555
function env(name: String): String {
5656
}
5757

58-
/*
58+
/**
5959
* Gets the current login user.
6060
*/
6161
function auth(): Any {
6262
}
6363

64-
/*
64+
/**
6565
* Gets current date-time (as DateTime type).
6666
*/
6767
function now(): DateTime {
6868
}
6969

70-
/*
70+
/**
7171
* Generates a globally unique identifier based on the UUID specs.
7272
*/
7373
function uuid(): String {
7474
}
7575

76-
/*
76+
/**
7777
* Generates a globally unique identifier based on the CUID spec.
7878
*/
7979
function cuid(): String {
8080
}
8181

82-
/*
82+
/**
8383
* Creates a sequence of integers in the underlying database and assign the incremented
8484
* values to the ID values of the created records based on the sequence.
8585
*/
8686
function autoincrement(): Int {
8787
}
8888

89-
/*
89+
/**
9090
* Represents default values that cannot be expressed in the Prisma schema (such as random()).
9191
*/
9292
function dbgenerated(expr: String): Any {
@@ -98,50 +98,50 @@ function dbgenerated(expr: String): Any {
9898
function future(): Any {
9999
}
100100

101-
/*
101+
/**
102102
* If the field value contains the search string. By default, the search is case-sensitive,
103103
* but you can override the behavior with the "caseInSensitive" argument.
104104
*/
105105
function contains(field: String, search: String, caseInSensitive: Boolean?): Boolean {
106106
}
107107

108-
/*
108+
/**
109109
* 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.
110110
*/
111111
function search(field: String, search: String): Boolean {
112112
}
113113

114-
/*
114+
/**
115115
* If the field value starts with the search string
116116
*/
117117
function startsWith(field: String, search: String): Boolean {
118118
}
119119

120-
/*
120+
/**
121121
* If the field value ends with the search string
122122
*/
123123
function endsWith(field: String, search: String): Boolean {
124124
}
125125

126-
/*
126+
/**
127127
* If the field value (a list) has the given search value
128128
*/
129129
function has(field: Any[], search: Any): Boolean {
130130
}
131131

132-
/*
132+
/**
133133
* If the field value (a list) has every element of the search list
134134
*/
135135
function hasEvery(field: Any[], search: Any[]): Boolean {
136136
}
137137

138-
/*
138+
/**
139139
* If the field value (a list) has at least one element of the search list
140140
*/
141141
function hasSome(field: Any[], search: Any[]): Boolean {
142142
}
143143

144-
/*
144+
/**
145145
* If the field value (a list) is empty
146146
*/
147147
function isEmpty(field: Any[]): Boolean {
@@ -157,32 +157,32 @@ attribute @@@targetField(targetField: AttributeTargetField[])
157157
*/
158158
attribute @@@prisma()
159159

160-
/*
160+
/**
161161
* Defines an ID on the model.
162162
*/
163163
attribute @id(map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
164164

165-
/*
165+
/**
166166
* Defines a default value for a field.
167167
*/
168168
attribute @default(_ value: ContextType) @@@prisma
169169

170-
/*
170+
/**
171171
* Defines a unique constraint for this field.
172172
*/
173173
attribute @unique(map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
174174

175-
/*
175+
/**
176176
* Defines a multi-field ID (composite ID) on the model.
177177
*/
178178
attribute @@id(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
179179

180-
/*
180+
/**
181181
* Defines a compound unique constraint for the specified fields.
182182
*/
183183
attribute @@unique(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
184184

185-
/*
185+
/**
186186
* Index types
187187
*/
188188
enum IndexType {
@@ -194,37 +194,37 @@ enum IndexType {
194194
Brin
195195
}
196196

197-
/*
197+
/**
198198
* Defines an index in the database.
199199
*/
200200
attribute @@index(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: String?, clustered: Boolean?, type: IndexType?) @@@prisma
201201

202-
/*
202+
/**
203203
* Defines meta information about the relation.
204204
*/
205205
attribute @relation(_ name: String?, fields: FieldReference[]?, references: TransitiveFieldReference[]?, onDelete: ReferentialAction?, onUpdate: ReferentialAction?, map: String?) @@@prisma
206206

207-
/*
207+
/**
208208
* Maps a field name or enum value from the schema to a column with a different name in the database.
209209
*/
210210
attribute @map(_ name: String) @@@prisma
211211

212-
/*
212+
/**
213213
* Maps the schema model name to a table with a different name, or an enum name to a different underlying enum in the database.
214214
*/
215215
attribute @@map(_ name: String) @@@prisma
216216

217-
/*
217+
/**
218218
* Exclude a field from the Prisma Client (for example, a field that you do not want Prisma users to update).
219219
*/
220220
attribute @ignore() @@@prisma
221221

222-
/*
222+
/**
223223
* Exclude a model from the Prisma Client (for example, a model that you do not want Prisma users to update).
224224
*/
225225
attribute @@ignore() @@@prisma
226226

227-
/*
227+
/**
228228
* Automatically stores the time when a record was last updated.
229229
*/
230230
attribute @updatedAt() @@@targetField([DateTimeField]) @@@prisma
@@ -317,22 +317,22 @@ attribute @db.Blob() @@@targetField([BytesField]) @@@prisma
317317
attribute @db.MediumBlob() @@@targetField([BytesField]) @@@prisma
318318
attribute @db.Image() @@@targetField([BytesField]) @@@prisma
319319

320-
/*
320+
/**
321321
* Specifies the schema to use in a multi-schema database. https://www.prisma.io/docs/guides/database/multi-schema.
322322
*/
323323
attribute @@schema(_ name: String) @@@prisma
324324

325-
/*
325+
/**
326326
* Defines an access policy that allows a set of operations when the given condition is true.
327327
*/
328328
attribute @@allow(_ operation: String, _ condition: Boolean)
329329

330-
/*
330+
/**
331331
* Defines an access policy that denies a set of operations when the given condition is true.
332332
*/
333333
attribute @@deny(_ operation: String, _ condition: Boolean)
334334

335-
/*
335+
/**
336336
* Indicates that the field is a password field and needs to be hashed before persistence.
337337
*
338338
* ZenStack uses `bcryptjs` library to hash password. You can use the `saltLength` parameter
@@ -346,72 +346,72 @@ attribute @@deny(_ operation: String, _ condition: Boolean)
346346
*/
347347
attribute @password(saltLength: Int?, salt: String?) @@@targetField([StringField])
348348

349-
/*
349+
/**
350350
* Indicates that the field should be omitted when read from the generated services.
351351
*/
352352
attribute @omit()
353353

354-
/*
354+
/**
355355
* Validates length of a string field.
356356
*/
357357
attribute @length(_ min: Int?, _ max: Int?) @@@targetField([StringField])
358358

359-
/*
359+
/**
360360
* Validates a string field value matches a regex.
361361
*/
362362
attribute @regex(_ regex: String) @@@targetField([StringField])
363363

364-
/*
364+
/**
365365
* Validates a string field value starts with the given text.
366366
*/
367367
attribute @startsWith(_ text: String) @@@targetField([StringField])
368368

369-
/*
369+
/**
370370
* Validates a string field value ends with the given text.
371371
*/
372372
attribute @endsWith(_ text: String) @@@targetField([StringField])
373373

374-
/*
374+
/**
375375
* Validates a string field value is a valid email address.
376376
*/
377377
attribute @email() @@@targetField([StringField])
378378

379-
/*
379+
/**
380380
* Validates a string field value is a valid ISO datetime.
381381
*/
382382
attribute @datetime() @@@targetField([StringField])
383383

384-
/*
384+
/**
385385
* Validates a string field value is a valid url.
386386
*/
387387
attribute @url() @@@targetField([StringField])
388388

389-
/*
389+
/**
390390
* Validates a number field is greater than the given value.
391391
*/
392392
attribute @gt(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
393393

394-
/*
394+
/**
395395
* Validates a number field is greater than or equal to the given value.
396396
*/
397397
attribute @gte(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
398398

399-
/*
399+
/**
400400
* Validates a number field is less than the given value.
401401
*/
402402
attribute @lt(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
403403

404-
/*
404+
/**
405405
* Validates a number field is less than or equal to the given value.
406406
*/
407407
attribute @lte(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
408408

409-
/*
409+
/**
410410
* A utility attribute to allow passthrough of arbitrary attribute text to the generated Prisma schema.
411411
*/
412412
attribute @prisma.passthrough(_ text: String)
413413

414-
/*
414+
/**
415415
* A utility attribute to allow passthrough of arbitrary attribute text to the generated Prisma schema.
416416
*/
417417
attribute @@prisma.passthrough(_ text: String)

0 commit comments

Comments
 (0)