Skip to content

Commit

Permalink
feat: add-email-subscription-to-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Oct 27, 2024
1 parent 2c22ba2 commit a61292a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/schemas/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@
"title": "farcaster",
"pattern": "^[a-z0-9-]*$",
"maxLength": 17
},
"emailSubscription": {
"type": "object",
"properties": {
"email": {
"type": "string",
"title": "email",
"maxLength": 256
},
"subscriptions": {
"type": "array",
"title": "subscriptions",
"uniqueItems": true,
"items": { "type": "string" }
}
},
"required": [],
"additionalProperties": false
}
},
"required": [],
Expand Down
8 changes: 8 additions & 0 deletions test/examples/profile-addEmailSubscription.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Vitalik",
"avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM",
"about": "This is my about info",
"emailSubscription": {
"email": "[email protected]"
}
}
8 changes: 8 additions & 0 deletions test/examples/profile-updateEmailSubscription.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Vitalik",
"avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM",
"about": "This is my about info",
"emailSubscription": {
"subscriptions": ["summary", "newProposal"]
}
}
12 changes: 12 additions & 0 deletions test/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import spaceStarknetDelegation from './examples/space-starknet-delegation.json';
import proposalTurbo from './examples/proposal-turbo.json';
import vote from './examples/vote.json';
import profile from './examples/profile.json';
import profileAddEmailSubscription from './examples/profile-addEmailSubscription.json';
import profileUpdateEmailSubscription from './examples/profile-updateEmailSubscription.json';
import statement from './examples/statement.json';
import alias from './examples/alias.json';
import schemas from '../src/schemas';
Expand All @@ -24,6 +26,16 @@ describe.each([
{ schemaType: 'proposal', schema: schemas.proposal, example: proposal },
{ schemaType: 'vote', schema: schemas.vote, example: vote },
{ schemaType: 'profile', schema: schemas.profile, example: profile },
{
schemaType: 'profile',
schema: schemas.profile,
example: profileAddEmailSubscription
},
{
schemaType: 'profile',
schema: schemas.profile,
example: profileUpdateEmailSubscription
},
{ schemaType: 'statement', schema: schemas.statement, example: statement },
{ schemaType: 'zodiac', schema: schemas.zodiac, example: space },
{ schemaType: 'alias', schema: schemas.alias, example: alias }
Expand Down

0 comments on commit a61292a

Please sign in to comment.