@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.
- package/CHANGELOG.md +4 -6
- package/build.js +14 -0
- package/dist/blob-refs.d.ts +4 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +15097 -20
- package/dist/index.js.map +7 -1
- package/dist/lexicons.d.ts +0 -40
- package/dist/serialize.d.ts +0 -1
- package/dist/types.d.ts +400 -401
- package/dist/util.d.ts +0 -1
- package/dist/validation.d.ts +0 -1
- package/dist/validators/blob.d.ts +0 -1
- package/dist/validators/complex.d.ts +0 -1
- package/dist/validators/formats.d.ts +0 -1
- package/dist/validators/primitives.d.ts +0 -1
- package/dist/validators/xrpc.d.ts +0 -1
- package/jest.config.js +3 -4
- package/package.json +8 -9
- package/tsconfig.build.json +2 -6
- package/tsconfig.json +10 -3
- package/dist/blob-refs.d.ts.map +0 -1
- package/dist/blob-refs.js +0 -82
- package/dist/blob-refs.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lexicons.d.ts.map +0 -1
- package/dist/lexicons.js +0 -228
- package/dist/lexicons.js.map +0 -1
- package/dist/serialize.d.ts.map +0 -1
- package/dist/serialize.js +0 -80
- package/dist/serialize.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -331
- package/dist/types.js.map +0 -1
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -158
- package/dist/util.js.map +0 -1
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -67
- package/dist/validation.js.map +0 -1
- package/dist/validators/blob.d.ts.map +0 -1
- package/dist/validators/blob.js +0 -17
- package/dist/validators/blob.js.map +0 -1
- package/dist/validators/complex.d.ts.map +0 -1
- package/dist/validators/complex.js +0 -144
- package/dist/validators/complex.js.map +0 -1
- package/dist/validators/formats.d.ts.map +0 -1
- package/dist/validators/formats.js +0 -125
- package/dist/validators/formats.js.map +0 -1
- package/dist/validators/primitives.d.ts.map +0 -1
- package/dist/validators/primitives.js +0 -289
- package/dist/validators/primitives.js.map +0 -1
- package/dist/validators/xrpc.d.ts.map +0 -1
- package/dist/validators/xrpc.js +0 -67
- package/dist/validators/xrpc.js.map +0 -1
- package/tsconfig.tests.json +0 -7
package/dist/lexicons.d.ts
CHANGED
|
@@ -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
|
package/dist/serialize.d.ts
CHANGED
|
@@ -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
|