@atproto/xrpc-server 0.4.1 → 0.4.2

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-server
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atproto/lexicon@0.3.1
9
+
3
10
  ## 0.4.1
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -43596,13 +43596,13 @@ var ensureValidAtUri = (uri2) => {
43596
43596
  throw new Error("ATURI requires at least method and authority sections");
43597
43597
  }
43598
43598
  try {
43599
- ensureValidHandle(parts[2]);
43600
- } catch {
43601
- try {
43599
+ if (parts[2].startsWith("did:")) {
43602
43600
  ensureValidDid(parts[2]);
43603
- } catch {
43604
- throw new Error("ATURI authority must be a valid handle or DID");
43601
+ } else {
43602
+ ensureValidHandle(parts[2]);
43605
43603
  }
43604
+ } catch {
43605
+ throw new Error("ATURI authority must be a valid handle or DID");
43606
43606
  }
43607
43607
  if (parts.length >= 4) {
43608
43608
  if (parts[3].length == 0) {
@@ -44938,7 +44938,7 @@ function datetime(path, value) {
44938
44938
  } catch {
44939
44939
  return {
44940
44940
  success: false,
44941
- error: new ValidationError(`${path} must be an iso8601 formatted datetime`)
44941
+ error: new ValidationError(`${path} must be an valid atproto datetime (both RFC-3339 and ISO-8601)`)
44942
44942
  };
44943
44943
  }
44944
44944
  return { success: true, value };
@@ -52923,11 +52923,9 @@ var Server = class {
52923
52923
  req,
52924
52924
  res
52925
52925
  };
52926
- if (consumeRateLimit) {
52927
- const result = await consumeRateLimit(reqCtx);
52928
- if (result instanceof RateLimitExceededError) {
52929
- return next(result);
52930
- }
52926
+ const result = await consumeRateLimit(reqCtx);
52927
+ if (result instanceof RateLimitExceededError) {
52928
+ return next(result);
52931
52929
  }
52932
52930
  const outputUnvalidated = await handler(reqCtx);
52933
52931
  if (isHandlerError(outputUnvalidated)) {