import { FunctionContext, FunctionResponse, SduiPageFunctionEvent } 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: SduiPageFunctionEvent, context: FunctionContext, ): Promise { const action = event.parameters.action; if (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: '' }); }