@atproto/lexicon 0.3.0 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atproto/lexicon
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`3c0ef382`](https://github.com/bluesky-social/atproto/commit/3c0ef382c12a413cc971ae47ffb341236c545f60)]:
8
+ - @atproto/syntax@0.1.5
9
+
3
10
  ## 0.3.0
4
11
 
5
12
  ### Minor Changes
package/dist/index.js CHANGED
@@ -12644,13 +12644,13 @@ var ensureValidAtUri = (uri2) => {
12644
12644
  throw new Error("ATURI requires at least method and authority sections");
12645
12645
  }
12646
12646
  try {
12647
- ensureValidHandle(parts[2]);
12648
- } catch {
12649
- try {
12647
+ if (parts[2].startsWith("did:")) {
12650
12648
  ensureValidDid(parts[2]);
12651
- } catch {
12652
- throw new Error("ATURI authority must be a valid handle or DID");
12649
+ } else {
12650
+ ensureValidHandle(parts[2]);
12653
12651
  }
12652
+ } catch {
12653
+ throw new Error("ATURI authority must be a valid handle or DID");
12654
12654
  }
12655
12655
  if (parts.length >= 4) {
12656
12656
  if (parts[3].length == 0) {
@@ -13945,7 +13945,7 @@ function datetime(path, value) {
13945
13945
  } catch {
13946
13946
  return {
13947
13947
  success: false,
13948
- error: new ValidationError(`${path} must be an iso8601 formatted datetime`)
13948
+ error: new ValidationError(`${path} must be an valid atproto datetime (both RFC-3339 and ISO-8601)`)
13949
13949
  };
13950
13950
  }
13951
13951
  return { success: true, value };