@zenstackhq/language 3.7.1 → 3.8.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/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/res/stdlib.zmodel +17 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@zenstackhq/language",
|
|
3
3
|
"displayName": "ZenStack Language Tooling",
|
|
4
4
|
"description": "ZenStack ZModel language specification",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.8.0-beta.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "ZenStack Team",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"pluralize": "^8.0.0",
|
|
70
70
|
"ts-pattern": "^5.7.1",
|
|
71
71
|
"vscode-languageserver": "^9.0.1",
|
|
72
|
-
"@zenstackhq/common-helpers": "3.
|
|
72
|
+
"@zenstackhq/common-helpers": "3.8.0-beta.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/pluralize": "^0.0.33",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"glob": "^11.1.0",
|
|
78
78
|
"langium-cli": "3.5.0",
|
|
79
79
|
"tmp": "^0.2.4",
|
|
80
|
-
"@zenstackhq/eslint-config": "3.
|
|
81
|
-
"@zenstackhq/tsdown-config": "3.
|
|
82
|
-
"@zenstackhq/vitest-config": "3.
|
|
83
|
-
"@zenstackhq/typescript-config": "3.
|
|
80
|
+
"@zenstackhq/eslint-config": "3.8.0-beta.1",
|
|
81
|
+
"@zenstackhq/tsdown-config": "3.8.0-beta.1",
|
|
82
|
+
"@zenstackhq/vitest-config": "3.8.0-beta.1",
|
|
83
|
+
"@zenstackhq/typescript-config": "3.8.0-beta.1"
|
|
84
84
|
},
|
|
85
85
|
"funding": "https://github.com/sponsors/zenstackhq",
|
|
86
86
|
"scripts": {
|
package/res/stdlib.zmodel
CHANGED
|
@@ -204,6 +204,12 @@ attribute @@@completionHint(_ values: String[])
|
|
|
204
204
|
*/
|
|
205
205
|
attribute @@@once()
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Indicates that a field-level attribute can only be applied to a single field within a model
|
|
209
|
+
* (including fields inherited from base models and mixins).
|
|
210
|
+
*/
|
|
211
|
+
attribute @@@onceInModel()
|
|
212
|
+
|
|
207
213
|
/**
|
|
208
214
|
* Defines a single-field ID on the model.
|
|
209
215
|
*
|
|
@@ -551,6 +557,11 @@ attribute @datetime(_ message: String?) @@@targetField([StringField]) @@@validat
|
|
|
551
557
|
*/
|
|
552
558
|
attribute @url(_ message: String?) @@@targetField([StringField]) @@@validation
|
|
553
559
|
|
|
560
|
+
/**
|
|
561
|
+
* Validates a string field value is a valid E.164 phone number.
|
|
562
|
+
*/
|
|
563
|
+
attribute @phone(_ message: String?) @@@targetField([StringField]) @@@validation
|
|
564
|
+
|
|
554
565
|
/**
|
|
555
566
|
* Trims whitespaces from the start and end of the string.
|
|
556
567
|
*/
|
|
@@ -622,6 +633,12 @@ function isDateTime(field: String): Boolean {
|
|
|
622
633
|
function isUrl(field: String): Boolean {
|
|
623
634
|
} @@@expressionContext([ValidationRule])
|
|
624
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Validates a string field value is a valid E.164 phone number.
|
|
638
|
+
*/
|
|
639
|
+
function isPhone(field: String): Boolean {
|
|
640
|
+
} @@@expressionContext([ValidationRule])
|
|
641
|
+
|
|
625
642
|
//////////////////////////////////////////////
|
|
626
643
|
// End validation attributes and functions
|
|
627
644
|
//////////////////////////////////////////////
|