MCPcopy Create free account
hub / github.com/apitable/apitable / syncCmd

Method syncCmd

packages/widget-sdk/src/message/event_message.ts:107–118  ·  view source on GitHub ↗
(cmdOptions: ICollaCommandOptions, widgetId: string)

Source from the content-addressed store, hash-verified

105 }
106
107 syncCmd(cmdOptions: ICollaCommandOptions, widgetId: string): Promise<ICollaCommandExecuteResult<any>> {
108 this.emit(MessageType.WIDGET_SYNC_COMMAND, cmdOptions);
109 return new Promise((resolve, reject) => {
110 this.on(MessageType.MAIN_SYNC_COMMAND_RESULT, interceptor((res: IResponse<ICollaCommandExecuteResult<any>>) => {
111 if (res.success && res.data) {
112 resolve(res.data);
113 return;
114 }
115 reject(res.message);
116 }), widgetId);
117 });
118 }
119
120 onSyncCmdOptions(widgetId: string, callback: (res: ICollaCommandOptions) => void) {
121 this.on(MessageType.WIDGET_SYNC_COMMAND, interceptor(callback), widgetId);

Callers 1

cmdExecuteFunction · 0.45

Calls 3

emitMethod · 0.95
onMethod · 0.95
interceptorFunction · 0.90

Tested by

no test coverage detected