mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
refactor: remove dependency on DWN.pkl
This commit is contained in:
parent
0e14099f0c
commit
d9815cc96c
1
pkg/services/ipfsapi/ipfsapi.go
Normal file
1
pkg/services/ipfsapi/ipfsapi.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package ipfsapi
|
1
pkg/services/ipfsget/ipfsget.go
Normal file
1
pkg/services/ipfsget/ipfsget.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package ipfsget
|
@ -3,7 +3,6 @@
|
|||||||
module common.types.Ctx
|
module common.types.Ctx
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||||
import "./DWN.pkl"
|
|
||||||
|
|
||||||
class JsonField extends go.Field {
|
class JsonField extends go.Field {
|
||||||
structTags {
|
structTags {
|
||||||
|
22
pkl/pkl.exts/PklProject
Normal file
22
pkl/pkl.exts/PklProject
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
/// Configuration files for integrating the Matrix service
|
||||||
|
amends "../basePklProject.pkl"
|
||||||
|
|
||||||
|
package {
|
||||||
|
name = "net.matrix"
|
||||||
|
version = "0.0.1"
|
||||||
|
}
|
0
pkl/pkl.exts/json.pkl
Normal file
0
pkl/pkl.exts/json.pkl
Normal file
4
pkl/sonr.chain/PklProject.deps.json
Normal file
4
pkl/sonr.chain/PklProject.deps.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"resolvedDependencies": {}
|
||||||
|
}
|
275
pkl/sonr.dwn/ORM.pkl
Normal file
275
pkl/sonr.dwn/ORM.pkl
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
@go.Package { name = "github.com/onsonr/sonr/pkg/common/models" }
|
||||||
|
|
||||||
|
module common.types.ORM
|
||||||
|
|
||||||
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||||
|
|
||||||
|
|
||||||
|
// Enums
|
||||||
|
typealias AssetType = "native"|"wrapped"|"staking"|"pool"|"ibc"|"cw20"
|
||||||
|
|
||||||
|
typealias DIDMethod = "ipfs"|"sonr"|"bitcoin"|"ethereum"|"ibc"|"webauthn"|"dwn"|"service"
|
||||||
|
|
||||||
|
typealias KeyAlgorithm = "es256"|"es384"|"es512"|"eddsa"|"es256k"|"ecdsa"
|
||||||
|
|
||||||
|
typealias KeyCurve = "p256"|"p384"|"p521"|"x25519"|"x448"|"ed25519"|"ed448"|"secp256k1"|"bls12381"|"keccak256"
|
||||||
|
|
||||||
|
typealias KeyEncoding = "raw"|"hex"|"multibase"
|
||||||
|
|
||||||
|
typealias KeyRole = "authentication"|"assertion"|"delegation"|"invocation"
|
||||||
|
|
||||||
|
typealias KeyType = "octet"|"elliptic"|"rsa"|"symmetric"|"hmac"|"mpc"|"zk"|"webauthn"|"bip32"
|
||||||
|
|
||||||
|
typealias KeyShareRole = "user"|"validator"
|
||||||
|
|
||||||
|
typealias PermissionGrant = "none"|"read"|"write"|"verify"|"broadcast"|"admin"
|
||||||
|
|
||||||
|
typealias PermissionScope = "profile"|"metadata"|"permissions"|"wallets"|"transactions"|"user"|"validator"
|
||||||
|
|
||||||
|
typealias Base58 = String
|
||||||
|
typealias Base64 = String
|
||||||
|
|
||||||
|
typealias Bech32 = String
|
||||||
|
typealias Keccak = String
|
||||||
|
|
||||||
|
typealias ChainCode = UInt
|
||||||
|
typealias Scope = String
|
||||||
|
|
||||||
|
typealias Hex = String
|
||||||
|
|
||||||
|
class PrimaryKey extends go.Field {
|
||||||
|
structTags {
|
||||||
|
["json"] = "%{name},omitempty"
|
||||||
|
["query"] = "%{name}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class JsonField extends go.Field {
|
||||||
|
structTags {
|
||||||
|
["json"] = "%{name},omitempty"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Account {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
name: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
address: Bech32|Keccak|String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
publicKey: Base58
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
chainCode: ChainCode
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
index: Int
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
controller: Bech32
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
createdAt: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
class Asset {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
name: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
symbol: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
decimals: Int
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
chainCode: ChainCode
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
createdAt: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
class Chain {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
name: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
networkId: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
chainCode: ChainCode
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
createdAt: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
class Credential {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
subject: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
controller: Bech32
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
attestationType: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
origin: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
label: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
deviceId: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
credentialId: Base64
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
publicKey: Base64
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
transport: List<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 DID {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
role: KeyRole
|
||||||
|
algorithm: KeyAlgorithm
|
||||||
|
encoding: KeyEncoding
|
||||||
|
curve: KeyCurve
|
||||||
|
key_type: KeyType
|
||||||
|
raw: Base64
|
||||||
|
jwk: JWK
|
||||||
|
}
|
||||||
|
|
||||||
|
class JWK {
|
||||||
|
@JsonField
|
||||||
|
kty: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
crv: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
x: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
y: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
n: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
e: String
|
||||||
|
}
|
||||||
|
|
||||||
|
class Grant {
|
||||||
|
@PrimaryKey
|
||||||
|
id: UInt
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
subject: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
controller: Bech32
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
origin: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
token: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
scopes: List<String>
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
createdAt: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
updatedAt: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
class Keyshare {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
data: Base64
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
role: Int
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
createdAt: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
lastRefreshed: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
class Profile {
|
||||||
|
@PrimaryKey
|
||||||
|
id: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
subject: String
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
controller: Bech32
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
originUri: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
publicMetadata: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
privateMetadata: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
createdAt: String?
|
||||||
|
|
||||||
|
@JsonField
|
||||||
|
updatedAt: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
db_name: String = "vault"
|
||||||
|
db_version: Int = 1
|
22
pkl/sonr.dwn/PklProject
Normal file
22
pkl/sonr.dwn/PklProject
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
/// Common types for operations across the sonr ecosystem
|
||||||
|
amends "../basePklProject.pkl"
|
||||||
|
|
||||||
|
package {
|
||||||
|
name = "base.types"
|
||||||
|
version = "0.0.1"
|
||||||
|
}
|
4
pkl/sonr.dwn/PklProject.deps.json
Normal file
4
pkl/sonr.dwn/PklProject.deps.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"resolvedDependencies": {}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user