@atproto/lexicon 0.3.0 → 0.3.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,19 @@
1
1
  # @atproto/lexicon
2
2
 
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`0c815b964`](https://github.com/bluesky-social/atproto/commit/0c815b964c030aa0f277c40bf9786f130dc320f4)]:
8
+ - @atproto/syntax@0.2.0
9
+
10
+ ## 0.3.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`3c0ef382`](https://github.com/bluesky-social/atproto/commit/3c0ef382c12a413cc971ae47ffb341236c545f60)]:
15
+ - @atproto/syntax@0.1.5
16
+
3
17
  ## 0.3.0
4
18
 
5
19
  ### Minor Changes
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  Dual MIT/Apache-2.0 License
2
2
 
3
- Copyright (c) 2022-2023 Bluesky PBC, and Contributors
3
+ Copyright (c) 2022-2024 Bluesky PBC, and Contributors
4
4
 
5
5
  Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
6
6
 
@@ -16,7 +16,7 @@ export declare const typedJsonBlobRef: z.ZodObject<{
16
16
  size: number;
17
17
  ref?: any;
18
18
  }>;
19
- export declare type TypedJsonBlobRef = z.infer<typeof typedJsonBlobRef>;
19
+ export type TypedJsonBlobRef = z.infer<typeof typedJsonBlobRef>;
20
20
  export declare const untypedJsonBlobRef: z.ZodObject<{
21
21
  cid: z.ZodString;
22
22
  mimeType: z.ZodString;
@@ -27,7 +27,7 @@ export declare const untypedJsonBlobRef: z.ZodObject<{
27
27
  cid: string;
28
28
  mimeType: string;
29
29
  }>;
30
- export declare type UntypedJsonBlobRef = z.infer<typeof untypedJsonBlobRef>;
30
+ export type UntypedJsonBlobRef = z.infer<typeof untypedJsonBlobRef>;
31
31
  export declare const jsonBlobRef: z.ZodUnion<[z.ZodObject<{
32
32
  $type: z.ZodLiteral<"blob">;
33
33
  ref: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
@@ -53,7 +53,7 @@ export declare const jsonBlobRef: z.ZodUnion<[z.ZodObject<{
53
53
  cid: string;
54
54
  mimeType: string;
55
55
  }>]>;
56
- export declare type JsonBlobRef = z.infer<typeof jsonBlobRef>;
56
+ export type JsonBlobRef = z.infer<typeof jsonBlobRef>;
57
57
  export declare class BlobRef {
58
58
  ref: CID;
59
59
  mimeType: string;
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 };