@atproto/lexicon 0.3.3-next.0 → 0.3.3

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +4 -6
  2. package/build.js +14 -0
  3. package/dist/blob-refs.d.ts +4 -5
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +15097 -20
  6. package/dist/index.js.map +7 -1
  7. package/dist/lexicons.d.ts +0 -40
  8. package/dist/serialize.d.ts +0 -1
  9. package/dist/types.d.ts +400 -401
  10. package/dist/util.d.ts +0 -1
  11. package/dist/validation.d.ts +0 -1
  12. package/dist/validators/blob.d.ts +0 -1
  13. package/dist/validators/complex.d.ts +0 -1
  14. package/dist/validators/formats.d.ts +0 -1
  15. package/dist/validators/primitives.d.ts +0 -1
  16. package/dist/validators/xrpc.d.ts +0 -1
  17. package/jest.config.js +3 -4
  18. package/package.json +8 -9
  19. package/tsconfig.build.json +2 -6
  20. package/tsconfig.json +10 -3
  21. package/dist/blob-refs.d.ts.map +0 -1
  22. package/dist/blob-refs.js +0 -82
  23. package/dist/blob-refs.js.map +0 -1
  24. package/dist/index.d.ts.map +0 -1
  25. package/dist/lexicons.d.ts.map +0 -1
  26. package/dist/lexicons.js +0 -228
  27. package/dist/lexicons.js.map +0 -1
  28. package/dist/serialize.d.ts.map +0 -1
  29. package/dist/serialize.js +0 -80
  30. package/dist/serialize.js.map +0 -1
  31. package/dist/types.d.ts.map +0 -1
  32. package/dist/types.js +0 -331
  33. package/dist/types.js.map +0 -1
  34. package/dist/util.d.ts.map +0 -1
  35. package/dist/util.js +0 -158
  36. package/dist/util.js.map +0 -1
  37. package/dist/validation.d.ts.map +0 -1
  38. package/dist/validation.js +0 -67
  39. package/dist/validation.js.map +0 -1
  40. package/dist/validators/blob.d.ts.map +0 -1
  41. package/dist/validators/blob.js +0 -17
  42. package/dist/validators/blob.js.map +0 -1
  43. package/dist/validators/complex.d.ts.map +0 -1
  44. package/dist/validators/complex.js +0 -144
  45. package/dist/validators/complex.js.map +0 -1
  46. package/dist/validators/formats.d.ts.map +0 -1
  47. package/dist/validators/formats.js +0 -125
  48. package/dist/validators/formats.js.map +0 -1
  49. package/dist/validators/primitives.d.ts.map +0 -1
  50. package/dist/validators/primitives.js +0 -289
  51. package/dist/validators/primitives.js.map +0 -1
  52. package/dist/validators/xrpc.d.ts.map +0 -1
  53. package/dist/validators/xrpc.js +0 -67
  54. package/dist/validators/xrpc.js.map +0 -1
  55. package/tsconfig.tests.json +0 -7
@@ -1,60 +1,20 @@
1
1
  import { LexiconDoc, LexUserType, ValidationResult } from './types';
2
- /**
3
- * A collection of compiled lexicons.
4
- */
5
2
  export declare class Lexicons {
6
3
  docs: Map<string, LexiconDoc>;
7
4
  defs: Map<string, LexUserType>;
8
5
  constructor(docs?: LexiconDoc[]);
9
- /**
10
- * Add a lexicon doc.
11
- */
12
6
  add(doc: LexiconDoc): void;
13
- /**
14
- * Remove a lexicon doc.
15
- */
16
7
  remove(uri: string): void;
17
- /**
18
- * Get a lexicon doc.
19
- */
20
8
  get(uri: string): LexiconDoc | undefined;
21
- /**
22
- * Get a definition.
23
- */
24
9
  getDef(uri: string): LexUserType | undefined;
25
- /**
26
- * Get a def, throw if not found. Throws on not found.
27
- */
28
10
  getDefOrThrow<T extends LexUserType['type'] = LexUserType['type']>(uri: string, types?: readonly T[]): Extract<LexUserType, {
29
11
  type: T;
30
12
  }>;
31
- /**
32
- * Validate a record or object.
33
- */
34
13
  validate(lexUri: string, value: unknown): ValidationResult;
35
- /**
36
- * Validate a record and throw on any error.
37
- */
38
14
  assertValidRecord(lexUri: string, value: unknown): unknown;
39
- /**
40
- * Validate xrpc query params and throw on any error.
41
- */
42
15
  assertValidXrpcParams(lexUri: string, value: unknown): unknown;
43
- /**
44
- * Validate xrpc input body and throw on any error.
45
- */
46
16
  assertValidXrpcInput(lexUri: string, value: unknown): unknown;
47
- /**
48
- * Validate xrpc output body and throw on any error.
49
- */
50
17
  assertValidXrpcOutput(lexUri: string, value: unknown): unknown;
51
- /**
52
- * Validate xrpc subscription message and throw on any error.
53
- */
54
18
  assertValidXrpcMessage<T = unknown>(lexUri: string, value: unknown): T;
55
- /**
56
- * Resolve a lex uri given a ref
57
- */
58
19
  resolveLexUri(lexUri: string, ref: string): string;
59
20
  }
60
- //# sourceMappingURL=lexicons.d.ts.map
@@ -10,4 +10,3 @@ export declare const lexToJson: (val: LexValue) => JsonValue;
10
10
  export declare const stringifyLex: (val: LexValue) => string;
11
11
  export declare const jsonToLex: (val: JsonValue) => LexValue;
12
12
  export declare const jsonStringToLex: (val: string) => LexValue;
13
- //# sourceMappingURL=serialize.d.ts.map