Commit Graph

22 Commits

Author SHA1 Message Date
Asai Toshiya 0d237405d9
fix lint error. 2024-10-31 20:43:03 +09:00
Fishcake 94f841f347 Fix fetch to work in the edge and node environments, cleanup type issues
- Fix "TypeError: Invalid redirect value, must be one of "follow" or "manual" ("error" won't be implemented since it does not make sense at the edge; use "manual" and check the response status code)." that is thrown when trying to use fetch in the edge environment  (e.g., workers)
- Cleanup types and variable definitions.
2024-10-28 14:56:10 -03:00
fiatjaf 23d95acb26 move Nip05 type to nip05.ts 2024-09-09 14:23:03 -03:00
António Conselheiro ee76d69b4b
including nostr specialized types (#409)
* including nostr types

* including tests for nostr type guard

* fix tests for nostr type guard

* fix linter and add eslint and prettier to devcontainer

* including null in nostr type guard signature

* fix type, ops

* including ncryptsec in nostr type guard

* fix linter for ncryptsec

* including ncryptsec return type for nip49

* fixing names of nostr types and types guards

* fixing names of nostr types and types guards in unit tests descriptions

* fix prettier

* including type guard for nip5
2024-09-09 14:16:23 -03:00
fiatjaf cf766cd835 nip05: fix regex group 2 matching. 2024-02-12 07:41:44 -03:00
fiatjaf d14830a8ff nip46 big implementation adapted from ignition. 2024-02-11 19:14:04 -03:00
fiatjaf 04252aaaec nip05: improve regex. 2024-02-11 07:48:13 -03:00
Shusui MOYATANI 8c78649d5c ignore HTTP redirect in nip05 2024-02-09 12:00:10 -03:00
Alex Gleason 718032022c
just format 2023-08-31 13:42:15 -05:00
Alex Gleason 08885ab8da Refactor imports: use file extension, improve tree shaking, update tests 2023-05-12 17:03:41 -03:00
Alex Gleason 6a07d2d9d3 nip05: fix not calling underscored fetch 2023-05-07 21:18:22 -03:00
Alex Gleason 341ccc5ac5 nip05: move NIP05Result to the bottom, add another test 2023-05-07 21:18:22 -03:00
Alex Gleason d2a9af2586 nip05 refactoring 2023-05-07 21:18:22 -03:00
channelninja 731705047a fix(nip05): allow dot in name 2023-04-09 19:32:58 -03:00
fiatjaf 63cbc4133a
nip05 domain must have a dot. 2023-03-02 21:32:53 -03:00
fiatjaf 086f8830e3
catch fetch error on nip05. 2023-03-02 08:21:17 -03:00
Luis Miguel 61f397463d nip05 supports uppercase
nip05 says `NIP-05 assumes the <local-part> part will be restricted to the characters a-z0-9-_., case insensitive`

So a lot of people is starting the names with uppercase. See here:

`https://nostr-check.com/.well-known/nostr.json`

So I think we should change the regex to accept lowercase or uppercase.

Another way to do it would be to do a `.toLowerCase` at the beginning, but then we would need to do this search ignoring the case:

```
if (!res?.names?.[name])
```

So maybe for now this is enough?
2023-01-31 10:22:11 -03:00
fiatjaf f7e510e1c8
nip05 regex name check. 2022-12-23 15:04:24 -03:00
fiatjaf c08bdac7a7
catch usage of global fetch for nodejs.
fixes https://github.com/fiatjaf/nostr-tools/issues/53
2022-12-23 11:36:37 -03:00
fiatjaf 3f1025f551
nip05.queryProfile() and test. 2022-12-20 18:36:49 -03:00
fiatjaf 72781e0eab
nip05 typescript fixes. 2022-12-20 16:16:59 -03:00
fiatjaf de8bdd8370
fix typescript types everywhere, delete pool.js and refactor relay.js to use event listeners everywhere. 2022-12-18 17:02:19 -03:00