pl-api: Improve defaults for InteractionPolicy schema
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
444f9126d2
commit
618f5f5f25
1 changed files with 4 additions and 2 deletions
|
@ -4,8 +4,10 @@ import { coerceObject } from './utils';
|
|||
|
||||
const interactionPolicyEntrySchema = v.picklist(['public', 'followers', 'following', 'mutuals', 'mentioned', 'author', 'me']);
|
||||
|
||||
type InteractionPolicyEntry = v.InferOutput<typeof interactionPolicyEntrySchema>;
|
||||
|
||||
const interactionPolicyRuleSchema = coerceObject({
|
||||
always: v.fallback(v.array(interactionPolicyEntrySchema), ['public']),
|
||||
always: v.fallback(v.array(interactionPolicyEntrySchema), ['public', 'me']),
|
||||
with_approval: v.fallback(v.array(interactionPolicyEntrySchema), []),
|
||||
});
|
||||
|
||||
|
@ -27,5 +29,5 @@ const interactionPoliciesSchema = coerceObject({
|
|||
|
||||
type InteractionPolicies = v.InferOutput<typeof interactionPoliciesSchema>;
|
||||
|
||||
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicy, type InteractionPolicies };
|
||||
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicyEntry, type InteractionPolicy, type InteractionPolicies };
|
||||
|
||||
|
|
Loading…
Reference in a new issue