Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From v0.19.0 To v0.20.0
2025-03-07
| ||
16:02 | Fix date in home page ... (Leaf check-in: 9c43b4d2b2 user: stern tags: trunk) | |
15:01 | Version 0.20.0 ... (check-in: 16b4168715 user: stern tags: release, trunk, v0.20.0) | |
2025-03-04
| ||
21:11 | sz: allow optional inlines in Transclude list ... (check-in: d73c989323 user: stern tags: trunk) | |
2024-12-13
| ||
14:14 | Remove query action constants for rss/atom feed ... (check-in: 7902e0d349 user: stern tags: trunk) | |
12:10 | Version 0.19.0 ... (check-in: fd15ae683e user: stern tags: release, trunk, v0.19.0) | |
2024-12-02
| ||
17:00 | Remove some linter errors (revive) ... (check-in: 2b332aee9c user: stern tags: trunk) | |
Changes to api/api.go.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - + - - - - - - - - - - - - - - - - | // SPDX-License-Identifier: EUPL-1.2 // SPDX-FileCopyrightText: 2021-present Detlef Stern //----------------------------------------------------------------------------- // Package api contains common definitions used for client and server. package api |
︙ | |||
55 56 57 58 59 60 61 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + - + | type MetaRights struct { Meta ZettelMeta Rights ZettelRights } // ZidMetaRights contains the identifier, the metadata of a zettel, and its rights. type ZidMetaRights struct { |
Changes to api/const.go.
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | // SPDX-FileCopyrightText: 2021-present Detlef Stern //----------------------------------------------------------------------------- package api import "fmt" |
︙ | |||
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | + - - - | ContextDirective = "CONTEXT" // Context directive CostDirective = "COST" // Maximum cost of a context operation ForwardDirective = "FORWARD" // Forward-only context FullDirective = "FULL" // Include tags in context IdentDirective = "IDENT" // Use only specified zettel ItemsDirective = "ITEMS" // Select list elements in a zettel MaxDirective = "MAX" // Maximum number of context results MinDirective = "MIN" // Minimum number of context results LimitDirective = "LIMIT" // Maximum number of zettel OffsetDirective = "OFFSET" // Offset to start returned zettel list OrDirective = "OR" // Combine several search expression with an "or" OrderDirective = "ORDER" // Specify metadata keys for the order of returned list PhraseDirective = "PHRASE" // Only unlinked zettel with given phrase PickDirective = "PICK" // Pick some random zettel RandomDirective = "RANDOM" // Order zettel list randomly ReverseDirective = "REVERSE" // Reverse the order of a zettel list UnlinkedDirective = "UNLINKED" // Search for zettel that contain a phase(s) but do not link ActionSeparator = "|" // Separates action list of previous elements of query expression |
︙ |
Changes to api/urlbuilder.go.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | + - + + + | // // SPDX-License-Identifier: EUPL-1.2 // SPDX-FileCopyrightText: 2020-present Detlef Stern //----------------------------------------------------------------------------- package api import ( |
︙ | |||
38 39 40 41 42 43 44 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - - + + | cpy := new(URLBuilder) ub.base.Copy(&cpy.base) cpy.prefix = ub.prefix return cpy } // SetZid sets the zettel identifier. |
︙ |
Changes to attrs/attrs.go.
︙ | |||
11 12 13 14 15 16 17 18 19 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + - - | // SPDX-FileCopyrightText: 2020-present Detlef Stern //----------------------------------------------------------------------------- // Package attrs stores attributes of zettel parts. package attrs import ( "maps" "slices" "strings" |
︙ | |||
44 45 46 47 48 49 50 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + - + - - - - - - - - - | if a != nil { a.Remove(DefaultAttribute) } return a } // Keys returns the sorted list of keys. |
︙ |
Changes to client/client.go.
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + | "strconv" "strings" "time" "t73f.de/r/sx" "t73f.de/r/sx/sxreader" "t73f.de/r/zsc/api" "t73f.de/r/zsc/domain/id" "t73f.de/r/zsc/sexp" ) // Client contains all data to execute requests. type Client struct { base string username string |
︙ | |||
185 186 187 188 189 190 191 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - + | } func (c *Client) executeAuthRequest(req *http.Request) error { resp, err := c.executeRequest(req) if err != nil { return err } |
︙ | |||
247 248 249 250 251 252 253 | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | - + - + - + - + - + - - + - - - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + | } // CreateZettel creates a new zettel and returns its URL. // // data contains the zettel metadata and content, as it is stored in a file in a zettel box, // or as returned by [Client.GetZettel]. // Metadata is separated from zettel content by an empty line. |
Changes to client/client_test.go.
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | + - + - + | "flag" "net/http" "net/url" "testing" "t73f.de/r/zsc/api" "t73f.de/r/zsc/client" "t73f.de/r/zsc/domain/id" ) func TestZettelList(t *testing.T) { c := getClient() _, err := c.QueryZettel(context.Background(), "") if err != nil { t.Error(err) return } } func TestGetProtectedZettel(t *testing.T) { c := getClient() |
︙ |
Changes to client/retrieve.go.
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | "fmt" "io" "net/http" "t73f.de/r/sx" "t73f.de/r/sx/sxreader" "t73f.de/r/zsc/api" "t73f.de/r/zsc/domain/id" "t73f.de/r/zsc/sexp" "t73f.de/r/zsc/sz" ) var bsLF = []byte{'\n'} // QueryZettel returns a list of all Zettel based on the given query. |
︙ | |||
41 42 43 44 45 46 47 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + | // [Query the list of all zettel]: https://zettelstore.de/manual/h/00001012051400 func (c *Client) QueryZettel(ctx context.Context, query string) ([][]byte, error) { ub := c.NewURLBuilder('z').AppendQuery(query) resp, err := c.buildAndExecuteRequest(ctx, http.MethodGet, ub, nil) if err != nil { return nil, err } |
︙ | |||
74 75 76 77 78 79 80 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - - + + - + - - - - - - - + - + | // [Query the list of all zettel]: https://zettelstore.de/manual/h/00001012051400 func (c *Client) QueryZettelData(ctx context.Context, query string) (string, string, []api.ZidMetaRights, error) { ub := c.NewURLBuilder('z').AppendKVQuery(api.QueryKeyEncoding, api.EncodingData).AppendQuery(query) resp, err := c.buildAndExecuteRequest(ctx, http.MethodGet, ub, nil) if err != nil { return "", "", nil, err } |
︙ | |||
178 179 180 181 182 183 184 | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | - + - + - + - + - + - + - + - + - - - + - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | return nil, nil } agg := make(api.Aggregate, len(lines)) for _, line := range lines { if fields := bytes.Fields(line); len(fields) > 1 { key := string(fields[0]) for _, field := range fields[1:] { |
︙ | |||
415 416 417 418 419 420 421 | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | - + | // GetVersionInfo returns version information of the Zettelstore that is used. func (c *Client) GetVersionInfo(ctx context.Context) (VersionInfo, error) { resp, err := c.buildAndExecuteRequest(ctx, http.MethodGet, c.NewURLBuilder('x'), nil) if err != nil { return VersionInfo{}, err } |
︙ | |||
459 460 461 462 463 464 465 | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - - + + - + - + - + + - + - + | Patch int Info string Hash string } // GetApplicationZid returns the zettel identifier used to configure a client // application with the given name. |
Added domain/id/id.go.