@luka-cat-mimi/n8n-nodes-feishu-project
Version:
飞书项目 N8N 集成插件,支持附件管理等功能
62 lines • 2.22 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const RequestUtils_1 = __importDefault(require("../../../help/utils/RequestUtils"));
const sharedOptions_1 = require("../../../help/utils/sharedOptions");
const SpaceListOperate = {
name: '获取空间列表',
value: 'space:list',
order: 10,
options: [
{
displayName: '排序方式',
name: 'order',
type: 'options',
options: [
{
name: '不排序',
value: '',
},
{
name: '按最近访问时间升序 (Last Visited)',
value: 'last_visited',
},
{
name: '按最近访问时间升序 (+Last Visited)',
value: '+last_visited',
},
{
name: '按最近访问时间降序 (-Last Visited)',
value: '-last_visited',
},
],
default: '',
description: '排序字段,格式为前缀+排序字段。+号表示升序;-表示降序;不加默认为升序。目前仅支持对 last_visited (最近访问时间)排序。',
},
sharedOptions_1.commonOptions,
],
async call(index) {
const orderValue = this.getNodeParameter('order', index);
const options = this.getNodeParameter('options', index, {});
const credentials = await this.getCredentials('feishuProjectApi');
const body = {
user_key: credentials.userId,
};
if (orderValue) {
body.order = [orderValue];
}
const response = await RequestUtils_1.default.request.call(this, {
method: 'POST',
url: `/open_api/projects`,
body: body,
timeout: options.timeout,
});
return {
data: response,
};
}
};
exports.default = SpaceListOperate;
//# sourceMappingURL=SpaceListOperate.js.map