Zettelstore Client

Check-in Differences
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From v0.8.0 To v0.9.0

2022-12-15
18:39
Add constants to merge endpoint into /z ... (check-in: e93b6cc96d user: stern tags: trunk)
2022-12-12
12:50
Version 0.9.0 ... (check-in: 668f89b43e user: stern tags: trunk, release, v0.9.0)
11:22
Remove Deepsource integration, because it still fails on Go 1.18 elements ... (check-in: 201e5b2e91 user: stern tags: trunk)
2022-11-02
12:56
Remove support for pikchr ... (check-in: 7356da2787 user: stern tags: trunk)
2022-10-26
10:35
Version 0.8.0 ... (check-in: 81588b15bf user: stern tags: trunk, release, v0.8.0)
2022-09-27
07:33
Add two new metadata key names ... (check-in: babb301d99 user: stern tags: trunk)

Deleted .deepsource.toml.

1
2
3
4
5
6
7
8
version = 1

[[analyzers]]
name = "go"
enabled = true

  [analyzers.meta]
  import_root = "github.com/zettelstore/client"
<
<
<
<
<
<
<
<
















Changes to api/const.go.

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
	ValueSyntaxDraw        = "draw"
	ValueSyntaxGif         = "gif"
	ValueSyntaxHTML        = "html"
	ValueSyntaxMarkdown    = "markdown"
	ValueSyntaxMD          = "md"
	ValueSyntaxMustache    = "mustache"
	ValueSyntaxNone        = "none"
	ValueSyntaxPikchr      = "pikchr"
	ValueSyntaxSVG         = "svg"
	ValueSyntaxText        = "text"
	ValueSyntaxZmk         = "zmk"
	ValueUserRoleCreator   = "creator"
	ValueUserRoleOwner     = "owner"
	ValueUserRoleReader    = "reader"
	ValueUserRoleWriter    = "writer"







<







121
122
123
124
125
126
127

128
129
130
131
132
133
134
	ValueSyntaxDraw        = "draw"
	ValueSyntaxGif         = "gif"
	ValueSyntaxHTML        = "html"
	ValueSyntaxMarkdown    = "markdown"
	ValueSyntaxMD          = "md"
	ValueSyntaxMustache    = "mustache"
	ValueSyntaxNone        = "none"

	ValueSyntaxSVG         = "svg"
	ValueSyntaxText        = "text"
	ValueSyntaxZmk         = "zmk"
	ValueUserRoleCreator   = "creator"
	ValueUserRoleOwner     = "owner"
	ValueUserRoleReader    = "reader"
	ValueUserRoleWriter    = "writer"
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173

174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
	HeaderDestination = "Destination"
	HeaderLocation    = "Location"
)

// Values for HTTP query parameter.
const (
	QueryKeyCommand  = "cmd"
	QueryKeyDepth    = "depth"
	QueryKeyDir      = "dir"
	QueryKeyEncoding = "enc"
	QueryKeyLimit    = "limit"
	QueryKeyPart     = "part"
	QueryKeyPhrase   = "phrase"
	QueryKeyQuery    = "q"
)

// Supported dir values.
const (
	DirBackward = "backward"
	DirForward  = "forward"
)

// Supported encoding values.
const (
	EncodingHTML  = "html"

	EncodingSexpr = "sexpr"
	EncodingText  = "text"
	EncodingZJSON = "zjson"
	EncodingZMK   = "zmk"
)

var mapEncodingEnum = map[string]EncodingEnum{
	EncodingHTML:  EncoderHTML,

	EncodingSexpr: EncoderSexpr,
	EncodingText:  EncoderText,
	EncodingZJSON: EncoderZJSON,
	EncodingZMK:   EncoderZmk,
}
var mapEnumEncoding = map[EncodingEnum]string{}








|

















>








>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
	HeaderDestination = "Destination"
	HeaderLocation    = "Location"
)

// Values for HTTP query parameter.
const (
	QueryKeyCommand  = "cmd"
	QueryKeyCost     = "cost"
	QueryKeyDir      = "dir"
	QueryKeyEncoding = "enc"
	QueryKeyLimit    = "limit"
	QueryKeyPart     = "part"
	QueryKeyPhrase   = "phrase"
	QueryKeyQuery    = "q"
)

// Supported dir values.
const (
	DirBackward = "backward"
	DirForward  = "forward"
)

// Supported encoding values.
const (
	EncodingHTML  = "html"
	EncodingMD    = "md"
	EncodingSexpr = "sexpr"
	EncodingText  = "text"
	EncodingZJSON = "zjson"
	EncodingZMK   = "zmk"
)

var mapEncodingEnum = map[string]EncodingEnum{
	EncodingHTML:  EncoderHTML,
	EncodingMD:    EncoderMD,
	EncodingSexpr: EncoderSexpr,
	EncodingText:  EncoderText,
	EncodingZJSON: EncoderZJSON,
	EncodingZMK:   EncoderZmk,
}
var mapEnumEncoding = map[EncodingEnum]string{}

203
204
205
206
207
208
209

210
211
212
213
214
215
216
// EncodingEnum lists all valid encoder keys.
type EncodingEnum uint8

// Values for EncoderEnum
const (
	EncoderUnknown EncodingEnum = iota
	EncoderHTML

	EncoderSexpr
	EncoderText
	EncoderZJSON
	EncoderZmk
)

// String representation of an encoder key.







