MCPcopy Index your code
hub / github.com/simstudioai/sim / verifyCredentialSetBilling

Function verifyCredentialSetBilling

apps/sim/lib/webhooks/processor.ts:55–82  ·  view source on GitHub ↗
(credentialSetId: string)

Source from the content-addressed store, hash-verified

53}
54
55async function verifyCredentialSetBilling(credentialSetId: string): Promise<{
56 valid: boolean
57 error?: string
58}> {
59 if (!isProd) {
60 return { valid: true }
61 }
62
63 const [set] = await db
64 .select({ organizationId: credentialSet.organizationId })
65 .from(credentialSet)
66 .where(eq(credentialSet.id, credentialSetId))
67 .limit(1)
68
69 if (!set) {
70 return { valid: false, error: 'Credential set not found' }
71 }
72
73 const hasTeamPlan = await isOrganizationOnTeamOrEnterprisePlan(set.organizationId)
74 if (!hasTeamPlan) {
75 return {
76 valid: false,
77 error: 'Credential sets require a Team or Enterprise plan. Please upgrade to continue.',
78 }
79 }
80
81 return { valid: true }
82}
83
84const WEBHOOK_BODY_LABEL = 'Webhook request body'
85

Callers 2

queueWebhookExecutionFunction · 0.85

Calls 2

eqFunction · 0.50

Tested by

no test coverage detected