feature/driver indexed db (#12)

* fix: update commitizen version

* feat: add WASM build tags to db actions

* feat: Update all actions to follow `AddAsset` for error handling

* feat: remove database dependency in dwn and motr commands

* feat: add basic info form to registration view

* feat: implement basic browser navigation component

* refactor: move database related files to middleware

* fix: remove unused test command

* fix: update source directory for buf-publish workflow
This commit is contained in:
Prad Nukala
2024-09-16 01:06:00 -04:00
committed by GitHub
parent 7bdf6c3eb4
commit 8022428e37
118 changed files with 388 additions and 1007 deletions
-37
View File
@@ -1,37 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/motr/api" }
module api
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
}
}
abstract class Request {
route: String
method: String
headers: Map<String, String>
origin: String?
userAgent: String?
body: Dynamic
}
abstract class Response {
statusCode: Int
headers: Map<String, String>
body: Dynamic
}
class GetAccountsRequest extends Request {
route = "/accounts"
method = "GET"
headers = {
"Content-Type" = "application/json"
}
origin = null
userAgent = null
body = null
}
-30
View File
@@ -1,30 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/motr/api/bake" }
module bake
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
}
}
abstract class Macroon {
id: String
location: String
}
abstract class FirstPartyCaveats {
scope: String
exp: Int
cnf: String
aud: String
}
abstract class ThirdPartyCaveats {
scope: String
exp: Int
cnf: String
aud: String
}
-59
View File
@@ -1,59 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/x/did/types/oidc" }
module oidc
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
["param"] = "%{name}"
}
}
class DiscoveryDocument {
@JsonField
issuer: String
@JsonField
authorization_endpoint: String
@JsonField
token_endpoint: String
@JsonField
userinfo_endpoint: String
@JsonField
jwks_uri: String
@JsonField
registration_endpoint: String
@JsonField
scopes_supported: List<String>
@JsonField
response_types_supported: List<String>
@JsonField
response_modes_supported: List<String>
@JsonField
subject_types_supported: List<String>
@JsonField
id_token_signing_alg_values_supported: List<String>
@JsonField
claims_supported: List<String>
@JsonField
grant_types_supported: List<String>
@JsonField
acr_values_supported: List<String>
@JsonField
token_endpoint_auth_methods_supported: List<String>
}
-227
View File
@@ -1,227 +0,0 @@
@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?
}
-175
View File
@@ -1,175 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/x/did/types/txns" }
module txns
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
/// Common Cosmos SDK types
typealias Coin = Dynamic
typealias AccAddress = String
typealias ValAddress = String
typealias Timestamp = String
/// Base class for all messages
abstract class Msg {
/// The type URL for the message
typeUrl: String
}
/// Base class for all proposals
class Proposal {
/// The title of the proposal
title: String
/// The description of the proposal
description: String
}
/// Gov module messages
class MsgGovSubmitProposal extends Msg {
typeUrl = "/cosmos.gov.v1beta1.MsgSubmitProposal"
content: Proposal
initialDeposit: List<Coin>
proposer: AccAddress
}
class MsgGovVote extends Msg {
typeUrl = "/cosmos.gov.v1beta1.MsgVote"
proposalId: Int
voter: AccAddress
option: Int
}
class MsgGovDeposit extends Msg {
typeUrl = "/cosmos.gov.v1beta1.MsgDeposit"
proposalId: Int
depositor: AccAddress
amount: List<Coin>
}
/// Group module messages
class MsgGroupCreateGroup extends Msg {
typeUrl = "/cosmos.group.v1.MsgCreateGroup"
admin: AccAddress
members: List<Dynamic>
metadata: String
}
class MsgGroupSubmitProposal extends Msg {
typeUrl = "/cosmos.group.v1.MsgSubmitProposal"
groupPolicyAddress: AccAddress
proposers: List<AccAddress>
metadata: String
messages: List<Dynamic>
exec: Int
}
class MsgGroupVote extends Msg {
typeUrl = "/cosmos.group.v1.MsgVote"
proposalId: Int
voter: AccAddress
option: Int
metadata: String
exec: Int
}
/// Staking module messages
class MsgStakingCreateValidator extends Msg {
typeUrl = "/cosmos.staking.v1beta1.MsgCreateValidator"
description: Dynamic
commission: Dynamic
minSelfDelegation: String
delegatorAddress: AccAddress
validatorAddress: ValAddress
pubkey: Dynamic
value: Coin
}
class MsgStakingDelegate extends Msg {
typeUrl = "/cosmos.staking.v1beta1.MsgDelegate"
delegatorAddress: AccAddress
validatorAddress: ValAddress
amount: Coin
}
class MsgStakingUndelegate extends Msg {
typeUrl = "/cosmos.staking.v1beta1.MsgUndelegate"
delegatorAddress: AccAddress
validatorAddress: ValAddress
amount: Coin
}
class MsgStakingBeginRedelegate extends Msg {
typeUrl = "/cosmos.staking.v1beta1.MsgBeginRedelegate"
delegatorAddress: AccAddress
validatorSrcAddress: ValAddress
validatorDstAddress: ValAddress
amount: Coin
}
class MsgDidUpdateParams extends Msg {
typeUrl = "/sonr.did.v1.MsgUpdateParams"
authority: AccAddress
params: Dynamic
token: Dynamic
}
class MsgDidAllocateVault extends Msg {
typeUrl = "/sonr.did.v1.MsgAllocateVault"
authority: AccAddress
subject: String
token: Dynamic
}
class MsgDidProveWitness extends Msg {
typeUrl = "/sonr.did.v1.MsgProveWitness"
authority: AccAddress
property: String
witness: Listing<Int>
token: Dynamic
}
class MsgDidSyncVault extends Msg {
typeUrl = "/sonr.did.v1.MsgSyncVault"
controller: AccAddress
token: Dynamic
}
class MsgDidRegisterController extends Msg {
typeUrl = "/sonr.did.v1.MsgRegisterController"
authority: AccAddress
cid: String
origin: String
authentication: List<Dynamic>
token: Dynamic
}
class MsgDidAuthorize extends Msg {
typeUrl = "/sonr.did.v1.MsgAuthorize"
authority: AccAddress
controller: AccAddress
address: AccAddress
origin: String
token: Dynamic
}
class MsgDidRegisterService extends Msg {
typeUrl = "/sonr.did.v1.MsgRegisterService"
controller: AccAddress
originUri: String
scopes: Dynamic
description: String
serviceEndpoints: Map<String, String>
metadata: Dynamic
token: Dynamic
}
/// Represents a transaction body
class TxBody {
messages: List<Msg>
memo: String?
timeoutHeight: Int?
extensionOptions: List<Dynamic>?
nonCriticalExtensionOptions: List<Dynamic>?
}