Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Mar 12, 2024
1 parent 7f01347 commit befd3eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function create_draft (
members = [],
roles = [],
signatures = [],
store = {},
terms = []
} = template
const prop = create_proposal(proposal)
Expand All @@ -62,7 +63,7 @@ export function create_draft (
? create_policy(e)
: e as RolePolicy
})
const draft = { approvals, members, proposal : prop, roles : policies, signatures, terms }
const draft = { approvals, members, proposal : prop, roles : policies, signatures, store, terms }
return schema.draft.session.parse(draft)
}

Expand Down
6 changes: 6 additions & 0 deletions src/schema/draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const policy = z.object({
programs : prop.terms.array()
})

const store = z.object({
cid : str.optional()
})

const terms = prop.data.keyof()

const session = z.object({
Expand All @@ -43,6 +47,7 @@ const session = z.object({
proposal : prop.data,
roles : policy.array(),
signatures : hex.array(),
store : store,
terms : terms.array()
})

Expand All @@ -51,6 +56,7 @@ const template = z.object({
proposal : prop.template,
roles : role.array().optional(),
signatures : hex.array().optional(),
store : store.optional(),
terms : terms.array().optional()
})

Expand Down
6 changes: 6 additions & 0 deletions src/types/draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface DraftTemplate {
proposal : ProposalTemplate | ProposalData
roles ?: Array<RolePolicy | RoleTemplate>
signatures ?: string[]
store ?: DraftStore
terms ?: string[]
}

Expand All @@ -43,5 +44,10 @@ export interface DraftData {
proposal : ProposalData
roles : RolePolicy[]
signatures : string[]
store : DraftStore
terms : string[]
}

export interface DraftStore {
cid ?: string
}

0 comments on commit befd3eb

Please sign in to comment.