Skip to content

Commit

Permalink
feat: add asset api
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 25, 2024
1 parent 30e3204 commit f99607b
Show file tree
Hide file tree
Showing 21 changed files with 296 additions and 85 deletions.
7 changes: 7 additions & 0 deletions apps/zhi-infra/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# zhi-infra

## 0.21.5

### Patch Changes

- Updated dependencies
- zhi-common@1.32.0

## 0.21.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/zhi-infra/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-infra",
"version": "0.21.4",
"version": "0.21.5",
"type": "module",
"description": "basic issues for zhi",
"main": "./dist/index.cjs",
Expand Down
7 changes: 7 additions & 0 deletions libs/zhi-blog-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# zhi-blog-api

## 1.56.3

### Patch Changes

- Updated dependencies
- zhi-common@1.32.0

## 1.56.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-blog-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-blog-api",
"version": "1.56.2",
"version": "1.56.3",
"type": "module",
"description": "a common blog interface",
"main": "./dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions libs/zhi-common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# zhi-common

## 1.32.0

### Minor Changes

- feat: add asset api

## 1.31.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-common",
"version": "1.31.0",
"version": "1.32.0",
"type": "module",
"description": "a collection of util tools",
"main": "./dist/index.js",
Expand Down
12 changes: 12 additions & 0 deletions libs/zhi-common/src/lib/dateUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ class DateUtil {
return this.formatIsoToZhDate(new Date(timestamp).toISOString())
}

/**
* 时间戳转完整时间
*
* @param timestamp - 时间戳
*/
public static formatTimestampToZh(timestamp: any) {
if (typeof timestamp == "string") {
timestamp = parseInt(timestamp)
}
return this.formatIsoToZh(new Date(timestamp).toISOString())
}

/**
* 转换数字日期为中文日期
*
Expand Down
23 changes: 23 additions & 0 deletions libs/zhi-fetch-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# zhi-fetch-middleware

## 0.9.0

### Minor Changes

- feat: add asset api

### Patch Changes

- Updated dependencies
- zhi-common@1.32.0

## 0.8.2

### Patch Changes

- fix: revert resp parse

## 0.8.1

### Patch Changes

- feat: add force proxy options

## 0.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-fetch-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-fetch-middleware",
"version": "0.8.0",
"version": "0.9.0",
"type": "module",
"description": "an intermediate tier prepared for fetch requests",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-fetch-middleware/src/lib/commonFetchClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class CommonFetchClient {
this.logger.info(`check response is stream =>${isStream}`)

if (isStream) {
this.logger.info("检测到response不是Response的实例,直接返回", typeof response)
this.logger.info("检测到response不是Response的实例", typeof response)
resJson = response
} else {
// 解析响应体并返回响应结果
Expand Down
7 changes: 7 additions & 0 deletions libs/zhi-github-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# zhi-github-middleware

## 0.4.16

### Patch Changes

- Updated dependencies
- zhi-common@1.32.0

## 0.4.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-github-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-github-middleware",
"version": "0.4.15",
"version": "0.4.16",
"type": "module",
"description": "a middleware for github api",
"main": "./dist/index.js",
Expand Down
26 changes: 26 additions & 0 deletions libs/zhi-gitlab-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# zhi-gitlab-middleware

## 0.7.0

### Minor Changes

- feat: add asset api

### Patch Changes

- Updated dependencies
- zhi-fetch-middleware@0.9.0

## 0.6.28

### Patch Changes

- fix: revert resp parse
- Updated dependencies
- zhi-fetch-middleware@0.8.2

## 0.6.27

### Patch Changes

- Updated dependencies
- zhi-fetch-middleware@0.8.1

## 0.6.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-gitlab-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-gitlab-middleware",
"version": "0.6.26",
"version": "0.7.0",
"type": "module",
"description": "a middleware for gitlab api ",
"main": "./dist/index.js",
Expand Down
12 changes: 12 additions & 0 deletions libs/zhi-siyuan-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# zhi-siyuan-api

## 2.19.0

### Minor Changes

- feat: add asset api

### Patch Changes

- Updated dependencies
- zhi-common@1.32.0
- zhi-blog-api@1.56.3

## 2.18.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-siyuan-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-siyuan-api",
"version": "2.18.6",
"version": "2.19.0",
"type": "module",
"description": "a siyuan-note api including both kernel and client",
"main": "./dist/index.js",
Expand Down
7 changes: 7 additions & 0 deletions libs/zhi-siyuan-api/src/lib/kernel/siyuanKernelApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,13 @@ class SiyuanKernelApi implements ISiyuanKernelApi {
}
return await this.siyuanRequest("/api/block/updateBlock", params)
}

public async netAssets2LocalAssets(id: string): Promise<SiyuanData["data"]> {
const params = {
id: id,
}
return await this.siyuanRequest("/api/format/netAssets2LocalAssets", params)
}
}

export default SiyuanKernelApi
7 changes: 7 additions & 0 deletions libs/zhi-xmlrpc-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# zhi-xmlrpc-middleware

## 0.6.20

### Patch Changes

- Updated dependencies
- zhi-common@1.32.0

## 0.6.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-xmlrpc-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-xmlrpc-middleware",
"version": "0.6.19",
"version": "0.6.20",
"type": "module",
"description": "abstract xmlrpc middle layer",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"@changesets/cli": "^2.27.1",
"@terwer/commit-config-custom": "workspace:*",
"@terwer/eslint-config-custom": "workspace:*",
"turbo": "^1.12.5"
"turbo": "^1.13.0"
}
}
Loading

0 comments on commit f99607b

Please sign in to comment.