const exampleSimpleAbility = createVincentAbility({
packageName: '@lit-protocol/yesability@1.0.0',
abilityDescription: 'Yes Ability description',
abilityParamsSchema: testSchema,
supportedPolicies: supportedPoliciesForAbility([testPolicy]),
precheck: async (params, { succeed, fail }) => {
// Should allow succeed() with no arguments
succeed();
// Should allow fail() with string error
fail('Error message');
// @ts-expect-error - Should not allow succeed() with arguments when no schema
succeed({ message: 'test' });
// @ts-expect-error - Should not allow fail() with object when no schema
fail({ error: 'test' });
return succeed();
},
execute: async (params, { succeed }) => {
// Should allow succeed() with no arguments
succeed();
// @ts-expect-error - Should not allow succeed() with arguments when no schema
return succeed({ data: 'test' });
},
});