>







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// EncodingEnum lists all valid encoder keys.
type EncodingEnum uint8

// Values for EncoderEnum
const (
	EncoderUnknown EncodingEnum = iota
	EncoderHTML
	EncoderMD
	EncoderSexpr
	EncoderText
	EncoderZJSON
	EncoderZmk
)

// String representation of an encoder key.

Changes to client/client.go.

475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
	DirBackward
	DirForward
)

// GetZettelContext returns metadata of the given zettel and, more important,
// metadata of zettel that for the context of the first zettel.
func (c *Client) GetZettelContext(
	ctx context.Context, zid api.ZettelID, dir ContextDirection, depth, limit int) (
	*api.ZidMetaRelatedList, error,
) {
	ub := c.newURLBuilder('x').SetZid(zid)
	switch dir {
	case DirBackward:
		ub.AppendKVQuery(api.QueryKeyDir, api.DirBackward)
	case DirForward:
		ub.AppendKVQuery(api.QueryKeyDir, api.DirForward)
	}
	if depth > 0 {
		ub.AppendKVQuery(api.QueryKeyDepth, strconv.Itoa(depth))
	}
	if limit > 0 {
		ub.AppendKVQuery(api.QueryKeyLimit, strconv.Itoa(limit))
	}
	resp, err := c.buildAndExecuteRequest(ctx, http.MethodGet, ub, nil, nil)
	if err != nil {
		return nil, err







|









|
|







475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
	DirBackward
	DirForward
)

// GetZettelContext returns metadata of the given zettel and, more important,
// metadata of zettel that for the context of the first zettel.
func (c *Client) GetZettelContext(
	ctx context.Context, zid api.ZettelID, dir ContextDirection, cost, limit int) (
	*api.ZidMetaRelatedList, error,
) {
	ub := c.newURLBuilder('x').SetZid(zid)
	switch dir {
	case DirBackward:
		ub.AppendKVQuery(api.QueryKeyDir, api.DirBackward)
	case DirForward:
		ub.AppendKVQuery(api.QueryKeyDir, api.DirForward)
	}
	if cost > 0 {
		ub.AppendKVQuery(api.QueryKeyCost, strconv.Itoa(cost))
	}
	if limit > 0 {
		ub.AppendKVQuery(api.QueryKeyLimit, strconv.Itoa(limit))
	}
	resp, err := c.buildAndExecuteRequest(ctx, http.MethodGet, ub, nil, nil)
	if err != nil {
		return nil, err

Changes to www/changes.wiki.

1
2





3
4
5
6
7
8
9
10
11
12
13
14
15
<title>Change Log</title>






<a name="0_6"></a>
<h2>Changes for Version 0.6.0 (2022-08-11)</h2>
  *  Add support to build URLs with search expressions
  *  Use Go 1.19
  *  Fix some bugs

<a name="0_5"></a>
<h2>Changes for Version 0.5.1 (2022-08-08)</h2>
  *  Support for search references
     (minor: api, zjson, sexpr, html)

<h2>Changes for Version 0.5 (2022-07-29)</h2>
  *  Initial public release.


>
>
>
>
>













1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<title>Change Log</title>

<a name="0_9"></a>
<h2>Changes for Version 0.9.0 (2022-12-12)</h2>
  *  Rename <tt>api.QueryKeyDepth</tt> to <tt>api.QueryKeyCost</tt>
  *  Update encode / syntax names

<a name="0_6"></a>
<h2>Changes for Version 0.6.0 (2022-08-11)</h2>
  *  Add support to build URLs with search expressions
  *  Use Go 1.19
  *  Fix some bugs

<a name="0_5"></a>
<h2>Changes for Version 0.5.1 (2022-08-08)</h2>
  *  Support for search references
     (minor: api, zjson, sexpr, html)

<h2>Changes for Version 0.5 (2022-07-29)</h2>
  *  Initial public release.

Changes to www/index.wiki.

1
2
3
4
5
6
7
8
9
10
11
12
<title>Home</title>

This repository contains Go client software to
access [https://zettelstore.de|Zettelstore] via its API.

<h3>Latest Release: 0.6.0 (2022-08-11)</h3>
  *  [./changes.wiki#0_6|Change summary]
  *  [/timeline?p=v0.6.0&bt=v0.5&y=ci|Check-ins for version 0.6.0],
     [/vdiff?to=v0.6.0&from=v0.5|content diff]
  *  [/timeline?df=v0.6.0&y=ci|Check-ins derived from the 0.6.0 release],
     [/vdiff?from=v0.6.0&to=trunk|content diff]
  *  [/timeline?t=release|Timeline of all past releases]





|
|
|
|
|
|

1
2
3
4
5
6
7
8
9
10
11
12
<title>Home</title>

This repository contains Go client software to
access [https://zettelstore.de|Zettelstore] via its API.

<h3>Latest Release: 0.9.0 (2022-12-12)</h3>
  *  [./changes.wiki#0_9|Change summary]
  *  [/timeline?p=v0.9.0&bt=v0.8.0&y=ci|Check-ins for version 0.9.0],
     [/vdiff?to=v0.9.0&from=v0.8.0|content diff]
  *  [/timeline?df=v0.9.0&y=ci|Check-ins derived from the 0.9.0 release],
     [/vdiff?from=v0.9.0&to=trunk|content diff]
  *  [/timeline?t=release|Timeline of all past releases]