@zenstackhq/language 3.7.1 → 3.7.2
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/package.json +6 -6
- package/res/stdlib.zmodel +11 -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.7.
|
|
5
|
+
"version": "3.7.2",
|
|
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.7.
|
|
72
|
+
"@zenstackhq/common-helpers": "3.7.2"
|
|
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.7.
|
|
81
|
-
"@zenstackhq/tsdown-config": "3.7.
|
|
82
|
-
"@zenstackhq/
|
|
83
|
-
"@zenstackhq/
|
|
80
|
+
"@zenstackhq/eslint-config": "3.7.2",
|
|
81
|
+
"@zenstackhq/tsdown-config": "3.7.2",
|
|
82
|
+
"@zenstackhq/typescript-config": "3.7.2",
|
|
83
|
+
"@zenstackhq/vitest-config": "3.7.2"
|
|
84
84
|
},
|
|
85
85
|
"funding": "https://github.com/sponsors/zenstackhq",
|
|
86
86
|
"scripts": {
|
package/res/stdlib.zmodel
CHANGED
|
@@ -551,6 +551,11 @@ attribute @datetime(_ message: String?) @@@targetField([StringField]) @@@validat
|
|
|
551
551
|
*/
|
|
552
552
|
attribute @url(_ message: String?) @@@targetField([StringField]) @@@validation
|
|
553
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Validates a string field value is a valid E.164 phone number.
|
|
556
|
+
*/
|
|
557
|
+
attribute @phone(_ message: String?) @@@targetField([StringField]) @@@validation
|
|
558
|
+
|
|
554
559
|
/**
|
|
555
560
|
* Trims whitespaces from the start and end of the string.
|
|
556
561
|
*/
|
|
@@ -622,6 +627,12 @@ function isDateTime(field: String): Boolean {
|
|
|
622
627
|
function isUrl(field: String): Boolean {
|
|
623
628
|
} @@@expressionContext([ValidationRule])
|
|
624
629
|
|
|
630
|
+
/**
|
|
631
|
+
* Validates a string field value is a valid E.164 phone number.
|
|
632
|
+
*/
|
|
633
|
+
function isPhone(field: String): Boolean {
|
|
634
|
+
} @@@expressionContext([ValidationRule])
|
|
635
|
+
|
|
625
636
|
//////////////////////////////////////////////
|
|
626
637
|
// End validation attributes and functions
|
|
627
638
|
//////////////////////////////////////////////
|