trilium-api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +37 -0
- package/.github/workflows/publish.yml +86 -0
- package/LICENSE +661 -0
- package/README.md +836 -0
- package/package.json +32 -0
- package/src/client.test.ts +477 -0
- package/src/client.ts +91 -0
- package/src/demo-mapper.ts +166 -0
- package/src/demo-search.ts +108 -0
- package/src/demo.ts +126 -0
- package/src/generated/trilium.d.ts +1758 -0
- package/src/index.ts +35 -0
- package/src/mapper.test.ts +638 -0
- package/src/mapper.ts +534 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [18, 20, 22]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repository
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install pnpm
|
|
22
|
+
uses: pnpm/action-setup@v4
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
cache: 'pnpm'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: pnpm install
|
|
32
|
+
|
|
33
|
+
- name: Type check
|
|
34
|
+
run: pnpm test:ts
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: pnpm test:run
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: 'Version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
default: 'patch'
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
force:
|
|
16
|
+
description: 'Force publish (overwrite existing version)'
|
|
17
|
+
required: false
|
|
18
|
+
default: false
|
|
19
|
+
type: boolean
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
publish:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: write
|
|
27
|
+
id-token: write # Required for npm trusted publishing (OIDC)
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout repository
|
|
31
|
+
uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
35
|
+
|
|
36
|
+
- name: Configure Git
|
|
37
|
+
run: |
|
|
38
|
+
git config user.name "github-actions[bot]"
|
|
39
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
40
|
+
|
|
41
|
+
- name: Install pnpm
|
|
42
|
+
uses: pnpm/action-setup@v4
|
|
43
|
+
|
|
44
|
+
- name: Setup Node.js
|
|
45
|
+
uses: actions/setup-node@v4
|
|
46
|
+
with:
|
|
47
|
+
node-version: 20
|
|
48
|
+
cache: 'pnpm'
|
|
49
|
+
registry-url: 'https://registry.npmjs.org'
|
|
50
|
+
|
|
51
|
+
- name: Install dependencies
|
|
52
|
+
run: pnpm install
|
|
53
|
+
|
|
54
|
+
- name: Type check
|
|
55
|
+
run: pnpm test:ts
|
|
56
|
+
|
|
57
|
+
- name: Run tests
|
|
58
|
+
run: pnpm test:run
|
|
59
|
+
|
|
60
|
+
- name: Bump version
|
|
61
|
+
id: version
|
|
62
|
+
run: |
|
|
63
|
+
pnpm version ${{ inputs.version }} --no-git-tag-version
|
|
64
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
65
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
66
|
+
|
|
67
|
+
- name: Commit and tag
|
|
68
|
+
run: |
|
|
69
|
+
git add package.json
|
|
70
|
+
git commit -m "chore: release v${{ steps.version.outputs.version }}"
|
|
71
|
+
git tag "v${{ steps.version.outputs.version }}"
|
|
72
|
+
git push && git push --tags
|
|
73
|
+
|
|
74
|
+
- name: Build
|
|
75
|
+
run: pnpm build
|
|
76
|
+
|
|
77
|
+
- name: Publish to npm
|
|
78
|
+
run: pnpm publish --access public --no-git-checks ${{ inputs.force && '--force' || '' }}
|
|
79
|
+
# Uses OIDC trusted publishing - no NPM_TOKEN needed
|
|
80
|
+
|
|
81
|
+
- name: Create GitHub Release
|
|
82
|
+
uses: softprops/action-gh-release@v2
|
|
83
|
+
with:
|
|
84
|
+
tag_name: v${{ steps.version.outputs.version }}
|
|
85
|
+
name: v${{ steps.version.outputs.version }}
|
|
86
|
+
generate_release_notes: true
|