feat: add PKL schema for message formats

This commit is contained in:
Prad Nukala
2024-09-30 19:44:16 -04:00
parent d9b1ac72a3
commit aa830517f3
58 changed files with 1201 additions and 133 deletions
-3
View File
@@ -72,9 +72,6 @@ class Schema {
@JsonField
keyshare: String
@JsonField
publicKey: String
@JsonField
profile: String
}
+37
View File
@@ -0,0 +1,37 @@
@go.Package { name = "github.com/onsonr/sonr/pkg/format" }
module format
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
}
}
typealias DID = String
typealias DIDMethod = "ipfs"|"sonr"|"bitcoin"|"ethereum"|"ibc"|"webauthn"|"dwn"|"service"
class Macaroon {
@JsonField
location: String
@JsonField
originator: String
@JsonField
identifier: String
@JsonField
first_party: List<String>
@JsonField
third_party: List<String>
@JsonField
expiration: Int
}
typealias MacaroonToken = String
+1 -2
View File
@@ -1,6 +1,6 @@
@go.Package { name = "github.com/onsonr/sonr/pkg/orm" }
module models
module orm
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
@@ -273,4 +273,3 @@ class Profile {
db_name: String = "vault"
db_version: Int = 1
+1 -1
View File
@@ -1,4 +1,4 @@
@go.Package { name = "github.com/onsonr/sonr/internal/orm/transactions" }
@go.Package { name = "github.com/onsonr/sonr/pkg/orm/transactions" }
module transactions