mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-30 17:18:36 +08:00
Compare commits
41 Commits
2.3.3
...
da72846903
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da72846903 | ||
|
|
8e08c4325d | ||
|
|
ebb7a290e8 | ||
|
|
24e68fc798 | ||
|
|
78d2a29c8a | ||
|
|
1156bd3809 | ||
|
|
b46e24f1ed | ||
|
|
a950e2e301 | ||
|
|
aac7bc154a | ||
|
|
a573ef728d | ||
|
|
1344c14933 | ||
|
|
c1f4ecd14b | ||
|
|
5942876c92 | ||
|
|
3218eb9fba | ||
|
|
48566eca20 | ||
|
|
8bd8346423 | ||
|
|
00411e9599 | ||
|
|
296125f6b4 | ||
|
|
1b385ccd0a | ||
|
|
a90e4871bb | ||
|
|
885ccba027 | ||
|
|
f282dde1b7 | ||
|
|
bc166d8db1 | ||
|
|
7612637951 | ||
|
|
e8b1617916 | ||
|
|
fd29ed820e | ||
|
|
1f58670906 | ||
|
|
fc47d36e8d | ||
|
|
cd4e610c46 | ||
|
|
b05c248c44 | ||
|
|
800e218dee | ||
|
|
3b774552af | ||
| b8a02c49f1 | |||
|
|
046a67f22c | ||
| 426f05dfbd | |||
|
|
0addaa0d7f | ||
| 1d5792c966 | |||
|
|
193d3f6f87 | ||
| e9c2b4aada | |||
| b5ac42e6e3 | |||
| 60d002677b |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -21,3 +21,10 @@ data.json
|
|||||||
# Exclude macOS Finder (System Explorer) View States
|
# Exclude macOS Finder (System Explorer) View States
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.history
|
.history
|
||||||
|
|
||||||
|
# local data
|
||||||
|
local-data
|
||||||
|
|
||||||
|
# vitepress
|
||||||
|
doc/.vitepress/dist
|
||||||
|
doc/.vitepress/cache
|
||||||
|
|||||||
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,7 +1,6 @@
|
|||||||
## Fix
|
## Feature
|
||||||
|
|
||||||
- Fix a gif link in README.md
|
- Unify and combine the upload logic for three types of database.
|
||||||
|
- Better debugging information for upload failures.
|
||||||
## Features
|
- 统一和合并三种数据库的上传逻辑。
|
||||||
|
- 优化控制台输出的调试信息。
|
||||||
- Change the success notice colour to green
|
|
||||||
18
README-zh.md
18
README-zh.md
@@ -44,21 +44,21 @@ tags:
|
|||||||
|
|
||||||
- 这个版本开始,你可以**任意修改第一列表头的名字 (标题列,默认:'title')**。 (**注意:你必须保证你的Notion数据库中有'tags‘这一列的存在,并且在markdown文件中把`tags:`添加到你的YAML表头中。否则会返回`400 错误`。但是你可以`tags:`设置为空。**)
|
- 这个版本开始,你可以**任意修改第一列表头的名字 (标题列,默认:'title')**。 (**注意:你必须保证你的Notion数据库中有'tags‘这一列的存在,并且在markdown文件中把`tags:`添加到你的YAML表头中。否则会返回`400 错误`。但是你可以`tags:`设置为空。**)
|
||||||
|
|
||||||

|

|
||||||
例如这样:
|
例如这样:
|
||||||

|

|
||||||
- 增加了一个控制按钮来控制是否开启当前数据库同步命令的功能。如果你关闭了这个按钮,你在上传命令列表中就不会出现当前数据库的选项。
|
- 增加了一个控制按钮来控制是否开启当前数据库同步命令的功能。如果你关闭了这个按钮,你在上传命令列表中就不会出现当前数据库的选项。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 0.2.6
|
### 0.2.6
|
||||||
|
|
||||||
- 增加一个按钮用来控制是否在名列列表中显示如下数据库。
|
- 增加一个按钮用来控制是否在名列列表中显示如下数据库。
|
||||||
|
|
||||||

|

|
||||||
如果你关闭普通数据库的按钮,你在上传命令列表中就不会出现普通数据库的选项。如果你关闭NotionNext数据库的按钮,你在上传命令列表中就不会出现NotionNext数据库的选项。
|
如果你关闭普通数据库的按钮,你在上传命令列表中就不会出现普通数据库的选项。如果你关闭NotionNext数据库的按钮,你在上传命令列表中就不会出现NotionNext数据库的选项。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 0.2.3
|
### 0.2.3
|
||||||
|
|
||||||
@@ -70,9 +70,9 @@ tags:
|
|||||||
- 你可以有一个NotionNext和一个普通Notion数据库。
|
- 你可以有一个NotionNext和一个普通Notion数据库。
|
||||||
- 普通Notion数据库的同步方式和原作者的一样,只同步`title`和`tags`。**如果使用普通数据库功能,你需要保证你的数据库中有`title`和`tags`这两个表头。必须使用小写。**
|
- 普通Notion数据库的同步方式和原作者的一样,只同步`title`和`tags`。**如果使用普通数据库功能,你需要保证你的数据库中有`title`和`tags`这两个表头。必须使用小写。**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 0.2.1
|
### 0.2.1
|
||||||
|
|
||||||
@@ -181,10 +181,10 @@ Contents Below
|
|||||||
```
|
```
|
||||||
|
|
||||||
模板使用如下:
|
模板使用如下:
|
||||||

|

|
||||||
|
|
||||||
**插件预览如下**
|
**插件预览如下**
|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
65
README.md
65
README.md
@@ -9,27 +9,28 @@
|
|||||||
|
|
||||||
[//]: # ([中文文档](README-zh.md))
|
[//]: # ([中文文档](README-zh.md))
|
||||||
|
|
||||||
**Now, support both NotionNext and General databases with customised properties.**
|
**Now, support All Notion databases, including NotionNext and General Notion databases, and customise the database list.**
|
||||||
|
|
||||||
**现在支持NotionNext和普通Notion数据库,可自定义数据库列表。**
|
**现在支持所有Notion数据库,包括NotionNext和一般Notion数据库,以及自定义数据库列表。**
|
||||||
|
|
||||||
## Precautions
|
## Precautions
|
||||||
|
|
||||||
### For customised database users
|
### For customised database users before version 2.3.0
|
||||||
|
|
||||||
**⚠️⚠️⚠️: The existing customised database should be recreated if you want to update to version 2.3.0. The new version has a new database structure, and the old database structure is not compatible with the new version to build the index properly.**
|
**⚠️⚠️⚠️: The existing customised database should be recreated if you want to update to version 2.3.0. The new version has a new database structure, and the old database structure is not compatible with the new version to build the index properly.**
|
||||||
|
|
||||||
### 自定义数据库用户
|
### 在2.3.0版本之前的自定义数据库用户
|
||||||
|
|
||||||
**⚠️⚠️⚠️: 如果你想要更新到2.3.0版本,你需要重新创建自定义数据库。新版本有一个新的数据库结构,旧的数据库结构无法构建索引。**
|
**⚠️⚠️⚠️: 如果你想要更新到2.3.0版本,你需要重新创建自定义数据库。新版本有一个新的数据库结构,旧的数据库结构无法构建索引。**
|
||||||
|
|
||||||
## TODO List
|
## TODO List
|
||||||
|
|
||||||
- [x] ~~Modify the Edit function for the custom properties. 改进自定义属性的编辑功能~~
|
- [x] Modify the Edit function for the custom properties. 改进自定义属性的编辑功能
|
||||||
|
- [x] Support sync with long notes (From `v2.4.0`). 从`v2.4.0`开始支持长笔记同步
|
||||||
|
- [x] Support custom properties for Notion General database. 支持自定义属性
|
||||||
|
- [x] Support preview for database details in plugin settings. 支持预览数据库详情
|
||||||
|
- [x] Support edit for database details in plugin settings. 支持编辑数据库详情
|
||||||
- [ ] Support group upload with one click 支持一键多数据库上传
|
- [ ] Support group upload with one click 支持一键多数据库上传
|
||||||
- [x] ~~Support custom properties for Notion General database. 支持自定义属性~~
|
|
||||||
- [x] ~~Support preview for database details in plugin settings. 支持预览数据库详情~~
|
|
||||||
- [x] ~~Support edit for database details in plugin settings. 支持编辑数据库详情~~
|
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
@@ -39,38 +40,38 @@ If you want to use this plugin, you need to follow the following steps to set up
|
|||||||
|
|
||||||
1). Go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and **copy the token**.
|
1). Go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and **copy the token**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
2). Create a database in your Notion workspace.
|
2). Create a database in your Notion workspace.
|
||||||
|
|
||||||
Open Notion, click top-left `Create` a new page` -> You can give a title for the page and press "/" Select 'Database - Full page'.
|
Open Notion, click top-left `Create` a new page` -> You can give a title for the page and press "/" Select 'Database - Full page'.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Rename the database properties to `title` and `tags`.
|
Rename the database properties to `title` and `tags`.
|
||||||
**⚠️⚠️`title` is the title column! `tags` is lower case⚠️⚠️**
|
**⚠️⚠️`title` is the title column! `tags` is lower case⚠️⚠️**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3). Add the Notion API integration.
|
3). Add the Notion API integration.
|
||||||
|
|
||||||
Click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
Click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
4). Publish the database to the public.
|
4). Publish the database to the public.
|
||||||
Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the URL**.
|
Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the URL**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 2. Setting up the plugin in Obsidian
|
### 2. Setting up the plugin in Obsidian
|
||||||
|
|
||||||
1). Go to Obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
1). Go to Obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
||||||

|

|
||||||
|
|
||||||
2). Open the plugin settings and create a new database.
|
2). Open the plugin settings and create a new database.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 3. Create a database
|
### 3. Create a database
|
||||||
|
|
||||||
@@ -80,7 +81,7 @@ Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the U
|
|||||||
|
|
||||||
General database is the default database, which only has the `title` and `tags` columns. **⚠️⚠️`title` and `tags` are lowercase⚠️⚠️**
|
General database is the default database, which only has the `title` and `tags` columns. **⚠️⚠️`title` and `tags` are lowercase⚠️⚠️**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The general is as follows:
|
The general is as follows:
|
||||||
|
|
||||||
@@ -93,17 +94,17 @@ The general is as follows:
|
|||||||
|
|
||||||
After setting, it should look like this:
|
After setting, it should look like this:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Once you click `save`, the new database will be created in the plugin settings and display in the detabase list.
|
Once you click `save`, the new database will be created in the plugin settings and display in the detabase list.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 2️⃣ NotionNext database
|
#### 2️⃣ NotionNext database
|
||||||
|
|
||||||
If you use [NotionNext](https://github.com/tangly1024/NotionNext) to set up your website, you can use the NotionNext database. (**All the properties are in lowercase, and you do not need to change the properties**)
|
If you use [NotionNext](https://github.com/tangly1024/NotionNext) to set up your website, you can use the NotionNext database. (**All the properties are in lowercase, and you do not need to change the properties**)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Like the general database, you need to fill in the following information:
|
Like the general database, you need to fill in the following information:
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ Like the general database, you need to fill in the following information:
|
|||||||
|
|
||||||
The custom database is purely customised, and you can customise the properties you want to sync. (**All the properties are in lowercase, and you do not need to change the properties**)
|
The custom database is purely customised, and you can customise the properties you want to sync. (**All the properties are in lowercase, and you do not need to change the properties**)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The basic information is identical to the general database and NotionNext database. You need to fill in the following information:
|
The basic information is identical to the general database and NotionNext database. You need to fill in the following information:
|
||||||
|
|
||||||
@@ -127,15 +128,15 @@ The basic information is identical to the general database and NotionNext databa
|
|||||||
|
|
||||||
After adding the information, You can click `Add New Property` to add the properties you want to sync. There is no limit to the number of properties you can add.
|
After adding the information, You can click `Add New Property` to add the properties you want to sync. There is no limit to the number of properties you can add.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**⚠️⚠️⚠️**: **`Title column` is the main property in the Notion database, which has the open button to open the underlying page.** You can select the type of all other properties. **⚠️⚠️⚠️**
|
**⚠️⚠️⚠️**: **`Title column` is the main property in the Notion database, which has the open button to open the underlying page.** You can select the type of all other properties. **⚠️⚠️⚠️**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
According to the previously shown database, you can use `title` as the `Title column`, and `Tags` as the property 1.
|
According to the previously shown database, you can use `title` as the `Title column`, and `Tags` as the property 1.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**Until now, you have set up the plugin in Obsidian. You can start syncing your notes to Notion.**
|
**Until now, you have set up the plugin in Obsidian. You can start syncing your notes to Notion.**
|
||||||
|
|
||||||
@@ -159,7 +160,7 @@ This is a test file.
|
|||||||
|
|
||||||
After creating the note, you can click the `Share to NotionNext` button on the left sidebar to sync the note to Notion.
|
After creating the note, you can click the `Share to NotionNext` button on the left sidebar to sync the note to Notion.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 2️⃣ note for NotionNext database
|
#### 2️⃣ note for NotionNext database
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ NotionID-pengjiaxin: 8ba573de-8fdf-4681-b063-c39d26e7860e
|
|||||||
this is a test file
|
this is a test file
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 3️⃣ note for custom database
|
#### 3️⃣ note for custom database
|
||||||
|
|
||||||
@@ -195,7 +196,7 @@ this is a test file
|
|||||||
|
|
||||||
Use the previously created general database and rename `title` to `Name` and `tags` to `Tags` in Notion.
|
Use the previously created general database and rename `title` to `Name` and `tags` to `Tags` in Notion.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The front matter for the custom database is as follows:
|
The front matter for the custom database is as follows:
|
||||||
|
|
||||||
@@ -210,23 +211,23 @@ Tags:
|
|||||||
This is a test file.
|
This is a test file.
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
##### sync more properties
|
##### sync more properties
|
||||||
|
|
||||||
Add more property to the custom database. For example, we can add a `summary` and `date` property to the custom database.
|
Add more property to the custom database. For example, we can add a `summary` and `date` property to the custom database.
|
||||||
|
|
||||||
1). Click `Edit` in the plugin settings.
|
1). Click `Edit` in the plugin settings.
|
||||||

