Commit graph

156 commits

Author SHA1 Message Date
Kim Alvefur
2ef0e122fd util.xtemplate: Use same argument order in filters even without 'args'
This removes the different argument order used between '{x|foo}' and
'{x|foo(y)}' because the differing order was awkward and confusing.

This util does not seem to be widely used so should not be problematic
to change this part. The only known use is in mod_pubsub, which does not
use the filter function feature.
2024-10-16 16:15:05 +02:00
Kim Alvefur
8a96854733 util.xtemplate: Fix error on applying each() to zero stanzas 2024-07-11 15:04:29 +02:00
Kim Alvefur
01a44e88db mod_cron: Fix log format to account for float that was integer before 2024-02-24 14:35:17 +01:00
Kim Alvefur
cef925e9a5 mod_cron: Sync Teal source with 92301fa7a673
Yeah, it's weird to have two versions. Needing more build dependencies
is also something we want to avoid, so here we are.
2024-02-24 14:32:59 +01:00
Kim Alvefur
a2b268528d util.strbitop: Add common_prefix_bits() to Teal interface description 2024-02-23 16:38:05 +01:00
Kim Alvefur
bb081f052f util.hashes: Add missing entries to Teal interface description
Also sorted to match C source
2024-02-23 16:35:21 +01:00
Kim Alvefur
c333519fb2 util.crypto: Update Teal interface description to match C sources
Was missing some entries.

Rearranged to match order of entries in the C source Reg table.
2024-02-23 16:33:08 +01:00
Kim Alvefur
c61c78447b util.xtemplate: Adopt {-path-} syntax to strip preceding and/or trailing whitespace
Seen in some other template languages
2023-12-09 14:57:41 +01:00
Kim Alvefur
e03fe2ebe3 util.jsonschema: Return basic structured validation response 2023-12-02 21:45:38 +01:00
Matthew Wild
56d45091bd mod_cron: Update Teal source and rebuild 2023-11-30 12:41:26 +00:00
Kim Alvefur
43d1285dbd moduleapi: Update Teal spec
Updates for 65fb0d7a2312::59c3d775c7fa
2023-11-13 10:40:24 +01:00
Kim Alvefur
7b882e4405 mod_cron: Make task frequencies configurable in overly generic manner
Requested feature for many modules, notably MAM and file sharing.
2023-10-22 18:58:02 +02:00
Kim Alvefur
76bf26057e mod_cron: Fix missing restore method in Teal record definition 2023-10-22 18:57:28 +02:00
Kim Alvefur
da4111b997 mod_cron: Remove unused import [luacheck]
Use of datetime was removed in 6ac5ad578565
2023-10-15 16:41:25 +02:00
Kim Alvefur
9f21d5487c mod_cron: Load last task run time inside task runner to fix async
This ensures that all interactions with storage happen inside an async
thread, allowing async waiting to be performed in storage drivers.
2023-10-14 22:32:33 +02:00
Kim Alvefur
3a071d87b8 mod_cron: Revert bbd3ac65640d
Maybe it is better to run daily and weekly tasks 'now' on the theory
that people set these things up during times that are appropriate for
maintenance already, so the same time next day or next week might be
fine for periodic cleanup.
2023-07-30 13:03:40 +02:00
Kim Alvefur
048b064fcd util.pposix: Add remove_blocks() for deleting parts of files
Allows implementing e.g. a FIFO

Will probably only work on some Linux file systems like ext4.
2023-06-07 05:07:03 +02:00
Kim Alvefur
8ba5e50cc2 util.serialization: Teach Teal about the new "pretty" preset 2023-06-30 18:51:03 +02:00
Kim Alvefur
e9a9633aec util.jsonpointer: Change function prototype to allow anything
But anything that's not a table can't be resolved into, which could
happen in the middle, so eh.
2023-06-30 18:45:18 +02:00
Kim Alvefur
70e4b13d0e util.jsonpointer: Silence Teal warning
It seems to think 'table' never has array items, but we don't know that.
2023-06-30 15:02:26 +02:00
Kim Alvefur
597f3c7f0a util.jsonschema: Remove wrapper function
This was to silence some Teal warning that seems to have gone away.
2023-06-17 17:19:40 +02:00
Kim Alvefur
f0242ae57c util.jsonschema: Silence Teal warnings about utf8 library
Teal worries that we redefine the global.

