Skip to content

Commit a61292a

Browse files
committed
feat: add-email-subscription-to-profile
1 parent 2c22ba2 commit a61292a

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

src/schemas/profile.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,24 @@
5151
"title": "farcaster",
5252
"pattern": "^[a-z0-9-]*$",
5353
"maxLength": 17
54+
},
55+
"emailSubscription": {
56+
"type": "object",
57+
"properties": {
58+
"email": {
59+
"type": "string",
60+
"title": "email",
61+
"maxLength": 256
62+
},
63+
"subscriptions": {
64+
"type": "array",
65+
"title": "subscriptions",
66+
"uniqueItems": true,
67+
"items": { "type": "string" }
68+
}
69+
},
70+
"required": [],
71+
"additionalProperties": false
5472
}
5573
},
5674
"required": [],
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "Vitalik",
3+
"avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM",
4+
"about": "This is my about info",
5+
"emailSubscription": {
6+
"email": "[email protected]"
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "Vitalik",
3+
"avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM",
4+
"about": "This is my about info",
5+
"emailSubscription": {
6+
"subscriptions": ["summary", "newProposal"]
7+
}
8+
}

test/schema.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import spaceStarknetDelegation from './examples/space-starknet-delegation.json';
77
import proposalTurbo from './examples/proposal-turbo.json';
88
import vote from './examples/vote.json';
99
import profile from './examples/profile.json';
10+
import profileAddEmailSubscription from './examples/profile-addEmailSubscription.json';
11+
import profileUpdateEmailSubscription from './examples/profile-updateEmailSubscription.json';
1012
import statement from './examples/statement.json';
1113
import alias from './examples/alias.json';
1214
import schemas from '../src/schemas';
@@ -24,6 +26,16 @@ describe.each([
2426
{ schemaType: 'proposal', schema: schemas.proposal, example: proposal },
2527
{ schemaType: 'vote', schema: schemas.vote, example: vote },
2628
{ schemaType: 'profile', schema: schemas.profile, example: profile },
29+
{
30+
schemaType: 'profile',
31+
schema: schemas.profile,
32+
example: profileAddEmailSubscription
33+
},
34+
{
35+
schemaType: 'profile',
36+
schema: schemas.profile,
37+
example: profileUpdateEmailSubscription
38+
},
2739
{ schemaType: 'statement', schema: schemas.statement, example: statement },
2840
{ schemaType: 'zodiac', schema: schemas.zodiac, example: space },
2941
{ schemaType: 'alias', schema: schemas.alias, example: alias }

0 commit comments

Comments
 (0)