|

|
||||||
2). Click `Add` and add the `summary` and `date` property.
|
2). Click `Add` and add the `summary` and `date` property.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3). After adding the properties, you can see the properties in the plugin settings.
|
3). After adding the properties, you can see the properties in the plugin settings.
|
||||||

|

|
||||||
4). Add the `summary` and `date` in Notion
|
4). Add the `summary` and `date` in Notion
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
5). Create a new note with the `summary` and `date` property.
|
5). Create a new note with the `summary` and `date` property.
|
||||||
|
|
||||||
@@ -245,7 +246,7 @@ Add more property to the custom database. For example, we can add a `summary` an
|
|||||||
|
|
||||||
6). Sync the note to Notion.
|
6). Sync the note to Notion.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "share-to-notionnext",
|
"id": "share-to-notionnext",
|
||||||
"name": "Share to NotionNext",
|
"name": "Share to NotionNext",
|
||||||
"version": "2.3.3",
|
"version": "2.6.0",
|
||||||
"minAppVersion": "0.0.1",
|
"minAppVersion": "0.0.1",
|
||||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||||
"author": "EasyChris, jxpeng98",
|
"author": "EasyChris, jxpeng98",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "share-to-notionnext",
|
"name": "share-to-notionnext",
|
||||||
"version": "2.3.3",
|
"version": "2.6.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
"description": "Share files to any Notion database using the Notion API, originally created by EasyChris/obsidian-to-notion.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node esbuild.config.mjs",
|
"dev": "node esbuild.config.mjs",
|
||||||
@@ -19,14 +19,13 @@
|
|||||||
"@typescript-eslint/parser": "^6.16.0",
|
"@typescript-eslint/parser": "^6.16.0",
|
||||||
"builtin-modules": "^3.3.0",
|
"builtin-modules": "^3.3.0",
|
||||||
"esbuild": "0.19.5",
|
"esbuild": "0.19.5",
|
||||||
"obsidian": "latest",
|
"obsidian": "^1.6.6",
|
||||||
"tslib": "2.6.2",
|
"tslib": "2.6.2",
|
||||||
"typescript": "5.2.2"
|
"typescript": "5.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tryfabric/martian": "^1.2.4",
|
"@jxpeng98/martian": "^1.2.7",
|
||||||
"https-proxy-agent": "^7.0.2",
|
"https-proxy-agent": "^7.0.2",
|
||||||
"process": "^0.11.10",
|
|
||||||
"remark-math": "^6.0.0",
|
"remark-math": "^6.0.0",
|
||||||
"yaml": "^2.3.4",
|
"yaml": "^2.3.4",
|
||||||
"yaml-front-matter": "^4.1.1"
|
"yaml-front-matter": "^4.1.1"
|
||||||
|
|||||||
@@ -8,10 +8,42 @@ export const I18n: {[key: string]:any} = {
|
|||||||
ja,
|
ja,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const I18nConfig = (lang: string): any => {
|
class I18nManager {
|
||||||
return I18n[lang];
|
private currentLanguage: string;
|
||||||
};
|
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.currentLanguage = this.detectLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the language to use
|
||||||
|
private detectLanguage(): string {
|
||||||
const storedLanguage = window.localStorage.getItem("language");
|
const storedLanguage = window.localStorage.getItem("language");
|
||||||
|
if (storedLanguage && this.isLanguageSupported(storedLanguage)) {
|
||||||
|
console.log(`Using stored language: ${storedLanguage}`);
|
||||||
|
return storedLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
export const i18nConfig = I18n[storedLanguage || window.navigator.language.split('-')[0] || "en"];
|
const browserLanguage = window.navigator.language.split("-")[0];
|
||||||
|
if (this.isLanguageSupported(browserLanguage)) {
|
||||||
|
console.log(`Using browser language: ${browserLanguage}`);
|
||||||
|
return browserLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default to English if no match is found
|
||||||
|
console.log("Using default language: en");
|
||||||
|
return "en";
|
||||||
|
}
|
||||||
|
|
||||||
|
private isLanguageSupported(lang: string): boolean {
|
||||||
|
return Object.prototype.hasOwnProperty.call(I18n, lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the i18n configuration for the current language
|
||||||
|
public getConfig(): any {
|
||||||
|
return I18n[this.currentLanguage];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const i18nManager = new I18nManager();
|
||||||
|
|
||||||
|
export const i18nConfig = i18nManager.getConfig();
|
||||||
|
|||||||
@@ -76,4 +76,8 @@ export const en = {
|
|||||||
AddNewProperty: "Add New Property",
|
AddNewProperty: "Add New Property",
|
||||||
AddNewPropertyDesc: "Add new property match with your notion database",
|
AddNewPropertyDesc: "Add new property match with your notion database",
|
||||||
CopyErrorMessage: "Auto copy failed, please copy it manually",
|
CopyErrorMessage: "Auto copy failed, please copy it manually",
|
||||||
|
BlockUploaded: "All blocks uploaded",
|
||||||
|
ExtraBlockUploaded: "Extra blocks uploaded",
|
||||||
|
CheckConsole: "Check the console for more information \n opt+cmd+i/ctrl+shift+i",
|
||||||
|
"reach-mobile-limit": "The number of blocks exceeds the limit of 100, please use the desktop plugin",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,7 @@ export const ja = {
|
|||||||
AddNewProperty: "新しいプロパティを追加",
|
AddNewProperty: "新しいプロパティを追加",
|
||||||
AddNewPropertyDesc: "新しいプロパティを追加してください",
|
AddNewPropertyDesc: "新しいプロパティを追加してください",
|
||||||
CopyErrorMessage: "自動コピーに失敗しました",
|
CopyErrorMessage: "自動コピーに失敗しました",
|
||||||
|
BlockUploaded: "ブロックがアップロードされました",
|
||||||
|
ExtraBlockUploaded: "追加ブロックがアップロードされました",
|
||||||
|
CheckConsole: "詳細情報を確認するには、コンソールを開いてください \n opt+cmd+i/ctrl+shift+i",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -71,4 +71,7 @@ export const zh = {
|
|||||||
AddNewProperty: "添加新属性",
|
AddNewProperty: "添加新属性",
|
||||||
AddNewPropertyDesc: "添加一个和Notion数据库匹配的新属性",
|
AddNewPropertyDesc: "添加一个和Notion数据库匹配的新属性",
|
||||||
CopyErrorMessage: "复制链接失败,请手动复制",
|
CopyErrorMessage: "复制链接失败,请手动复制",
|
||||||
|
BlockUploaded: "所有内容已成功上传",
|
||||||
|
ExtraBlockUploaded: "额外内容已成功上传",
|
||||||
|
CheckConsole: "opt+cmd+i/ctrl+shift+i,\n打开控制台查看更多信息",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting } from "obsidian";
|
import { App, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting } from "obsidian";
|
||||||
import { addIcons } from 'src/ui/icon';
|
import { addIcons } from 'src/ui/icon';
|
||||||
import { Upload2NotionGeneral } from "src/upload/upload_general/Upload2NotionGeneral";
|
|
||||||
import { Upload2NotionNext } from "src/upload/upload_next/Upload2NotionNext";
|
|
||||||
import { i18nConfig } from "src/lang/I18n";
|
import { i18nConfig } from "src/lang/I18n";
|
||||||
import ribbonCommands from "src/commands/NotionCommands";
|
import ribbonCommands from "src/commands/NotionCommands";
|
||||||
import { ObsidianSettingTab, PluginSettings, DEFAULT_SETTINGS, DatabaseDetails } from "src/ui/settingTabs";
|
import { ObsidianSettingTab, PluginSettings, DEFAULT_SETTINGS, DatabaseDetails } from "src/ui/settingTabs";
|
||||||
@@ -20,7 +18,7 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
|||||||
|
|
||||||
addIcons();
|
addIcons();
|
||||||
// This creates an icon in the left ribbon.
|
// This creates an icon in the left ribbon.
|
||||||
const ribbonIconEl = this.addRibbonIcon(
|
this.addRibbonIcon(
|
||||||
"notion-logo",
|
"notion-logo",
|
||||||
i18nConfig.ribbonIcon,
|
i18nConfig.ribbonIcon,
|
||||||
async (evt: MouseEvent) => {
|
async (evt: MouseEvent) => {
|
||||||
@@ -86,4 +84,3 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
582
src/upload/Upload2Notion.ts
Normal file
582
src/upload/Upload2Notion.ts
Normal file
@@ -0,0 +1,582 @@
|
|||||||
|
import { App, TFile } from "obsidian";
|
||||||
|
import { markdownToBlocks } from "@jxpeng98/martian";
|
||||||
|
import * as yamlFrontMatter from "yaml-front-matter";
|
||||||
|
import { LIMITS, paragraph } from "@jxpeng98/martian/src/notion";
|
||||||
|
import MyPlugin from "src/main";
|
||||||
|
import { DatabaseDetails } from "../ui/settingTabs";
|
||||||
|
import { updateYamlInfo } from "./updateYaml";
|
||||||
|
import { UploadBase, NotionPageResponse } from "./common/UploadBase";
|
||||||
|
|
||||||
|
export type DatasetType = "general" | "next" | "custom";
|
||||||
|
|
||||||
|
interface BaseSyncRequest {
|
||||||
|
dataset: DatasetType;
|
||||||
|
markdown: string;
|
||||||
|
nowFile: TFile;
|
||||||
|
app: App;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GeneralSyncRequest extends BaseSyncRequest {
|
||||||
|
dataset: "general";
|
||||||
|
title: string;
|
||||||
|
cover: string;
|
||||||
|
tags: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NextSyncRequest extends BaseSyncRequest {
|
||||||
|
dataset: "next";
|
||||||
|
title: string;
|
||||||
|
emoji: string;
|
||||||
|
cover: string;
|
||||||
|
tags: string[];
|
||||||
|
type: string;
|
||||||
|
slug: string;
|
||||||
|
stats: string;
|
||||||
|
category: string;
|
||||||
|
summary: string;
|
||||||
|
password: string;
|
||||||
|
favicon: string;
|
||||||
|
datetime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CustomSyncRequest extends BaseSyncRequest {
|
||||||
|
dataset: "custom";
|
||||||
|
cover: string;
|
||||||
|
customValues: Record<string, string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SyncRequest =
|
||||||
|
| GeneralSyncRequest
|
||||||
|
| NextSyncRequest
|
||||||
|
| CustomSyncRequest;
|
||||||
|
|
||||||
|
interface GeneralParams {
|
||||||
|
title: string;
|
||||||
|
cover?: string;
|
||||||
|
tags: string[];
|
||||||
|
childArr: any[];
|
||||||
|
notionId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NextParams {
|
||||||
|
title: string;
|
||||||
|
emoji: string;
|
||||||
|
cover?: string;
|
||||||
|
tags: string[];
|
||||||
|
type: string;
|
||||||
|
slug: string;
|
||||||
|
stats: string;
|
||||||
|
category: string;
|
||||||
|
summary: string;
|
||||||
|
password: string;
|
||||||
|
favicon: string;
|
||||||
|
datetime: string;
|
||||||
|
childArr: any[];
|
||||||
|
notionId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CustomParams {
|
||||||
|
cover?: string;
|
||||||
|
customValues: Record<string, string>;
|
||||||
|
childArr: any[];
|
||||||
|
notionId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Upload2Notion extends UploadBase {
|
||||||
|
|
||||||
|
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
||||||
|
super(plugin, dbDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
async sync(request: SyncRequest): Promise<NotionPageResponse> {
|
||||||
|
console.log(`[Upload2Notion] Start sync`, {
|
||||||
|
dataset: request.dataset,
|
||||||
|
file: request.nowFile.path,
|
||||||
|
database: this.dbDetails.databaseID,
|
||||||
|
});
|
||||||
|
|
||||||
|
let response: NotionPageResponse;
|
||||||
|
|
||||||
|
switch (request.dataset) {
|
||||||
|
case "general":
|
||||||
|
response = await this.handleGeneral(request);
|
||||||
|
break;
|
||||||
|
case "next":
|
||||||
|
response = await this.handleNext(request);
|
||||||
|
break;
|
||||||
|
case "custom":
|
||||||
|
response = await this.handleCustom(request);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(`Unsupported dataset type: ${(request as any).dataset}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`[Upload2Notion] Notion response status`, response.response?.status);
|
||||||
|
|
||||||
|
if (response.response && response.response.status === 200) {
|
||||||
|
console.log(`[Upload2Notion] Sync success`, {
|
||||||
|
notionPageId: response.data?.id,
|
||||||
|
notionPageUrl: response.data?.url,
|
||||||
|
});
|
||||||
|
await updateYamlInfo(
|
||||||
|
request.markdown,
|
||||||
|
request.nowFile,
|
||||||
|
response.data,
|
||||||
|
request.app,
|
||||||
|
this.plugin,
|
||||||
|
this.dbDetails,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(`[Upload2Notion] Sync failed`, response.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async handleGeneral(request: GeneralSyncRequest): Promise<NotionPageResponse> {
|
||||||
|
console.log(`[Upload2Notion] Handling general dataset`, {
|
||||||
|
cover: request.cover,
|
||||||
|
tags: request.tags,
|
||||||
|
});
|
||||||
|
const blocks = this.buildBlocks(request.markdown, {
|
||||||
|
notionLimits: {truncate: false},
|
||||||
|
});
|
||||||
|
const notionId = this.getNotionId(request.app, request.nowFile);
|
||||||
|
|
||||||
|
return this.upsertGeneral({
|
||||||
|
title: request.title,
|
||||||
|
cover: request.cover,
|
||||||
|
tags: request.tags || [],
|
||||||
|
childArr: blocks,
|
||||||
|
notionId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async handleNext(request: NextSyncRequest): Promise<NotionPageResponse> {
|
||||||
|
console.log(`[Upload2Notion] Handling next dataset`, {
|
||||||
|
type: request.type,
|
||||||
|
slug: request.slug,
|
||||||
|
category: request.category,
|
||||||
|
});
|
||||||
|
const blocks = this.buildBlocks(request.markdown, {
|
||||||
|
notionLimits: {truncate: false},
|
||||||
|
});
|
||||||
|
this.splitRichTextParagraphs(blocks);
|
||||||
|
const notionId = this.getNotionId(request.app, request.nowFile);
|
||||||
|
|
||||||
|
return this.upsertNext({
|
||||||
|
title: request.title,
|
||||||
|
emoji: request.emoji,
|
||||||
|
cover: request.cover,
|
||||||
|
tags: request.tags || [],
|
||||||
|
type: request.type,
|
||||||
|
slug: request.slug,
|
||||||
|
stats: request.stats,
|
||||||
|
category: request.category,
|
||||||
|
summary: request.summary,
|
||||||
|
password: request.password,
|
||||||
|
favicon: request.favicon,
|
||||||
|
datetime: request.datetime,
|
||||||
|
childArr: blocks,
|
||||||
|
notionId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async handleCustom(request: CustomSyncRequest): Promise<NotionPageResponse> {
|
||||||
|
console.log(`[Upload2Notion] Handling custom dataset`, {
|
||||||
|
customKeys: Object.keys(request.customValues || {}),
|
||||||
|
});
|
||||||
|
const blocks = this.buildBlocks(request.markdown, {
|
||||||
|
strictImageUrls: true,
|
||||||
|
notionLimits: {truncate: false},
|
||||||
|
});
|
||||||
|
const notionId = this.getNotionId(request.app, request.nowFile);
|
||||||
|
|
||||||
|
return this.upsertCustom({
|
||||||
|
cover: request.cover,
|
||||||
|
customValues: request.customValues,
|
||||||
|
childArr: blocks,
|
||||||
|
notionId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildBlocks(markdown: string, options: Record<string, unknown>): any[] {
|
||||||
|
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||||
|
const content = yamlContent.__content;
|
||||||
|
return markdownToBlocks(content, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getNotionId(app: App, nowFile: TFile): string | undefined {
|
||||||
|
const frontMatter = app.metadataCache.getFileCache(nowFile)?.frontmatter;
|
||||||
|
if (!frontMatter) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const {abName} = this.dbDetails;
|
||||||
|
const notionIDKey = `NotionID-${abName}`;
|
||||||
|
const notionId = frontMatter[notionIDKey];
|
||||||
|
return notionId ? String(notionId) : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
private splitRichTextParagraphs(blocks: any[]): void {
|
||||||
|
blocks.forEach((block, index) => {
|
||||||
|
if (
|
||||||
|
block.type === "paragraph" &&
|
||||||
|
block.paragraph.rich_text.length > LIMITS.RICH_TEXT_ARRAYS
|
||||||
|
) {
|
||||||
|
console.log(`[Upload2Notion] Splitting rich text paragraph`, {
|
||||||
|
index,
|
||||||
|
length: block.paragraph.rich_text.length,
|
||||||
|
});
|
||||||
|
const paragraphChunks = this.chunkArray<any>(block.paragraph.rich_text, 100);
|
||||||
|
const newParagraphBlocks = paragraphChunks.map((chunk) => paragraph(chunk));
|
||||||
|
blocks.splice(index, 1, ...newParagraphBlocks);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private chunkArray<T>(items: T[], size: number): T[][] {
|
||||||
|
const result: T[][] = [];
|
||||||
|
for (let i = 0; i < items.length; i += size) {
|
||||||
|
result.push(items.slice(i, i + size));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async upsertGeneral(params: GeneralParams): Promise<NotionPageResponse> {
|
||||||
|
const {firstChunk, extraChunks} = this.prepareBlocks(params.childArr);
|
||||||
|
const cover = params.notionId
|
||||||
|
? await this.resolveCoverForUpdate(params.cover)
|
||||||
|
: params.cover;
|
||||||
|
|
||||||
|
if (params.notionId) {
|
||||||
|
await this.deletePage(params.notionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = this.buildGeneralBody({
|
||||||
|
title: params.title,
|
||||||
|
tags: params.tags,
|
||||||
|
firstChunk,
|
||||||
|
});
|
||||||
|
this.applyCover(body, cover);
|
||||||
|
console.log(body);
|
||||||
|
return this.submitPage(body, extraChunks);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async upsertNext(params: NextParams): Promise<NotionPageResponse> {
|
||||||
|
const {firstChunk, extraChunks} = this.prepareBlocks(params.childArr);
|
||||||
|
const cover = params.notionId
|
||||||
|
? await this.resolveCoverForUpdate(params.cover)
|
||||||
|
: params.cover;
|
||||||
|
|
||||||
|
if (params.notionId) {
|
||||||
|
await this.deletePage(params.notionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = this.buildNextBody({
|
||||||
|
firstChunk,
|
||||||
|
title: params.title,
|
||||||
|
emoji: params.emoji,
|
||||||
|
tags: params.tags,
|
||||||
|
type: params.type,
|
||||||
|
slug: params.slug,
|
||||||
|
stats: params.stats,
|
||||||
|
category: params.category,
|
||||||
|
summary: params.summary,
|
||||||
|
password: params.password,
|
||||||
|
favicon: params.favicon,
|
||||||
|
datetime: params.datetime,
|
||||||
|
});
|
||||||
|
this.applyCover(body, cover);
|
||||||
|
console.log(body);
|
||||||
|
return this.submitPage(body, extraChunks);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async upsertCustom(params: CustomParams): Promise<NotionPageResponse> {
|
||||||
|
const {firstChunk, extraChunks} = this.prepareBlocks(params.childArr);
|
||||||
|
const cover = params.notionId
|
||||||
|
? await this.resolveCoverForUpdate(params.cover)
|
||||||
|
: params.cover;
|
||||||
|
|
||||||
|
if (params.notionId) {
|
||||||
|
await this.deletePage(params.notionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = this.buildCustomBody({
|
||||||
|
customValues: params.customValues,
|
||||||
|
firstChunk,
|
||||||
|
});
|
||||||
|
this.applyCover(body, cover);
|
||||||
|
console.log(body);
|
||||||
|
return this.submitPage(body, extraChunks);
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildGeneralBody(params: {title: string; tags: string[]; firstChunk: any[]}): any {
|
||||||
|
const {
|
||||||
|
databaseID,
|
||||||
|
customTitleButton,
|
||||||
|
customTitleName,
|
||||||
|
tagButton,
|
||||||
|
} = this.dbDetails;
|
||||||
|
|
||||||
|
return {
|
||||||
|
parent: {
|
||||||
|
database_id: databaseID,
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
[customTitleButton ? customTitleName : "title"]: {
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: params.title,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
...(tagButton
|
||||||
|
? {
|
||||||
|
tags: {
|
||||||
|
multi_select:
|
||||||
|
params.tags && params.tags.length > 0
|
||||||
|
? params.tags.map((tag) => ({name: tag}))
|
||||||
|
: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
|
},
|
||||||
|
children: params.firstChunk,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildNextBody(params: {
|
||||||
|
firstChunk: any[];
|
||||||
|
title: string;
|
||||||
|
emoji: string;
|
||||||
|
tags: string[];
|
||||||
|
type: string;
|
||||||
|
slug: string;
|
||||||
|
stats: string;
|
||||||
|
category: string;
|
||||||
|
summary: string;
|
||||||
|
password: string;
|
||||||
|
favicon: string;
|
||||||
|
datetime: string;
|
||||||
|
}): any {
|
||||||
|
const {databaseID} = this.dbDetails;
|
||||||
|
|
||||||
|
const pageProperties: any = {
|
||||||
|
parent: {
|
||||||
|
database_id: databaseID,
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
title: {
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: params.title,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
select: {
|
||||||
|
name: params.type || "Post",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
select: {
|
||||||
|
name: params.stats || "Draft",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
category: {
|
||||||
|
select: {
|
||||||
|
name: params.category || "Obsidian",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
rich_text: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: params.password || "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
rich_text: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: params.favicon || "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
date: {
|
||||||
|
date: {
|
||||||
|
start: params.datetime || new Date().toISOString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
if (params.tags && params.tags.length > 0) {
|
||||||
|
pageProperties.properties.tags = {
|
||||||
|
multi_select: params.tags.map((tag) => ({name: tag})),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.emoji) {
|
||||||
|
pageProperties.icon = {
|
||||||
|
emoji: params.emoji,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.slug) {
|
||||||
|
pageProperties.properties.slug = {
|
||||||
|
rich_text: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: params.slug,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.summary) {
|
||||||
|
pageProperties.properties.summary = {
|
||||||
|
rich_text: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: params.summary,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...pageProperties,
|
||||||
|
children: params.firstChunk,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildCustomBody(params: {
|
||||||
|
customValues: Record<string, string>;
|
||||||
|
firstChunk: any[];
|
||||||
|
}): any {
|
||||||
|
const {customProperties, databaseID} = this.dbDetails;
|
||||||
|
const properties: { [key: string]: any } = {};
|
||||||
|
|
||||||
|
if (customProperties) {
|
||||||
|
customProperties.forEach(({customName, customType}) => {
|
||||||
|
if (params.customValues[customName] !== undefined) {
|
||||||
|
const propertyValue = this.buildCustomProperty(customName, customType, params.customValues);
|
||||||
|
if (propertyValue !== undefined) {
|
||||||
|
properties[customName] = propertyValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
parent: {
|
||||||
|
database_id: databaseID,
|
||||||
|
},
|
||||||
|
properties,
|
||||||
|
children: params.firstChunk,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private buildCustomProperty(customName: string, customType: string, customValues: Record<string, any>) {
|
||||||
|
const value = customValues[customName] || "";
|
||||||
|
|
||||||
|
switch (customType) {
|
||||||
|
case "title":
|
||||||
|
return {
|
||||||
|
title: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: value,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
case "rich_text":
|
||||||
|
return {
|
||||||
|
rich_text: [
|
||||||
|
{
|
||||||
|
text: {
|
||||||
|
content: value || "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
case "date":
|
||||||
|
return {
|
||||||
|
date: {
|
||||||
|
start: value || new Date().toISOString(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
case "number":
|
||||||
|
return {
|
||||||
|
number: Number(value),
|
||||||
|
};
|
||||||
|
case "phone_number":
|
||||||
|
return {
|
||||||
|
phone_number: value,
|
||||||
|
};
|
||||||
|
case "email":
|
||||||
|
return {
|
||||||
|
email: value,
|
||||||
|
};
|
||||||
|
case "url":
|
||||||
|
return {
|
||||||
|
url: value,
|
||||||
|
};
|
||||||
|
case "files":
|
||||||
|
return {
|
||||||
|
files: Array.isArray(value)
|
||||||
|
? value.map((url: string) => ({
|
||||||
|
name: url,
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url,
|
||||||
|
},
|
||||||
|
}))
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
name: value,
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url: value,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
case "checkbox":
|
||||||
|
return {
|
||||||
|
checkbox: Boolean(value) || false,
|
||||||
|
};
|
||||||
|
case "select":
|
||||||
|
return {
|
||||||
|
select: {
|
||||||
|
name: value,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
case "multi_select":
|
||||||
|
return {
|
||||||
|
multi_select: Array.isArray(value)
|
||||||
|
? value.map((item: string) => ({name: item}))
|
||||||
|
: [{name: value}],
|
||||||
|
};
|
||||||
|
case "relation":
|
||||||
|
return {
|
||||||
|
relation: Array.isArray(value)
|
||||||
|
? value.map((item: string) => ({id: item}))
|
||||||
|
: [{id: value}],
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
186
src/upload/common/UploadBase.ts
Normal file
186
src/upload/common/UploadBase.ts
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
import { Notice, requestUrl } from "obsidian";
|
||||||
|
import MyPlugin from "src/main";
|
||||||
|
import { DatabaseDetails } from "../../ui/settingTabs";
|
||||||
|
import { i18nConfig } from "../../lang/I18n";
|
||||||
|
|
||||||
|
export interface NotionPageResponse {
|
||||||
|
response: any;
|
||||||
|
data: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PreparedBlocks {
|
||||||
|
firstChunk: any[];
|
||||||
|
extraChunks: any[][];
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class UploadBase {
|
||||||
|
protected plugin: MyPlugin;
|
||||||
|
protected dbDetails: DatabaseDetails;
|
||||||
|
|
||||||
|
protected constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.dbDetails = dbDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
async deletePage(notionID: string) {
|
||||||
|
const {notionAPI} = this.dbDetails;
|
||||||
|
return requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: "Bearer " + notionAPI,
|
||||||
|
"Notion-Version": "2022-06-28",
|
||||||
|
},
|
||||||
|
body: "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected prepareBlocks(childArr: any[]): PreparedBlocks {
|
||||||
|
this.stripCodeAnnotations(childArr);
|
||||||
|
|
||||||
|
const childArrLength = childArr.length;
|
||||||
|
console.log(`Page includes ${childArrLength} blocks`);
|
||||||
|
|
||||||
|
if (childArrLength <= 100) {
|
||||||
|
return {
|
||||||
|
firstChunk: childArr,
|
||||||
|
extraChunks: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const extraChunks: any[][] = [];
|
||||||
|
for (let i = 100; i < childArr.length; i += 100) {
|
||||||
|
extraChunks.push(childArr.slice(i, i + 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
firstChunk: childArr.slice(0, 100),
|
||||||
|
extraChunks,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected applyCover(body: any, cover?: string) {
|
||||||
|
if (cover) {
|
||||||
|
body.cover = {
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url: cover,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} else if (!body.cover && this.plugin.settings.bannerUrl) {
|
||||||
|
body.cover = {
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url: this.plugin.settings.bannerUrl,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async resolveCoverForUpdate(cover?: string): Promise<string | undefined> {
|
||||||
|
if (cover) {
|
||||||
|
return cover;
|
||||||
|
}
|
||||||
|
const databaseCover = await this.fetchDatabaseCover();
|
||||||
|
return databaseCover ?? undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async submitPage(body: any, extraChunks: any[][]): Promise<NotionPageResponse> {
|
||||||
|
const {notionAPI} = this.dbDetails;
|
||||||
|
|
||||||
|
const response = await requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/pages`,
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: "Bearer " + notionAPI,
|
||||||
|
"Notion-Version": "2022-06-28",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
throw: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = await response.json;
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
new Notice(`Error ${data.status}: ${data.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||||
|
console.log(`Error message: \n ${data.message}`);
|
||||||
|
} else {
|
||||||
|
console.log(`Page created: ${data.url}`);
|
||||||
|
console.log(`Page ID: ${data.id}`);
|
||||||
|
if (extraChunks.length > 0) {
|
||||||
|
await this.appendExtraBlocks(data.id, extraChunks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {response, data};
|
||||||
|
}
|
||||||
|
|
||||||
|
private stripCodeAnnotations(childArr: any[]) {
|
||||||
|
childArr.forEach((block: any) => {
|
||||||
|
if (block.type === "code") {
|
||||||
|
block.code.rich_text.forEach((item: any) => {
|
||||||
|
if (item.type === "text" && item.annotations) {
|
||||||
|
delete item.annotations;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async appendExtraBlocks(pageId: string, extraChunks: any[][]) {
|
||||||
|
const {notionAPI} = this.dbDetails;
|
||||||
|
|
||||||
|
for (let i = 0; i < extraChunks.length; i++) {
|
||||||
|
const chunk = extraChunks[i];
|
||||||
|
const extraBlocks = {
|
||||||
|
children: chunk,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(extraBlocks);
|
||||||
|
|
||||||
|
const extraResponse = await requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/blocks/${pageId}/children`,
|
||||||
|
method: "PATCH",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: "Bearer " + notionAPI,
|
||||||
|
"Notion-Version": "2022-06-28",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(extraBlocks),
|
||||||
|
});
|
||||||
|
|
||||||
|
const extraData: any = await extraResponse.json;
|
||||||
|
|
||||||
|
if (extraResponse.status !== 200) {
|
||||||
|
new Notice(`Error ${extraData.status}: ${extraData.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||||
|
console.log(`Error message: \n ${extraData.message}`);
|
||||||
|
} else {
|
||||||
|
console.log(`${i18nConfig["ExtraBlockUploaded"]} to page: ${pageId}`);
|
||||||
|
if (i === extraChunks.length - 1) {
|
||||||
|
console.log(`${i18nConfig["BlockUploaded"]} to page: ${pageId}`);
|
||||||
|
new Notice(`${i18nConfig["BlockUploaded"]} page: ${pageId}`, 5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async fetchDatabaseCover(): Promise<string | null> {
|
||||||
|
const {notionAPI, databaseID} = this.dbDetails;
|
||||||
|
const response = await requestUrl({
|
||||||
|
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
Authorization: "Bearer " + notionAPI,
|
||||||
|
"Notion-Version": "2022-06-28",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.json.cover && response.json.cover.external) {
|
||||||
|
return response.json.cover.external.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ export async function getNowFileMarkdownContentCustom(
|
|||||||
.map(property => property.customName);
|
.map(property => property.customName);
|
||||||
|
|
||||||
// Extract custom values from the front matter based on the names
|
// Extract custom values from the front matter based on the names
|
||||||
|
// Only collect data 'Relation' should be handled separately in the function buildBodyString
|
||||||
customPropertyNames.forEach(propertyName => {
|
customPropertyNames.forEach(propertyName => {
|
||||||
if (FileCache.frontmatter && FileCache.frontmatter[propertyName] !== undefined) {
|
if (FileCache.frontmatter && FileCache.frontmatter[propertyName] !== undefined) {
|
||||||
customValues[propertyName] = FileCache.frontmatter[propertyName];
|
customValues[propertyName] = FileCache.frontmatter[propertyName];
|
||||||
@@ -31,11 +32,15 @@ export async function getNowFileMarkdownContentCustom(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Check if any of the customProperties has a customType of 'title'
|
// Check if any of the customProperties has a customType of 'title'
|
||||||
const titleProperty = dbDetails.customProperties.find(property => property.customType === 'title');
|
const titleProperty = dbDetails.customProperties
|
||||||
|
.find(property => property.customType === 'title');
|
||||||
|
|
||||||
// If a 'title' type property exists, use the file's basename as its value
|
// If a 'title' type property exists, use the file's basename as its value
|
||||||
if (titleProperty) {
|
if (titleProperty) {
|
||||||
customValues[titleProperty.customName] = nowFile.basename; // Use 'basename' for the file name without extension
|
customValues[titleProperty.customName] =
|
||||||
|
(FileCache.frontmatter && FileCache.frontmatter[titleProperty.customName]) ?
|
||||||
|
FileCache.frontmatter[titleProperty.customName] : // use the front matter value if it exists
|
||||||
|
nowFile.basename; // Use 'basename' for the file name without extension
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -11,7 +11,7 @@ export async function updateYamlInfo(
|
|||||||
plugin: ObsidianSyncNotionPlugin,
|
plugin: ObsidianSyncNotionPlugin,
|
||||||
dbDetails: DatabaseDetails,
|
dbDetails: DatabaseDetails,
|
||||||
) {
|
) {
|
||||||
let { url, id } = res.json
|
let { url, id } = res;
|
||||||
// replace www to notionID
|
// replace www to notionID
|
||||||
const { notionUser, NotionLinkDisplay } = plugin.settings;
|
const { notionUser, NotionLinkDisplay } = plugin.settings;
|
||||||
const { abName } = dbDetails
|
const { abName } = dbDetails
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import {i18nConfig} from "../lang/I18n";
|
import {i18nConfig} from "../lang/I18n";
|
||||||
import {App, Notice} from "obsidian";
|
import {App, Notice} from "obsidian";
|
||||||
import { Upload2NotionNext } from "./upload_next/Upload2NotionNext";
|
import {Upload2Notion} from "./Upload2Notion";
|
||||||
import { Upload2NotionGeneral } from "./upload_general/Upload2NotionGeneral";
|
|
||||||
import { Upload2NotionCustom } from "./upoload_custom/Upload2NotionCustom";
|
|
||||||
import {DatabaseDetails, PluginSettings} from "../ui/settingTabs";
|
import {DatabaseDetails, PluginSettings} from "../ui/settingTabs";
|
||||||
import ObsidianSyncNotionPlugin from "../main";
|
import ObsidianSyncNotionPlugin from "../main";
|
||||||
import { getNowFileMarkdownContentNext } from "./upload_next/getMarkdownNext";
|
import {getNowFileMarkdownContentNext} from "./common/getMarkdownNext";
|
||||||
import { getNowFileMarkdownContentGeneral } from "./upload_general/getMarkdownGeneral";
|
import {getNowFileMarkdownContentGeneral} from "./common/getMarkdownGeneral";
|
||||||
import { getNowFileMarkdownContentCustom } from "./upoload_custom/getMarkdownCustom";
|
import {getNowFileMarkdownContentCustom} from "./common/getMarkdownCustom";
|
||||||
|
|
||||||
export async function uploadCommandNext(
|
export async function uploadCommandNext(
|
||||||
plugin: ObsidianSyncNotionPlugin,
|
plugin: ObsidianSyncNotionPlugin,
|
||||||
@@ -17,6 +15,7 @@ export async function uploadCommandNext(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
const {notionAPI, databaseID} = dbDetails;
|
const {notionAPI, databaseID} = dbDetails;
|
||||||
|
console.log(`[uploadCommandNext] ${new Date().toISOString()} Triggered for file`, app.workspace.getActiveFile()?.path);
|
||||||
|
|
||||||
// Check if the user has set up the Notion API and database ID
|
// Check if the user has set up the Notion API and database ID
|
||||||
if (notionAPI === "" || databaseID === "") {
|
if (notionAPI === "" || databaseID === "") {
|
||||||
@@ -43,13 +42,34 @@ export async function uploadCommandNext(
|
|||||||
|
|
||||||
if (markDownData) {
|
if (markDownData) {
|
||||||
const {basename} = nowFile;
|
const {basename} = nowFile;
|
||||||
const upload = new Upload2NotionNext(plugin, dbDetails);
|
|
||||||
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
|
||||||
|
|
||||||
if (res.status === 200) {
|
const upload = new Upload2Notion(plugin, dbDetails);
|
||||||
|
const res = await upload.sync({
|
||||||
|
dataset: "next",
|
||||||
|
title: basename,
|
||||||
|
emoji: emoji || "",
|
||||||
|
cover: cover || "",
|
||||||
|
tags: tags || [],
|
||||||
|
type: type || "",
|
||||||
|
slug: slug || "",
|
||||||
|
stats: stats || "",
|
||||||
|
category: category || "",
|
||||||
|
summary: summary || "",
|
||||||
|
password: paword || "",
|
||||||
|
favicon: favicon || "",
|
||||||
|
datetime: datetime || "",
|
||||||
|
markdown: markDownData,
|
||||||
|
nowFile,
|
||||||
|
app,
|
||||||
|
});
|
||||||
|
|
||||||
|
const {response} = res;
|
||||||
|
if (response.status === 200) {
|
||||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||||
|
console.log(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`);
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
||||||
|
console.log(`${i18nConfig["sync-fail"]} ${basename}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -64,6 +84,7 @@ export async function uploadCommandGeneral(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
const {notionAPI, databaseID} = dbDetails;
|
const {notionAPI, databaseID} = dbDetails;
|
||||||
|
console.log(`[uploadCommandGeneral] ${new Date().toISOString()} Triggered for file`, app.workspace.getActiveFile()?.path);
|
||||||
|
|
||||||
// Check if the user has set up the Notion API and database ID
|
// Check if the user has set up the Notion API and database ID
|
||||||
if (notionAPI === "" || databaseID === "") {
|
if (notionAPI === "" || databaseID === "") {
|
||||||
@@ -74,16 +95,30 @@ export async function uploadCommandGeneral(
|
|||||||
|
|
||||||
const {markDownData, nowFile, cover, tags} = await getNowFileMarkdownContentGeneral(app, settings)
|
const {markDownData, nowFile, cover, tags} = await getNowFileMarkdownContentGeneral(app, settings)
|
||||||
|
|
||||||
|
new Notice(`Start upload ${nowFile.basename}`);
|
||||||
|
console.log(`Start upload ${nowFile.basename}`);
|
||||||
|
|
||||||
if (markDownData) {
|
if (markDownData) {
|
||||||
const {basename} = nowFile;
|
const {basename} = nowFile;
|
||||||
|
|
||||||
const upload = new Upload2NotionGeneral(plugin, dbDetails);
|
const upload = new Upload2Notion(plugin, dbDetails);
|
||||||
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
const res = await upload.sync({
|
||||||
|
dataset: "general",
|
||||||
|
title: basename,
|
||||||
|
cover: cover || "",
|
||||||
|
tags: tags || [],
|
||||||
|
markdown: markDownData,
|
||||||
|
nowFile,
|
||||||
|
app,
|
||||||
|
});
|
||||||
|
|
||||||
if (res.status === 200) {
|
const {response} = res;
|
||||||
new Notice(`${i18nConfig["sync-success"]}${basename}`).noticeEl.style.color = "green";
|
if (response.status === 200) {
|
||||||
|
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||||
|
console.log(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`);
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
||||||
|
console.log(`${i18nConfig["sync-fail"]} ${basename}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -97,7 +132,8 @@ export async function uploadCommandCustom(
|
|||||||
app: App,
|
app: App,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
const { notionAPI, databaseID } = settings;
|
const {notionAPI, databaseID} = dbDetails;
|
||||||
|
console.log(`[uploadCommandCustom] ${new Date().toISOString()} Triggered for file`, app.workspace.getActiveFile()?.path);
|
||||||
|
|
||||||
// Check if the user has set up the Notion API and database ID
|
// Check if the user has set up the Notion API and database ID
|
||||||
if (notionAPI === "" || databaseID === "") {
|
if (notionAPI === "" || databaseID === "") {
|
||||||
@@ -108,16 +144,30 @@ export async function uploadCommandCustom(
|
|||||||
|
|
||||||
const {markDownData, nowFile, cover, customValues} = await getNowFileMarkdownContentCustom(app, dbDetails)
|
const {markDownData, nowFile, cover, customValues} = await getNowFileMarkdownContentCustom(app, dbDetails)
|
||||||
|
|
||||||
|
new Notice(`Start upload ${nowFile.basename}`);
|
||||||
|
console.log(`Start upload ${nowFile.basename}`);
|
||||||
|
|
||||||
if (markDownData) {
|
if (markDownData) {
|
||||||
const {basename} = nowFile;
|
const {basename} = nowFile;
|
||||||
|
|
||||||
const upload = new Upload2NotionCustom(plugin, dbDetails);
|
const upload = new Upload2Notion(plugin, dbDetails);
|
||||||
const res = await upload.syncMarkdownToNotionCustom(cover, customValues, markDownData, nowFile, this.app);
|
const res = await upload.sync({
|
||||||
|
dataset: "custom",
|
||||||
|
cover: cover || "",
|
||||||
|
customValues,
|
||||||
|
markdown: markDownData,
|
||||||
|
nowFile,
|
||||||
|
app,
|
||||||
|
});
|
||||||
|
|
||||||
if (res.status === 200) {
|
const {response} = res;
|
||||||
new Notice(`${i18nConfig["sync-success"]}${basename}`).noticeEl.style.color = "green";
|
|
||||||
|
if (response.status === 200) {
|
||||||
|
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||||
|
console.log(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`);
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
||||||
|
console.log(`${i18nConfig["sync-fail"]} ${basename}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from '@notionhq/client';
|
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
|
||||||
|
|
||||||
export class UploadBaseGeneral {
|
|
||||||
plugin: MyPlugin;
|
|
||||||
notion: Client;
|
|
||||||
agent: any;
|
|
||||||
dbDetails: DatabaseDetails
|
|
||||||
|
|
||||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.dbDetails = dbDetails
|
|
||||||
}
|
|
||||||
|
|
||||||
async deletePage(notionID: string) {
|
|
||||||
|
|
||||||
const { notionAPI } = this.dbDetails
|
|
||||||
return requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
},
|
|
||||||
body: ''
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async getDataBase(databaseID: string) {
|
|
||||||
const { notionAPI } = this.dbDetails
|
|
||||||
const response = await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check if cover is present in the JSON response and then get the URL
|
|
||||||
if (response.json.cover && response.json.cover.external) {
|
|
||||||
return response.json.cover.external.url;
|
|
||||||
} else {
|
|
||||||
return null; // or some other default value, if you prefer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// async updateYamlInfo(yamlContent: string, nowFile: TFile, res: any, app: App, settings: any) {
|
|
||||||
// let {url, id} = res.json
|
|
||||||
// // replace www to notionID
|
|
||||||
// const {notionUser} = this.plugin.settings;
|
|
||||||
//
|
|
||||||
// if (notionUser !== "") {
|
|
||||||
// // replace url str "www" to notionID
|
|
||||||
// url = url.replace("www.notion.so", `${notionUser}.notion.site`)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
|
||||||
// if (yamlContent['notionID']) {
|
|
||||||
// delete yamlContent['notionID']
|
|
||||||
// }
|
|
||||||
// if (yamlContent['link']) {
|
|
||||||
// delete yamlContent['link']
|
|
||||||
// }
|
|
||||||
// // add new notionID and link
|
|
||||||
// yamlContent.notionID = id;
|
|
||||||
// yamlContent.link = url;
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
// await navigator.clipboard.writeText(url)
|
|
||||||
// } catch (error) {
|
|
||||||
// new Notice(`复制链接失败,请手动复制${error}`)
|
|
||||||
// }
|
|
||||||
// // const __content = yamlContent.__content;
|
|
||||||
// // delete yamlContent.__content
|
|
||||||
// // const yamlhead = yaml.stringify(yamlContent)
|
|
||||||
// // // if yamlhead hava last \n remove it
|
|
||||||
// // const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
|
||||||
// // // if __content have start \n remove it
|
|
||||||
// // const __content_remove_n = __content.replace(/^\n/, '')
|
|
||||||
// // const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
|
||||||
// // try {
|
|
||||||
// // await nowFile.vault.modify(nowFile, content)
|
|
||||||
// // } catch (error) {
|
|
||||||
// // new Notice(`write file error ${error}`)
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from "@notionhq/client";
|
|
||||||
import { markdownToBlocks } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
import { DatabaseDetails, PluginSettings } from "../../ui/settingTabs";
|
|
||||||
import { UploadBaseGeneral } from "./BaseUpload2NotionGeneral";
|
|
||||||
import { updateYamlInfo } from "../updateYaml";
|
|
||||||
|
|
||||||
export class Upload2NotionGeneral extends UploadBaseGeneral {
|
|
||||||
settings: PluginSettings;
|
|
||||||
dbDetails: DatabaseDetails;
|
|
||||||
|
|
||||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
|
||||||
super(plugin, dbDetails);
|
|
||||||
this.dbDetails = dbDetails;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 因为需要解析notion的block进行对比,非常的麻烦,
|
|
||||||
// 暂时就直接删除,新建一个page
|
|
||||||
async updatePage(
|
|
||||||
notionID: string,
|
|
||||||
title: string,
|
|
||||||
cover: string,
|
|
||||||
tags: string[],
|
|
||||||
childArr: any,
|
|
||||||
) {
|
|
||||||
await this.deletePage(notionID);
|
|
||||||
|
|
||||||
const { databaseID } = this.dbDetails;
|
|
||||||
|
|
||||||
const databaseCover = await this.getDataBase(
|
|
||||||
databaseID,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (cover == null) {
|
|
||||||
cover = databaseCover;
|
|
||||||
}
|
|
||||||
|
|
||||||
return await this.createPage(title, cover, tags, childArr);
|
|
||||||
}
|
|
||||||
|
|
||||||
async createPage(
|
|
||||||
title: string,
|
|
||||||
cover: string,
|
|
||||||
tags: string[],
|
|
||||||
childArr: any,
|
|
||||||
) {
|
|
||||||
|
|
||||||
const {
|
|
||||||
databaseID,
|
|
||||||
customTitleButton,
|
|
||||||
customTitleName,
|
|
||||||
tagButton,
|
|
||||||
notionAPI
|
|
||||||
} = this.dbDetails;
|
|
||||||
|
|
||||||
const bodyString: any = {
|
|
||||||
parent: {
|
|
||||||
database_id: databaseID,
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
[customTitleButton
|
|
||||||
? customTitleName
|
|
||||||
: "title"]: {
|
|
||||||
title: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: title,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
...(tagButton
|
|
||||||
? {
|
|
||||||
tags: {
|
|
||||||
multi_select: tags && true ? tags.map((tag) => ({ name: tag })) : [],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: {}),
|
|
||||||
},
|
|
||||||
children: childArr,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (cover) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: cover,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bodyString.cover && this.plugin.settings.bannerUrl) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: this.plugin.settings.bannerUrl,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
return await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/pages`,
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
// 'User-Agent': 'obsidian.md',
|
|
||||||
Authorization:
|
|
||||||
"Bearer " + notionAPI,
|
|
||||||
"Notion-Version": "2022-06-28",
|
|
||||||
},
|
|
||||||
body: JSON.stringify(bodyString),
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
new Notice(`network error ${error}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async syncMarkdownToNotionGeneral(
|
|
||||||
title: string,
|
|
||||||
cover: string,
|
|
||||||
tags: string[],
|
|
||||||
markdown: string,
|
|
||||||
nowFile: TFile,
|
|
||||||
app: App,
|
|
||||||
): Promise<any> {
|
|
||||||
const options = {
|
|
||||||
notionLimits: {
|
|
||||||
truncate: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let res: any;
|
|
||||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
|
||||||
const __content = yamlContent.__content;
|
|
||||||
const file2Block = markdownToBlocks(__content, options);
|
|
||||||
const frontmasster =
|
|
||||||
app.metadataCache.getFileCache(nowFile)?.frontmatter;
|
|
||||||
const { abName } = this.dbDetails
|
|
||||||
const notionIDKey = `NotionID-${abName}`;
|
|
||||||
const notionID = frontmasster ? frontmasster[notionIDKey] : null;
|
|
||||||
|
|
||||||
|
|
||||||
if (notionID) {
|
|
||||||
res = await this.updatePage(
|
|
||||||
notionID,
|
|
||||||
title,
|
|
||||||
cover,
|
|
||||||
tags,
|
|
||||||
file2Block,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
res = await this.createPage(title, cover, tags, file2Block);
|
|
||||||
}
|
|
||||||
if (res.status === 200) {
|
|
||||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
|
||||||
} else {
|
|
||||||
new Notice(`${res.text}`);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from '@notionhq/client';
|
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
|
||||||
|
|
||||||
export class UploadBaseNext {
|
|
||||||
plugin: MyPlugin;
|
|
||||||
notion: Client;
|
|
||||||
agent: any;
|
|
||||||
dbDetails: DatabaseDetails
|
|
||||||
|
|
||||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.dbDetails = dbDetails
|
|
||||||
}
|
|
||||||
|
|
||||||
async deletePage(notionID: string) {
|
|
||||||
const { notionAPI } = this.dbDetails
|
|
||||||
return requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
},
|
|
||||||
body: ''
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async getDataBase(databaseID: string) {
|
|
||||||
const { notionAPI } = this.dbDetails
|
|
||||||
|
|
||||||
const response = await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check if cover is present in the JSON response and then get the URL
|
|
||||||
if (response.json.cover && response.json.cover.external) {
|
|
||||||
return response.json.cover.external.url;
|
|
||||||
} else {
|
|
||||||
return null; // or some other default value, if you prefer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// async updateYamlInfo(yamlContent: string, nowFile: TFile, res: any, app: App, settings: any) {
|
|
||||||
// let {url, id} = res.json
|
|
||||||
// // replace www to notionID
|
|
||||||
// const { notionUser} = this.plugin.settings;
|
|
||||||
//
|
|
||||||
// if (notionUser !== "") {
|
|
||||||
// // replace url str "www" to notionID
|
|
||||||
// url = url.replace("www.notion.so", `${notionUser}.notion.site`)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
|
||||||
// if (yamlContent['notionID']) {
|
|
||||||
// delete yamlContent['notionID']
|
|
||||||
// }
|
|
||||||
// if (yamlContent['link']) {
|
|
||||||
// delete yamlContent['link']
|
|
||||||
// }
|
|
||||||
// // add new notionID and link
|
|
||||||
// yamlContent.notionID = id;
|
|
||||||
// yamlContent.link = url;
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
// await navigator.clipboard.writeText(url)
|
|
||||||
// } catch (error) {
|
|
||||||
// new Notice(`复制链接失败,请手动复制${error}`)
|
|
||||||
// }
|
|
||||||
// // const __content = yamlContent.__content;
|
|
||||||
// // delete yamlContent.__content
|
|
||||||
// // const yamlhead = yaml.stringify(yamlContent)
|
|
||||||
// // // if yamlhead hava last \n remove it
|
|
||||||
// // const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
|
||||||
// // // if __content have start \n remove it
|
|
||||||
// // const __content_remove_n = __content.replace(/^\n/, '')
|
|
||||||
// // const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
|
||||||
// // try {
|
|
||||||
// // await nowFile.vault.modify(nowFile, content)
|
|
||||||
// // } catch (error) {
|
|
||||||
// // new Notice(`write file error ${error}`)
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@@ -1,320 +0,0 @@
|
|||||||
import { UploadBaseNext } from "./BaseUpload2NotionNext";
|
|
||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from '@notionhq/client';
|
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
import { DatabaseDetails, PluginSettings } from "../../ui/settingTabs";
|
|
||||||
import { updateYamlInfo } from "../updateYaml";
|
|
||||||
import { LIMITS, paragraph } from "@tryfabric/martian/src/notion";
|
|
||||||
|
|
||||||
export class Upload2NotionNext extends UploadBaseNext {
|
|
||||||
settings: PluginSettings;
|
|
||||||
dbDetails: DatabaseDetails
|
|
||||||
|
|
||||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
|
||||||
super(plugin, dbDetails);
|
|
||||||
this.dbDetails = dbDetails
|
|
||||||
}
|
|
||||||
|
|
||||||
// 因为需要解析notion的block进行对比,非常的麻烦,
|
|
||||||
// 暂时就直接删除,新建一个page
|
|
||||||
async updatePage(
|
|
||||||
notionID: string,
|
|
||||||
title: string,
|
|
||||||
emoji: string,
|
|
||||||
cover: string,
|
|
||||||
tags: string[],
|
|
||||||
type: string,
|
|
||||||
slug: string,
|
|
||||||
stats: string,
|
|
||||||
category: string,
|
|
||||||
summary: string,
|
|
||||||
paword: string,
|
|
||||||
favicon: string,
|
|
||||||
datetime: string,
|
|
||||||
childArr: any
|
|
||||||
) {
|
|
||||||
await this.deletePage(notionID)
|
|
||||||
|
|
||||||
const { databaseID } = this.dbDetails
|
|
||||||
|
|
||||||
const databaseCover = await this.getDataBase(databaseID)
|
|
||||||
|
|
||||||
if (cover == null) {
|
|
||||||
cover = databaseCover
|
|
||||||
}
|
|
||||||
|
|
||||||
return await this.createPage(
|
|
||||||
title,
|
|
||||||
emoji,
|
|
||||||
cover,
|
|
||||||
tags,
|
|
||||||
type,
|
|
||||||
slug,
|
|
||||||
stats,
|
|
||||||
category,
|
|
||||||
summary,
|
|
||||||
paword,
|
|
||||||
favicon,
|
|
||||||
datetime,
|
|
||||||
childArr)
|
|
||||||
}
|
|
||||||
|
|
||||||
async createPage(
|
|
||||||
title: string,
|
|
||||||
emoji: string,
|
|
||||||
cover: string,
|
|
||||||
tags: string[],
|
|
||||||
type: string,
|
|
||||||
slug: string,
|
|
||||||
stats: string,
|
|
||||||
category: string,
|
|
||||||
summary: string,
|
|
||||||
pawrod: string,
|
|
||||||
favicon: string,
|
|
||||||
datetime: string,
|
|
||||||
childArr: any
|
|
||||||
) {
|
|
||||||
|
|
||||||
const {
|
|
||||||
databaseID,
|
|
||||||
notionAPI
|
|
||||||
} = this.dbDetails
|
|
||||||
|
|
||||||
|
|
||||||
const bodyString: any = {
|
|
||||||
parent: {
|
|
||||||
database_id: databaseID,
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
title: {
|
|
||||||
title: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: title
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
select: {
|
|
||||||
name: type || 'Post'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
select: {
|
|
||||||
name: stats || 'Draft'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
category: {
|
|
||||||
select: {
|
|
||||||
name: category || 'Obsidian'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
password: {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: pawrod || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
icon: {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: favicon || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
date: {
|
|
||||||
date: {
|
|
||||||
start: datetime || new Date().toISOString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
children: childArr,
|
|
||||||
}
|
|
||||||
|
|
||||||
// add tags
|
|
||||||
if (tags) {
|
|
||||||
bodyString.properties.tags = {
|
|
||||||
multi_select: tags.map(tag => {
|
|
||||||
return { "name": tag }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add title icon
|
|
||||||
if (emoji) {
|
|
||||||
bodyString.icon = {
|
|
||||||
emoji: emoji
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add slug
|
|
||||||
if (slug) {
|
|
||||||
bodyString.properties.slug = {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: slug
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if summary is available
|
|
||||||
if (summary) {
|
|
||||||
bodyString.properties.summary = {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: summary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (cover) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: cover
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bodyString.cover && this.plugin.settings.bannerUrl) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: this.plugin.settings.bannerUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
return await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/pages`,
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
// 'User-Agent': 'obsidian.md',
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(bodyString),
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
new Notice(`network error ${error}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async syncMarkdownToNotionNext(
|
|
||||||
title: string,
|
|
||||||
emoji: string,
|
|
||||||
cover: string,
|
|
||||||
tags: string[],
|
|
||||||
type: string,
|
|
||||||
slug: string,
|
|
||||||
stats: string,
|
|
||||||
category: string,
|
|
||||||
summary: string,
|
|
||||||
paword: string,
|
|
||||||
favicon: string,
|
|
||||||
datetime: string,
|
|
||||||
markdown: string,
|
|
||||||
nowFile: TFile,
|
|
||||||
app: App,
|
|
||||||
): Promise<any> {
|
|
||||||
const options = {
|
|
||||||
notionLimits: {
|
|
||||||
truncate: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let res: any
|
|
||||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
|
||||||
const __content = yamlContent.__content
|
|
||||||
const file2Block = markdownToBlocks(__content, options);
|
|
||||||
const frontmasster = app.metadataCache.getFileCache(nowFile)?.frontmatter
|
|
||||||
const { abName } = this.dbDetails
|
|
||||||
const notionIDKey = `NotionID-${abName}`;
|
|
||||||
const notionID = frontmasster ? frontmasster[notionIDKey] : null;
|
|
||||||
|
|
||||||
|
|
||||||
// increase the limits
|
|
||||||
// Motivated by https://github.com/tryfabric/martian/issues/51
|
|
||||||
file2Block.forEach((block, index) => {
|
|
||||||
if (
|
|
||||||
block.type === 'paragraph' &&
|
|
||||||
block.paragraph.rich_text.length > LIMITS.RICH_TEXT_ARRAYS
|
|
||||||
) {
|
|
||||||
|
|
||||||
const newParagraphBlocks: any[] = []
|
|
||||||
const chunk: any = []
|
|
||||||
const richTextChunks = chunk(block.paragraph.rich_text, 100)
|
|
||||||
|
|
||||||
richTextChunks.forEach((chunk: any) => {
|
|
||||||
newParagraphBlocks.push(paragraph(chunk))
|
|
||||||
})
|
|
||||||
|
|
||||||
file2Block.splice(index, 1, ...newParagraphBlocks)
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (notionID) {
|
|
||||||
res = await this.updatePage(
|
|
||||||
notionID,
|
|
||||||
title,
|
|
||||||
emoji,
|
|
||||||
cover,
|
|
||||||
tags,
|
|
||||||
type,
|
|
||||||
slug,
|
|
||||||
stats,
|
|
||||||
category,
|
|
||||||
summary,
|
|
||||||
paword,
|
|
||||||
favicon,
|
|
||||||
datetime,
|
|
||||||
file2Block
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
res = await this.createPage(
|
|
||||||
title,
|
|
||||||
emoji,
|
|
||||||
cover,
|
|
||||||
tags,
|
|
||||||
type,
|
|
||||||
slug,
|
|
||||||
stats,
|
|
||||||
category,
|
|
||||||
summary,
|
|
||||||
paword,
|
|
||||||
favicon,
|
|
||||||
datetime,
|
|
||||||
file2Block
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.status === 200) {
|
|
||||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails)
|
|
||||||
} else {
|
|
||||||
new Notice(`${res.text}`)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { Client } from '@notionhq/client';
|
|
||||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
|
||||||
|
|
||||||
export class UploadBaseCustom {
|
|
||||||
plugin: MyPlugin;
|
|
||||||
notion: Client;
|
|
||||||
agent: any;
|
|
||||||
dbDetails: DatabaseDetails
|
|
||||||
|
|
||||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.dbDetails = dbDetails
|
|
||||||
}
|
|
||||||
|
|
||||||
async deletePage(notionID: string) {
|
|
||||||
const { notionAPI } = this.dbDetails
|
|
||||||
return requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
},
|
|
||||||
body: ''
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async getDataBase(databaseID: string) {
|
|
||||||
const { notionAPI } = this.dbDetails
|
|
||||||
const response = await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Authorization': 'Bearer ' + notionAPI,
|
|
||||||
'Notion-Version': '2022-06-28',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// Check if cover is present in the JSON response and then get the URL
|
|
||||||
if (response.json.cover && response.json.cover.external) {
|
|
||||||
return response.json.cover.external.url;
|
|
||||||
} else {
|
|
||||||
return null; // or some other default value, if you prefer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
|
||||||
import { markdownToBlocks } from "@tryfabric/martian";
|
|
||||||
import * as yamlFrontMatter from "yaml-front-matter";
|
|
||||||
// import * as yaml from "yaml"
|
|
||||||
import MyPlugin from "src/main";
|
|
||||||
import { DatabaseDetails, PluginSettings } from "../../ui/settingTabs";
|
|
||||||
import { updateYamlInfo } from "../updateYaml";
|
|
||||||
import { UploadBaseCustom } from "./BaseUpload2NotionCustom";
|
|
||||||
|
|
||||||
export class Upload2NotionCustom extends UploadBaseCustom {
|
|
||||||
settings: PluginSettings;
|
|
||||||
dbDetails: DatabaseDetails;
|
|
||||||
|
|
||||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
|
||||||
super(plugin, dbDetails);
|
|
||||||
this.dbDetails = dbDetails;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 因为需要解析notion的block进行对比,非常的麻烦,
|
|
||||||
// 暂时就直接删除,新建一个page
|
|
||||||
async updatePage(
|
|
||||||
notionID: string,
|
|
||||||
cover: string,
|
|
||||||
customValues: Record<string, string>,
|
|
||||||
childArr: any,
|
|
||||||
) {
|
|
||||||
await this.deletePage(notionID);
|
|
||||||
|
|
||||||
const { databaseID } = this.dbDetails;
|
|
||||||
|
|
||||||
const databaseCover = await this.getDataBase(
|
|
||||||
databaseID
|
|
||||||
);
|
|
||||||
|
|
||||||
if (cover == null) {
|
|
||||||
cover = databaseCover;
|
|
||||||
}
|
|
||||||
|
|
||||||
return await this.createPage(cover, customValues, childArr);
|
|
||||||
}
|
|
||||||
|
|
||||||
async createPage(
|
|
||||||
cover: string,
|
|
||||||
customValues: Record<string, string>,
|
|
||||||
childArr: any,
|
|
||||||
) {
|
|
||||||
|
|
||||||
const {
|
|
||||||
databaseID,
|
|
||||||
customProperties,
|
|
||||||
notionAPI
|
|
||||||
} = this.dbDetails;
|
|
||||||
|
|
||||||
const bodyString: any = this.buildBodyString(customProperties, customValues, childArr);
|
|
||||||
|
|
||||||
if (cover) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: cover,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bodyString.cover && this.plugin.settings.bannerUrl) {
|
|
||||||
bodyString.cover = {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: this.plugin.settings.bannerUrl,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(bodyString)
|
|
||||||
|
|
||||||
try {
|
|
||||||
return await requestUrl({
|
|
||||||
url: `https://api.notion.com/v1/pages`,
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
// 'User-Agent': 'obsidian.md',
|
|
||||||
Authorization:
|
|
||||||
"Bearer " + notionAPI,
|
|
||||||
"Notion-Version": "2022-06-28",
|
|
||||||
},
|
|
||||||
body: JSON.stringify(bodyString),
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
new Notice(`network error ${error}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async syncMarkdownToNotionCustom(
|
|
||||||
cover: string,
|
|
||||||
customValues: Record<string, string>,
|
|
||||||
markdown: string,
|
|
||||||
nowFile: TFile,
|
|
||||||
app: App,
|
|
||||||
): Promise<any> {
|
|
||||||
const options = {
|
|
||||||
strictImageUrls: true,
|
|
||||||
notionLimits: {
|
|
||||||
truncate: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let res: any;
|
|
||||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
|
||||||
const __content = yamlContent.__content;
|
|
||||||
const file2Block = markdownToBlocks(__content, options);
|
|
||||||
const frontmasster =
|
|
||||||
app.metadataCache.getFileCache(nowFile)?.frontmatter;
|
|
||||||
const { abName } = this.dbDetails
|
|
||||||
const notionIDKey = `NotionID-${abName}`;
|
|
||||||
const notionID = frontmasster ? frontmasster[notionIDKey] : null;
|
|
||||||
|
|
||||||
if (notionID) {
|
|
||||||
res = await this.updatePage(
|
|
||||||
notionID,
|
|
||||||
cover,
|
|
||||||
customValues,
|
|
||||||
file2Block,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
res = await this.createPage(cover, customValues, file2Block);
|
|
||||||
}
|
|
||||||
if (res && res.status === 200) {
|
|
||||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
|
||||||
} else {
|
|
||||||
new Notice(`${res.text}`);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
private buildPropertyObject(customName: string, customType: string, customValues: Record<string, any>) {
|
|
||||||
const value = customValues[customName] || '';
|
|
||||||
|
|
||||||
switch (customType) {
|
|
||||||
case "title":
|
|
||||||
return {
|
|
||||||
title: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: value,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
case "rich_text":
|
|
||||||
return {
|
|
||||||
rich_text: [
|
|
||||||
{
|
|
||||||
text: {
|
|
||||||
content: value || '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
case "date":
|
|
||||||
return {
|
|
||||||
date: {
|
|
||||||
start: value || new Date().toISOString(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
case "number":
|
|
||||||
return {
|
|
||||||
number: Number(value),
|
|
||||||
};
|
|
||||||
case "phone_number":
|
|
||||||
return {
|
|
||||||
phone_number: value,
|
|
||||||
};
|
|
||||||
case "email":
|
|
||||||
return {
|
|
||||||
email: value,
|
|
||||||
};
|
|
||||||
case "url":
|
|
||||||
return {
|
|
||||||
url: value,
|
|
||||||
};
|
|
||||||
case "files":
|
|
||||||
return {
|
|
||||||
files: Array.isArray(value) ? value.map(url => ({
|
|
||||||
name: url,
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: url,
|
|
||||||
},
|
|
||||||
})) : [
|
|
||||||
{
|
|
||||||
name: value,
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: value,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
case "checkbox":
|
|
||||||
return {
|
|
||||||
checkbox: Boolean(value) || false,
|
|
||||||
};
|
|
||||||
case "select":
|
|
||||||
return {
|
|
||||||
select: {
|
|
||||||
name: value,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
case "multi_select":
|
|
||||||
return {
|
|
||||||
multi_select: Array.isArray(value) ? value.map(item => ({ name: item })) : [{ name: value }],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private buildBodyString(
|
|
||||||
customProperties: { customName: string; customType: string }[],
|
|
||||||
customValues: Record<string, string>,
|
|
||||||
childArr: any,
|
|
||||||
) {
|
|
||||||
|
|
||||||
const properties: { [key: string]: any } = {};
|
|
||||||
|
|
||||||
// Only include custom properties that have values
|
|
||||||
customProperties.forEach(({ customName, customType }) => {
|
|
||||||
if (customValues[customName] !== undefined) {
|
|
||||||
properties[customName] = this.buildPropertyObject(customName, customType, customValues);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// console.log(properties)
|
|
||||||
|
|
||||||
return {
|
|
||||||
parent: {
|
|
||||||
database_id: this.dbDetails.databaseID,
|
|
||||||
},
|
|
||||||
properties,
|
|
||||||
children: childArr,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
375
yarn.lock
375
yarn.lock
@@ -120,9 +120,20 @@
|
|||||||
eslint-visitor-keys "^3.3.0"
|
eslint-visitor-keys "^3.3.0"
|
||||||
|
|
||||||
"@eslint-community/regexpp@^4.5.1":
|
"@eslint-community/regexpp@^4.5.1":
|
||||||
version "4.10.0"
|
version "4.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63"
|
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
|
||||||
integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==
|
integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==
|
||||||
|
|
||||||
|
"@jxpeng98/martian@^1.2.7":
|
||||||
|
version "1.2.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/@jxpeng98/martian/-/martian-1.2.7.tgz#43c8e5403064eb0bae1afe44d0c369ecdd1b4888"
|
||||||
|
integrity sha512-SeGqHRUeDkCP9SEJt5sddXit+VVoGQhx/U1ePiqcww6dbK0gnv2CiDzfgtRkBFW8zoCBzkq50m/UBS0xz/VGig==
|
||||||
|
dependencies:
|
||||||
|
"@notionhq/client" "^1.0.4"
|
||||||
|
remark-gfm "^1.0.0"
|
||||||
|
remark-math "^4.0.0"
|
||||||
|
remark-parse "^9.0.0"
|
||||||
|
unified "^9.2.1"
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
@@ -153,17 +164,6 @@
|
|||||||
"@types/node-fetch" "^2.5.10"
|
"@types/node-fetch" "^2.5.10"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@tryfabric/martian@^1.2.4":
|
|
||||||
version "1.2.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tryfabric/martian/-/martian-1.2.4.tgz#3fdfe7129f1c28bccddc34854cf353b0f37c0c02"
|
|
||||||
integrity sha512-g7SP7beaxrjxLnW//vskra07a1jsJowqp07KMouxh4gCwaF+ItHbRZN8O+1dhJivBi3VdasT71BPyk+8wzEreQ==
|
|
||||||
dependencies:
|
|
||||||
"@notionhq/client" "^1.0.4"
|
|
||||||
remark-gfm "^1.0.0"
|
|
||||||
remark-math "^4.0.0"
|
|
||||||
remark-parse "^9.0.0"
|
|
||||||
unified "^9.2.1"
|
|
||||||
|
|
||||||
"@types/codemirror@5.60.8":
|
"@types/codemirror@5.60.8":
|
||||||
version "5.60.8"
|
version "5.60.8"
|
||||||
resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.8.tgz#b647d04b470e8e1836dd84b2879988fc55c9de68"
|
resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.8.tgz#b647d04b470e8e1836dd84b2879988fc55c9de68"
|
||||||
@@ -184,9 +184,9 @@
|
|||||||
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
|
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
|
||||||
|
|
||||||
"@types/hast@^3.0.0":
|
"@types/hast@^3.0.0":
|
||||||
version "3.0.3"
|
version "3.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.3.tgz#7f75e6b43bc3f90316046a287d9ad3888309f7e1"
|
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa"
|
||||||
integrity sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==
|
integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "*"
|
"@types/unist" "*"
|
||||||
|
|
||||||
@@ -201,9 +201,9 @@
|
|||||||
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||||
|
|
||||||
"@types/katex@^0.16.0":
|
"@types/katex@^0.16.0":
|
||||||
version "0.16.6"
|
version "0.16.7"
|
||||||
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.6.tgz#6dd82f78a1a1d2eceeff6bb97ba98d7c062454cb"
|
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.7.tgz#03ab680ab4fa4fbc6cb46ecf987ecad5d8019868"
|
||||||
integrity sha512-rZYO1HInM99rAFYNwGqbYPxHZHxu2IwZYKj4bJ4oh6edVrm1UId8mmbHIZLBtG253qU6y3piag0XYe/joNnwzQ==
|
integrity sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==
|
||||||
|
|
||||||
"@types/mdast@^3.0.0":
|
"@types/mdast@^3.0.0":
|
||||||
version "3.0.15"
|
version "3.0.15"
|
||||||
@@ -213,9 +213,9 @@
|
|||||||
"@types/unist" "^2"
|
"@types/unist" "^2"
|
||||||
|
|
||||||
"@types/mdast@^4.0.0":
|
"@types/mdast@^4.0.0":
|
||||||
version "4.0.3"
|
version "4.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.3.tgz#1e011ff013566e919a4232d1701ad30d70cab333"
|
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6"
|
||||||
integrity sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==
|
integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "*"
|
"@types/unist" "*"
|
||||||
|
|
||||||
@@ -225,29 +225,29 @@
|
|||||||
integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
|
integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
|
||||||
|
|
||||||
"@types/node-fetch@^2.5.10":
|
"@types/node-fetch@^2.5.10":
|
||||||
version "2.6.9"
|
version "2.6.11"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e"
|
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24"
|
||||||
integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA==
|
integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
form-data "^4.0.0"
|
form-data "^4.0.0"
|
||||||
|
|
||||||
"@types/node@*", "@types/node@^20.5.7":
|
"@types/node@*", "@types/node@^20.5.7":
|
||||||
version "20.9.0"
|
version "20.14.12"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.12.tgz#129d7c3a822cb49fc7ff661235f19cfefd422b49"
|
||||||
integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==
|
integrity sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types "~5.26.4"
|
undici-types "~5.26.4"
|
||||||
|
|
||||||
"@types/semver@^7.5.0":
|
"@types/semver@^7.5.0":
|
||||||
version "7.5.5"
|
version "7.5.8"
|
||||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.5.tgz#deed5ab7019756c9c90ea86139106b0346223f35"
|
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
|
||||||
integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==
|
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==
|
||||||
|
|
||||||
"@types/tern@*":
|
"@types/tern@*":
|
||||||
version "0.23.7"
|
version "0.23.9"
|
||||||
resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.7.tgz#f3c27fb7d6db5e86d7f069e7d5124bfa677a5b2d"
|
resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.9.tgz#6f6093a4a9af3e6bb8dde528e024924d196b367c"
|
||||||
integrity sha512-0YS9XCZ0LAhlP11HV9SqncUYyz9Ggsgc7Om/AmchKvoeFyj0qPaJmX6rJ93mJVExizWDzUMb49gAtVpI1uHd8Q==
|
integrity sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/estree" "*"
|
"@types/estree" "*"
|
||||||
|
|
||||||
@@ -270,15 +270,15 @@
|
|||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@^6.16.0":
|
"@typescript-eslint/eslint-plugin@^6.16.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.16.0.tgz#cc29fbd208ea976de3db7feb07755bba0ce8d8bc"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3"
|
||||||
integrity sha512-O5f7Kv5o4dLWQtPX4ywPPa+v9G+1q1x8mz0Kr0pXUtKsevo+gIJHLkGc8RxaZWtP8RrhwhSNIWThnW42K9/0rQ==
|
integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@eslint-community/regexpp" "^4.5.1"
|
"@eslint-community/regexpp" "^4.5.1"
|
||||||
"@typescript-eslint/scope-manager" "6.16.0"
|
"@typescript-eslint/scope-manager" "6.21.0"
|
||||||
"@typescript-eslint/type-utils" "6.16.0"
|
"@typescript-eslint/type-utils" "6.21.0"
|
||||||
"@typescript-eslint/utils" "6.16.0"
|
"@typescript-eslint/utils" "6.21.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
graphemer "^1.4.0"
|
graphemer "^1.4.0"
|
||||||
ignore "^5.2.4"
|
ignore "^5.2.4"
|
||||||
@@ -287,46 +287,46 @@
|
|||||||
ts-api-utils "^1.0.1"
|
ts-api-utils "^1.0.1"
|
||||||
|
|
||||||
"@typescript-eslint/parser@^6.16.0":
|
"@typescript-eslint/parser@^6.16.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.16.0.tgz#36f39f63b126aa25af2ad2df13d9891e9fd5b40c"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b"
|
||||||
integrity sha512-H2GM3eUo12HpKZU9njig3DF5zJ58ja6ahj1GoHEHOgQvYxzoFJJEvC1MQ7T2l9Ha+69ZSOn7RTxOdpC/y3ikMw==
|
integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/scope-manager" "6.16.0"
|
"@typescript-eslint/scope-manager" "6.21.0"
|
||||||
"@typescript-eslint/types" "6.16.0"
|
"@typescript-eslint/types" "6.21.0"
|
||||||
"@typescript-eslint/typescript-estree" "6.16.0"
|
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
|
|
||||||
"@typescript-eslint/scope-manager@6.16.0":
|
"@typescript-eslint/scope-manager@6.21.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.16.0.tgz#f3e9a00fbc1d0701356359cd56489c54d9e37168"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1"
|
||||||
integrity sha512-0N7Y9DSPdaBQ3sqSCwlrm9zJwkpOuc6HYm7LpzLAPqBL7dmzAUimr4M29dMkOP/tEwvOCC/Cxo//yOfJD3HUiw==
|
integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "6.16.0"
|
"@typescript-eslint/types" "6.21.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||||
|
|
||||||
"@typescript-eslint/type-utils@6.16.0":
|
"@typescript-eslint/type-utils@6.21.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.16.0.tgz#5f21c3e49e540ad132dc87fc99af463c184d5ed1"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e"
|
||||||
integrity sha512-ThmrEOcARmOnoyQfYkHw/DX2SEYBalVECmoldVuH6qagKROp/jMnfXpAU/pAIWub9c4YTxga+XwgAkoA0pxfmg==
|
integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/typescript-estree" "6.16.0"
|
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||||
"@typescript-eslint/utils" "6.16.0"
|
"@typescript-eslint/utils" "6.21.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
ts-api-utils "^1.0.1"
|
ts-api-utils "^1.0.1"
|
||||||
|
|
||||||
"@typescript-eslint/types@6.16.0":
|
"@typescript-eslint/types@6.21.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.16.0.tgz#a3abe0045737d44d8234708d5ed8fef5d59dc91e"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d"
|
||||||
integrity sha512-hvDFpLEvTJoHutVl87+MG/c5C8I6LOgEx05zExTSJDEVU7hhR3jhV8M5zuggbdFCw98+HhZWPHZeKS97kS3JoQ==
|
integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==
|
||||||
|
|
||||||
"@typescript-eslint/typescript-estree@6.16.0":
|
"@typescript-eslint/typescript-estree@6.21.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.16.0.tgz#d6e0578e4f593045f0df06c4b3a22bd6f13f2d03"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46"
|
||||||
integrity sha512-VTWZuixh/vr7nih6CfrdpmFNLEnoVBF1skfjdyGnNwXOH1SLeHItGdZDHhhAIzd3ACazyY2Fg76zuzOVTaknGA==
|
integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "6.16.0"
|
"@typescript-eslint/types" "6.21.0"
|
||||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
globby "^11.1.0"
|
globby "^11.1.0"
|
||||||
is-glob "^4.0.3"
|
is-glob "^4.0.3"
|
||||||
@@ -334,31 +334,31 @@
|
|||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
ts-api-utils "^1.0.1"
|
ts-api-utils "^1.0.1"
|
||||||
|
|
||||||
"@typescript-eslint/utils@6.16.0":
|
"@typescript-eslint/utils@6.21.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.16.0.tgz#1c291492d34670f9210d2b7fcf6b402bea3134ae"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134"
|
||||||
integrity sha512-T83QPKrBm6n//q9mv7oiSvy/Xq/7Hyw9SzSEhMHJwznEmQayfBM87+oAlkNAMEO7/MjIwKyOHgBJbxB0s7gx2A==
|
integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@eslint-community/eslint-utils" "^4.4.0"
|
"@eslint-community/eslint-utils" "^4.4.0"
|
||||||
"@types/json-schema" "^7.0.12"
|
"@types/json-schema" "^7.0.12"
|
||||||
"@types/semver" "^7.5.0"
|
"@types/semver" "^7.5.0"
|
||||||
"@typescript-eslint/scope-manager" "6.16.0"
|
"@typescript-eslint/scope-manager" "6.21.0"
|
||||||
"@typescript-eslint/types" "6.16.0"
|
"@typescript-eslint/types" "6.21.0"
|
||||||
"@typescript-eslint/typescript-estree" "6.16.0"
|
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
|
|
||||||
"@typescript-eslint/visitor-keys@6.16.0":
|
"@typescript-eslint/visitor-keys@6.21.0":
|
||||||
version "6.16.0"
|
version "6.21.0"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.16.0.tgz#d50da18a05d91318ed3e7e8889bda0edc35f3a10"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47"
|
||||||
integrity sha512-QSFQLruk7fhs91a/Ep/LqRdbJCZ1Rq03rqBdKT5Ky17Sz8zRLUksqIe9DW0pKtg/Z35/ztbLQ6qpOCN6rOC11A==
|
integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "6.16.0"
|
"@typescript-eslint/types" "6.21.0"
|
||||||
eslint-visitor-keys "^3.4.1"
|
eslint-visitor-keys "^3.4.1"
|
||||||
|
|
||||||
agent-base@^7.0.2:
|
agent-base@^7.0.2:
|
||||||
version "7.1.0"
|
version "7.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434"
|
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317"
|
||||||
integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==
|
integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==
|
||||||
dependencies:
|
dependencies:
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
|
|
||||||
@@ -401,12 +401,12 @@ brace-expansion@^2.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
balanced-match "^1.0.0"
|
balanced-match "^1.0.0"
|
||||||
|
|
||||||
braces@^3.0.2:
|
braces@^3.0.3:
|
||||||
version "3.0.2"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
|
||||||
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
|
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
|
||||||
dependencies:
|
dependencies:
|
||||||
fill-range "^7.0.1"
|
fill-range "^7.1.1"
|
||||||
|
|
||||||
builtin-modules@^3.3.0:
|
builtin-modules@^3.3.0:
|
||||||
version "3.3.0"
|
version "3.3.0"
|
||||||
@@ -460,10 +460,22 @@ commander@^8.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
||||||
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
|
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
|
||||||
|
|
||||||
|
cross-fetch@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983"
|
||||||
|
integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==
|
||||||
|
dependencies:
|
||||||
|
node-fetch "^2.6.12"
|
||||||
|
|
||||||
|
data-uri-to-buffer@^4.0.0:
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e"
|
||||||
|
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==
|
||||||
|
|
||||||
debug@4, debug@^4.0.0, debug@^4.3.4:
|
debug@4, debug@^4.0.0, debug@^4.3.4:
|
||||||
version "4.3.4"
|
version "4.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b"
|
||||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==
|
||||||
dependencies:
|
dependencies:
|
||||||
ms "2.1.2"
|
ms "2.1.2"
|
||||||
|
|
||||||
@@ -558,16 +570,24 @@ fast-glob@^3.2.9:
|
|||||||
micromatch "^4.0.4"
|
micromatch "^4.0.4"
|
||||||
|
|
||||||
fastq@^1.6.0:
|
fastq@^1.6.0:
|
||||||
version "1.15.0"
|
version "1.17.1"
|
||||||
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a"
|
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47"
|
||||||
integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==
|
integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==
|
||||||
dependencies:
|
dependencies:
|
||||||
reusify "^1.0.4"
|
reusify "^1.0.4"
|
||||||
|
|
||||||
fill-range@^7.0.1:
|
fetch-blob@^3.1.2, fetch-blob@^3.1.4:
|
||||||
version "7.0.1"
|
version "3.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9"
|
||||||
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
|
integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==
|
||||||
|
dependencies:
|
||||||
|
node-domexception "^1.0.0"
|
||||||
|
web-streams-polyfill "^3.0.3"
|
||||||
|
|
||||||
|
fill-range@^7.1.1:
|
||||||
|
version "7.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
|
||||||
|
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
|
||||||
dependencies:
|
dependencies:
|
||||||
to-regex-range "^5.0.1"
|
to-regex-range "^5.0.1"
|
||||||
|
|
||||||
@@ -580,6 +600,13 @@ form-data@^4.0.0:
|
|||||||
combined-stream "^1.0.8"
|
combined-stream "^1.0.8"
|
||||||
mime-types "^2.1.12"
|
mime-types "^2.1.12"
|
||||||
|
|
||||||
|
formdata-polyfill@^4.0.10:
|
||||||
|
version "4.0.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
|
||||||
|
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
|
||||||
|
dependencies:
|
||||||
|
fetch-blob "^3.1.2"
|
||||||
|
|
||||||
glob-parent@^5.1.2:
|
glob-parent@^5.1.2:
|
||||||
version "5.1.2"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
||||||
@@ -605,17 +632,17 @@ graphemer@^1.4.0:
|
|||||||
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
||||||
|
|
||||||
https-proxy-agent@^7.0.2:
|
https-proxy-agent@^7.0.2:
|
||||||
version "7.0.2"
|
version "7.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b"
|
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2"
|
||||||
integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==
|
integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==
|
||||||
dependencies:
|
dependencies:
|
||||||
agent-base "^7.0.2"
|
agent-base "^7.0.2"
|
||||||
debug "4"
|
debug "4"
|
||||||
|
|
||||||
ignore@^5.2.0, ignore@^5.2.4:
|
ignore@^5.2.0, ignore@^5.2.4:
|
||||||
version "5.3.0"
|
version "5.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78"
|
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
|
||||||
integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==
|
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==
|
||||||
|
|
||||||
is-alphabetical@^1.0.0:
|
is-alphabetical@^1.0.0:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
@@ -688,9 +715,9 @@ katex@^0.12.0:
|
|||||||
commander "^2.19.0"
|
commander "^2.19.0"
|
||||||
|
|
||||||
katex@^0.16.0:
|
katex@^0.16.0:
|
||||||
version "0.16.9"
|
version "0.16.11"
|
||||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.9.tgz#bc62d8f7abfea6e181250f85a56e4ef292dcb1fa"
|
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.11.tgz#4bc84d5584f996abece5f01c6ad11304276a33f5"
|
||||||
integrity sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==
|
integrity sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
commander "^8.3.0"
|
commander "^8.3.0"
|
||||||
|
|
||||||
@@ -704,13 +731,6 @@ longest-streak@^3.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4"
|
resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4"
|
||||||
integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==
|
integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==
|
||||||
|
|
||||||
lru-cache@^6.0.0:
|
|
||||||
version "6.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
|
|
||||||
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
|
|
||||||
dependencies:
|
|
||||||
yallist "^4.0.0"
|
|
||||||
|
|
||||||
markdown-table@^2.0.0:
|
markdown-table@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b"
|
resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b"
|
||||||
@@ -739,9 +759,9 @@ mdast-util-from-markdown@^0.8.0:
|
|||||||
unist-util-stringify-position "^2.0.0"
|
unist-util-stringify-position "^2.0.0"
|
||||||
|
|
||||||
mdast-util-from-markdown@^2.0.0:
|
mdast-util-from-markdown@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz#52f14815ec291ed061f2922fd14d6689c810cb88"
|
resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz#32a6e8f512b416e1f51eb817fc64bd867ebcd9cc"
|
||||||
integrity sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==
|
integrity sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/mdast" "^4.0.0"
|
"@types/mdast" "^4.0.0"
|
||||||
"@types/unist" "^3.0.0"
|
"@types/unist" "^3.0.0"
|
||||||
@@ -821,9 +841,9 @@ mdast-util-math@^3.0.0:
|
|||||||
unist-util-remove-position "^5.0.0"
|
unist-util-remove-position "^5.0.0"
|
||||||
|
|
||||||
mdast-util-phrasing@^4.0.0:
|
mdast-util-phrasing@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz#468cbbb277375523de807248b8ad969feb02a5c7"
|
resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz#7cc0a8dec30eaf04b7b1a9661a92adb3382aa6e3"
|
||||||
integrity sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==
|
integrity sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/mdast" "^4.0.0"
|
"@types/mdast" "^4.0.0"
|
||||||
unist-util-is "^6.0.0"
|
unist-util-is "^6.0.0"
|
||||||
@@ -872,9 +892,9 @@ merge2@^1.3.0, merge2@^1.4.1:
|
|||||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||||
|
|
||||||
micromark-core-commonmark@^2.0.0:
|
micromark-core-commonmark@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz#50740201f0ee78c12a675bf3e68ffebc0bf931a3"
|
resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz#9a45510557d068605c6e9a80f282b2bb8581e43d"
|
||||||
integrity sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==
|
integrity sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==
|
||||||
dependencies:
|
dependencies:
|
||||||
decode-named-character-reference "^1.0.0"
|
decode-named-character-reference "^1.0.0"
|
||||||
devlop "^1.0.0"
|
devlop "^1.0.0"
|
||||||
@@ -947,9 +967,9 @@ micromark-extension-math@^0.1.0:
|
|||||||
micromark "~2.11.0"
|
micromark "~2.11.0"
|
||||||
|
|
||||||
micromark-extension-math@^3.0.0:
|
micromark-extension-math@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-3.0.0.tgz#c7a47d6ce990812243ad3946a30bb60e4c2a8c76"
|
resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz#c42ee3b1dd5a9a03584e83dd8f08e3de510212c1"
|
||||||
integrity sha512-iJ2Q28vBoEovLN5o3GO12CpqorQRYDPT+p4zW50tGwTfJB+iv/VnB6Ini+gqa24K97DwptMBBIvVX6Bjk49oyQ==
|
integrity sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/katex" "^0.16.0"
|
"@types/katex" "^0.16.0"
|
||||||
devlop "^1.0.0"
|
devlop "^1.0.0"
|
||||||
@@ -1007,9 +1027,9 @@ micromark-factory-whitespace@^2.0.0:
|
|||||||
micromark-util-types "^2.0.0"
|
micromark-util-types "^2.0.0"
|
||||||
|
|
||||||
micromark-util-character@^2.0.0:
|
micromark-util-character@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.0.1.tgz#52b824c2e2633b6fb33399d2ec78ee2a90d6b298"
|
resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.0.tgz#31320ace16b4644316f6bf057531689c71e2aee1"
|
||||||
integrity sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==
|
integrity sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
micromark-util-symbol "^2.0.0"
|
micromark-util-symbol "^2.0.0"
|
||||||
micromark-util-types "^2.0.0"
|
micromark-util-types "^2.0.0"
|
||||||
@@ -1089,9 +1109,9 @@ micromark-util-sanitize-uri@^2.0.0:
|
|||||||
micromark-util-symbol "^2.0.0"
|
micromark-util-symbol "^2.0.0"
|
||||||
|
|
||||||
micromark-util-subtokenize@^2.0.0:
|
micromark-util-subtokenize@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz#9f412442d77e0c5789ffdf42377fa8a2bcbdf581"
|
resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz#76129c49ac65da6e479c09d0ec4b5f29ec6eace5"
|
||||||
integrity sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==
|
integrity sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
devlop "^1.0.0"
|
devlop "^1.0.0"
|
||||||
micromark-util-chunked "^2.0.0"
|
micromark-util-chunked "^2.0.0"
|
||||||
@@ -1140,11 +1160,11 @@ micromark@^4.0.0:
|
|||||||
micromark-util-types "^2.0.0"
|
micromark-util-types "^2.0.0"
|
||||||
|
|
||||||
micromatch@^4.0.4:
|
micromatch@^4.0.4:
|
||||||
version "4.0.5"
|
version "4.0.7"
|
||||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
|
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5"
|
||||||
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
|
integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
braces "^3.0.2"
|
braces "^3.0.3"
|
||||||
picomatch "^2.3.1"
|
picomatch "^2.3.1"
|
||||||
|
|
||||||
mime-db@1.52.0:
|
mime-db@1.52.0:
|
||||||
@@ -1181,17 +1201,31 @@ natural-compare@^1.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||||
|
|
||||||
node-fetch@^2.6.1:
|
node-domexception@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
|
||||||
|
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
|
||||||
|
|
||||||
|
node-fetch@^2.6.1, node-fetch@^2.6.12:
|
||||||
version "2.7.0"
|
version "2.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
|
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
|
||||||
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
|
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
|
||||||
dependencies:
|
dependencies:
|
||||||
whatwg-url "^5.0.0"
|
whatwg-url "^5.0.0"
|
||||||
|
|
||||||
obsidian@latest:
|
node-fetch@^3.3.2:
|
||||||
version "1.4.11"
|
version "3.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/obsidian/-/obsidian-1.4.11.tgz#5cba594c83a74ebad58b630c610265018abdadaa"
|
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b"
|
||||||
integrity sha512-BCVYTvaXxElJMl6MMbDdY/CGK+aq18SdtDY/7vH8v6BxCBQ6KF4kKxL0vG9UZ0o5qh139KpUoJHNm+6O5dllKA==
|
integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==
|
||||||
|
dependencies:
|
||||||
|
data-uri-to-buffer "^4.0.0"
|
||||||
|
fetch-blob "^3.1.4"
|
||||||
|
formdata-polyfill "^4.0.10"
|
||||||
|
|
||||||
|
obsidian@^1.6.6:
|
||||||
|
version "1.6.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/obsidian/-/obsidian-1.6.6.tgz#d45c4021c291765e1b77ed4a1c645e562ff6e77f"
|
||||||
|
integrity sha512-GZHzeOiwmw/wBjB5JwrsxAZBLqxGQmqtEKSvJJvT0LtTcqeOFnV8jv0ZK5kO7hBb44WxJc+LdS7mZgLXbb+qXQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/codemirror" "5.60.8"
|
"@types/codemirror" "5.60.8"
|
||||||
moment "2.29.4"
|
moment "2.29.4"
|
||||||
@@ -1218,11 +1252,6 @@ picomatch@^2.3.1:
|
|||||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||||
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||||
|
|
||||||
process@^0.11.10:
|
|
||||||
version "0.11.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
|
|
||||||
integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==
|
|
||||||
|
|
||||||
queue-microtask@^1.2.2:
|
queue-microtask@^1.2.2:
|
||||||
version "1.2.3"
|
version "1.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
|
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
|
||||||
@@ -1279,11 +1308,9 @@ run-parallel@^1.1.9:
|
|||||||
queue-microtask "^1.2.2"
|
queue-microtask "^1.2.2"
|
||||||
|
|
||||||
semver@^7.5.4:
|
semver@^7.5.4:
|
||||||
version "7.5.4"
|
version "7.6.3"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
|
||||||
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
|
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
|
||||||
dependencies:
|
|
||||||
lru-cache "^6.0.0"
|
|
||||||
|
|
||||||
slash@^3.0.0:
|
slash@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
@@ -1313,14 +1340,14 @@ trough@^1.0.0:
|
|||||||
integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==
|
integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==
|
||||||
|
|
||||||
trough@^2.0.0:
|
trough@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876"
|
resolved "https://registry.yarnpkg.com/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f"
|
||||||
integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==
|
integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==
|
||||||
|
|
||||||
ts-api-utils@^1.0.1:
|
ts-api-utils@^1.0.1:
|
||||||
version "1.0.3"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331"
|
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1"
|
||||||
integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==
|
integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==
|
||||||
|
|
||||||
tslib@2.6.2:
|
tslib@2.6.2:
|
||||||
version "2.6.2"
|
version "2.6.2"
|
||||||
@@ -1338,9 +1365,9 @@ undici-types@~5.26.4:
|
|||||||
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
||||||
|
|
||||||
unified@^11.0.0:
|
unified@^11.0.0:
|
||||||
version "11.0.4"
|
version "11.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.4.tgz#f4be0ac0fe4c88cb873687c07c64c49ed5969015"
|
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1"
|
||||||
integrity sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==
|
integrity sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "^3.0.0"
|
"@types/unist" "^3.0.0"
|
||||||
bail "^2.0.0"
|
bail "^2.0.0"
|
||||||
@@ -1448,14 +1475,19 @@ vfile@^4.0.0:
|
|||||||
vfile-message "^2.0.0"
|
vfile-message "^2.0.0"
|
||||||
|
|
||||||
vfile@^6.0.0:
|
vfile@^6.0.0:
|
||||||
version "6.0.1"
|
version "6.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.1.tgz#1e8327f41eac91947d4fe9d237a2dd9209762536"
|
resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.2.tgz#ef49548ea3d270097a67011921411130ceae7deb"
|
||||||
integrity sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==
|
integrity sha512-zND7NlS8rJYb/sPqkb13ZvbbUoExdbi4w3SfRrMq6R3FvnLQmmfpajJNITuuYm6AZ5uao9vy4BAos3EXBPf2rg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/unist" "^3.0.0"
|
"@types/unist" "^3.0.0"
|
||||||
unist-util-stringify-position "^4.0.0"
|
unist-util-stringify-position "^4.0.0"
|
||||||
vfile-message "^4.0.0"
|
vfile-message "^4.0.0"
|
||||||
|
|
||||||
|
web-streams-polyfill@^3.0.3:
|
||||||
|
version "3.3.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b"
|
||||||
|
integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==
|
||||||
|
|
||||||
webidl-conversions@^3.0.0:
|
webidl-conversions@^3.0.0:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||||
@@ -1469,11 +1501,6 @@ whatwg-url@^5.0.0:
|
|||||||
tr46 "~0.0.3"
|
tr46 "~0.0.3"
|
||||||
webidl-conversions "^3.0.0"
|
webidl-conversions "^3.0.0"
|
||||||
|
|
||||||
yallist@^4.0.0:
|
|
||||||
version "4.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
|
||||||
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
|
|
||||||
|
|
||||||
yaml-front-matter@^4.1.1:
|
yaml-front-matter@^4.1.1:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/yaml-front-matter/-/yaml-front-matter-4.1.1.tgz#66eaa9a998fc3dd723708c73aa8e06e79cac91c9"
|
resolved "https://registry.yarnpkg.com/yaml-front-matter/-/yaml-front-matter-4.1.1.tgz#66eaa9a998fc3dd723708c73aa8e06e79cac91c9"
|
||||||
@@ -1483,9 +1510,9 @@ yaml-front-matter@^4.1.1:
|
|||||||
js-yaml "^3.14.1"
|
js-yaml "^3.14.1"
|
||||||
|
|
||||||
yaml@^2.3.4:
|
yaml@^2.3.4:
|
||||||
version "2.3.4"
|
version "2.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"
|
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.0.tgz#c6165a721cf8000e91c36490a41d7be25176cf5d"
|
||||||
integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==
|
integrity sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==
|
||||||
|
|
||||||
zwitch@^1.0.0:
|
zwitch@^1.0.0:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user