Skip to content

Commit

Permalink
fix email protocol and associated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Mar 22, 2024
1 parent 18126f8 commit d987909
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 102 deletions.
23 changes: 15 additions & 8 deletions packages/agent/tests/fixtures/protocol-definitions/email.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"protocol": "http://email-protocol.xyz",
"published": true,
"types": {
"thread": {
"schema": "http://email-protocol.xyz/schema/thread",
"dataFormats": [
"text/plain"
]
},
"email": {
"schema": "http://email-protocol.xyz/schema/email",
"dataFormats": [
Expand All @@ -10,24 +16,24 @@
}
},
"structure": {
"email": {
"thread": {
"$actions": [
{
"who": "anyone",
"can": [
"create"
"create", "update"
]
},
{
"who": "author",
"of": "email",
"of": "thread",
"can": [
"read"
]
},
{
"who": "recipient",
"of": "email",
"of": "thread",
"can": [
"read"
]
Expand All @@ -36,21 +42,22 @@
"email": {
"$actions": [
{
"who": "anyone",
"who": "recipient",
"of": "thread",
"can": [
"create"
"create", "update"
]
},
{
"who": "author",
"of": "email/email",
"of": "thread/email",
"can": [
"read"
]
},
{
"who": "recipient",
"of": "email/email",
"of": "thread/email",
"can": [
"read"
]
Expand Down
12 changes: 6 additions & 6 deletions packages/api/tests/dwn-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ describe('DwnApi', () => {
data : 'test',
message : {
protocol : 'http://email-protocol.xyz',
protocolPath : 'email',
schema : 'http://email-protocol.xyz/schema/email',
protocolPath : 'thread',
schema : 'http://email-protocol.xyz/schema/thread',
dataFormat : 'text/plain'
}
});
Expand Down Expand Up @@ -919,8 +919,8 @@ describe('DwnApi', () => {
data : 'test',
message : {
protocol : 'http://email-protocol.xyz',
protocolPath : 'email',
schema : 'http://email-protocol.xyz/schema/email',
protocolPath : 'thread',
schema : 'http://email-protocol.xyz/schema/thread',
dataFormat : 'text/plain'
}
});
Expand Down Expand Up @@ -1087,8 +1087,8 @@ describe('DwnApi', () => {
data : 'test',
message : {
protocol : 'http://email-protocol.xyz',
protocolPath : 'email',
schema : 'http://email-protocol.xyz/schema/email',
protocolPath : 'thread',
schema : 'http://email-protocol.xyz/schema/thread',
dataFormat : 'text/plain'
}
});
Expand Down
23 changes: 15 additions & 8 deletions packages/api/tests/fixtures/protocol-definitions/email.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"protocol": "http://email-protocol.xyz",
"published": true,
"types": {
"thread": {
"schema": "http://email-protocol.xyz/schema/thread",
"dataFormats": [
"text/plain"
]
},
"email": {
"schema": "http://email-protocol.xyz/schema/email",
"dataFormats": [
Expand All @@ -10,24 +16,24 @@
}
},
"structure": {
"email": {
"thread": {
"$actions": [
{
"who": "anyone",
"can": [
"create"
"create", "update"
]
},
{
"who": "author",
"of": "email",
"of": "thread",
"can": [
"read"
]
},
{
"who": "recipient",
"of": "email",
"of": "thread",
"can": [
"read"
]
Expand All @@ -36,21 +42,22 @@
"email": {
"$actions": [
{
"who": "anyone",
"who": "recipient",
"of": "thread",
"can": [
"create"
"create", "update"
]
},
{
"who": "author",
"of": "email/email",
"of": "thread/email",
"can": [
"read"
]
},
{
"who": "recipient",
"of": "email/email",
"of": "thread/email",
"can": [
"read"
]
Expand Down
45 changes: 0 additions & 45 deletions packages/api/tests/fixtures/protocol-definitions/thread.json

This file was deleted.

Loading

0 comments on commit d987909

Please sign in to comment.