@atproto/xrpc 0.4.0 → 0.4.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/xrpc
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atproto/lexicon@0.3.1
9
+
3
10
  ## 0.4.0
4
11
 
5
12
  ### Minor Changes
package/dist/index.js CHANGED
@@ -12688,13 +12688,13 @@ var ensureValidAtUri = (uri2) => {
12688
12688
  throw new Error("ATURI requires at least method and authority sections");
12689
12689
  }
12690
12690
  try {
12691
- ensureValidHandle(parts[2]);
12692
- } catch {
12693
- try {
12691
+ if (parts[2].startsWith("did:")) {
12694
12692
  ensureValidDid(parts[2]);
12695
- } catch {
12696
- throw new Error("ATURI authority must be a valid handle or DID");
12693
+ } else {
12694
+ ensureValidHandle(parts[2]);
12697
12695
  }
12696
+ } catch {
12697
+ throw new Error("ATURI authority must be a valid handle or DID");
12698
12698
  }
12699
12699
  if (parts.length >= 4) {
12700
12700
  if (parts[3].length == 0) {
@@ -13989,7 +13989,7 @@ function datetime(path, value) {
13989
13989
  } catch {
13990
13990
  return {
13991
13991
  success: false,
13992
- error: new ValidationError(`${path} must be an iso8601 formatted datetime`)
13992
+ error: new ValidationError(`${path} must be an valid atproto datetime (both RFC-3339 and ISO-8601)`)
13993
13993
  };
13994
13994
  }
13995
13995
  return { success: true, value };