[api] Add window-sum for calculating a sum based on an internal window