Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Nigao/moneyschema (#435)
Browse files Browse the repository at this point in the history
* age schema

* dimension schema

* geography schema

* geography schema

* fix bug, temperature schema

* change schema name

* rename several properties

* delete test2.schema
  • Loading branch information
ninggao authored Dec 18, 2019
1 parent 24f8123 commit 6665b4a
Show file tree
Hide file tree
Showing 27 changed files with 198 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
],
"args": [
"dialog:generate",
"${workspaceFolder}/packages/dialog/test/commands/dialog/forms/test2.schema",
"${workspaceFolder}/packages/dialog/test/commands/dialog/forms/unittests.schema",
"-o",
"${env:TEMP}/test.out",
"${env:TEMP}/unittests.out",
"--force",
"--verbose"
],
Expand Down
17 changes: 17 additions & 0 deletions packages/dialog/templates/age.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"age": {
"type": "object",
"$mappings": ["@{concat('age:', property)}", "age"],
"properties": {
"number": {
"type": "number"
},
"units": {
"type": "string"
}
},
"required": ["number", "units"],
"$templates": ["age.lu","objectProperty.lg", "stringAsk.dialog","ageSet.dialog"]
}
}
25 changes: 25 additions & 0 deletions packages/dialog/templates/ageSet.dialog.lg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# filename
- @{schemaName}-@{property}Setage.dialog

# template
- ```
{
"$schema": "@{appSchema}",
"$kind": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "age",
"actions": [
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.number",
"value": "@age['number']"
},
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.units",
"value": "@age['units']"
}
]
}
```
16 changes: 0 additions & 16 deletions packages/dialog/templates/currency.schema

This file was deleted.

17 changes: 17 additions & 0 deletions packages/dialog/templates/dimension.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"dimension": {
"type": "object",
"$mappings": ["@{concat('dimension:', property)}", "dimension"],
"properties": {
"number": {
"type": "number"
},
"units": {
"type": "string"
}
},
"required": ["number", "units"],
"$templates": ["dimension.lu","objectProperty.lg", "stringAsk.dialog","dimensionSet.dialog"]
}
}
25 changes: 25 additions & 0 deletions packages/dialog/templates/dimensionSet.dialog.lg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# filename
- @{schemaName}-@{property}Setdimension.dialog

# template
- ```
{
"$schema": "@{appSchema}",
"$kind": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "dimension",
"actions": [
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.number",
"value": "@dimension['number']"
},
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.units",
"value": "@dimension['units']"
}
]
}
```
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/age.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-age.@{locale}.lu

# template
- $PREBUILT:age @{roles()}
Expand Down
7 changes: 0 additions & 7 deletions packages/dialog/templates/en-us/currency.lu.lg

This file was deleted.

2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/dimension.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-dimension.@{locale}.lu

# template
- $PREBUILT:dimension @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/email.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-email.@{locale}.lu

# template
- $PREBUILT:email @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/geographyV2.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-geographyV2.@{locale}.lu

# template
- $PREBUILT:geographyV2 @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/keyPhrase.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-keyPhrase.@{locale}.lu

# template
- $PREBUILT:keyPhrase @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/number.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-number.@{locale}.lu

# template
- $PREBUILT:number @{roles()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
- # Ask@{property}\n- @\{askString('@{property}')\}\n

# NameTemplate
- # @{property}Name\n- @{phrase(property, locale)}\n
- # @{property}Name\n- @{phrase(property, locale)}\n
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/ordinal.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-ordinal.@{locale}.lu

# template
- $PREBUILT:ordinal @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/percentage.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-percentage.@{locale}.lu

# template
- $PREBUILT:percentage @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/personName.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-personName.@{locale}.lu

# template
- $PREBUILT:personName @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/temperature.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-temperature.@{locale}.lu

# template
- $PREBUILT:temperature @{roles()}
Expand Down
2 changes: 1 addition & 1 deletion packages/dialog/templates/en-us/url.lu.lg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# filename
- @{entityFilename()}
- @{schemaName}-url.@{locale}.lu

# template
- $PREBUILT:url @{roles()}
Expand Down
17 changes: 17 additions & 0 deletions packages/dialog/templates/geography.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"geographyV2": {
"type": "object",
"$mappings": ["@{concat('geographyV2:', property)}", "geographyV2"],
"properties": {
"type": {
"type": "type"
},
"location": {
"type": "location"
}
},
"required": ["type", "location"],
"$templates": ["geographyV2.lu","objectProperty.lg", "stringAsk.dialog","geographyV2Set.dialog"]
}
}
25 changes: 25 additions & 0 deletions packages/dialog/templates/geographyV2Set.dialog.lg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# filename
- @{schemaName}-@{property}SetgeographyV2.dialog

# template
- ```
{
"$schema": "@{appSchema}",
"$kind": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "geographyV2",
"actions": [
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.type",
"value": "@geographyV2['type']"
},
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.location",
"value": "@geographyV2['location']"
}
]
}
```
4 changes: 2 additions & 2 deletions packages/dialog/templates/money.schema
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema",
"money": {
"type": "object",
"$mappings": ["money"],
"$mappings": ["@{concat('money:', property)}", "money"],
"properties": {
"number": {
"type": "number"
Expand All @@ -12,6 +12,6 @@
}
},
"required": ["number", "units"],
"$templates": ["money.lu","money.lg", "moneyAsk.dialog","moneySet.dialog"]
"$templates": ["money.lu","objectProperty.lg", "stringAsk.dialog","moneySet.dialog"]
}
}
23 changes: 0 additions & 23 deletions packages/dialog/templates/moneyAsk.dialog.lg

This file was deleted.

2 changes: 1 addition & 1 deletion packages/dialog/templates/standard.schema
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
"TriggerIntent.dialog",
"luconfig.json",
"lu.dialog",
"Main.dialog"
"Main.dialog"
]
}
17 changes: 17 additions & 0 deletions packages/dialog/templates/temperature.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"temperature": {
"type": "object",
"$mappings": ["@{concat('temperature:', property)}", "temperature"],
"properties": {
"number": {
"type": "number"
},
"units": {
"type": "string"
}
},
"required": ["number", "units"],
"$templates": ["temperature.lu","objectProperty.lg", "stringAsk.dialog","temperatureSet.dialog"]
}
}
25 changes: 25 additions & 0 deletions packages/dialog/templates/temperatureSet.dialog.lg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# filename
- @{schemaName}-@{property}Setmoney.dialog

# template
- ```
{
"$schema": "@{appSchema}",
"$kind": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "temperature",
"actions": [
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.number",
"value": "@temperature['number']"
},
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}.units",
"value": "@temperature['units']"
}
]
}
```
Loading

0 comments on commit 6665b4a

Please sign in to comment.