Skip to main content
Glama

mcp-google-sheets

license-keys-controller.ts1.65 kB
import { ActivepiecesError, ErrorCode, isNil, PrincipalType, VerifyLicenseKeyRequestBody } from '@activepieces/shared' import { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' import { Type } from '@sinclair/typebox' import { licenseKeysService } from './license-keys-service' export const licenseKeysController: FastifyPluginAsyncTypebox = async (app) => { app.get('/:licenseKey', GetLicenseKeyRequest, async (req) => { const licenseKey = await licenseKeysService(app.log).getKey(req.params.licenseKey) return licenseKey }) app.post('/verify', VerifyLicenseKeyRequest, async (req) => { const { platformId, licenseKey } = req.body const key = await licenseKeysService(app.log).verifyKeyOrReturnNull({ platformId, license: licenseKey, }) if (isNil(key)) { throw new ActivepiecesError({ code: ErrorCode.INVALID_LICENSE_KEY, params: { key: licenseKey, }, }) } await licenseKeysService(app.log).applyLimits(platformId, key) return key }) } const VerifyLicenseKeyRequest = { config: { allowedPrincipals: [ PrincipalType.UNKNOWN, PrincipalType.USER, ], }, schema: { body: VerifyLicenseKeyRequestBody, }, } const GetLicenseKeyRequest = { config: { allowedPrincipals: [ PrincipalType.UNKNOWN, PrincipalType.USER, ], }, schema: { params: Type.Object({ licenseKey: Type.String(), }), }, }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server