atproto explorer pdsls.dev
atproto tool

revert local schema validation

juli.ee 38df6c06 e1224663

verified
Changed files
+123 -1
src
utils
types
views
+2
package.json
···
"@atcute/did-plc": "^0.2.0",
"@atcute/identity": "^1.1.3",
"@atcute/identity-resolver": "^1.1.4",
+
"@atcute/leaflet": "^1.0.12",
"@atcute/lexicon-doc": "^2.0.1",
"@atcute/lexicon-resolver": "^0.1.4",
"@atcute/lexicons": "^1.2.4",
"@atcute/oauth-browser-client": "^2.0.1",
"@atcute/repo": "^0.1.0",
+
"@atcute/tangled": "^1.0.12",
"@atcute/tid": "^1.0.3",
"@codemirror/commands": "^6.10.0",
"@codemirror/lang-json": "^6.0.2",
+22
pnpm-lock.yaml
···
'@atcute/identity-resolver':
specifier: ^1.1.4
version: 1.1.4(@atcute/identity@1.1.3)
+
'@atcute/leaflet':
+
specifier: ^1.0.12
+
version: 1.0.12
'@atcute/lexicon-doc':
specifier: ^2.0.1
version: 2.0.1
···
'@atcute/repo':
specifier: ^0.1.0
version: 0.1.0
+
'@atcute/tangled':
+
specifier: ^1.0.12
+
version: 1.0.12
'@atcute/tid':
specifier: ^1.0.3
version: 1.0.3
···
'@atcute/identity@1.1.3':
resolution: {integrity: sha512-oIqPoI8TwWeQxvcLmFEZLdN2XdWcaLVtlm8pNk0E72As9HNzzD9pwKPrLr3rmTLRIoULPPFmq9iFNsTeCIU9ng==}
+
'@atcute/leaflet@1.0.12':
+
resolution: {integrity: sha512-T5laBTl8vwzy0eZXBy07IQSjsLqhbZmRJsffnNQ6XMSc+lnCZ/NHfuKy8TNJbDU6dc26Z7o5l0ELfWz5QESo+w==}
+
'@atcute/lexicon-doc@2.0.1':
resolution: {integrity: sha512-yWgcBYkvifczVODZSgdVkIljzIfdh50t+QXjkDL/FSu2RP43NGBEZ5xfZqJcT68/UoyE+doSg0dhvOEIlVGU/A==}
···
'@atcute/repo@0.1.0':
resolution: {integrity: sha512-INiYAuma8dydBu7cqd2WVpcXh3mzhIepYBUqFWAK5MqMulPRLTRCc/9GW3G9pxYrOdlvLCVamG2Jf8XK0nuFEw==}
+
+
'@atcute/tangled@1.0.12':
+
resolution: {integrity: sha512-JKA5sOhd8SLhDFhY+PKHqLLytQBBKSiwcaEzfYUJBeyfvqXFPNNAwvRbe3VST4IQ3izoOu3O0R9/b1mjL45UzA==}
'@atcute/tid@1.0.3':
resolution: {integrity: sha512-wfMJx1IMdnu0CZgWl0uR4JO2s6PGT1YPhpytD4ZHzEYKKQVuqV6Eb/7vieaVo1eYNMp2FrY67FZObeR7utRl2w==}
···
'@atcute/lexicons': 1.2.4
'@badrap/valita': 0.4.6
+
'@atcute/leaflet@1.0.12':
+
dependencies:
+
'@atcute/atproto': 3.1.9
+
'@atcute/lexicons': 1.2.4
+
'@atcute/lexicon-doc@2.0.1':
dependencies:
'@atcute/identity': 1.1.3
···
'@atcute/lexicons': 1.2.4
'@atcute/mst': 0.1.0
'@atcute/uint8array': 1.0.5
+
+
'@atcute/tangled@1.0.12':
+
dependencies:
+
'@atcute/atproto': 3.1.9
+
'@atcute/lexicons': 1.2.4
'@atcute/tid@1.0.3': {}
+94
src/utils/types/lexicons.ts
···
+
import {
+
AppBskyActorProfile,
+
AppBskyActorStatus,
+
AppBskyFeedGenerator,
+
AppBskyFeedLike,
+
AppBskyFeedPost,
+
AppBskyFeedPostgate,
+
AppBskyFeedRepost,
+
AppBskyFeedThreadgate,
+
AppBskyGraphBlock,
+
AppBskyGraphFollow,
+
AppBskyGraphList,
+
AppBskyGraphListblock,
+
AppBskyGraphListitem,
+
AppBskyGraphStarterpack,
+
AppBskyGraphVerification,
+
AppBskyLabelerService,
+
ChatBskyActorDeclaration,
+
} from "@atcute/bluesky";
+
import {
+
PubLeafletComment,
+
PubLeafletDocument,
+
PubLeafletGraphSubscription,
+
PubLeafletPublication,
+
} from "@atcute/leaflet";
+
import {
+
ShTangledActorProfile,
+
ShTangledFeedStar,
+
ShTangledGraphFollow,
+
ShTangledKnot,
+
ShTangledKnotMember,
+
ShTangledPublicKey,
+
ShTangledRepo,
+
ShTangledRepoArtifact,
+
ShTangledRepoIssue,
+
ShTangledRepoIssueComment,
+
ShTangledRepoIssueState,
+
ShTangledRepoIssueStateClosed,
+
ShTangledRepoIssueStateOpen,
+
ShTangledRepoPull,
+
ShTangledRepoPullComment,
+
ShTangledRepoPullStatus,
+
ShTangledRepoPullStatusClosed,
+
ShTangledRepoPullStatusMerged,
+
ShTangledRepoPullStatusOpen,
+
} from "@atcute/tangled";
+
+
export const lexicons: Record<string, any> = {
+
// Bluesky
+
"app.bsky.actor.profile": AppBskyActorProfile.mainSchema,
+
"app.bsky.actor.status": AppBskyActorStatus.mainSchema,
+
"app.bsky.feed.generator": AppBskyFeedGenerator.mainSchema,
+
"app.bsky.feed.like": AppBskyFeedLike.mainSchema,
+
"app.bsky.feed.post": AppBskyFeedPost.mainSchema,
+
"app.bsky.feed.postgate": AppBskyFeedPostgate.mainSchema,
+
"app.bsky.feed.repost": AppBskyFeedRepost.mainSchema,
+
"app.bsky.feed.threadgate": AppBskyFeedThreadgate.mainSchema,
+
"app.bsky.graph.block": AppBskyGraphBlock.mainSchema,
+
"app.bsky.graph.follow": AppBskyGraphFollow.mainSchema,
+
"app.bsky.graph.list": AppBskyGraphList.mainSchema,
+
"app.bsky.graph.listblock": AppBskyGraphListblock.mainSchema,
+
"app.bsky.graph.listitem": AppBskyGraphListitem.mainSchema,
+
"app.bsky.graph.starterpack": AppBskyGraphStarterpack.mainSchema,
+
"app.bsky.graph.verification": AppBskyGraphVerification.mainSchema,
+
"app.bsky.labeler.service": AppBskyLabelerService.mainSchema,
+
"chat.bsky.actor.declaration": ChatBskyActorDeclaration.mainSchema,
+
+
// Tangled
+
"sh.tangled.actor.profile": ShTangledActorProfile.mainSchema,
+
"sh.tangled.feed.star": ShTangledFeedStar.mainSchema,
+
"sh.tangled.graph.follow": ShTangledGraphFollow.mainSchema,
+
"sh.tangled.knot.member": ShTangledKnotMember.mainSchema,
+
"sh.tangled.publicKey": ShTangledPublicKey.mainSchema,
+
"sh.tangled.repo": ShTangledRepo.mainSchema,
+
"sh.tangled.repo.artifact": ShTangledRepoArtifact.mainSchema,
+
"sh.tangled.repo.issue": ShTangledRepoIssue.mainSchema,
+
"sh.tangled.repo.issue.comment": ShTangledRepoIssueComment.mainSchema,
+
"sh.tangled.repo.issue.state": ShTangledRepoIssueState.mainSchema,
+
"sh.tangled.repo.issue.state.closed": ShTangledRepoIssueStateClosed.mainSchema,
+
"sh.tangled.repo.issue.state.open": ShTangledRepoIssueStateOpen.mainSchema,
+
"sh.tangled.repo.pull": ShTangledRepoPull.mainSchema,
+
"sh.tangled.repo.pull.comment": ShTangledRepoPullComment.mainSchema,
+
"sh.tangled.repo.pull.status": ShTangledRepoPullStatus.mainSchema,
+
"sh.tangled.repo.pull.status.closed": ShTangledRepoPullStatusClosed.mainSchema,
+
"sh.tangled.repo.pull.status.merged": ShTangledRepoPullStatusMerged.mainSchema,
+
"sh.tangled.repo.pull.status.open": ShTangledRepoPullStatusOpen.mainSchema,
+
"sh.tangled.knot": ShTangledKnot.mainSchema,
+
+
// Leaflet
+
"pub.leaflet.comment": PubLeafletComment.mainSchema,
+
"pub.leaflet.document": PubLeafletDocument.mainSchema,
+
"pub.leaflet.graph.subscription": PubLeafletGraphSubscription.mainSchema,
+
"pub.leaflet.publication": PubLeafletPublication.mainSchema,
+
};
+5 -1
src/views/record.tsx
···
import { lexiconDoc } from "@atcute/lexicon-doc";
import { RecordValidator } from "@atcute/lexicon-doc/validations";
import { ResolvedSchema } from "@atcute/lexicon-resolver";
-
import { ActorIdentifier, Nsid } from "@atcute/lexicons";
+
import { ActorIdentifier, is, Nsid } from "@atcute/lexicons";
import { AtprotoDid, Did, isNsid } from "@atcute/lexicons/syntax";
import { verifyRecord } from "@atcute/repo";
import { A, useLocation, useNavigate, useParams } from "@solidjs/router";
···
import Tooltip from "../components/tooltip.jsx";
import { resolveLexiconAuthority, resolveLexiconSchema, resolvePDS } from "../utils/api.js";
import { AtUri, uriTemplates } from "../utils/templates.js";
+
import { lexicons } from "../utils/types/lexicons.js";
const extractRefs = (obj: any): Nsid[] => {
const refs: Set<string> = new Set();
···
setLexiconNotFound(false);
lexiconDoc.parse(record, { mode: "passthrough" });
setValidSchema(true);
+
} else if (params.collection && params.collection in lexicons) {
+
if (is(lexicons[params.collection], record)) setValidSchema(true);
+
else setValidSchema(false);
} else {
const { resolved, failed } = await resolveAllLexicons(params.collection as Nsid);