@atproto/lexicon
Advanced tools
Comparing version 0.3.3-next.0 to 0.3.3
# @atproto/lexicon | ||
## 0.3.3-next.0 | ||
## 0.3.3 | ||
### Patch Changes | ||
- Overhaul of package builds, no longer bundling deps. | ||
- Updated dependencies [[`4eaadc0ac`](https://github.com/bluesky-social/atproto/commit/4eaadc0acb6b73b9745dd7a2b929d02e58083ab0)]: | ||
- @atproto/common-web@0.2.4 | ||
- @atproto/syntax@0.2.1 | ||
- Updated dependencies []: | ||
- @atproto/common-web@0.2.4-next.0 | ||
- @atproto/syntax@0.2.1-next.0 | ||
## 0.3.2 | ||
@@ -14,0 +12,0 @@ |
@@ -24,7 +24,7 @@ import { CID } from 'multiformats/cid'; | ||
}, "strict", z.ZodTypeAny, { | ||
cid: string; | ||
mimeType: string; | ||
}, { | ||
cid: string; | ||
}, { | ||
mimeType: string; | ||
cid: string; | ||
}>; | ||
@@ -51,7 +51,7 @@ export type UntypedJsonBlobRef = z.infer<typeof untypedJsonBlobRef>; | ||
}, "strict", z.ZodTypeAny, { | ||
cid: string; | ||
mimeType: string; | ||
}, { | ||
cid: string; | ||
}, { | ||
mimeType: string; | ||
cid: string; | ||
}>]>; | ||
@@ -70,2 +70,1 @@ export type JsonBlobRef = z.infer<typeof jsonBlobRef>; | ||
} | ||
//# sourceMappingURL=blob-refs.d.ts.map |
@@ -5,2 +5,1 @@ export * from './types'; | ||
export * from './serialize'; | ||
//# sourceMappingURL=index.d.ts.map |
import { LexiconDoc, LexUserType, ValidationResult } from './types'; | ||
/** | ||
* A collection of compiled lexicons. | ||
*/ | ||
export declare class Lexicons { | ||
@@ -9,53 +6,16 @@ docs: Map<string, LexiconDoc>; | ||
constructor(docs?: LexiconDoc[]); | ||
/** | ||
* Add a lexicon doc. | ||
*/ | ||
add(doc: LexiconDoc): void; | ||
/** | ||
* Remove a lexicon doc. | ||
*/ | ||
remove(uri: string): void; | ||
/** | ||
* Get a lexicon doc. | ||
*/ | ||
get(uri: string): LexiconDoc | undefined; | ||
/** | ||
* Get a definition. | ||
*/ | ||
getDef(uri: string): LexUserType | undefined; | ||
/** | ||
* Get a def, throw if not found. Throws on not found. | ||
*/ | ||
getDefOrThrow<T extends LexUserType['type'] = LexUserType['type']>(uri: string, types?: readonly T[]): Extract<LexUserType, { | ||
type: T; | ||
}>; | ||
/** | ||
* Validate a record or object. | ||
*/ | ||
validate(lexUri: string, value: unknown): ValidationResult; | ||
/** | ||
* Validate a record and throw on any error. | ||
*/ | ||
assertValidRecord(lexUri: string, value: unknown): unknown; | ||
/** | ||
* Validate xrpc query params and throw on any error. | ||
*/ | ||
assertValidXrpcParams(lexUri: string, value: unknown): unknown; | ||
/** | ||
* Validate xrpc input body and throw on any error. | ||
*/ | ||
assertValidXrpcInput(lexUri: string, value: unknown): unknown; | ||
/** | ||
* Validate xrpc output body and throw on any error. | ||
*/ | ||
assertValidXrpcOutput(lexUri: string, value: unknown): unknown; | ||
/** | ||
* Validate xrpc subscription message and throw on any error. | ||
*/ | ||
assertValidXrpcMessage<T = unknown>(lexUri: string, value: unknown): T; | ||
/** | ||
* Resolve a lex uri given a ref | ||
*/ | ||
resolveLexUri(lexUri: string, ref: string): string; | ||
} | ||
//# sourceMappingURL=lexicons.d.ts.map |
@@ -13,2 +13,1 @@ import { IpldValue, JsonValue } from '@atproto/common-web'; | ||
export declare const jsonStringToLex: (val: string) => LexValue; | ||
//# sourceMappingURL=serialize.d.ts.map |
@@ -12,2 +12,1 @@ import { Lexicons } from './lexicons'; | ||
}>(object: ObjectType, ctx: z.RefinementCtx): void; | ||
//# sourceMappingURL=util.d.ts.map |
@@ -8,2 +8,1 @@ import { Lexicons } from './lexicons'; | ||
export declare function assertValidXrpcMessage(lexicons: Lexicons, def: LexXrpcSubscription, value: unknown): unknown; | ||
//# sourceMappingURL=validation.d.ts.map |
import { Lexicons } from '../lexicons'; | ||
import { LexUserType, ValidationResult } from '../types'; | ||
export declare function blob(lexicons: Lexicons, path: string, def: LexUserType, value: unknown): ValidationResult; | ||
//# sourceMappingURL=blob.d.ts.map |
@@ -6,2 +6,1 @@ import { Lexicons } from '../lexicons'; | ||
export declare function object(lexicons: Lexicons, path: string, def: LexUserType, value: unknown): ValidationResult; | ||
//# sourceMappingURL=complex.d.ts.map |
@@ -11,2 +11,1 @@ import { ValidationResult } from '../types'; | ||
export declare function language(path: string, value: string): ValidationResult; | ||
//# sourceMappingURL=formats.d.ts.map |
@@ -10,2 +10,1 @@ import { Lexicons } from '../lexicons'; | ||
export declare function unknown(lexicons: Lexicons, path: string, def: LexUserType, value: unknown): ValidationResult; | ||
//# sourceMappingURL=primitives.d.ts.map |
import { Lexicons } from '../lexicons'; | ||
import { LexXrpcParameters, ValidationResult } from '../types'; | ||
export declare function params(lexicons: Lexicons, path: string, def: LexXrpcParameters, val: unknown): ValidationResult; | ||
//# sourceMappingURL=xrpc.d.ts.map |
@@ -1,7 +0,6 @@ | ||
/** @type {import('jest').Config} */ | ||
const base = require('../../jest.config.base.js') | ||
module.exports = { | ||
...base, | ||
displayName: 'Lexicon', | ||
transform: { '^.+\\.(t|j)s$': '@swc/jest' }, | ||
transformIgnorePatterns: [`<rootDir>/node_modules/(?!get-port)`], | ||
setupFiles: ['<rootDir>/../../jest.setup.ts'], | ||
} |
{ | ||
"name": "@atproto/lexicon", | ||
"version": "0.3.3-next.0", | ||
"version": "0.3.3", | ||
"license": "MIT", | ||
@@ -17,3 +17,2 @@ "description": "atproto Lexicon schema language library", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"dependencies": { | ||
@@ -23,12 +22,12 @@ "iso-datestring-validator": "^2.2.2", | ||
"zod": "^3.21.4", | ||
"@atproto/syntax": "^0.2.1-next.0", | ||
"@atproto/common-web": "^0.2.4-next.0" | ||
"@atproto/common-web": "^0.2.4", | ||
"@atproto/syntax": "^0.2.1" | ||
}, | ||
"devDependencies": { | ||
"jest": "^28.1.2" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"build": "tsc --build tsconfig.build.json" | ||
} | ||
"build": "node ./build.js", | ||
"postbuild": "tsc --build tsconfig.build.json", | ||
"update-main-to-dist": "node ../../update-main-to-dist.js packages/lexicon" | ||
}, | ||
"types": "dist/index.d.ts" | ||
} |
{ | ||
"extends": "../../tsconfig/isomorphic.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist" | ||
}, | ||
"include": ["./src"] | ||
"extends": "./tsconfig.json", | ||
"exclude": ["**/*.spec.ts", "**/*.test.ts"] | ||
} |
{ | ||
"include": [], | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", // Your outDir, | ||
"emitDeclarationOnly": true | ||
}, | ||
"include": ["./src"], | ||
"references": [ | ||
{ "path": "./tsconfig.build.json" }, | ||
{ "path": "./tsconfig.tests.json" } | ||
{ "path": "../common/tsconfig.build.json" }, | ||
{ "path": "../nsid/tsconfig.build.json" }, | ||
{ "path": "../uri/tsconfig.build.json" } | ||
] | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2931120
0
40044
0
36
1
Updated@atproto/common-web@^0.2.4
Updated@atproto/syntax@^0.2.1