Skip to content

Instantly share code, notes, and snippets.

View csuwildcat's full-sized avatar

Daniel Buchner csuwildcat

View GitHub Profile
{
"uri": "https://slick.app",
"schemas": {
"invite": "https://slick.app/schemas/invite",
"community": "https://slick.app/schemas/community",
"details": "https://slick.app/schemas/details",
"channel": "https://slick.app/schemas/channel",
"message": "https://slick.app/schemas/message",
"reaction": "https://slick.app/schemas/reaction",
"admin": "https://slick.app/schemas/admin",
{
types: {
invitation: {
schema: "https://example.com/protocols/signdocs/invitation"
dataFormats: ['application/json']
}
},
structure: {
invitation: {
$actions: [
$ npm run test:browser
> @web5/api@0.8.3 test:browser
> karma start karma.conf.cjs
Firefox 115.0 (Windows 10) WARN: 'failed to get tech preview dwn endpoints:', 'Network error'
18 11 2023 10:40:30.385:INFO [launcher]: Starting browser WebkitHeadless
18 11 2023 10:40:30.850:INFO [WebKit 605.1.15 (Windows 8)]: Connected on socket nFNGv_D5KWu4ABEUAAAF with id 17526702
WebKit 605.1.15 (Windows 8) LOG: 'STATUS CODE: 400 --> SchemaValidationFailure: /descriptor: must have required property 'schema''
$ npm run test:browser
> @web5/api@0.8.2 test:browser
> karma start karma.conf.cjs
START:
16 11 2023 08:21:44.758:INFO [esbuild]: Compiling to C:\Users\DANIEL~1\AppData\Local\Temp\6e4f1eb204b7584be7b660a3b65c3a40-bundle.js...
X [ERROR] Could not resolve "@web5/agent"
{
"protocol": "http://binary-protocol.xyz",
"published": true,
"types": {
"image": {
"dataFormats": ["image/gif", "image/png", "image/jpeg"]
}
},
"structure": {
"image": {}
import type { PortableDid } from '@web5/dids';
import type { ManagedIdentity } from '@web5/agent';
const fs = require('fs').promises;
import { expect } from 'chai';
import { TestManagedAgent } from '@web5/agent';
import { DwnApi } from '../src/dwn-api.js';
import { testDwnUrl } from './test-config.js';
{
"definition":{
"published":true,
"protocol":"https://protocol.example",
"types":{
"album":{
"schema":"https://protocol.example/album",
"dataFormats":[
"application/json"
]
{
"method": "ProtocolsConfigure",
"definition": {
"protocol": "https://identity.foundation/protocols/credentials",
"types": {
"issuanceTransaction": {
"schema": "https://identity.foundation/presentation-exchange/presentation-definition",
"dataFormat": [
"application/json"
]
{
definition: {
protocol: "https://protocol.example",
types: {
community: {
schema: "https://protocol.example/community",
dataFormats: ["application/json"]
},
member: {
schema: "https://protocol.example/member",
const fetchProfiles = async () => {
const managedIdentities = await IdentityAgentManager.listIdentities();
const promises = await Promise.all(managedIdentities.map(async identity => {
const agent = IdentityAgentManager.getAgent();
const web5 = new Web5({ agent, connectedDid: identity.did });
const queryResult = await web5.dwn.records.query({
message: {
filter: {
schema: profileProtocol.types.displayName.schema,