You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
727 B
32 lines
727 B
|
|
|
|
/* global grist, self */
|
|
|
|
self.importScripts('/grist-plugin-api.js');
|
|
|
|
grist.rpc.registerImpl("testApiBrowser", {
|
|
getImportSource() {
|
|
const api = grist.rpc.getStub('GristDocAPI@grist', grist.checkers.GristDocAPI);
|
|
return api.getDocName()
|
|
.then((result) => {
|
|
const content = JSON.stringify({
|
|
tables: [{
|
|
table_name: '',
|
|
column_metadata: [{
|
|
id: 'getDocName',
|
|
type: 'Text'
|
|
}],
|
|
table_data: [[result]]
|
|
}]
|
|
});
|
|
const fileItem = {content, name: "GristDocAPI.jgrist"};
|
|
return {
|
|
item: { kind: "fileList", files: [fileItem] },
|
|
description: "GristDocAPI results"
|
|
};
|
|
});
|
|
}
|
|
});
|
|
|
|
grist.ready();
|