n8n-nodes-feishu-lite
Version:
63 lines • 2.19 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 WikiSpacesNodeMoveOperate = {
name: '移动知识空间节点',
value: 'wiki:spaces:node:move',
order: 90,
options: [
{
displayName: '源知识空间ID',
name: 'space_id',
type: 'string',
required: true,
default: '',
},
{
displayName: '需要迁移的节点Token',
name: 'node_token',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
{
displayName: '目标父节点Token',
name: 'target_parent_token',
type: 'string',
typeOptions: { password: true },
default: '',
description: '移动到的父节点token',
},
{
displayName: '目标知识空间ID',
name: 'target_space_id',
type: 'string',
default: '',
description: '移动到的知识空间ID',
},
],
async call(index) {
const spaceId = this.getNodeParameter('space_id', index);
const nodeToken = this.getNodeParameter('node_token', index);
const targetParentToken = this.getNodeParameter('target_parent_token', index);
const targetSpaceId = this.getNodeParameter('target_space_id', index);
const body = {};
if (targetParentToken) {
body.target_parent_token = targetParentToken;
}
if (targetSpaceId) {
body.target_space_id = targetSpaceId;
}
return RequestUtils_1.default.request.call(this, {
method: 'POST',
url: `/open-apis/wiki/v2/spaces/${spaceId}/nodes/${nodeToken}/move`,
body,
});
},
};
exports.default = WikiSpacesNodeMoveOperate;
//# sourceMappingURL=WikiSpacesNodeMoveOperate.js.map