2024-09-18 02:22:17 -04:00
|
|
|
@go.Package { name = "github.com/onsonr/sonr/internal/vfs/models" }
|
2024-09-07 18:12:58 -04:00
|
|
|
|
2024-09-16 01:06:00 -04:00
|
|
|
module models
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
typealias Base58 = String
|
|
|
|
typealias Base64 = String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
typealias Bech32 = String
|
|
|
|
typealias Keccak = String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
typealias DID = String
|
|
|
|
typealias ChainCode = UInt
|
|
|
|
typealias Scope = String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
typealias Hex = String
|
|
|
|
typealias UTF8 = String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
class PrimaryKey extends go.Field {
|
2024-09-07 18:12:58 -04:00
|
|
|
structTags {
|
2024-09-18 02:22:17 -04:00
|
|
|
["json"] = "%{name},omitempty"
|
|
|
|
["query"] = "%{name}"
|
2024-09-07 18:12:58 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class JsonField extends go.Field {
|
|
|
|
structTags {
|
|
|
|
["json"] = "%{name},omitempty"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
class Account {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: DID
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
name: String
|
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
address: Bech32|Keccak|String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
publicKey: Base58
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
chainCode: ChainCode
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
index: Int
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
controller: Bech32
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
createdAt: String?
|
|
|
|
}
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
class Asset {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: DID
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
name: String
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
symbol: String
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
decimals: Int
|
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
chainCode: ChainCode
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
createdAt: String?
|
|
|
|
}
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
class Chain {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: DID
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
name: String
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
networkId: String
|
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
@JsonField
|
|
|
|
chainCode: ChainCode
|
|
|
|
|
2024-09-07 18:12:58 -04:00
|
|
|
@JsonField
|
|
|
|
createdAt: String?
|
|
|
|
}
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
class Credential {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: DID
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
subject: String
|
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
controller: Bech32
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
attestationType: String
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
origin: String
|
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
credentialId: Base64
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
publicKey: Base64
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
transport: List<String>
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
signCount: UInt
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
userPresent: Boolean
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
userVerified: Boolean
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
backupEligible: Boolean
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
backupState: Boolean
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
cloneWarning: Boolean
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
createdAt: String?
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
updatedAt: String?
|
|
|
|
}
|
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
class Grant {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: UInt
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
subject: String
|
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
controller: Bech32
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
origin: String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
token: String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
scopes: List<String>
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
createdAt: String?
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
updatedAt: String?
|
|
|
|
}
|
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
class Keyshare {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: DID
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
data: Base64
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
role: Int
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
createdAt: String?
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
lastRefreshed: String?
|
2024-09-07 18:12:58 -04:00
|
|
|
}
|
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
class PublicKey {
|
2024-09-07 18:12:58 -04:00
|
|
|
@PrimaryKey
|
2024-09-18 02:22:17 -04:00
|
|
|
id: DID
|
|
|
|
}
|
2024-09-07 18:12:58 -04:00
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
class Profile {
|
|
|
|
@PrimaryKey
|
|
|
|
id: String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
subject: String
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
controller: Bech32
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
originUri: String?
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
publicMetadata: String?
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
2024-09-18 02:22:17 -04:00
|
|
|
privateMetadata: String?
|
2024-09-07 18:12:58 -04:00
|
|
|
|
|
|
|
@JsonField
|
|
|
|
createdAt: String?
|
|
|
|
|
|
|
|
@JsonField
|
|
|
|
updatedAt: String?
|
|
|
|
}
|
2024-09-11 15:10:54 -04:00
|
|
|
|
2024-09-16 01:06:00 -04:00
|
|
|
|