Also that the fallback was missing type information.
2023-06-17 17:17:44 +02:00
Kim Alvefur
c8b5d7e99a util.jsonschema: Silence Teal warnings about counting items in tables
Teal thinks that these are key-value maps which are always of length
zero, but that is not the case.
2023-06-17 17:12:54 +02:00
Kim Alvefur
3320521129 teal: Describe http_url method
It is not part of the "real" module API, but used in various places.
Extending the API seems hard to describe in a type-safe way.
2023-05-24 14:56:50 +02:00
Kim Alvefur
693ac009db util.jsonschema: Fix UTF-8ness of 'minLength' and 'maxLength' 2023-04-23 10:42:07 +02:00
Kim Alvefur
3621b8ce91 util.jsonschema: Implement 'minContains' and 'maxContains' 2023-04-23 10:26:43 +02:00
Kim Alvefur
d78a32f136 util.jsonschema: Add some comments wrt Lua-specifics 2023-04-22 13:30:19 +02:00
Kim Alvefur
9c7c94ab73 util.jsonschema: Implement 'luaPattern' - Lua variant of 'pattern'
Like 'pattern' but uses Lua patterns instead of Regular Expressions,
since only a subset of regex are also valid Lua patterns.
2023-04-22 12:48:51 +02:00
Kim Alvefur
1dad83d28e util.jsonschema: Implement 'luaPatternProperties' as Lua variant of 'patternProperties'
Previous version of this patch used 'patternProperties' but that would
only work with simpler ECMA-262 regular expressions are also valid Lua
patterns.
2023-04-22 12:14:29 +02:00
Kim Alvefur
0e6043ecb6 util.jsonschema: Fix NYI 'patternProperties' definition
It's defined as an object mapping regex to schema, not a single schema
2023-04-22 12:13:38 +02:00
Kim Alvefur
aa0d6f297d util.set: Add missing remove function in Teal spec 2023-03-31 23:19:07 +02:00
Kim Alvefur
10431cfec6 net.http: Rename enum in Teal spec to avoid name clash 2023-03-31 23:18:49 +02:00
Kim Alvefur
9305f47525 teal-src/README: Words on Compiling to Lua 2023-03-28 11:42:20 +02:00
Kim Alvefur
4a78b88efd teal-src/README: Tweak markdown syntax 2023-03-28 11:42:09 +02:00
Kim Alvefur
0d2a9ef54a teal-src: Add a README with a few pointers to get started 2023-03-28 11:27:05 +02:00
Matthew Wild
5a831462c3 teal-src: Add keyval+ store type 2023-03-28 10:22:55 +01:00
Kim Alvefur
50058a1e46 util.jsonschema: Reorder type definition by specification, section
Also some comment headers and missing properties
2023-03-26 16:07:34 +02:00
Kim Alvefur
8c9ffa25eb util.jsonschema: Implement 'dependentSchemas'
If this object key exists then this schema must validate against the
current object.  Seems useful.
2023-03-26 15:20:07 +02:00
Kim Alvefur
4bc62438db util.jsonschema: Implement 'dependentRequired'
If this field exists, then these fields must also exist.
2023-03-26 15:19:14 +02:00
Kim Alvefur
f68336b96e teal: Move into prosody namespace 2023-03-23 13:36:52 +01:00
Kim Alvefur
adb37b8272 util.ip: Add Teal interface description 2023-03-14 19:46:46 +01:00
Kim Alvefur
b64d6afeab util.jwt: Import definition of key from util.crypto
Turns out we had a definition of that already
2023-03-10 13:58:43 +01:00
Kim Alvefur
7623bc24de util.jwt: Fixup argument and type order 2023-03-10 13:58:14 +01:00
Kim Alvefur
4fa75289f6 util.jwt: Document interface as Teal definition file 2023-03-10 10:55:50 +01:00
Kim Alvefur
931c14e50b core.usermanager: Add methods for enabling and disabling users
Calling into the auth module, where available.
2023-02-23 16:24:41 +01:00
Kim Alvefur
ef6ad34029 core.usermanager: Add Teal description file 2023-02-23 16:04:02 +01:00
Kim Alvefur
6ce26b1c94 MUC: Add Occupant API methods to Teal spec 2023-02-20 18:16:12 +01:00
Kim Alvefur
bac012d675 MUC: Add Teal description of muc.lib functions 2023-02-20 15:11:29 +01:00
Kim Alvefur
a35dac3a80 MUC: Start on a Teal description of MUC rooms
Started as part of a documentation project for the MUC API
2023-02-20 15:08:06 +01:00
Kim Alvefur
e2cff34641 util.mathcompat: Module to ease reuse of math.type()
Mostly to ensure it is available during tests, as util.startup is not
invoked there
2022-10-20 16:50:12 +02:00