@zenstackhq/language 3.7.0 → 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/dist/index.cjs +52 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +52 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/res/stdlib.zmodel +18 -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
|
//////////////////////////////////////////////
|
|
@@ -641,6 +652,13 @@ attribute @@prisma.passthrough(_ text: String)
|
|
|
641
652
|
*/
|
|
642
653
|
attribute @@delegate(_ discriminator: FieldReference)
|
|
643
654
|
|
|
655
|
+
/**
|
|
656
|
+
* Maps a delegate sub-model to a specific discriminator value. If not set the sub-model name is used as the discriminator value by default.
|
|
657
|
+
*
|
|
658
|
+
* @param value: A string literal or enum member used as the discriminator.
|
|
659
|
+
*/
|
|
660
|
+
attribute @@delegateMap(_ value: Any)
|
|
661
|
+
|
|
644
662
|
/**
|
|
645
663
|
* Used for specifying operator classes for GIN index.
|
|
646
664
|
*/
|