import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk'; import { ObjectListView, render } from '@rippling/pebble-sdui-web/catalogs/custom-apps'; const OBJECT = 'simple_todo__c'; export async function onRipplingEvent( event: FunctionEvent, context: FunctionContext, ): Promise { const action = event['parameters']?.action; if (!action || action === 'init') { const spec = render({ root: ObjectListView({ props: { objectApiName: OBJECT }, }), state: {}, }); return new FunctionResponse({ body: { spec: JSON.stringify(spec) }, statusCode: 200, headers: {}, message: '', }); } return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' }); }