MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / DataSourcePlugin

Function DataSourcePlugin

packages/plugin-datasource/src/index.ts:43–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43const DataSourcePlugin: PluginCreator<DataSourcePluginOptions> = options => {
44 return {
45 name: 'DataSourcePlugin',
46 deps: [],
47 init(ctx) {
48 const { config } = ctx
49
50 config.set('dataSourceEngine', {
51 createRuntime,
52 createInterpret,
53 createDataSourceEngine: (dataSource: InterpretDataSource, engine: IDataSourceRuntimeContext) => {
54 return createDataSourceEngine(dataSource, engine, options)
55 },
56 })
57 },
58 extend({ extend }) {
59 extend('Project', {
60 dataSource: {
61 get() {
62 return this.get('dataSource')
63 },
64 },
65 })
66 },
67 }
68}
69
70export default DataSourcePlugin

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected