public async Task GenerateSchemaAsync(ISyncService sync) { await sync.WriteJsonSchemaAsync <RuleModel>(new FilePath("rule.json")); var sample = new RuleModel { Name = "My-Rule", Trigger = new ContentChangedRuleTriggerDto { HandleAll = true }, TypedAction = new WebhookRuleActionDto { Url = new Uri("https://squidex.io") }, IsEnabled = true }; await sync.WriteWithSchema(new FilePath("rules", "__rule.json"), sample, Ref); }
public async Task GenerateSchemaAsync(DirectoryInfo directoryInfo, JsonHelper jsonHelper) { await jsonHelper.WriteJsonSchemaAsync <RuleModel>(directoryInfo, "rule.json"); var sample = new RuleModel { Name = "My-Rule", Trigger = new ContentChangedRuleTriggerDto { HandleAll = true }, TypedAction = new WebhookRuleActionDto { Url = new Uri("https://squidex.io") }, IsEnabled = true }; await jsonHelper.WriteWithSchema(directoryInfo, "rules/__rule.json", sample, Ref); }
public static CreateExtendableRuleDto ToCreate(this RuleModel model) { return(SimpleMapper.Map(model, new CreateExtendableRuleDto())); }