Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@siyuan-community/kernelapilist

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@siyuan-community/kernelapilist

思源后端接口列表生成器,生成产物可以用于函数式调用思源后端api

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
2
Created
Source

功能

从思源的源代码仓库拉取代码,然后一通鼓捣生成一个api列表类

使用

如果你担心列表不够新的话,运行

npm run gen

会生成一个新的index.js

生成之后就可以用了,如果生成失败可能是node连不上GitHub,改host去吧

import kernelAPI from '@siyuan-community/kernelapilist' 
//返回一个初始化好的后端接口列表对象
kernelAPI.sql()

或者你自己配置思源的地址

import {kernelApiList} from '@siyuan-community/kernelapilist' 
let 核心api = new kernelApiList(
            思源伺服ip:window.location.hostname,
        思源伺服端口:'',
        思源伺服协议:"http",
		apitoken:""

)
await 核心api.重命名文档({
  "notebook": "20210831090520-7dvbdv0",
  "path": "/20210902210113-0avi12f.sy",
  "title": "文档新标题"
})

或者这样也行

import {kernelApiList} from '@siyuan-community/kernelapilist' 
let kernelApi = new kernelApiList(
        siYuanIp:window.location.hostname,
        siYuanPort:'',
        siYuanScheme:"http",
		apitoken:""

)
kernelApi.renameDoc(
    {
          "notebook": "20210831090520-7dvbdv0",
  "path": "/20210902210113-0avi12f.sy",
  "title": "文档新标题"
    },
    '',
    (data)=>{
        console.log(data)
    }

)

或者把index.js拿出去用也可以

如果这玩意对你有用

可以去我的爱发电给我买杯咖啡

Keywords

siyuan

FAQs

Package last updated on 17 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts