Beispiel #1
0
 private object GetDefaultPayload(WebHookSubscription subscription, WebHookEventType eventType, Node node,
                                  VersionNumber previousVersion)
 {
     return(new
     {
         nodeId = node?.Id ?? 0,
         versionId = node?.VersionId ?? 0,
         version = node?.Version?.ToString(),
         previousVersion = previousVersion?.ToString(),
         versionModificationDate = node?.VersionModificationDate ?? DateTime.MinValue,
         modifiedBy = node?.ModifiedById ?? 0,
         path = node?.Path,
         name = node?.Name,
         displayName = node?.DisplayName,
         eventName = eventType.ToString(),
         subscriptionId = subscription.Id,
         sentTime = DateTime.UtcNow,
         repository = _clientStoreOptions.RepositoryUrl?.RemoveUrlSchema()
     });
 }
Beispiel #2
0
 public Task FireWebHookAsync(WebHookSubscription subscription, WebHookEventType eventType, Node node, CancellationToken cancel)
 {
     return(_webHookClient.SendAsync(subscription.Url, eventType.ToString(), node.Id, subscription.Id,
                                     subscription.HttpMethod, GetPayload(subscription, eventType, node, null),
                                     subscription.HttpHeaders, cancel));
 }