sonr/pkl/orm.pkl
Prad Nukala b593245fe6
feature/implement vault allocation (#11)
* feat: add authentication middleware

* feat: add REST API endpoints for database interactions

* refactor: move DiscoveryDocument Pkl schema to oidc module

* fix: replace sonrd with test_node.sh

* feat: use NFT keeper to mint DID namespace NFT

* refactor: move NFT class configuration to types

* feat: add GlobalIntegrity genesis state

* fix: ensure GlobalIntegrity is initialized in genesis

* refactor: update all references to transactions module

* refactor: improve genesis state struct

* chore(did): update discovery endpoint to reflect base url

* feat: remove unused context cache and client code

* refactor: remove middleware dependency from keeper

* feat: Add new query handlers for DID module

* feat: Implement unimplemented params queries

* feat: add support for first-party caveats

* refactor: move motr command to cmd directory

* feat: add support for GitHub releases

* fix(motr): build app.wasm for motr package

* feat: add card component

* feat: add IndexedDB support for persistent storage

* feat: Add Row and Column components

* feat: add  and  components

* refactor: improve button component

* refactor: remove unnecessary button parameter in renderButton

* feat: add vault service endpoint

* feat: add input component
2024-09-14 12:47:25 -04:00

228 lines
2.8 KiB
Plaintext

@go.Package { name = "github.com/onsonr/sonr/internal/db/orm" }
module orm
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class PrimaryKey extends go.Field {
structTags {
["gorm"] = "primaryKey,autoIncrement"
["json"] = "%{name},omitempty"
["query"] = "%{name}"
}
}
class Unique extends go.Field {
structTags {
["gorm"] = "unique"
["json"] = "%{name},omitempty"
}
}
class Default extends go.Field {
defaultValue: String
structTags {
["gorm"] = "default:%{defaultValue}"
["json"] = "%{name},omitempty"
}
}
class NotNull extends go.Field {
structTags {
["gorm"] = "not null"
}
}
class ForeignKey extends go.Field {
references: String
structTags {
["gorm"] = "foreignKey:%{references}"
}
}
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
["param"] = "%{name}"
}
}
class Account {
@PrimaryKey
id: UInt
@JsonField
name: String
@JsonField
address: String
@JsonField
publicKey: String
@JsonField
createdAt: String?
}
class Asset {
@PrimaryKey
id: UInt
@JsonField
name: String
@JsonField
symbol: String
@JsonField
decimals: Int
@JsonField
chainId: Int?
@JsonField
createdAt: String?
}
class Chain {
@PrimaryKey
id: UInt
@JsonField
name: String
@JsonField
networkId: String
@JsonField
createdAt: String?
}
class Credential {
@PrimaryKey
id: UInt
@JsonField
subject: String
@JsonField
controller: String
@JsonField
attestationType: String
@JsonField
origin: String
@JsonField
credentialId: String
@JsonField
publicKey: String
@JsonField
transport: String
@JsonField
signCount: UInt
@JsonField
userPresent: Boolean
@JsonField
userVerified: Boolean
@JsonField
backupEligible: Boolean
@JsonField
backupState: Boolean
@JsonField
cloneWarning: Boolean
@JsonField
createdAt: String?
@JsonField
updatedAt: String?
}
class Profile {
@PrimaryKey
id: String
@JsonField
subject: String
@JsonField
controller: String
@JsonField
originUri: String?
@JsonField
publicMetadata: String?
@JsonField
privateMetadata: String?
@JsonField
createdAt: String?
@JsonField
updatedAt: String?
}
class Property {
@PrimaryKey
id: UInt
@JsonField
profileId: String
@JsonField
key: String
@JsonField
accumulator: String
@JsonField
propertyKey: String
}
class Keyshare {
@PrimaryKey
id: UInt
@JsonField
data: String
@JsonField
role: Int
@JsonField
createdAt: String?
}
class Permission {
@PrimaryKey
id: UInt
@JsonField
serviceId: String
@JsonField
grants: String
@JsonField
scopes: String
@JsonField
createdAt: String?
@JsonField
updatedAt: String?
}