import type { BentoClient } from '../client'; import type { DataResponse } from '../client/types'; import type { FormResponse } from './types'; export class BentoForms { private readonly _url = '/fetch/responses'; constructor(private readonly _client: BentoClient) {} /** * Returns all of the responses for the form with the specified identifier. * * @param formIdentifier string * @returns Promise\ */ public async getResponses(formIdentifier: string): Promise { const result = await this._client.get>(this._url, { id: formIdentifier, }); if (Object.keys(result).length === 0 || !result.data) return null; return result.data; } }