zenstack 1.0.0-alpha.99 → 1.0.0-beta.1
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 +53 -20
- package/cli/cli-util.d.ts +4 -1
- package/cli/cli-util.js +62 -8
- package/cli/cli-util.js.map +1 -1
- package/cli/config.js +39 -13
- package/cli/config.js.map +1 -1
- package/cli/index.js +1 -6
- package/cli/index.js.map +1 -1
- package/cli/plugin-runner.js +22 -18
- package/cli/plugin-runner.js.map +1 -1
- package/language-server/utils.d.ts +1 -5
- package/language-server/utils.js +3 -20
- package/language-server/utils.js.map +1 -1
- package/language-server/validator/datamodel-validator.d.ts +7 -0
- package/language-server/validator/datamodel-validator.js +64 -19
- package/language-server/validator/datamodel-validator.js.map +1 -1
- package/language-server/validator/expression-validator.js +7 -7
- package/language-server/validator/expression-validator.js.map +1 -1
- package/language-server/validator/schema-validator.d.ts +4 -1
- package/language-server/validator/schema-validator.js +25 -5
- package/language-server/validator/schema-validator.js.map +1 -1
- package/language-server/validator/utils.d.ts +1 -1
- package/language-server/validator/utils.js +10 -1
- package/language-server/validator/utils.js.map +1 -1
- package/language-server/validator/zmodel-validator.d.ts +2 -0
- package/language-server/validator/zmodel-validator.js +5 -1
- package/language-server/validator/zmodel-validator.js.map +1 -1
- package/language-server/zmodel-code-action.d.ts +2 -1
- package/language-server/zmodel-code-action.js +19 -10
- package/language-server/zmodel-code-action.js.map +1 -1
- package/language-server/zmodel-definition.d.ts +7 -0
- package/language-server/zmodel-definition.js +31 -0
- package/language-server/zmodel-definition.js.map +1 -0
- package/language-server/zmodel-formatter.js +2 -2
- package/language-server/zmodel-formatter.js.map +1 -1
- package/language-server/zmodel-linker.d.ts +1 -0
- package/language-server/zmodel-linker.js +28 -6
- package/language-server/zmodel-linker.js.map +1 -1
- package/language-server/zmodel-module.js +4 -1
- package/language-server/zmodel-module.js.map +1 -1
- package/language-server/zmodel-scope.d.ts +7 -1
- package/language-server/zmodel-scope.js +57 -1
- package/language-server/zmodel-scope.js.map +1 -1
- package/package.json +18 -13
- package/plugins/access-policy/expression-writer.js +37 -12
- package/plugins/access-policy/expression-writer.js.map +1 -1
- package/plugins/access-policy/policy-guard-generator.js +92 -69
- package/plugins/access-policy/policy-guard-generator.js.map +1 -1
- package/plugins/access-policy/typescript-expression-transformer.d.ts +3 -3
- package/plugins/access-policy/typescript-expression-transformer.js +84 -25
- package/plugins/access-policy/typescript-expression-transformer.js.map +1 -1
- package/plugins/access-policy/utils.d.ts +2 -2
- package/plugins/access-policy/utils.js +2 -2
- package/plugins/access-policy/utils.js.map +1 -1
- package/plugins/access-policy/zod-schema-generator.d.ts +1 -1
- package/plugins/access-policy/zod-schema-generator.js +5 -2
- package/plugins/access-policy/zod-schema-generator.js.map +1 -1
- package/plugins/model-meta/index.js +17 -28
- package/plugins/model-meta/index.js.map +1 -1
- package/plugins/plugin-utils.d.ts +0 -4
- package/plugins/plugin-utils.js +13 -18
- package/plugins/plugin-utils.js.map +1 -1
- package/plugins/prisma/index.d.ts +1 -1
- package/plugins/prisma/prisma-builder.d.ts +3 -2
- package/plugins/prisma/prisma-builder.js +20 -5
- package/plugins/prisma/prisma-builder.js.map +1 -1
- package/plugins/prisma/schema-generator.d.ts +4 -1
- package/plugins/prisma/schema-generator.js +118 -30
- package/plugins/prisma/schema-generator.js.map +1 -1
- package/plugins/zod/generator.js +16 -6
- package/plugins/zod/generator.js.map +1 -1
- package/plugins/zod/transformer.d.ts +2 -2
- package/plugins/zod/transformer.js +56 -48
- package/plugins/zod/transformer.js.map +1 -1
- package/res/starter.zmodel +4 -4
- package/res/stdlib.zmodel +74 -61
- package/telemetry.d.ts +1 -1
- package/telemetry.js +2 -2
- package/telemetry.js.map +1 -1
- package/utils/ast-utils.d.ts +22 -2
- package/utils/ast-utils.js +155 -4
- package/utils/ast-utils.js.map +1 -1
- package/utils/version-utils.js +1 -0
- package/utils/version-utils.js.map +1 -1
package/res/stdlib.zmodel
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* Enum representing referential integrity related actions
|
|
3
3
|
*/
|
|
4
4
|
enum ReferentialAction {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
6
|
* Used with "onDelete": deleting a referenced record will trigger the deletion of referencing record.
|
|
7
7
|
* Used with "onUpdate": updates the relation scalar fields if the referenced scalar fields of the dependent record are updated.
|
|
8
8
|
*/
|
|
9
9
|
Cascade
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
12
|
* Used with "onDelete": prevents the deletion if any referencing records exist.
|
|
13
13
|
* Used with "onUpdate": prevents the identifier of a referenced record from being changed.
|
|
14
14
|
*/
|
|
15
15
|
Restrict
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
18
|
* Similar to 'Restrict', the difference between the two is dependent on the database being used.
|
|
19
19
|
* See details: https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions#noaction
|
|
20
20
|
*/
|
|
21
21
|
NoAction
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
24
|
* Used with "onDelete": the scalar field of the referencing object will be set to NULL.
|
|
25
25
|
* Used with "onUpdate": when updating the identifier of a referenced object, the scalar fields of the referencing objects will be set to NULL.
|
|
26
26
|
*/
|
|
27
27
|
SetNull
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
30
|
* Used with "onDelete": the scalar field of the referencing object will be set to the fields default value.
|
|
31
31
|
* Used with "onUpdate": the scalar field of the referencing object will be set to the fields default value.
|
|
32
32
|
*/
|
|
33
33
|
SetDefault
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
37
|
* Enum representing all possible field types
|
|
38
38
|
*/
|
|
39
39
|
enum AttributeTargetField {
|
|
@@ -49,44 +49,44 @@ enum AttributeTargetField {
|
|
|
49
49
|
ModelField
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
53
|
* Reads value from an environment variable.
|
|
54
54
|
*/
|
|
55
55
|
function env(name: String): String {
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
59
|
* Gets the current login user.
|
|
60
60
|
*/
|
|
61
61
|
function auth(): Any {
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
65
|
* Gets current date-time (as DateTime type).
|
|
66
66
|
*/
|
|
67
67
|
function now(): DateTime {
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
71
|
* Generates a globally unique identifier based on the UUID specs.
|
|
72
72
|
*/
|
|
73
73
|
function uuid(): String {
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
/**
|
|
77
77
|
* Generates a globally unique identifier based on the CUID spec.
|
|
78
78
|
*/
|
|
79
79
|
function cuid(): String {
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
/**
|
|
83
83
|
* Creates a sequence of integers in the underlying database and assign the incremented
|
|
84
84
|
* values to the ID values of the created records based on the sequence.
|
|
85
85
|
*/
|
|
86
86
|
function autoincrement(): Int {
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
90
|
* Represents default values that cannot be expressed in the Prisma schema (such as random()).
|
|
91
91
|
*/
|
|
92
92
|
function dbgenerated(expr: String): Any {
|
|
@@ -98,49 +98,50 @@ function dbgenerated(expr: String): Any {
|
|
|
98
98
|
function future(): Any {
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
* If the field value contains the search string
|
|
101
|
+
/**
|
|
102
|
+
* If the field value contains the search string. By default, the search is case-sensitive,
|
|
103
|
+
* but you can override the behavior with the "caseInSensitive" argument.
|
|
103
104
|
*/
|
|
104
|
-
function contains(field: String, search: String,
|
|
105
|
+
function contains(field: String, search: String, caseInSensitive: Boolean?): Boolean {
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
/**
|
|
108
109
|
* 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.
|
|
109
110
|
*/
|
|
110
111
|
function search(field: String, search: String): Boolean {
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
+
/**
|
|
114
115
|
* If the field value starts with the search string
|
|
115
116
|
*/
|
|
116
117
|
function startsWith(field: String, search: String): Boolean {
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
/**
|
|
120
121
|
* If the field value ends with the search string
|
|
121
122
|
*/
|
|
122
123
|
function endsWith(field: String, search: String): Boolean {
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
/**
|
|
126
127
|
* If the field value (a list) has the given search value
|
|
127
128
|
*/
|
|
128
129
|
function has(field: Any[], search: Any): Boolean {
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
|
|
132
|
+
/**
|
|
132
133
|
* If the field value (a list) has every element of the search list
|
|
133
134
|
*/
|
|
134
135
|
function hasEvery(field: Any[], search: Any[]): Boolean {
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
|
|
138
|
+
/**
|
|
138
139
|
* If the field value (a list) has at least one element of the search list
|
|
139
140
|
*/
|
|
140
141
|
function hasSome(field: Any[], search: Any[]): Boolean {
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
|
|
144
|
+
/**
|
|
144
145
|
* If the field value (a list) is empty
|
|
145
146
|
*/
|
|
146
147
|
function isEmpty(field: Any[]): Boolean {
|
|
@@ -156,62 +157,74 @@ attribute @@@targetField(targetField: AttributeTargetField[])
|
|
|
156
157
|
*/
|
|
157
158
|
attribute @@@prisma()
|
|
158
159
|
|
|
159
|
-
|
|
160
|
+
/**
|
|
160
161
|
* Defines an ID on the model.
|
|
161
162
|
*/
|
|
162
|
-
attribute @id(map: String?) @@@prisma
|
|
163
|
+
attribute @id(map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
|
|
163
164
|
|
|
164
|
-
|
|
165
|
+
/**
|
|
165
166
|
* Defines a default value for a field.
|
|
166
167
|
*/
|
|
167
168
|
attribute @default(_ value: ContextType) @@@prisma
|
|
168
169
|
|
|
169
|
-
|
|
170
|
+
/**
|
|
170
171
|
* Defines a unique constraint for this field.
|
|
171
172
|
*/
|
|
172
|
-
attribute @unique(map: String?) @@@prisma
|
|
173
|
+
attribute @unique(map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
|
|
173
174
|
|
|
174
|
-
|
|
175
|
+
/**
|
|
175
176
|
* Defines a multi-field ID (composite ID) on the model.
|
|
176
177
|
*/
|
|
177
|
-
attribute @@id(_ fields: FieldReference[], name: String?, map: String?) @@@prisma
|
|
178
|
+
attribute @@id(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
|
|
178
179
|
|
|
179
|
-
|
|
180
|
+
/**
|
|
180
181
|
* Defines a compound unique constraint for the specified fields.
|
|
181
182
|
*/
|
|
182
|
-
attribute @@unique(_ fields: FieldReference[], name: String?, map: String?) @@@prisma
|
|
183
|
+
attribute @@unique(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: String?, clustered: Boolean?) @@@prisma
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Index types
|
|
187
|
+
*/
|
|
188
|
+
enum IndexType {
|
|
189
|
+
BTree
|
|
190
|
+
Hash
|
|
191
|
+
Gist
|
|
192
|
+
Gin
|
|
193
|
+
SpGist
|
|
194
|
+
Brin
|
|
195
|
+
}
|
|
183
196
|
|
|
184
|
-
|
|
197
|
+
/**
|
|
185
198
|
* Defines an index in the database.
|
|
186
199
|
*/
|
|
187
|
-
attribute @@index(_ fields: FieldReference[], map: String?) @@@prisma
|
|
200
|
+
attribute @@index(_ fields: FieldReference[], name: String?, map: String?, length: Int?, sort: String?, clustered: Boolean?, type: IndexType?) @@@prisma
|
|
188
201
|
|
|
189
|
-
|
|
202
|
+
/**
|
|
190
203
|
* Defines meta information about the relation.
|
|
191
204
|
*/
|
|
192
205
|
attribute @relation(_ name: String?, fields: FieldReference[]?, references: TransitiveFieldReference[]?, onDelete: ReferentialAction?, onUpdate: ReferentialAction?, map: String?) @@@prisma
|
|
193
206
|
|
|
194
|
-
|
|
207
|
+
/**
|
|
195
208
|
* Maps a field name or enum value from the schema to a column with a different name in the database.
|
|
196
209
|
*/
|
|
197
210
|
attribute @map(_ name: String) @@@prisma
|
|
198
211
|
|
|
199
|
-
|
|
212
|
+
/**
|
|
200
213
|
* Maps the schema model name to a table with a different name, or an enum name to a different underlying enum in the database.
|
|
201
214
|
*/
|
|
202
215
|
attribute @@map(_ name: String) @@@prisma
|
|
203
216
|
|
|
204
|
-
|
|
217
|
+
/**
|
|
205
218
|
* Exclude a field from the Prisma Client (for example, a field that you do not want Prisma users to update).
|
|
206
219
|
*/
|
|
207
220
|
attribute @ignore() @@@prisma
|
|
208
221
|
|
|
209
|
-
|
|
222
|
+
/**
|
|
210
223
|
* Exclude a model from the Prisma Client (for example, a model that you do not want Prisma users to update).
|
|
211
224
|
*/
|
|
212
225
|
attribute @@ignore() @@@prisma
|
|
213
226
|
|
|
214
|
-
|
|
227
|
+
/**
|
|
215
228
|
* Automatically stores the time when a record was last updated.
|
|
216
229
|
*/
|
|
217
230
|
attribute @updatedAt() @@@targetField([DateTimeField]) @@@prisma
|
|
@@ -268,7 +281,7 @@ attribute @db.Int8() @@@targetField([BigIntField]) @@@prisma
|
|
|
268
281
|
attribute @db.DoublePrecision() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
269
282
|
attribute @db.Real() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
270
283
|
attribute @db.Float() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
271
|
-
attribute @db.Decimal() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
284
|
+
attribute @db.Decimal(_ p: Int?, _ s: Int?) @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
272
285
|
attribute @db.Double() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
273
286
|
attribute @db.Money() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
274
287
|
attribute @db.SmallMoney() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
@@ -277,7 +290,7 @@ attribute @db.Float4() @@@targetField([FloatField, DecimalField]) @@@prisma
|
|
|
277
290
|
|
|
278
291
|
// DateTime type modifiers
|
|
279
292
|
|
|
280
|
-
attribute @db.DateTime(x: Int?) @@@targetField([DateTimeField]) @@@prisma
|
|
293
|
+
attribute @db.DateTime(_ x: Int?) @@@targetField([DateTimeField]) @@@prisma
|
|
281
294
|
attribute @db.DateTime2() @@@targetField([DateTimeField]) @@@prisma
|
|
282
295
|
attribute @db.SmallDateTime() @@@targetField([DateTimeField]) @@@prisma
|
|
283
296
|
attribute @db.DateTimeOffset() @@@targetField([DateTimeField]) @@@prisma
|
|
@@ -304,22 +317,22 @@ attribute @db.Blob() @@@targetField([BytesField]) @@@prisma
|
|
|
304
317
|
attribute @db.MediumBlob() @@@targetField([BytesField]) @@@prisma
|
|
305
318
|
attribute @db.Image() @@@targetField([BytesField]) @@@prisma
|
|
306
319
|
|
|
307
|
-
|
|
320
|
+
/**
|
|
308
321
|
* Specifies the schema to use in a multi-schema database. https://www.prisma.io/docs/guides/database/multi-schema.
|
|
309
322
|
*/
|
|
310
323
|
attribute @@schema(_ name: String) @@@prisma
|
|
311
324
|
|
|
312
|
-
|
|
325
|
+
/**
|
|
313
326
|
* Defines an access policy that allows a set of operations when the given condition is true.
|
|
314
327
|
*/
|
|
315
328
|
attribute @@allow(_ operation: String, _ condition: Boolean)
|
|
316
329
|
|
|
317
|
-
|
|
330
|
+
/**
|
|
318
331
|
* Defines an access policy that denies a set of operations when the given condition is true.
|
|
319
332
|
*/
|
|
320
333
|
attribute @@deny(_ operation: String, _ condition: Boolean)
|
|
321
334
|
|
|
322
|
-
|
|
335
|
+
/**
|
|
323
336
|
* Indicates that the field is a password field and needs to be hashed before persistence.
|
|
324
337
|
*
|
|
325
338
|
* ZenStack uses `bcryptjs` library to hash password. You can use the `saltLength` parameter
|
|
@@ -333,72 +346,72 @@ attribute @@deny(_ operation: String, _ condition: Boolean)
|
|
|
333
346
|
*/
|
|
334
347
|
attribute @password(saltLength: Int?, salt: String?) @@@targetField([StringField])
|
|
335
348
|
|
|
336
|
-
|
|
349
|
+
/**
|
|
337
350
|
* Indicates that the field should be omitted when read from the generated services.
|
|
338
351
|
*/
|
|
339
352
|
attribute @omit()
|
|
340
353
|
|
|
341
|
-
|
|
354
|
+
/**
|
|
342
355
|
* Validates length of a string field.
|
|
343
356
|
*/
|
|
344
357
|
attribute @length(_ min: Int?, _ max: Int?) @@@targetField([StringField])
|
|
345
358
|
|
|
346
|
-
|
|
359
|
+
/**
|
|
347
360
|
* Validates a string field value matches a regex.
|
|
348
361
|
*/
|
|
349
362
|
attribute @regex(_ regex: String) @@@targetField([StringField])
|
|
350
363
|
|
|
351
|
-
|
|
364
|
+
/**
|
|
352
365
|
* Validates a string field value starts with the given text.
|
|
353
366
|
*/
|
|
354
367
|
attribute @startsWith(_ text: String) @@@targetField([StringField])
|
|
355
368
|
|
|
356
|
-
|
|
369
|
+
/**
|
|
357
370
|
* Validates a string field value ends with the given text.
|
|
358
371
|
*/
|
|
359
372
|
attribute @endsWith(_ text: String) @@@targetField([StringField])
|
|
360
373
|
|
|
361
|
-
|
|
374
|
+
/**
|
|
362
375
|
* Validates a string field value is a valid email address.
|
|
363
376
|
*/
|
|
364
377
|
attribute @email() @@@targetField([StringField])
|
|
365
378
|
|
|
366
|
-
|
|
379
|
+
/**
|
|
367
380
|
* Validates a string field value is a valid ISO datetime.
|
|
368
381
|
*/
|
|
369
382
|
attribute @datetime() @@@targetField([StringField])
|
|
370
383
|
|
|
371
|
-
|
|
384
|
+
/**
|
|
372
385
|
* Validates a string field value is a valid url.
|
|
373
386
|
*/
|
|
374
387
|
attribute @url() @@@targetField([StringField])
|
|
375
388
|
|
|
376
|
-
|
|
389
|
+
/**
|
|
377
390
|
* Validates a number field is greater than the given value.
|
|
378
391
|
*/
|
|
379
392
|
attribute @gt(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
|
|
380
393
|
|
|
381
|
-
|
|
394
|
+
/**
|
|
382
395
|
* Validates a number field is greater than or equal to the given value.
|
|
383
396
|
*/
|
|
384
397
|
attribute @gte(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
|
|
385
398
|
|
|
386
|
-
|
|
399
|
+
/**
|
|
387
400
|
* Validates a number field is less than the given value.
|
|
388
401
|
*/
|
|
389
402
|
attribute @lt(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
|
|
390
403
|
|
|
391
|
-
|
|
404
|
+
/**
|
|
392
405
|
* Validates a number field is less than or equal to the given value.
|
|
393
406
|
*/
|
|
394
407
|
attribute @lte(_ value: Int) @@@targetField([IntField, FloatField, DecimalField])
|
|
395
408
|
|
|
396
|
-
|
|
409
|
+
/**
|
|
397
410
|
* A utility attribute to allow passthrough of arbitrary attribute text to the generated Prisma schema.
|
|
398
411
|
*/
|
|
399
412
|
attribute @prisma.passthrough(_ text: String)
|
|
400
413
|
|
|
401
|
-
|
|
414
|
+
/**
|
|
402
415
|
* A utility attribute to allow passthrough of arbitrary attribute text to the generated Prisma schema.
|
|
403
416
|
*/
|
|
404
417
|
attribute @@prisma.passthrough(_ text: String)
|
package/telemetry.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Telemetry events
|
|
3
3
|
*/
|
|
4
|
-
export declare type TelemetryEvents = 'cli:start' | 'cli:complete' | 'cli:error' | 'cli:crash' | 'cli:command:start' | 'cli:command:complete' | 'cli:command:error' | 'cli:plugin:start' | 'cli:plugin:complete' | 'cli:plugin:error';
|
|
4
|
+
export declare type TelemetryEvents = 'cli:start' | 'cli:complete' | 'cli:error' | 'cli:crash' | 'cli:command:start' | 'cli:command:complete' | 'cli:command:error' | 'cli:plugin:start' | 'cli:plugin:complete' | 'cli:plugin:error' | 'prisma:error';
|
|
5
5
|
/**
|
|
6
6
|
* Utility class for sending telemetry
|
|
7
7
|
*/
|
package/telemetry.js
CHANGED
|
@@ -36,9 +36,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.Telemetry = void 0;
|
|
39
|
+
const cuid2_1 = require("@paralleldrive/cuid2");
|
|
39
40
|
const async_exit_hook_1 = __importDefault(require("async-exit-hook"));
|
|
40
41
|
const commander_1 = require("commander");
|
|
41
|
-
const cuid_1 = __importDefault(require("cuid"));
|
|
42
42
|
const mixpanel_1 = require("mixpanel");
|
|
43
43
|
const node_machine_id_1 = require("node-machine-id");
|
|
44
44
|
const os = __importStar(require("os"));
|
|
@@ -52,7 +52,7 @@ const version_utils_1 = require("./utils/version-utils");
|
|
|
52
52
|
class Telemetry {
|
|
53
53
|
constructor() {
|
|
54
54
|
this.hostId = (0, node_machine_id_1.machineIdSync)();
|
|
55
|
-
this.sessionid = (0,
|
|
55
|
+
this.sessionid = (0, cuid2_1.createId)();
|
|
56
56
|
this._os = os.platform();
|
|
57
57
|
this.version = (0, version_utils_1.getVersion)();
|
|
58
58
|
this.exitWait = 200;
|
package/telemetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuC;AACvC,yCAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAgD;AAChD,sEAAuC;AACvC,yCAA2C;AAC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,EAAE;gBACf,IAAI,CAAC,KAAK,CAAC,UAAU,kBACjB,OAAO,EAAE,GAAG,CAAC,OAAO,EACpB,KAAK,EAAE,GAAG,CAAC,KAAK,IACb,UAAU,EACf,CAAC;gBACH,OAAO,GAAG,KAAK,CAAC;gBAChB,MAAM,GAAG,CAAC;aACb;oBAAS;gBACN,IAAI,CAAC,KAAK,CAAC,aAAa,kBACpB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAC5B,OAAO,IACJ,UAAU,EACf,CAAC;aACN;QACL,CAAC;KAAA;CACJ;AAjGD,8BAiGC;AAED,kBAAe,IAAI,SAAS,EAAE,CAAC"}
|
package/utils/ast-utils.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
import { DataModel, DataModelField, Expression } from '@zenstackhq/language/ast';
|
|
1
|
+
import { DataModel, DataModelAttribute, DataModelField, Expression, Model, ModelImport } from '@zenstackhq/language/ast';
|
|
2
|
+
import { AstNode, LangiumDocuments } from 'langium';
|
|
3
|
+
import { URI } from 'vscode-uri';
|
|
4
|
+
export declare function extractDataModelsWithAllowRules(model: Model): DataModel[];
|
|
5
|
+
export declare function analyzePolicies(dataModel: DataModel): {
|
|
6
|
+
allows: DataModelAttribute[];
|
|
7
|
+
denies: DataModelAttribute[];
|
|
8
|
+
create: boolean | undefined;
|
|
9
|
+
read: boolean | undefined;
|
|
10
|
+
update: boolean | undefined;
|
|
11
|
+
delete: boolean | undefined;
|
|
12
|
+
allowAll: boolean;
|
|
13
|
+
denyAll: boolean;
|
|
14
|
+
hasFieldValidation: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function mergeBaseModel(model: Model): void;
|
|
17
|
+
export declare const VALIDATION_ATTRIBUTES: string[];
|
|
2
18
|
export declare function getIdFields(dataModel: DataModel): DataModelField[];
|
|
3
|
-
export declare function isAuthInvocation(
|
|
19
|
+
export declare function isAuthInvocation(node: AstNode): boolean;
|
|
4
20
|
export declare function isEnumFieldReference(expr: Expression): boolean;
|
|
5
21
|
export declare function getDataModelFieldReference(expr: Expression): DataModelField | undefined;
|
|
22
|
+
export declare function resolveImportUri(imp: ModelImport): URI | undefined;
|
|
23
|
+
export declare function resolveTransitiveImports(documents: LangiumDocuments, model: Model): Model[];
|
|
24
|
+
export declare function resolveImport(documents: LangiumDocuments, imp: ModelImport): Model | undefined;
|
|
25
|
+
export declare function getAllDeclarationsFromImports(documents: LangiumDocuments, model: Model): import("@zenstackhq/language/ast").AbstractDeclaration[];
|
package/utils/ast-utils.js
CHANGED
|
@@ -1,10 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDataModelFieldReference = exports.isEnumFieldReference = exports.isAuthInvocation = exports.getIdFields = void 0;
|
|
3
|
+
exports.getAllDeclarationsFromImports = exports.resolveImport = exports.resolveTransitiveImports = exports.resolveImportUri = exports.getDataModelFieldReference = exports.isEnumFieldReference = exports.isAuthInvocation = exports.getIdFields = exports.VALIDATION_ATTRIBUTES = exports.mergeBaseModel = exports.analyzePolicies = exports.extractDataModelsWithAllowRules = void 0;
|
|
4
4
|
const ast_1 = require("@zenstackhq/language/ast");
|
|
5
|
+
const sdk_1 = require("@zenstackhq/sdk");
|
|
6
|
+
const langium_1 = require("langium");
|
|
7
|
+
const vscode_uri_1 = require("vscode-uri");
|
|
5
8
|
const utils_1 = require("../language-server/utils");
|
|
9
|
+
function extractDataModelsWithAllowRules(model) {
|
|
10
|
+
return model.declarations.filter((d) => (0, ast_1.isDataModel)(d) && d.attributes.some((attr) => { var _a; return ((_a = attr.decl.ref) === null || _a === void 0 ? void 0 : _a.name) === '@@allow'; }));
|
|
11
|
+
}
|
|
12
|
+
exports.extractDataModelsWithAllowRules = extractDataModelsWithAllowRules;
|
|
13
|
+
function analyzePolicies(dataModel) {
|
|
14
|
+
const allows = dataModel.attributes.filter((attr) => { var _a; return ((_a = attr.decl.ref) === null || _a === void 0 ? void 0 : _a.name) === '@@allow'; });
|
|
15
|
+
const denies = dataModel.attributes.filter((attr) => { var _a; return ((_a = attr.decl.ref) === null || _a === void 0 ? void 0 : _a.name) === '@@deny'; });
|
|
16
|
+
const create = toStaticPolicy('create', allows, denies);
|
|
17
|
+
const read = toStaticPolicy('read', allows, denies);
|
|
18
|
+
const update = toStaticPolicy('update', allows, denies);
|
|
19
|
+
const del = toStaticPolicy('delete', allows, denies);
|
|
20
|
+
const hasFieldValidation = dataModel.$resolvedFields.some((field) => field.attributes.some((attr) => exports.VALIDATION_ATTRIBUTES.includes(attr.decl.$refText)));
|
|
21
|
+
return {
|
|
22
|
+
allows,
|
|
23
|
+
denies,
|
|
24
|
+
create,
|
|
25
|
+
read,
|
|
26
|
+
update,
|
|
27
|
+
delete: del,
|
|
28
|
+
allowAll: create === true && read === true && update === true && del === true,
|
|
29
|
+
denyAll: create === false && read === false && update === false && del === false,
|
|
30
|
+
hasFieldValidation,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.analyzePolicies = analyzePolicies;
|
|
34
|
+
function mergeBaseModel(model) {
|
|
35
|
+
model.declarations
|
|
36
|
+
.filter((x) => x.$type === 'DataModel')
|
|
37
|
+
.forEach((decl) => {
|
|
38
|
+
const dataModel = decl;
|
|
39
|
+
dataModel.fields = dataModel.superTypes
|
|
40
|
+
.flatMap((superType) => updateContainer(superType.ref.fields, dataModel))
|
|
41
|
+
.concat(dataModel.fields);
|
|
42
|
+
dataModel.attributes = dataModel.superTypes
|
|
43
|
+
.flatMap((superType) => updateContainer(superType.ref.attributes, dataModel))
|
|
44
|
+
.concat(dataModel.attributes);
|
|
45
|
+
});
|
|
46
|
+
// remove abstract models
|
|
47
|
+
model.declarations = model.declarations.filter((x) => !(x.$type == 'DataModel' && x.isAbstract));
|
|
48
|
+
}
|
|
49
|
+
exports.mergeBaseModel = mergeBaseModel;
|
|
50
|
+
function updateContainer(nodes, container) {
|
|
51
|
+
return nodes.map((node) => {
|
|
52
|
+
const cloneField = Object.assign({}, node);
|
|
53
|
+
const mutable = cloneField;
|
|
54
|
+
// update container
|
|
55
|
+
mutable.$container = container;
|
|
56
|
+
return mutable;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function toStaticPolicy(operation, allows, denies) {
|
|
60
|
+
const filteredDenies = forOperation(operation, denies);
|
|
61
|
+
if (filteredDenies.some((rule) => (0, sdk_1.getLiteral)(rule.args[1].value) === true)) {
|
|
62
|
+
// any constant true deny rule
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
const filteredAllows = forOperation(operation, allows);
|
|
66
|
+
if (filteredAllows.length === 0) {
|
|
67
|
+
// no allow rule
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (filteredDenies.length === 0 &&
|
|
71
|
+
filteredAllows.some((rule) => (0, sdk_1.getLiteral)(rule.args[1].value) === true)) {
|
|
72
|
+
// any constant true allow rule
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
function forOperation(operation, rules) {
|
|
78
|
+
return rules.filter((rule) => {
|
|
79
|
+
const ops = (0, sdk_1.getLiteral)(rule.args[0].value);
|
|
80
|
+
if (!ops) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (ops === 'all') {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
const splitOps = ops.split(',').map((p) => p.trim());
|
|
87
|
+
return splitOps.includes(operation);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
exports.VALIDATION_ATTRIBUTES = [
|
|
91
|
+
'@length',
|
|
92
|
+
'@regex',
|
|
93
|
+
'@startsWith',
|
|
94
|
+
'@endsWith',
|
|
95
|
+
'@email',
|
|
96
|
+
'@url',
|
|
97
|
+
'@datetime',
|
|
98
|
+
'@gt',
|
|
99
|
+
'@gte',
|
|
100
|
+
'@lt',
|
|
101
|
+
'@lte',
|
|
102
|
+
];
|
|
6
103
|
function getIdFields(dataModel) {
|
|
7
|
-
const fieldLevelId = dataModel.
|
|
104
|
+
const fieldLevelId = dataModel.$resolvedFields.find((f) => f.attributes.some((attr) => attr.decl.$refText === '@id'));
|
|
8
105
|
if (fieldLevelId) {
|
|
9
106
|
return [fieldLevelId];
|
|
10
107
|
}
|
|
@@ -25,9 +122,9 @@ function getIdFields(dataModel) {
|
|
|
25
122
|
return [];
|
|
26
123
|
}
|
|
27
124
|
exports.getIdFields = getIdFields;
|
|
28
|
-
function isAuthInvocation(
|
|
125
|
+
function isAuthInvocation(node) {
|
|
29
126
|
var _a;
|
|
30
|
-
return (0, ast_1.isInvocationExpr)(
|
|
127
|
+
return (0, ast_1.isInvocationExpr)(node) && ((_a = node.function.ref) === null || _a === void 0 ? void 0 : _a.name) === 'auth' && (0, utils_1.isFromStdlib)(node.function.ref);
|
|
31
128
|
}
|
|
32
129
|
exports.isAuthInvocation = isAuthInvocation;
|
|
33
130
|
function isEnumFieldReference(expr) {
|
|
@@ -46,4 +143,58 @@ function getDataModelFieldReference(expr) {
|
|
|
46
143
|
}
|
|
47
144
|
}
|
|
48
145
|
exports.getDataModelFieldReference = getDataModelFieldReference;
|
|
146
|
+
function resolveImportUri(imp) {
|
|
147
|
+
if (imp.path === undefined || imp.path.length === 0) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
const dirUri = vscode_uri_1.Utils.dirname((0, langium_1.getDocument)(imp).uri);
|
|
151
|
+
let grammarPath = imp.path;
|
|
152
|
+
if (!grammarPath.endsWith('.zmodel')) {
|
|
153
|
+
grammarPath += '.zmodel';
|
|
154
|
+
}
|
|
155
|
+
return vscode_uri_1.Utils.resolvePath(dirUri, grammarPath);
|
|
156
|
+
}
|
|
157
|
+
exports.resolveImportUri = resolveImportUri;
|
|
158
|
+
function resolveTransitiveImports(documents, model) {
|
|
159
|
+
return resolveTransitiveImportsInternal(documents, model);
|
|
160
|
+
}
|
|
161
|
+
exports.resolveTransitiveImports = resolveTransitiveImports;
|
|
162
|
+
function resolveTransitiveImportsInternal(documents, model, initialModel = model, visited = new Set(), models = new Set()) {
|
|
163
|
+
const doc = (0, langium_1.getDocument)(model);
|
|
164
|
+
if (initialModel !== model) {
|
|
165
|
+
models.add(model);
|
|
166
|
+
}
|
|
167
|
+
if (!visited.has(doc.uri)) {
|
|
168
|
+
visited.add(doc.uri);
|
|
169
|
+
for (const imp of model.imports) {
|
|
170
|
+
const importedModel = resolveImport(documents, imp);
|
|
171
|
+
if (importedModel) {
|
|
172
|
+
resolveTransitiveImportsInternal(documents, importedModel, initialModel, visited, models);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return Array.from(models);
|
|
177
|
+
}
|
|
178
|
+
function resolveImport(documents, imp) {
|
|
179
|
+
const resolvedUri = resolveImportUri(imp);
|
|
180
|
+
try {
|
|
181
|
+
if (resolvedUri) {
|
|
182
|
+
const resolvedDocument = documents.getOrCreateDocument(resolvedUri);
|
|
183
|
+
const node = resolvedDocument.parseResult.value;
|
|
184
|
+
if ((0, ast_1.isModel)(node)) {
|
|
185
|
+
return node;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch (_a) {
|
|
190
|
+
// NOOP
|
|
191
|
+
}
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
exports.resolveImport = resolveImport;
|
|
195
|
+
function getAllDeclarationsFromImports(documents, model) {
|
|
196
|
+
const imports = resolveTransitiveImports(documents, model);
|
|
197
|
+
return model.declarations.concat(...imports.map((imp) => imp.declarations));
|
|
198
|
+
}
|
|
199
|
+
exports.getAllDeclarationsFromImports = getAllDeclarationsFromImports;
|
|
49
200
|
//# sourceMappingURL=ast-utils.js.map
|
package/utils/ast-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-utils.js","sourceRoot":"","sources":["../../src/utils/ast-utils.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file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version":3,"file":"version-utils.js","sourceRoot":"","sources":["../../src/utils/version-utils.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,SAAgB,UAAU;IACtB,IAAI;QACA,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;KAC7C;IAAC,WAAM;QACJ,OAAO,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;KAChD;AACL,CAAC;
|
|
1
|
+
{"version":3,"file":"version-utils.js","sourceRoot":"","sources":["../../src/utils/version-utils.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,SAAgB,UAAU;IACtB,IAAI;QACA,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;KAC7C;IAAC,WAAM;QACJ,kBAAkB;QAClB,OAAO,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;KAChD;AACL,CAAC;AAPD,gCAOC"}
|