diff --git a/pkg/services/ipfsapi/ipfsapi.go b/pkg/services/ipfsapi/ipfsapi.go new file mode 100644 index 000000000..f017ba8b8 --- /dev/null +++ b/pkg/services/ipfsapi/ipfsapi.go @@ -0,0 +1 @@ +package ipfsapi diff --git a/pkg/services/ipfsget/ipfsget.go b/pkg/services/ipfsget/ipfsget.go new file mode 100644 index 000000000..c77e53a5d --- /dev/null +++ b/pkg/services/ipfsget/ipfsget.go @@ -0,0 +1 @@ +package ipfsget diff --git a/pkl/base.types/Ctx.pkl b/pkl/base.types/Ctx.pkl index 9feef81b7..8d199db56 100644 --- a/pkl/base.types/Ctx.pkl +++ b/pkl/base.types/Ctx.pkl @@ -3,7 +3,6 @@ module common.types.Ctx import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" -import "./DWN.pkl" class JsonField extends go.Field { structTags { diff --git a/pkl/pkl.exts/PklProject b/pkl/pkl.exts/PklProject new file mode 100644 index 000000000..23bb2d48e --- /dev/null +++ b/pkl/pkl.exts/PklProject @@ -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" +} diff --git a/pkl/chain.sonr/PklProject.deps.json b/pkl/pkl.exts/PklProject.deps.json similarity index 100% rename from pkl/chain.sonr/PklProject.deps.json rename to pkl/pkl.exts/PklProject.deps.json diff --git a/pkl/pkl.exts/json.pkl b/pkl/pkl.exts/json.pkl new file mode 100644 index 000000000..e69de29bb diff --git a/pkl/chain.sonr/App.pkl b/pkl/sonr.chain/App.pkl similarity index 100% rename from pkl/chain.sonr/App.pkl rename to pkl/sonr.chain/App.pkl diff --git a/pkl/chain.sonr/Chain.pkl b/pkl/sonr.chain/Chain.pkl similarity index 100% rename from pkl/chain.sonr/Chain.pkl rename to pkl/sonr.chain/Chain.pkl diff --git a/pkl/chain.sonr/Genesis.pkl b/pkl/sonr.chain/Genesis.pkl similarity index 100% rename from pkl/chain.sonr/Genesis.pkl rename to pkl/sonr.chain/Genesis.pkl diff --git a/pkl/chain.sonr/PklProject b/pkl/sonr.chain/PklProject similarity index 100% rename from pkl/chain.sonr/PklProject rename to pkl/sonr.chain/PklProject diff --git a/pkl/sonr.chain/PklProject.deps.json b/pkl/sonr.chain/PklProject.deps.json new file mode 100644 index 000000000..836079aad --- /dev/null +++ b/pkl/sonr.chain/PklProject.deps.json @@ -0,0 +1,4 @@ +{ + "schemaVersion": 1, + "resolvedDependencies": {} +} \ No newline at end of file diff --git a/pkl/sonr.dwn/ORM.pkl b/pkl/sonr.dwn/ORM.pkl new file mode 100644 index 000000000..d6a59b1b5 --- /dev/null +++ b/pkl/sonr.dwn/ORM.pkl @@ -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 + + @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 + + @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 diff --git a/pkl/sonr.dwn/PklProject b/pkl/sonr.dwn/PklProject new file mode 100644 index 000000000..f5363cc8e --- /dev/null +++ b/pkl/sonr.dwn/PklProject @@ -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" +} diff --git a/pkl/sonr.dwn/PklProject.deps.json b/pkl/sonr.dwn/PklProject.deps.json new file mode 100644 index 000000000..836079aad --- /dev/null +++ b/pkl/sonr.dwn/PklProject.deps.json @@ -0,0 +1,4 @@ +{ + "schemaVersion": 1, + "resolvedDependencies": {} +} \ No newline at end of file