forked from adl-lang/adl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db5f48a
commit 7736092
Showing
60 changed files
with
2,225 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,55 @@ | ||
{ | ||
"adlc": "0.0.0", | ||
"use": [] | ||
"defaultGenOptions": [ | ||
{ | ||
"tsgen": { | ||
"referenceable": "remote", | ||
"outputs": { | ||
"outputDir": "", | ||
"manifest": null | ||
}, | ||
"includeRuntime": false, | ||
"runtimeDir": null, | ||
"generate_transitive": false, | ||
"include_resolver": false, | ||
"modules": "all", | ||
"capitalize_branch_names_in_types": true, | ||
"capitalize_type_names": true | ||
} | ||
} | ||
], | ||
"use": [ | ||
{ | ||
"path": "./adlc_dev" | ||
}, | ||
{ | ||
"path": "./tests/test31/lib" | ||
}, | ||
{ | ||
"path": "./stdlib/adlc" | ||
}, | ||
{ | ||
"path": "./stdlib/sys" | ||
}, | ||
{ | ||
"path": "./tests/test31/proj", | ||
"genOptions": [ | ||
{ | ||
"tsgen": { | ||
"outputs": { | ||
"outputDir": "../generated/typescript/tests/test31/src", | ||
"manifest": "../generated/typescript/tests/test31/.adl-manifest" | ||
}, | ||
"includeRuntime": true, | ||
"runtimeDir": "./runtime", | ||
"generate_transitive": true, | ||
"include_resolver": true, | ||
"modules": "all", | ||
"capitalize_branch_names_in_types": true, | ||
"capitalize_type_names": true | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"pkg": { "path" : "" }, | ||
"path" : "github.com/adl-lang/adl/adl/adkc_dev", | ||
"adlc": "0.0.0" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"path" : "github.com/adl-lang/adl/adl/stdlib/adlc", | ||
"globalAlias": "adlc", | ||
"adlc": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"path" : "github.com/adl-lang/adl/adl/stdlib/sys", | ||
"globalAlias": "sys", | ||
"adlc": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"path" : "github.com/adl-lang/adl/adl/tests/test31/lib", | ||
"globalAlias": "common", | ||
"adlc": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
module common { | ||
|
||
import common.strings.StringNE; | ||
import common.db.DbColumnType; | ||
|
||
/// A instant in time, represented as milliseconds from | ||
/// the epoch of "1970-01-01T00:00:00Z | ||
newtype Instant = Int64; | ||
|
||
/// A date in ISO8601 format | ||
newtype LocalDate = String = "1970-01-01"; | ||
|
||
/// A time in ISO8601 format | ||
newtype LocalTime = String = "00:00:00"; | ||
|
||
/// A datetime in ISO8601 format | ||
newtype LocalDateTime = String = "1970-01-01T00:00:00"; | ||
|
||
/// The day of the week | ||
union DayOfWeek { | ||
Void monday; | ||
Void tuesday; | ||
Void wednesday; | ||
Void thursday; | ||
Void friday; | ||
Void saturday; | ||
Void sunday; | ||
}; | ||
|
||
/// A duration in ISO8601 format | ||
@DbColumnType "interval" | ||
newtype Duration = String = "P1D"; | ||
|
||
/// An IANA timezone | ||
newtype Timezone = StringNE; | ||
|
||
/// A holder for paginated results | ||
struct Paginated<T> { | ||
|
||
/// The paginated items | ||
Vector<T> items; | ||
|
||
/// The offset used for this query | ||
Int64 current_offset; | ||
|
||
/// The size of the entire date set | ||
Int64 total_size; | ||
}; | ||
|
||
/// Empty Struct (Used mostly for Void RPC responses) | ||
struct Unit {}; | ||
|
||
/// Phantom type to capture a StringMap with a named string key type: | ||
type StringKeyMap<K,V> = StringMap<V>; | ||
|
||
/// Naming aid for strings used as keys | ||
type Key<T> = String; | ||
|
||
/// A value of type T along with the Key<T> | ||
struct WithKey<T> { | ||
Key<T> key; | ||
T value; | ||
}; | ||
|
||
/// Postgres array of strings type that is serialized in to a list of Strings | ||
@DbColumnType "text[]" | ||
newtype StringList = Vector<String>; | ||
|
||
// Postgres tsvector type for plain text searching | ||
@DbColumnType "tsvector" | ||
newtype TSVector = String; | ||
|
||
/// Postgres Geography type that is serialized using GeoJson | ||
// Maps to postgres database as 'geography' column | ||
// See https://postgis.net/workshops/postgis-intro/geography.html#casting-to-geometry | ||
@DbColumnType "geography" | ||
newtype GeographyGeoJson = String; | ||
|
||
/// Postgres Geometry type | ||
// Maps to postgres database as 'geometry' column | ||
// Serialise to/from WKT (Well Known Text) in the string | ||
@DbColumnType "geometry" | ||
newtype GeometryWKT = String; | ||
|
||
|
||
/// A floating point decimal value | ||
// | ||
// In principle, the json format allows numbers with arbitrary decimal precision. However | ||
// support for this is dependent on individual client libraries, and crucially the | ||
// JSON.parse() function in browsers converts json numbers to a binary floating point | ||
// double representation. Hence we take the safe option and serialize as JSON strings. | ||
@DbColumnType "numeric" | ||
newtype BigDecimal = String; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
module common | ||
{ | ||
import adlc.config.java.*; | ||
import common.db.JavaDbCustomType; | ||
import sys.types.Set; | ||
|
||
annotation JavaPackage "au.com.helixta.adl.common"; | ||
|
||
annotation Instant JavaCustomType { | ||
"javaname" : "java.time.Instant", | ||
"helpers" : "au.com.helixta.adl.custom.InstantHelpers" | ||
}; | ||
|
||
annotation LocalDate JavaCustomType { | ||
"javaname" : "java.time.LocalDate", | ||
"helpers" : "au.com.helixta.adl.custom.LocalDateHelpers" | ||
}; | ||
|
||
annotation LocalTime JavaCustomType { | ||
"javaname" : "java.time.LocalTime", | ||
"helpers" : "au.com.helixta.adl.custom.LocalTimeHelpers" | ||
}; | ||
|
||
annotation LocalDateTime JavaCustomType { | ||
"javaname" : "java.time.LocalDateTime", | ||
"helpers" : "au.com.helixta.adl.custom.LocalDateTimeHelpers" | ||
}; | ||
|
||
annotation DayOfWeek JavaCustomType { | ||
"javaname" : "java.time.DayOfWeek", | ||
"helpers" : "au.com.helixta.adl.custom.DayOfWeekHelpers" | ||
}; | ||
|
||
annotation GeographyGeoJson JavaCustomType { | ||
"javaname" : "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryHelpers" | ||
}; | ||
|
||
annotation GeographyGeoJson JavaDbCustomType { | ||
"javaDbType": "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryHelpers" | ||
}; | ||
|
||
annotation GeometryWKT JavaCustomType { | ||
"javaname" : "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryWKTHelpers" | ||
}; | ||
|
||
annotation GeometryWKT JavaDbCustomType { | ||
"javaDbType" : "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryWKTHelpers" | ||
}; | ||
|
||
annotation TSVector JavaDbCustomType { | ||
"javaDbType" : "String", | ||
"helpers": "au.com.helixta.adl.custom.TSVectorHelpers" | ||
}; | ||
|
||
annotation StringList JavaDbCustomType { | ||
"javaDbType" : "au.com.helixta.nofrills.sql.StringList", | ||
"helpers": "au.com.helixta.adl.custom.StringListHelpers" | ||
}; | ||
|
||
annotation StringList JavaCustomType { | ||
"javaname" : "au.com.helixta.nofrills.sql.StringList", | ||
"helpers": "au.com.helixta.adl.custom.StringListHelpers" | ||
}; | ||
|
||
annotation BigDecimal JavaCustomType { | ||
"javaname" : "java.math.BigDecimal", | ||
"helpers": "au.com.helixta.adl.custom.BigDecimalHelpers" | ||
}; | ||
|
||
annotation BigDecimal JavaDbCustomType { | ||
"javaDbType" : "java.math.BigDecimal", | ||
"helpers": "au.com.helixta.adl.custom.BigDecimalHelpers" | ||
}; | ||
|
||
/// Force adlc java runtime to include HashSetHelpers.java | ||
newtype SetStrings = Set<String>; | ||
|
||
}; |
Oops, something went wrong.