(userId: string, subscription: SubscriptionInfo | null)
| 40 | } |
| 41 | |
| 42 | private getRateLimitKey(userId: string, subscription: SubscriptionInfo | null): string { |
| 43 | if (!subscription) return userId |
| 44 | |
| 45 | if (isOrgScopedSubscription(subscription, userId)) { |
| 46 | return subscription.referenceId |
| 47 | } |
| 48 | |
| 49 | return userId |
| 50 | } |
| 51 | |
| 52 | private getCounterType(triggerType: TriggerType, isAsync: boolean): RateLimitCounterType { |
| 53 | if (triggerType === 'api-endpoint') return 'api-endpoint' |
no test coverage detected