From f5707e09f0a0d068dd5238465f6bfce6fb82d17b Mon Sep 17 00:00:00 2001 From: Matthieu Sieben Date: Fri, 8 Nov 2024 21:14:09 +0100 Subject: [PATCH] codegen --- packages/api/src/client/index.ts | 190 +++--- packages/api/src/client/lexicons.ts | 4 +- .../src/client/types/app/bsky/actor/defs.ts | 456 +++++++------- .../types/app/bsky/actor/getPreferences.ts | 3 +- .../client/types/app/bsky/actor/getProfile.ts | 2 +- .../types/app/bsky/actor/getProfiles.ts | 3 +- .../types/app/bsky/actor/getSuggestions.ts | 3 +- .../client/types/app/bsky/actor/profile.ts | 17 +- .../types/app/bsky/actor/putPreferences.ts | 3 +- .../types/app/bsky/actor/searchActors.ts | 3 +- .../app/bsky/actor/searchActorsTypeahead.ts | 3 +- .../src/client/types/app/bsky/embed/defs.ts | 21 +- .../client/types/app/bsky/embed/external.ts | 75 ++- .../src/client/types/app/bsky/embed/images.ts | 71 ++- .../src/client/types/app/bsky/embed/record.ts | 113 ++-- .../types/app/bsky/embed/recordWithMedia.ts | 41 +- .../src/client/types/app/bsky/embed/video.ts | 54 +- .../src/client/types/app/bsky/feed/defs.ts | 329 +++++----- .../app/bsky/feed/describeFeedGenerator.ts | 39 +- .../client/types/app/bsky/feed/generator.ts | 17 +- .../types/app/bsky/feed/getActorFeeds.ts | 3 +- .../types/app/bsky/feed/getActorLikes.ts | 3 +- .../types/app/bsky/feed/getAuthorFeed.ts | 3 +- .../src/client/types/app/bsky/feed/getFeed.ts | 3 +- .../types/app/bsky/feed/getFeedGenerator.ts | 3 +- .../types/app/bsky/feed/getFeedGenerators.ts | 3 +- .../types/app/bsky/feed/getFeedSkeleton.ts | 3 +- .../client/types/app/bsky/feed/getLikes.ts | 20 +- .../client/types/app/bsky/feed/getListFeed.ts | 3 +- .../types/app/bsky/feed/getPostThread.ts | 3 +- .../client/types/app/bsky/feed/getPosts.ts | 3 +- .../client/types/app/bsky/feed/getQuotes.ts | 3 +- .../types/app/bsky/feed/getRepostedBy.ts | 3 +- .../types/app/bsky/feed/getSuggestedFeeds.ts | 3 +- .../client/types/app/bsky/feed/getTimeline.ts | 3 +- .../src/client/types/app/bsky/feed/like.ts | 17 +- .../src/client/types/app/bsky/feed/post.ts | 70 ++- .../client/types/app/bsky/feed/postgate.ts | 36 +- .../src/client/types/app/bsky/feed/repost.ts | 17 +- .../client/types/app/bsky/feed/searchPosts.ts | 3 +- .../types/app/bsky/feed/sendInteractions.ts | 7 +- .../client/types/app/bsky/feed/threadgate.ts | 74 ++- .../src/client/types/app/bsky/graph/block.ts | 17 +- .../src/client/types/app/bsky/graph/defs.ts | 160 ++--- .../src/client/types/app/bsky/graph/follow.ts | 17 +- .../app/bsky/graph/getActorStarterPacks.ts | 3 +- .../client/types/app/bsky/graph/getBlocks.ts | 3 +- .../types/app/bsky/graph/getFollowers.ts | 3 +- .../client/types/app/bsky/graph/getFollows.ts | 3 +- .../types/app/bsky/graph/getKnownFollowers.ts | 3 +- .../client/types/app/bsky/graph/getList.ts | 3 +- .../types/app/bsky/graph/getListBlocks.ts | 3 +- .../types/app/bsky/graph/getListMutes.ts | 3 +- .../client/types/app/bsky/graph/getLists.ts | 3 +- .../client/types/app/bsky/graph/getMutes.ts | 3 +- .../types/app/bsky/graph/getRelationships.ts | 3 +- .../types/app/bsky/graph/getStarterPack.ts | 3 +- .../types/app/bsky/graph/getStarterPacks.ts | 3 +- .../bsky/graph/getSuggestedFollowsByActor.ts | 5 +- .../src/client/types/app/bsky/graph/list.ts | 17 +- .../client/types/app/bsky/graph/listblock.ts | 17 +- .../client/types/app/bsky/graph/listitem.ts | 17 +- .../client/types/app/bsky/graph/muteActor.ts | 3 +- .../types/app/bsky/graph/muteActorList.ts | 3 +- .../client/types/app/bsky/graph/muteThread.ts | 3 +- .../types/app/bsky/graph/starterpack.ts | 36 +- .../types/app/bsky/graph/unmuteActor.ts | 3 +- .../types/app/bsky/graph/unmuteActorList.ts | 3 +- .../types/app/bsky/graph/unmuteThread.ts | 3 +- .../src/client/types/app/bsky/labeler/defs.ts | 76 +-- .../types/app/bsky/labeler/getServices.ts | 3 +- .../client/types/app/bsky/labeler/service.ts | 17 +- .../app/bsky/notification/getUnreadCount.ts | 3 +- .../bsky/notification/listNotifications.ts | 18 +- .../app/bsky/notification/putPreferences.ts | 3 +- .../app/bsky/notification/registerPush.ts | 3 +- .../types/app/bsky/notification/updateSeen.ts | 3 +- .../client/types/app/bsky/richtext/facet.ts | 92 +-- .../client/types/app/bsky/unspecced/defs.ts | 36 +- .../types/app/bsky/unspecced/getConfig.ts | 3 +- .../unspecced/getPopularFeedGenerators.ts | 3 +- .../bsky/unspecced/getSuggestionsSkeleton.ts | 3 +- .../bsky/unspecced/getTaggedSuggestions.ts | 16 +- .../bsky/unspecced/searchActorsSkeleton.ts | 3 +- .../app/bsky/unspecced/searchPostsSkeleton.ts | 3 +- .../src/client/types/app/bsky/video/defs.ts | 21 +- .../types/app/bsky/video/getJobStatus.ts | 3 +- .../types/app/bsky/video/getUploadLimits.ts | 3 +- .../types/app/bsky/video/uploadVideo.ts | 3 +- .../types/chat/bsky/actor/declaration.ts | 17 +- .../src/client/types/chat/bsky/actor/defs.ts | 21 +- .../types/chat/bsky/actor/deleteAccount.ts | 6 +- .../chat/bsky/actor/exportAccountData.ts | 2 +- .../src/client/types/chat/bsky/convo/defs.ts | 192 +++--- .../chat/bsky/convo/deleteMessageForSelf.ts | 3 +- .../client/types/chat/bsky/convo/getConvo.ts | 3 +- .../chat/bsky/convo/getConvoForMembers.ts | 3 +- .../client/types/chat/bsky/convo/getLog.ts | 3 +- .../types/chat/bsky/convo/getMessages.ts | 3 +- .../types/chat/bsky/convo/leaveConvo.ts | 4 +- .../types/chat/bsky/convo/listConvos.ts | 3 +- .../client/types/chat/bsky/convo/muteConvo.ts | 4 +- .../types/chat/bsky/convo/sendMessage.ts | 3 +- .../types/chat/bsky/convo/sendMessageBatch.ts | 21 +- .../types/chat/bsky/convo/unmuteConvo.ts | 4 +- .../types/chat/bsky/convo/updateRead.ts | 4 +- .../chat/bsky/moderation/getActorMetadata.ts | 19 +- .../chat/bsky/moderation/getMessageContext.ts | 3 +- .../chat/bsky/moderation/updateActorAccess.ts | 3 +- .../client/types/com/atproto/admin/defs.ts | 99 +-- .../types/com/atproto/admin/deleteAccount.ts | 3 +- .../atproto/admin/disableAccountInvites.ts | 3 +- .../com/atproto/admin/disableInviteCodes.ts | 3 +- .../com/atproto/admin/enableAccountInvites.ts | 3 +- .../types/com/atproto/admin/getAccountInfo.ts | 2 +- .../com/atproto/admin/getAccountInfos.ts | 3 +- .../types/com/atproto/admin/getInviteCodes.ts | 3 +- .../com/atproto/admin/getSubjectStatus.ts | 3 +- .../types/com/atproto/admin/searchAccounts.ts | 3 +- .../types/com/atproto/admin/sendEmail.ts | 4 +- .../com/atproto/admin/updateAccountEmail.ts | 3 +- .../com/atproto/admin/updateAccountHandle.ts | 3 +- .../atproto/admin/updateAccountPassword.ts | 3 +- .../com/atproto/admin/updateSubjectStatus.ts | 4 +- .../identity/getRecommendedDidCredentials.ts | 7 +- .../identity/requestPlcOperationSignature.ts | 2 +- .../com/atproto/identity/resolveHandle.ts | 3 +- .../com/atproto/identity/signPlcOperation.ts | 10 +- .../atproto/identity/submitPlcOperation.ts | 5 +- .../com/atproto/identity/updateHandle.ts | 3 +- .../client/types/com/atproto/label/defs.ts | 93 +-- .../types/com/atproto/label/queryLabels.ts | 3 +- .../com/atproto/label/subscribeLabels.ts | 40 +- .../com/atproto/moderation/createReport.ts | 4 +- .../types/com/atproto/moderation/defs.ts | 2 +- .../types/com/atproto/repo/applyWrites.ts | 116 ++-- .../types/com/atproto/repo/createRecord.ts | 6 +- .../src/client/types/com/atproto/repo/defs.ts | 21 +- .../types/com/atproto/repo/deleteRecord.ts | 4 +- .../types/com/atproto/repo/describeRepo.ts | 5 +- .../types/com/atproto/repo/getRecord.ts | 5 +- .../types/com/atproto/repo/importRepo.ts | 2 +- .../com/atproto/repo/listMissingBlobs.ts | 20 +- .../types/com/atproto/repo/listRecords.ts | 24 +- .../types/com/atproto/repo/putRecord.ts | 6 +- .../types/com/atproto/repo/strongRef.ts | 18 +- .../types/com/atproto/repo/uploadBlob.ts | 3 +- .../com/atproto/server/activateAccount.ts | 2 +- .../com/atproto/server/checkAccountStatus.ts | 3 +- .../types/com/atproto/server/confirmEmail.ts | 3 +- .../types/com/atproto/server/createAccount.ts | 8 +- .../com/atproto/server/createAppPassword.ts | 16 +- .../com/atproto/server/createInviteCode.ts | 4 +- .../com/atproto/server/createInviteCodes.ts | 17 +- .../types/com/atproto/server/createSession.ts | 6 +- .../com/atproto/server/deactivateAccount.ts | 3 +- .../client/types/com/atproto/server/defs.ts | 40 +- .../types/com/atproto/server/deleteAccount.ts | 3 +- .../types/com/atproto/server/deleteSession.ts | 2 +- .../com/atproto/server/describeServer.ts | 39 +- .../atproto/server/getAccountInviteCodes.ts | 3 +- .../com/atproto/server/getServiceAuth.ts | 3 +- .../types/com/atproto/server/getSession.ts | 5 +- .../com/atproto/server/listAppPasswords.ts | 19 +- .../com/atproto/server/refreshSession.ts | 5 +- .../atproto/server/requestAccountDelete.ts | 2 +- .../server/requestEmailConfirmation.ts | 2 +- .../com/atproto/server/requestEmailUpdate.ts | 3 +- .../atproto/server/requestPasswordReset.ts | 3 +- .../com/atproto/server/reserveSigningKey.ts | 4 +- .../types/com/atproto/server/resetPassword.ts | 3 +- .../com/atproto/server/revokeAppPassword.ts | 3 +- .../types/com/atproto/server/updateEmail.ts | 3 +- .../client/types/com/atproto/sync/getBlob.ts | 2 +- .../types/com/atproto/sync/getBlocks.ts | 2 +- .../types/com/atproto/sync/getCheckout.ts | 2 +- .../client/types/com/atproto/sync/getHead.ts | 3 +- .../types/com/atproto/sync/getLatestCommit.ts | 3 +- .../types/com/atproto/sync/getRecord.ts | 2 +- .../client/types/com/atproto/sync/getRepo.ts | 2 +- .../types/com/atproto/sync/getRepoStatus.ts | 3 +- .../types/com/atproto/sync/listBlobs.ts | 3 +- .../types/com/atproto/sync/listRepos.ts | 22 +- .../types/com/atproto/sync/notifyOfUpdate.ts | 3 +- .../types/com/atproto/sync/requestCrawl.ts | 3 +- .../types/com/atproto/sync/subscribeRepos.ts | 152 ++--- .../com/atproto/temp/checkSignupQueue.ts | 3 +- .../types/com/atproto/temp/fetchLabels.ts | 3 +- .../atproto/temp/requestPhoneVerification.ts | 3 +- .../ozone/communication/createTemplate.ts | 3 +- .../types/tools/ozone/communication/defs.ts | 19 +- .../ozone/communication/deleteTemplate.ts | 3 +- .../ozone/communication/listTemplates.ts | 3 +- .../ozone/communication/updateTemplate.ts | 3 +- .../types/tools/ozone/moderation/defs.ts | 593 ++++++++++-------- .../types/tools/ozone/moderation/emitEvent.ts | 3 +- .../types/tools/ozone/moderation/getEvent.ts | 2 +- .../types/tools/ozone/moderation/getRecord.ts | 2 +- .../tools/ozone/moderation/getRecords.ts | 3 +- .../types/tools/ozone/moderation/getRepo.ts | 2 +- .../types/tools/ozone/moderation/getRepos.ts | 3 +- .../tools/ozone/moderation/queryEvents.ts | 3 +- .../tools/ozone/moderation/queryStatuses.ts | 3 +- .../tools/ozone/moderation/searchRepos.ts | 3 +- .../types/tools/ozone/server/getConfig.ts | 37 +- .../client/types/tools/ozone/set/addValues.ts | 3 +- .../src/client/types/tools/ozone/set/defs.ts | 38 +- .../client/types/tools/ozone/set/deleteSet.ts | 7 +- .../types/tools/ozone/set/deleteValues.ts | 3 +- .../client/types/tools/ozone/set/getValues.ts | 3 +- .../client/types/tools/ozone/set/querySets.ts | 3 +- .../client/types/tools/ozone/set/upsertSet.ts | 2 +- .../client/types/tools/ozone/setting/defs.ts | 23 +- .../types/tools/ozone/setting/listOptions.ts | 3 +- .../tools/ozone/setting/removeOptions.ts | 7 +- .../types/tools/ozone/setting/upsertOption.ts | 6 +- .../types/tools/ozone/signature/defs.ts | 21 +- .../tools/ozone/signature/findCorrelation.ts | 3 +- .../ozone/signature/findRelatedAccounts.ts | 16 +- .../tools/ozone/signature/searchAccounts.ts | 3 +- .../types/tools/ozone/team/addMember.ts | 3 +- .../src/client/types/tools/ozone/team/defs.ts | 21 +- .../types/tools/ozone/team/deleteMember.ts | 3 +- .../types/tools/ozone/team/listMembers.ts | 3 +- .../types/tools/ozone/team/updateMember.ts | 3 +- packages/api/src/client/util.ts | 11 +- packages/bsky/src/lexicon/lexicons.ts | 4 +- .../src/lexicon/types/app/bsky/actor/defs.ts | 456 +++++++------- .../types/app/bsky/actor/getPreferences.ts | 3 +- .../types/app/bsky/actor/getProfile.ts | 2 +- .../types/app/bsky/actor/getProfiles.ts | 3 +- .../types/app/bsky/actor/getSuggestions.ts | 3 +- .../lexicon/types/app/bsky/actor/profile.ts | 17 +- .../types/app/bsky/actor/putPreferences.ts | 3 +- .../types/app/bsky/actor/searchActors.ts | 3 +- .../app/bsky/actor/searchActorsTypeahead.ts | 3 +- .../src/lexicon/types/app/bsky/embed/defs.ts | 21 +- .../lexicon/types/app/bsky/embed/external.ts | 75 ++- .../lexicon/types/app/bsky/embed/images.ts | 71 ++- .../lexicon/types/app/bsky/embed/record.ts | 113 ++-- .../types/app/bsky/embed/recordWithMedia.ts | 41 +- .../src/lexicon/types/app/bsky/embed/video.ts | 54 +- .../src/lexicon/types/app/bsky/feed/defs.ts | 329 +++++----- .../app/bsky/feed/describeFeedGenerator.ts | 39 +- .../lexicon/types/app/bsky/feed/generator.ts | 17 +- .../types/app/bsky/feed/getActorFeeds.ts | 3 +- .../types/app/bsky/feed/getActorLikes.ts | 3 +- .../types/app/bsky/feed/getAuthorFeed.ts | 3 +- .../lexicon/types/app/bsky/feed/getFeed.ts | 3 +- .../types/app/bsky/feed/getFeedGenerator.ts | 3 +- .../types/app/bsky/feed/getFeedGenerators.ts | 3 +- .../types/app/bsky/feed/getFeedSkeleton.ts | 3 +- .../lexicon/types/app/bsky/feed/getLikes.ts | 20 +- .../types/app/bsky/feed/getListFeed.ts | 3 +- .../types/app/bsky/feed/getPostThread.ts | 3 +- .../lexicon/types/app/bsky/feed/getPosts.ts | 3 +- .../lexicon/types/app/bsky/feed/getQuotes.ts | 3 +- .../types/app/bsky/feed/getRepostedBy.ts | 3 +- .../types/app/bsky/feed/getSuggestedFeeds.ts | 3 +- .../types/app/bsky/feed/getTimeline.ts | 3 +- .../src/lexicon/types/app/bsky/feed/like.ts | 17 +- .../src/lexicon/types/app/bsky/feed/post.ts | 70 ++- .../lexicon/types/app/bsky/feed/postgate.ts | 36 +- .../src/lexicon/types/app/bsky/feed/repost.ts | 17 +- .../types/app/bsky/feed/searchPosts.ts | 3 +- .../types/app/bsky/feed/sendInteractions.ts | 7 +- .../lexicon/types/app/bsky/feed/threadgate.ts | 74 ++- .../src/lexicon/types/app/bsky/graph/block.ts | 17 +- .../src/lexicon/types/app/bsky/graph/defs.ts | 160 ++--- .../lexicon/types/app/bsky/graph/follow.ts | 17 +- .../app/bsky/graph/getActorStarterPacks.ts | 3 +- .../lexicon/types/app/bsky/graph/getBlocks.ts | 3 +- .../types/app/bsky/graph/getFollowers.ts | 3 +- .../types/app/bsky/graph/getFollows.ts | 3 +- .../types/app/bsky/graph/getKnownFollowers.ts | 3 +- .../lexicon/types/app/bsky/graph/getList.ts | 3 +- .../types/app/bsky/graph/getListBlocks.ts | 3 +- .../types/app/bsky/graph/getListMutes.ts | 3 +- .../lexicon/types/app/bsky/graph/getLists.ts | 3 +- .../lexicon/types/app/bsky/graph/getMutes.ts | 3 +- .../types/app/bsky/graph/getRelationships.ts | 3 +- .../types/app/bsky/graph/getStarterPack.ts | 3 +- .../types/app/bsky/graph/getStarterPacks.ts | 3 +- .../bsky/graph/getSuggestedFollowsByActor.ts | 5 +- .../src/lexicon/types/app/bsky/graph/list.ts | 17 +- .../lexicon/types/app/bsky/graph/listblock.ts | 17 +- .../lexicon/types/app/bsky/graph/listitem.ts | 17 +- .../lexicon/types/app/bsky/graph/muteActor.ts | 3 +- .../types/app/bsky/graph/muteActorList.ts | 3 +- .../types/app/bsky/graph/muteThread.ts | 3 +- .../types/app/bsky/graph/starterpack.ts | 36 +- .../types/app/bsky/graph/unmuteActor.ts | 3 +- .../types/app/bsky/graph/unmuteActorList.ts | 3 +- .../types/app/bsky/graph/unmuteThread.ts | 3 +- .../lexicon/types/app/bsky/labeler/defs.ts | 76 +-- .../types/app/bsky/labeler/getServices.ts | 3 +- .../lexicon/types/app/bsky/labeler/service.ts | 17 +- .../app/bsky/notification/getUnreadCount.ts | 3 +- .../bsky/notification/listNotifications.ts | 18 +- .../app/bsky/notification/putPreferences.ts | 3 +- .../app/bsky/notification/registerPush.ts | 3 +- .../types/app/bsky/notification/updateSeen.ts | 3 +- .../lexicon/types/app/bsky/richtext/facet.ts | 92 +-- .../lexicon/types/app/bsky/unspecced/defs.ts | 36 +- .../types/app/bsky/unspecced/getConfig.ts | 3 +- .../unspecced/getPopularFeedGenerators.ts | 3 +- .../bsky/unspecced/getSuggestionsSkeleton.ts | 3 +- .../bsky/unspecced/getTaggedSuggestions.ts | 16 +- .../bsky/unspecced/searchActorsSkeleton.ts | 3 +- .../app/bsky/unspecced/searchPostsSkeleton.ts | 3 +- .../src/lexicon/types/app/bsky/video/defs.ts | 21 +- .../types/app/bsky/video/getJobStatus.ts | 3 +- .../types/app/bsky/video/getUploadLimits.ts | 3 +- .../types/app/bsky/video/uploadVideo.ts | 3 +- .../types/chat/bsky/actor/declaration.ts | 17 +- .../src/lexicon/types/chat/bsky/actor/defs.ts | 21 +- .../types/chat/bsky/actor/deleteAccount.ts | 6 +- .../chat/bsky/actor/exportAccountData.ts | 2 +- .../src/lexicon/types/chat/bsky/convo/defs.ts | 192 +++--- .../chat/bsky/convo/deleteMessageForSelf.ts | 3 +- .../lexicon/types/chat/bsky/convo/getConvo.ts | 3 +- .../chat/bsky/convo/getConvoForMembers.ts | 3 +- .../lexicon/types/chat/bsky/convo/getLog.ts | 3 +- .../types/chat/bsky/convo/getMessages.ts | 3 +- .../types/chat/bsky/convo/leaveConvo.ts | 4 +- .../types/chat/bsky/convo/listConvos.ts | 3 +- .../types/chat/bsky/convo/muteConvo.ts | 4 +- .../types/chat/bsky/convo/sendMessage.ts | 3 +- .../types/chat/bsky/convo/sendMessageBatch.ts | 21 +- .../types/chat/bsky/convo/unmuteConvo.ts | 4 +- .../types/chat/bsky/convo/updateRead.ts | 4 +- .../chat/bsky/moderation/getActorMetadata.ts | 19 +- .../chat/bsky/moderation/getMessageContext.ts | 3 +- .../chat/bsky/moderation/updateActorAccess.ts | 3 +- .../lexicon/types/com/atproto/admin/defs.ts | 99 +-- .../types/com/atproto/admin/deleteAccount.ts | 3 +- .../atproto/admin/disableAccountInvites.ts | 3 +- .../com/atproto/admin/disableInviteCodes.ts | 3 +- .../com/atproto/admin/enableAccountInvites.ts | 3 +- .../types/com/atproto/admin/getAccountInfo.ts | 2 +- .../com/atproto/admin/getAccountInfos.ts | 3 +- .../types/com/atproto/admin/getInviteCodes.ts | 3 +- .../com/atproto/admin/getSubjectStatus.ts | 3 +- .../types/com/atproto/admin/searchAccounts.ts | 3 +- .../types/com/atproto/admin/sendEmail.ts | 4 +- .../com/atproto/admin/updateAccountEmail.ts | 3 +- .../com/atproto/admin/updateAccountHandle.ts | 3 +- .../atproto/admin/updateAccountPassword.ts | 3 +- .../com/atproto/admin/updateSubjectStatus.ts | 4 +- .../identity/getRecommendedDidCredentials.ts | 7 +- .../identity/requestPlcOperationSignature.ts | 2 +- .../com/atproto/identity/resolveHandle.ts | 3 +- .../com/atproto/identity/signPlcOperation.ts | 10 +- .../atproto/identity/submitPlcOperation.ts | 5 +- .../com/atproto/identity/updateHandle.ts | 3 +- .../lexicon/types/com/atproto/label/defs.ts | 93 +-- .../types/com/atproto/label/queryLabels.ts | 3 +- .../com/atproto/label/subscribeLabels.ts | 40 +- .../com/atproto/moderation/createReport.ts | 4 +- .../types/com/atproto/moderation/defs.ts | 2 +- .../types/com/atproto/repo/applyWrites.ts | 116 ++-- .../types/com/atproto/repo/createRecord.ts | 6 +- .../lexicon/types/com/atproto/repo/defs.ts | 21 +- .../types/com/atproto/repo/deleteRecord.ts | 4 +- .../types/com/atproto/repo/describeRepo.ts | 5 +- .../types/com/atproto/repo/getRecord.ts | 5 +- .../types/com/atproto/repo/importRepo.ts | 2 +- .../com/atproto/repo/listMissingBlobs.ts | 20 +- .../types/com/atproto/repo/listRecords.ts | 24 +- .../types/com/atproto/repo/putRecord.ts | 6 +- .../types/com/atproto/repo/strongRef.ts | 18 +- .../types/com/atproto/repo/uploadBlob.ts | 3 +- .../com/atproto/server/activateAccount.ts | 2 +- .../com/atproto/server/checkAccountStatus.ts | 3 +- .../types/com/atproto/server/confirmEmail.ts | 3 +- .../types/com/atproto/server/createAccount.ts | 8 +- .../com/atproto/server/createAppPassword.ts | 16 +- .../com/atproto/server/createInviteCode.ts | 4 +- .../com/atproto/server/createInviteCodes.ts | 17 +- .../types/com/atproto/server/createSession.ts | 6 +- .../com/atproto/server/deactivateAccount.ts | 3 +- .../lexicon/types/com/atproto/server/defs.ts | 40 +- .../types/com/atproto/server/deleteAccount.ts | 3 +- .../types/com/atproto/server/deleteSession.ts | 2 +- .../com/atproto/server/describeServer.ts | 39 +- .../atproto/server/getAccountInviteCodes.ts | 3 +- .../com/atproto/server/getServiceAuth.ts | 3 +- .../types/com/atproto/server/getSession.ts | 5 +- .../com/atproto/server/listAppPasswords.ts | 19 +- .../com/atproto/server/refreshSession.ts | 5 +- .../atproto/server/requestAccountDelete.ts | 2 +- .../server/requestEmailConfirmation.ts | 2 +- .../com/atproto/server/requestEmailUpdate.ts | 3 +- .../atproto/server/requestPasswordReset.ts | 3 +- .../com/atproto/server/reserveSigningKey.ts | 4 +- .../types/com/atproto/server/resetPassword.ts | 3 +- .../com/atproto/server/revokeAppPassword.ts | 3 +- .../types/com/atproto/server/updateEmail.ts | 3 +- .../lexicon/types/com/atproto/sync/getBlob.ts | 2 +- .../types/com/atproto/sync/getBlocks.ts | 2 +- .../types/com/atproto/sync/getCheckout.ts | 2 +- .../lexicon/types/com/atproto/sync/getHead.ts | 3 +- .../types/com/atproto/sync/getLatestCommit.ts | 3 +- .../types/com/atproto/sync/getRecord.ts | 2 +- .../lexicon/types/com/atproto/sync/getRepo.ts | 2 +- .../types/com/atproto/sync/getRepoStatus.ts | 3 +- .../types/com/atproto/sync/listBlobs.ts | 3 +- .../types/com/atproto/sync/listRepos.ts | 22 +- .../types/com/atproto/sync/notifyOfUpdate.ts | 3 +- .../types/com/atproto/sync/requestCrawl.ts | 3 +- .../types/com/atproto/sync/subscribeRepos.ts | 152 ++--- .../com/atproto/temp/checkSignupQueue.ts | 3 +- .../types/com/atproto/temp/fetchLabels.ts | 3 +- .../atproto/temp/requestPhoneVerification.ts | 3 +- packages/bsky/src/lexicon/util.ts | 11 +- packages/ozone/src/lexicon/lexicons.ts | 4 +- .../src/lexicon/types/app/bsky/actor/defs.ts | 456 +++++++------- .../types/app/bsky/actor/getPreferences.ts | 3 +- .../types/app/bsky/actor/getProfile.ts | 2 +- .../types/app/bsky/actor/getProfiles.ts | 3 +- .../types/app/bsky/actor/getSuggestions.ts | 3 +- .../lexicon/types/app/bsky/actor/profile.ts | 17 +- .../types/app/bsky/actor/putPreferences.ts | 3 +- .../types/app/bsky/actor/searchActors.ts | 3 +- .../app/bsky/actor/searchActorsTypeahead.ts | 3 +- .../src/lexicon/types/app/bsky/embed/defs.ts | 21 +- .../lexicon/types/app/bsky/embed/external.ts | 75 ++- .../lexicon/types/app/bsky/embed/images.ts | 71 ++- .../lexicon/types/app/bsky/embed/record.ts | 113 ++-- .../types/app/bsky/embed/recordWithMedia.ts | 41 +- .../src/lexicon/types/app/bsky/embed/video.ts | 54 +- .../src/lexicon/types/app/bsky/feed/defs.ts | 329 +++++----- .../app/bsky/feed/describeFeedGenerator.ts | 39 +- .../lexicon/types/app/bsky/feed/generator.ts | 17 +- .../types/app/bsky/feed/getActorFeeds.ts | 3 +- .../types/app/bsky/feed/getActorLikes.ts | 3 +- .../types/app/bsky/feed/getAuthorFeed.ts | 3 +- .../lexicon/types/app/bsky/feed/getFeed.ts | 3 +- .../types/app/bsky/feed/getFeedGenerator.ts | 3 +- .../types/app/bsky/feed/getFeedGenerators.ts | 3 +- .../types/app/bsky/feed/getFeedSkeleton.ts | 3 +- .../lexicon/types/app/bsky/feed/getLikes.ts | 20 +- .../types/app/bsky/feed/getListFeed.ts | 3 +- .../types/app/bsky/feed/getPostThread.ts | 3 +- .../lexicon/types/app/bsky/feed/getPosts.ts | 3 +- .../lexicon/types/app/bsky/feed/getQuotes.ts | 3 +- .../types/app/bsky/feed/getRepostedBy.ts | 3 +- .../types/app/bsky/feed/getSuggestedFeeds.ts | 3 +- .../types/app/bsky/feed/getTimeline.ts | 3 +- .../src/lexicon/types/app/bsky/feed/like.ts | 17 +- .../src/lexicon/types/app/bsky/feed/post.ts | 70 ++- .../lexicon/types/app/bsky/feed/postgate.ts | 36 +- .../src/lexicon/types/app/bsky/feed/repost.ts | 17 +- .../types/app/bsky/feed/searchPosts.ts | 3 +- .../types/app/bsky/feed/sendInteractions.ts | 7 +- .../lexicon/types/app/bsky/feed/threadgate.ts | 74 ++- .../src/lexicon/types/app/bsky/graph/block.ts | 17 +- .../src/lexicon/types/app/bsky/graph/defs.ts | 160 ++--- .../lexicon/types/app/bsky/graph/follow.ts | 17 +- .../app/bsky/graph/getActorStarterPacks.ts | 3 +- .../lexicon/types/app/bsky/graph/getBlocks.ts | 3 +- .../types/app/bsky/graph/getFollowers.ts | 3 +- .../types/app/bsky/graph/getFollows.ts | 3 +- .../types/app/bsky/graph/getKnownFollowers.ts | 3 +- .../lexicon/types/app/bsky/graph/getList.ts | 3 +- .../types/app/bsky/graph/getListBlocks.ts | 3 +- .../types/app/bsky/graph/getListMutes.ts | 3 +- .../lexicon/types/app/bsky/graph/getLists.ts | 3 +- .../lexicon/types/app/bsky/graph/getMutes.ts | 3 +- .../types/app/bsky/graph/getRelationships.ts | 3 +- .../types/app/bsky/graph/getStarterPack.ts | 3 +- .../types/app/bsky/graph/getStarterPacks.ts | 3 +- .../bsky/graph/getSuggestedFollowsByActor.ts | 5 +- .../src/lexicon/types/app/bsky/graph/list.ts | 17 +- .../lexicon/types/app/bsky/graph/listblock.ts | 17 +- .../lexicon/types/app/bsky/graph/listitem.ts | 17 +- .../lexicon/types/app/bsky/graph/muteActor.ts | 3 +- .../types/app/bsky/graph/muteActorList.ts | 3 +- .../types/app/bsky/graph/muteThread.ts | 3 +- .../types/app/bsky/graph/starterpack.ts | 36 +- .../types/app/bsky/graph/unmuteActor.ts | 3 +- .../types/app/bsky/graph/unmuteActorList.ts | 3 +- .../types/app/bsky/graph/unmuteThread.ts | 3 +- .../lexicon/types/app/bsky/labeler/defs.ts | 76 +-- .../types/app/bsky/labeler/getServices.ts | 3 +- .../lexicon/types/app/bsky/labeler/service.ts | 17 +- .../app/bsky/notification/getUnreadCount.ts | 3 +- .../bsky/notification/listNotifications.ts | 18 +- .../app/bsky/notification/putPreferences.ts | 3 +- .../app/bsky/notification/registerPush.ts | 3 +- .../types/app/bsky/notification/updateSeen.ts | 3 +- .../lexicon/types/app/bsky/richtext/facet.ts | 92 +-- .../lexicon/types/app/bsky/unspecced/defs.ts | 36 +- .../types/app/bsky/unspecced/getConfig.ts | 3 +- .../unspecced/getPopularFeedGenerators.ts | 3 +- .../bsky/unspecced/getSuggestionsSkeleton.ts | 3 +- .../bsky/unspecced/getTaggedSuggestions.ts | 16 +- .../bsky/unspecced/searchActorsSkeleton.ts | 3 +- .../app/bsky/unspecced/searchPostsSkeleton.ts | 3 +- .../src/lexicon/types/app/bsky/video/defs.ts | 21 +- .../types/app/bsky/video/getJobStatus.ts | 3 +- .../types/app/bsky/video/getUploadLimits.ts | 3 +- .../types/app/bsky/video/uploadVideo.ts | 3 +- .../types/chat/bsky/actor/declaration.ts | 17 +- .../src/lexicon/types/chat/bsky/actor/defs.ts | 21 +- .../types/chat/bsky/actor/deleteAccount.ts | 6 +- .../chat/bsky/actor/exportAccountData.ts | 2 +- .../src/lexicon/types/chat/bsky/convo/defs.ts | 192 +++--- .../chat/bsky/convo/deleteMessageForSelf.ts | 3 +- .../lexicon/types/chat/bsky/convo/getConvo.ts | 3 +- .../chat/bsky/convo/getConvoForMembers.ts | 3 +- .../lexicon/types/chat/bsky/convo/getLog.ts | 3 +- .../types/chat/bsky/convo/getMessages.ts | 3 +- .../types/chat/bsky/convo/leaveConvo.ts | 4 +- .../types/chat/bsky/convo/listConvos.ts | 3 +- .../types/chat/bsky/convo/muteConvo.ts | 4 +- .../types/chat/bsky/convo/sendMessage.ts | 3 +- .../types/chat/bsky/convo/sendMessageBatch.ts | 21 +- .../types/chat/bsky/convo/unmuteConvo.ts | 4 +- .../types/chat/bsky/convo/updateRead.ts | 4 +- .../chat/bsky/moderation/getActorMetadata.ts | 19 +- .../chat/bsky/moderation/getMessageContext.ts | 3 +- .../chat/bsky/moderation/updateActorAccess.ts | 3 +- .../lexicon/types/com/atproto/admin/defs.ts | 99 +-- .../types/com/atproto/admin/deleteAccount.ts | 3 +- .../atproto/admin/disableAccountInvites.ts | 3 +- .../com/atproto/admin/disableInviteCodes.ts | 3 +- .../com/atproto/admin/enableAccountInvites.ts | 3 +- .../types/com/atproto/admin/getAccountInfo.ts | 2 +- .../com/atproto/admin/getAccountInfos.ts | 3 +- .../types/com/atproto/admin/getInviteCodes.ts | 3 +- .../com/atproto/admin/getSubjectStatus.ts | 3 +- .../types/com/atproto/admin/searchAccounts.ts | 3 +- .../types/com/atproto/admin/sendEmail.ts | 4 +- .../com/atproto/admin/updateAccountEmail.ts | 3 +- .../com/atproto/admin/updateAccountHandle.ts | 3 +- .../atproto/admin/updateAccountPassword.ts | 3 +- .../com/atproto/admin/updateSubjectStatus.ts | 4 +- .../identity/getRecommendedDidCredentials.ts | 7 +- .../identity/requestPlcOperationSignature.ts | 2 +- .../com/atproto/identity/resolveHandle.ts | 3 +- .../com/atproto/identity/signPlcOperation.ts | 10 +- .../atproto/identity/submitPlcOperation.ts | 5 +- .../com/atproto/identity/updateHandle.ts | 3 +- .../lexicon/types/com/atproto/label/defs.ts | 93 +-- .../types/com/atproto/label/queryLabels.ts | 3 +- .../com/atproto/label/subscribeLabels.ts | 40 +- .../com/atproto/moderation/createReport.ts | 4 +- .../types/com/atproto/moderation/defs.ts | 2 +- .../types/com/atproto/repo/applyWrites.ts | 116 ++-- .../types/com/atproto/repo/createRecord.ts | 6 +- .../lexicon/types/com/atproto/repo/defs.ts | 21 +- .../types/com/atproto/repo/deleteRecord.ts | 4 +- .../types/com/atproto/repo/describeRepo.ts | 5 +- .../types/com/atproto/repo/getRecord.ts | 5 +- .../types/com/atproto/repo/importRepo.ts | 2 +- .../com/atproto/repo/listMissingBlobs.ts | 20 +- .../types/com/atproto/repo/listRecords.ts | 24 +- .../types/com/atproto/repo/putRecord.ts | 6 +- .../types/com/atproto/repo/strongRef.ts | 18 +- .../types/com/atproto/repo/uploadBlob.ts | 3 +- .../com/atproto/server/activateAccount.ts | 2 +- .../com/atproto/server/checkAccountStatus.ts | 3 +- .../types/com/atproto/server/confirmEmail.ts | 3 +- .../types/com/atproto/server/createAccount.ts | 8 +- .../com/atproto/server/createAppPassword.ts | 16 +- .../com/atproto/server/createInviteCode.ts | 4 +- .../com/atproto/server/createInviteCodes.ts | 17 +- .../types/com/atproto/server/createSession.ts | 6 +- .../com/atproto/server/deactivateAccount.ts | 3 +- .../lexicon/types/com/atproto/server/defs.ts | 40 +- .../types/com/atproto/server/deleteAccount.ts | 3 +- .../types/com/atproto/server/deleteSession.ts | 2 +- .../com/atproto/server/describeServer.ts | 39 +- .../atproto/server/getAccountInviteCodes.ts | 3 +- .../com/atproto/server/getServiceAuth.ts | 3 +- .../types/com/atproto/server/getSession.ts | 5 +- .../com/atproto/server/listAppPasswords.ts | 19 +- .../com/atproto/server/refreshSession.ts | 5 +- .../atproto/server/requestAccountDelete.ts | 2 +- .../server/requestEmailConfirmation.ts | 2 +- .../com/atproto/server/requestEmailUpdate.ts | 3 +- .../atproto/server/requestPasswordReset.ts | 3 +- .../com/atproto/server/reserveSigningKey.ts | 4 +- .../types/com/atproto/server/resetPassword.ts | 3 +- .../com/atproto/server/revokeAppPassword.ts | 3 +- .../types/com/atproto/server/updateEmail.ts | 3 +- .../lexicon/types/com/atproto/sync/getBlob.ts | 2 +- .../types/com/atproto/sync/getBlocks.ts | 2 +- .../types/com/atproto/sync/getCheckout.ts | 2 +- .../lexicon/types/com/atproto/sync/getHead.ts | 3 +- .../types/com/atproto/sync/getLatestCommit.ts | 3 +- .../types/com/atproto/sync/getRecord.ts | 2 +- .../lexicon/types/com/atproto/sync/getRepo.ts | 2 +- .../types/com/atproto/sync/getRepoStatus.ts | 3 +- .../types/com/atproto/sync/listBlobs.ts | 3 +- .../types/com/atproto/sync/listRepos.ts | 22 +- .../types/com/atproto/sync/notifyOfUpdate.ts | 3 +- .../types/com/atproto/sync/requestCrawl.ts | 3 +- .../types/com/atproto/sync/subscribeRepos.ts | 152 ++--- .../com/atproto/temp/checkSignupQueue.ts | 3 +- .../types/com/atproto/temp/fetchLabels.ts | 3 +- .../atproto/temp/requestPhoneVerification.ts | 3 +- .../ozone/communication/createTemplate.ts | 3 +- .../types/tools/ozone/communication/defs.ts | 19 +- .../ozone/communication/deleteTemplate.ts | 3 +- .../ozone/communication/listTemplates.ts | 3 +- .../ozone/communication/updateTemplate.ts | 3 +- .../types/tools/ozone/moderation/defs.ts | 593 ++++++++++-------- .../types/tools/ozone/moderation/emitEvent.ts | 3 +- .../types/tools/ozone/moderation/getEvent.ts | 2 +- .../types/tools/ozone/moderation/getRecord.ts | 2 +- .../tools/ozone/moderation/getRecords.ts | 3 +- .../types/tools/ozone/moderation/getRepo.ts | 2 +- .../types/tools/ozone/moderation/getRepos.ts | 3 +- .../tools/ozone/moderation/queryEvents.ts | 3 +- .../tools/ozone/moderation/queryStatuses.ts | 3 +- .../tools/ozone/moderation/searchRepos.ts | 3 +- .../types/tools/ozone/server/getConfig.ts | 37 +- .../types/tools/ozone/set/addValues.ts | 3 +- .../src/lexicon/types/tools/ozone/set/defs.ts | 38 +- .../types/tools/ozone/set/deleteSet.ts | 7 +- .../types/tools/ozone/set/deleteValues.ts | 3 +- .../types/tools/ozone/set/getValues.ts | 3 +- .../types/tools/ozone/set/querySets.ts | 3 +- .../types/tools/ozone/set/upsertSet.ts | 2 +- .../lexicon/types/tools/ozone/setting/defs.ts | 23 +- .../types/tools/ozone/setting/listOptions.ts | 3 +- .../tools/ozone/setting/removeOptions.ts | 7 +- .../types/tools/ozone/setting/upsertOption.ts | 6 +- .../types/tools/ozone/signature/defs.ts | 21 +- .../tools/ozone/signature/findCorrelation.ts | 3 +- .../ozone/signature/findRelatedAccounts.ts | 16 +- .../tools/ozone/signature/searchAccounts.ts | 3 +- .../types/tools/ozone/team/addMember.ts | 3 +- .../lexicon/types/tools/ozone/team/defs.ts | 21 +- .../types/tools/ozone/team/deleteMember.ts | 3 +- .../types/tools/ozone/team/listMembers.ts | 3 +- .../types/tools/ozone/team/updateMember.ts | 3 +- packages/ozone/src/lexicon/util.ts | 11 +- packages/pds/src/lexicon/lexicons.ts | 2 +- .../src/lexicon/types/app/bsky/actor/defs.ts | 456 +++++++------- .../types/app/bsky/actor/getPreferences.ts | 3 +- .../types/app/bsky/actor/getProfile.ts | 2 +- .../types/app/bsky/actor/getProfiles.ts | 3 +- .../types/app/bsky/actor/getSuggestions.ts | 3 +- .../lexicon/types/app/bsky/actor/profile.ts | 17 +- .../types/app/bsky/actor/putPreferences.ts | 3 +- .../types/app/bsky/actor/searchActors.ts | 3 +- .../app/bsky/actor/searchActorsTypeahead.ts | 3 +- .../src/lexicon/types/app/bsky/embed/defs.ts | 21 +- .../lexicon/types/app/bsky/embed/external.ts | 75 ++- .../lexicon/types/app/bsky/embed/images.ts | 71 ++- .../lexicon/types/app/bsky/embed/record.ts | 113 ++-- .../types/app/bsky/embed/recordWithMedia.ts | 41 +- .../src/lexicon/types/app/bsky/embed/video.ts | 54 +- .../src/lexicon/types/app/bsky/feed/defs.ts | 329 +++++----- .../app/bsky/feed/describeFeedGenerator.ts | 39 +- .../lexicon/types/app/bsky/feed/generator.ts | 17 +- .../types/app/bsky/feed/getActorFeeds.ts | 3 +- .../types/app/bsky/feed/getActorLikes.ts | 3 +- .../types/app/bsky/feed/getAuthorFeed.ts | 3 +- .../lexicon/types/app/bsky/feed/getFeed.ts | 3 +- .../types/app/bsky/feed/getFeedGenerator.ts | 3 +- .../types/app/bsky/feed/getFeedGenerators.ts | 3 +- .../types/app/bsky/feed/getFeedSkeleton.ts | 3 +- .../lexicon/types/app/bsky/feed/getLikes.ts | 20 +- .../types/app/bsky/feed/getListFeed.ts | 3 +- .../types/app/bsky/feed/getPostThread.ts | 3 +- .../lexicon/types/app/bsky/feed/getPosts.ts | 3 +- .../lexicon/types/app/bsky/feed/getQuotes.ts | 3 +- .../types/app/bsky/feed/getRepostedBy.ts | 3 +- .../types/app/bsky/feed/getSuggestedFeeds.ts | 3 +- .../types/app/bsky/feed/getTimeline.ts | 3 +- .../src/lexicon/types/app/bsky/feed/like.ts | 17 +- .../src/lexicon/types/app/bsky/feed/post.ts | 70 ++- .../lexicon/types/app/bsky/feed/postgate.ts | 36 +- .../src/lexicon/types/app/bsky/feed/repost.ts | 17 +- .../types/app/bsky/feed/searchPosts.ts | 3 +- .../types/app/bsky/feed/sendInteractions.ts | 7 +- .../lexicon/types/app/bsky/feed/threadgate.ts | 74 ++- .../src/lexicon/types/app/bsky/graph/block.ts | 17 +- .../src/lexicon/types/app/bsky/graph/defs.ts | 160 ++--- .../lexicon/types/app/bsky/graph/follow.ts | 17 +- .../app/bsky/graph/getActorStarterPacks.ts | 3 +- .../lexicon/types/app/bsky/graph/getBlocks.ts | 3 +- .../types/app/bsky/graph/getFollowers.ts | 3 +- .../types/app/bsky/graph/getFollows.ts | 3 +- .../types/app/bsky/graph/getKnownFollowers.ts | 3 +- .../lexicon/types/app/bsky/graph/getList.ts | 3 +- .../types/app/bsky/graph/getListBlocks.ts | 3 +- .../types/app/bsky/graph/getListMutes.ts | 3 +- .../lexicon/types/app/bsky/graph/getLists.ts | 3 +- .../lexicon/types/app/bsky/graph/getMutes.ts | 3 +- .../types/app/bsky/graph/getRelationships.ts | 3 +- .../types/app/bsky/graph/getStarterPack.ts | 3 +- .../types/app/bsky/graph/getStarterPacks.ts | 3 +- .../bsky/graph/getSuggestedFollowsByActor.ts | 5 +- .../src/lexicon/types/app/bsky/graph/list.ts | 17 +- .../lexicon/types/app/bsky/graph/listblock.ts | 17 +- .../lexicon/types/app/bsky/graph/listitem.ts | 17 +- .../lexicon/types/app/bsky/graph/muteActor.ts | 3 +- .../types/app/bsky/graph/muteActorList.ts | 3 +- .../types/app/bsky/graph/muteThread.ts | 3 +- .../types/app/bsky/graph/starterpack.ts | 36 +- .../types/app/bsky/graph/unmuteActor.ts | 3 +- .../types/app/bsky/graph/unmuteActorList.ts | 3 +- .../types/app/bsky/graph/unmuteThread.ts | 3 +- .../lexicon/types/app/bsky/labeler/defs.ts | 76 +-- .../types/app/bsky/labeler/getServices.ts | 3 +- .../lexicon/types/app/bsky/labeler/service.ts | 17 +- .../app/bsky/notification/getUnreadCount.ts | 3 +- .../bsky/notification/listNotifications.ts | 18 +- .../app/bsky/notification/putPreferences.ts | 3 +- .../app/bsky/notification/registerPush.ts | 3 +- .../types/app/bsky/notification/updateSeen.ts | 3 +- .../lexicon/types/app/bsky/richtext/facet.ts | 92 +-- .../lexicon/types/app/bsky/unspecced/defs.ts | 36 +- .../types/app/bsky/unspecced/getConfig.ts | 3 +- .../unspecced/getPopularFeedGenerators.ts | 3 +- .../bsky/unspecced/getSuggestionsSkeleton.ts | 3 +- .../bsky/unspecced/getTaggedSuggestions.ts | 16 +- .../bsky/unspecced/searchActorsSkeleton.ts | 3 +- .../app/bsky/unspecced/searchPostsSkeleton.ts | 3 +- .../src/lexicon/types/app/bsky/video/defs.ts | 21 +- .../types/app/bsky/video/getJobStatus.ts | 3 +- .../types/app/bsky/video/getUploadLimits.ts | 3 +- .../types/app/bsky/video/uploadVideo.ts | 3 +- .../types/chat/bsky/actor/declaration.ts | 17 +- .../src/lexicon/types/chat/bsky/actor/defs.ts | 21 +- .../types/chat/bsky/actor/deleteAccount.ts | 6 +- .../chat/bsky/actor/exportAccountData.ts | 2 +- .../src/lexicon/types/chat/bsky/convo/defs.ts | 192 +++--- .../chat/bsky/convo/deleteMessageForSelf.ts | 3 +- .../lexicon/types/chat/bsky/convo/getConvo.ts | 3 +- .../chat/bsky/convo/getConvoForMembers.ts | 3 +- .../lexicon/types/chat/bsky/convo/getLog.ts | 3 +- .../types/chat/bsky/convo/getMessages.ts | 3 +- .../types/chat/bsky/convo/leaveConvo.ts | 4 +- .../types/chat/bsky/convo/listConvos.ts | 3 +- .../types/chat/bsky/convo/muteConvo.ts | 4 +- .../types/chat/bsky/convo/sendMessage.ts | 3 +- .../types/chat/bsky/convo/sendMessageBatch.ts | 21 +- .../types/chat/bsky/convo/unmuteConvo.ts | 4 +- .../types/chat/bsky/convo/updateRead.ts | 4 +- .../chat/bsky/moderation/getActorMetadata.ts | 19 +- .../chat/bsky/moderation/getMessageContext.ts | 3 +- .../chat/bsky/moderation/updateActorAccess.ts | 3 +- .../lexicon/types/com/atproto/admin/defs.ts | 99 +-- .../types/com/atproto/admin/deleteAccount.ts | 3 +- .../atproto/admin/disableAccountInvites.ts | 3 +- .../com/atproto/admin/disableInviteCodes.ts | 3 +- .../com/atproto/admin/enableAccountInvites.ts | 3 +- .../types/com/atproto/admin/getAccountInfo.ts | 2 +- .../com/atproto/admin/getAccountInfos.ts | 3 +- .../types/com/atproto/admin/getInviteCodes.ts | 3 +- .../com/atproto/admin/getSubjectStatus.ts | 3 +- .../types/com/atproto/admin/searchAccounts.ts | 3 +- .../types/com/atproto/admin/sendEmail.ts | 4 +- .../com/atproto/admin/updateAccountEmail.ts | 3 +- .../com/atproto/admin/updateAccountHandle.ts | 3 +- .../atproto/admin/updateAccountPassword.ts | 3 +- .../com/atproto/admin/updateSubjectStatus.ts | 4 +- .../identity/getRecommendedDidCredentials.ts | 7 +- .../identity/requestPlcOperationSignature.ts | 2 +- .../com/atproto/identity/resolveHandle.ts | 3 +- .../com/atproto/identity/signPlcOperation.ts | 10 +- .../atproto/identity/submitPlcOperation.ts | 5 +- .../com/atproto/identity/updateHandle.ts | 3 +- .../lexicon/types/com/atproto/label/defs.ts | 93 +-- .../types/com/atproto/label/queryLabels.ts | 3 +- .../com/atproto/label/subscribeLabels.ts | 40 +- .../com/atproto/moderation/createReport.ts | 4 +- .../types/com/atproto/moderation/defs.ts | 2 +- .../types/com/atproto/repo/applyWrites.ts | 116 ++-- .../types/com/atproto/repo/createRecord.ts | 6 +- .../lexicon/types/com/atproto/repo/defs.ts | 21 +- .../types/com/atproto/repo/deleteRecord.ts | 4 +- .../types/com/atproto/repo/describeRepo.ts | 5 +- .../types/com/atproto/repo/getRecord.ts | 5 +- .../types/com/atproto/repo/importRepo.ts | 2 +- .../com/atproto/repo/listMissingBlobs.ts | 20 +- .../types/com/atproto/repo/listRecords.ts | 24 +- .../types/com/atproto/repo/putRecord.ts | 6 +- .../types/com/atproto/repo/strongRef.ts | 18 +- .../types/com/atproto/repo/uploadBlob.ts | 3 +- .../com/atproto/server/activateAccount.ts | 2 +- .../com/atproto/server/checkAccountStatus.ts | 3 +- .../types/com/atproto/server/confirmEmail.ts | 3 +- .../types/com/atproto/server/createAccount.ts | 8 +- .../com/atproto/server/createAppPassword.ts | 16 +- .../com/atproto/server/createInviteCode.ts | 4 +- .../com/atproto/server/createInviteCodes.ts | 17 +- .../types/com/atproto/server/createSession.ts | 6 +- .../com/atproto/server/deactivateAccount.ts | 3 +- .../lexicon/types/com/atproto/server/defs.ts | 40 +- .../types/com/atproto/server/deleteAccount.ts | 3 +- .../types/com/atproto/server/deleteSession.ts | 2 +- .../com/atproto/server/describeServer.ts | 39 +- .../atproto/server/getAccountInviteCodes.ts | 3 +- .../com/atproto/server/getServiceAuth.ts | 3 +- .../types/com/atproto/server/getSession.ts | 5 +- .../com/atproto/server/listAppPasswords.ts | 19 +- .../com/atproto/server/refreshSession.ts | 5 +- .../atproto/server/requestAccountDelete.ts | 2 +- .../server/requestEmailConfirmation.ts | 2 +- .../com/atproto/server/requestEmailUpdate.ts | 3 +- .../atproto/server/requestPasswordReset.ts | 3 +- .../com/atproto/server/reserveSigningKey.ts | 4 +- .../types/com/atproto/server/resetPassword.ts | 3 +- .../com/atproto/server/revokeAppPassword.ts | 3 +- .../types/com/atproto/server/updateEmail.ts | 3 +- .../lexicon/types/com/atproto/sync/getBlob.ts | 2 +- .../types/com/atproto/sync/getBlocks.ts | 2 +- .../types/com/atproto/sync/getCheckout.ts | 2 +- .../lexicon/types/com/atproto/sync/getHead.ts | 3 +- .../types/com/atproto/sync/getLatestCommit.ts | 3 +- .../types/com/atproto/sync/getRecord.ts | 2 +- .../lexicon/types/com/atproto/sync/getRepo.ts | 2 +- .../types/com/atproto/sync/getRepoStatus.ts | 3 +- .../types/com/atproto/sync/listBlobs.ts | 3 +- .../types/com/atproto/sync/listRepos.ts | 22 +- .../types/com/atproto/sync/notifyOfUpdate.ts | 3 +- .../types/com/atproto/sync/requestCrawl.ts | 3 +- .../types/com/atproto/sync/subscribeRepos.ts | 152 ++--- .../com/atproto/temp/checkSignupQueue.ts | 3 +- .../types/com/atproto/temp/fetchLabels.ts | 3 +- .../atproto/temp/requestPhoneVerification.ts | 3 +- .../ozone/communication/createTemplate.ts | 3 +- .../types/tools/ozone/communication/defs.ts | 19 +- .../ozone/communication/deleteTemplate.ts | 3 +- .../ozone/communication/listTemplates.ts | 3 +- .../ozone/communication/updateTemplate.ts | 3 +- .../types/tools/ozone/moderation/defs.ts | 593 ++++++++++-------- .../types/tools/ozone/moderation/emitEvent.ts | 3 +- .../types/tools/ozone/moderation/getEvent.ts | 2 +- .../types/tools/ozone/moderation/getRecord.ts | 2 +- .../tools/ozone/moderation/getRecords.ts | 3 +- .../types/tools/ozone/moderation/getRepo.ts | 2 +- .../types/tools/ozone/moderation/getRepos.ts | 3 +- .../tools/ozone/moderation/queryEvents.ts | 3 +- .../tools/ozone/moderation/queryStatuses.ts | 3 +- .../tools/ozone/moderation/searchRepos.ts | 3 +- .../types/tools/ozone/server/getConfig.ts | 37 +- .../types/tools/ozone/set/addValues.ts | 3 +- .../src/lexicon/types/tools/ozone/set/defs.ts | 38 +- .../types/tools/ozone/set/deleteSet.ts | 7 +- .../types/tools/ozone/set/deleteValues.ts | 3 +- .../types/tools/ozone/set/getValues.ts | 3 +- .../types/tools/ozone/set/querySets.ts | 3 +- .../types/tools/ozone/set/upsertSet.ts | 2 +- .../lexicon/types/tools/ozone/setting/defs.ts | 23 +- .../types/tools/ozone/setting/listOptions.ts | 3 +- .../tools/ozone/setting/removeOptions.ts | 7 +- .../types/tools/ozone/setting/upsertOption.ts | 6 +- .../types/tools/ozone/signature/defs.ts | 21 +- .../tools/ozone/signature/findCorrelation.ts | 3 +- .../ozone/signature/findRelatedAccounts.ts | 16 +- .../tools/ozone/signature/searchAccounts.ts | 3 +- .../types/tools/ozone/team/addMember.ts | 3 +- .../lexicon/types/tools/ozone/team/defs.ts | 21 +- .../types/tools/ozone/team/deleteMember.ts | 3 +- .../types/tools/ozone/team/listMembers.ts | 3 +- .../types/tools/ozone/team/updateMember.ts | 3 +- packages/pds/src/lexicon/util.ts | 11 +- 865 files changed, 8760 insertions(+), 7973 deletions(-) diff --git a/packages/api/src/client/index.ts b/packages/api/src/client/index.ts index 3850e0abef7..2026bd40644 100644 --- a/packages/api/src/client/index.ts +++ b/packages/api/src/client/index.ts @@ -4,6 +4,7 @@ import { XrpcClient, FetchHandler, FetchHandlerOptions } from '@atproto/xrpc' import { schemas } from './lexicons' import { CID } from 'multiformats/cid' +import { OmitKey } from './util' import * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs' import * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' import * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' @@ -1588,7 +1589,7 @@ export class ProfileRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyActorProfile.Record }[] @@ -1601,7 +1602,7 @@ export class ProfileRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyActorProfile.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.actor.profile', @@ -1611,25 +1612,30 @@ export class ProfileRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyActorProfile.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.actor.profile' + const collection = 'app.bsky.actor.profile' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.actor.profile', rkey: 'self', ...params, record }, + { + collection, + rkey: 'self', + ...params, + record: { ...record, $type: collection }, + }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -1871,7 +1877,7 @@ export class GeneratorRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedGenerator.Record }[] @@ -1884,7 +1890,7 @@ export class GeneratorRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyFeedGenerator.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.feed.generator', @@ -1894,25 +1900,25 @@ export class GeneratorRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyFeedGenerator.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.feed.generator' + const collection = 'app.bsky.feed.generator' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.feed.generator', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -1932,7 +1938,7 @@ export class LikeRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedLike.Record }[] @@ -1945,7 +1951,7 @@ export class LikeRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyFeedLike.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.feed.like', @@ -1955,25 +1961,25 @@ export class LikeRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyFeedLike.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.feed.like' + const collection = 'app.bsky.feed.like' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.feed.like', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -1993,7 +1999,7 @@ export class PostRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedPost.Record }[] @@ -2006,7 +2012,7 @@ export class PostRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyFeedPost.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.feed.post', @@ -2016,25 +2022,25 @@ export class PostRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyFeedPost.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.feed.post' + const collection = 'app.bsky.feed.post' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.feed.post', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2054,7 +2060,7 @@ export class PostgateRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedPostgate.Record }[] @@ -2067,7 +2073,7 @@ export class PostgateRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyFeedPostgate.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.feed.postgate', @@ -2077,25 +2083,25 @@ export class PostgateRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyFeedPostgate.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.feed.postgate' + const collection = 'app.bsky.feed.postgate' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.feed.postgate', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2115,7 +2121,7 @@ export class RepostRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedRepost.Record }[] @@ -2128,7 +2134,7 @@ export class RepostRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyFeedRepost.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.feed.repost', @@ -2138,25 +2144,25 @@ export class RepostRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyFeedRepost.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.feed.repost' + const collection = 'app.bsky.feed.repost' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.feed.repost', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2176,7 +2182,7 @@ export class ThreadgateRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedThreadgate.Record }[] @@ -2189,7 +2195,7 @@ export class ThreadgateRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2203,25 +2209,25 @@ export class ThreadgateRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyFeedThreadgate.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.feed.threadgate' + const collection = 'app.bsky.feed.threadgate' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.feed.threadgate', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2470,7 +2476,7 @@ export class BlockRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphBlock.Record }[] @@ -2483,7 +2489,7 @@ export class BlockRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyGraphBlock.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.graph.block', @@ -2493,25 +2499,25 @@ export class BlockRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyGraphBlock.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.graph.block' + const collection = 'app.bsky.graph.block' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.graph.block', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2531,7 +2537,7 @@ export class FollowRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphFollow.Record }[] @@ -2544,7 +2550,7 @@ export class FollowRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyGraphFollow.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.graph.follow', @@ -2554,25 +2560,25 @@ export class FollowRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyGraphFollow.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.graph.follow' + const collection = 'app.bsky.graph.follow' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.graph.follow', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2592,7 +2598,7 @@ export class ListRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphList.Record }[] @@ -2605,7 +2611,7 @@ export class ListRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyGraphList.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.graph.list', @@ -2615,25 +2621,25 @@ export class ListRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyGraphList.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.graph.list' + const collection = 'app.bsky.graph.list' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.graph.list', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2653,7 +2659,7 @@ export class ListblockRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphListblock.Record }[] @@ -2666,7 +2672,7 @@ export class ListblockRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2680,25 +2686,25 @@ export class ListblockRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyGraphListblock.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.graph.listblock' + const collection = 'app.bsky.graph.listblock' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.graph.listblock', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2718,7 +2724,7 @@ export class ListitemRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphListitem.Record }[] @@ -2731,7 +2737,7 @@ export class ListitemRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string; cid: string; value: AppBskyGraphListitem.Record }> { const res = await this._client.call('com.atproto.repo.getRecord', { collection: 'app.bsky.graph.listitem', @@ -2741,25 +2747,25 @@ export class ListitemRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyGraphListitem.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.graph.listitem' + const collection = 'app.bsky.graph.listitem' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.graph.listitem', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2779,7 +2785,7 @@ export class StarterpackRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphStarterpack.Record }[] @@ -2792,7 +2798,7 @@ export class StarterpackRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2806,25 +2812,25 @@ export class StarterpackRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyGraphStarterpack.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.graph.starterpack' + const collection = 'app.bsky.graph.starterpack' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'app.bsky.graph.starterpack', ...params, record }, + { collection, ...params, record: { ...record, $type: collection } }, { encoding: 'application/json', headers }, ) return res.data } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -2866,7 +2872,7 @@ export class ServiceRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyLabelerService.Record }[] @@ -2879,7 +2885,7 @@ export class ServiceRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2893,22 +2899,22 @@ export class ServiceRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: AppBskyLabelerService.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'app.bsky.labeler.service' + const collection = 'app.bsky.labeler.service' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, { - collection: 'app.bsky.labeler.service', + collection, rkey: 'self', ...params, - record, + record: { ...record, $type: collection }, }, { encoding: 'application/json', headers }, ) @@ -2916,7 +2922,7 @@ export class ServiceRecord { } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -3187,7 +3193,7 @@ export class DeclarationRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: ChatBskyActorDeclaration.Record }[] @@ -3200,7 +3206,7 @@ export class DeclarationRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -3214,22 +3220,22 @@ export class DeclarationRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, record: ChatBskyActorDeclaration.Record, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'chat.bsky.actor.declaration' + const collection = 'chat.bsky.actor.declaration' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, { - collection: 'chat.bsky.actor.declaration', + collection, rkey: 'self', ...params, - record, + record: { ...record, $type: collection }, }, { encoding: 'application/json', headers }, ) @@ -3237,7 +3243,7 @@ export class DeclarationRecord { } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index fd1d5356364..c361c5f6a1d 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -8286,7 +8286,7 @@ export const schemaDict = { type: 'array', items: { type: 'ref', - ref: 'lex:app.bsky.actor.defs#profileView', + ref: 'lex:app.bsky.actor.defs#profileViewDetailed', }, }, isFallback: { @@ -13576,4 +13576,4 @@ export const ids = { ToolsOzoneTeamDeleteMember: 'tools.ozone.team.deleteMember', ToolsOzoneTeamListMembers: 'tools.ozone.team.listMembers', ToolsOzoneTeamUpdateMember: 'tools.ozone.team.updateMember', -} +} as const diff --git a/packages/api/src/client/types/app/bsky/actor/defs.ts b/packages/api/src/client/types/app/bsky/actor/defs.ts index c6392632de0..cb639adaf76 100644 --- a/packages/api/src/client/types/app/bsky/actor/defs.ts +++ b/packages/api/src/client/types/app/bsky/actor/defs.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' @@ -10,6 +10,7 @@ import * as AppBskyGraphDefs from '../graph/defs' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' export interface ProfileViewBasic { + $type?: 'app.bsky.actor.defs#profileViewBasic' did: string handle: string displayName?: string @@ -18,22 +19,23 @@ export interface ProfileViewBasic { viewer?: ViewerState labels?: ComAtprotoLabelDefs.Label[] createdAt?: string - [k: string]: unknown } -export function isProfileViewBasic(v: unknown): v is ProfileViewBasic { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#profileViewBasic' - ) +export function isProfileViewBasic( + v: unknown, +): v is ProfileViewBasic & { $type: 'app.bsky.actor.defs#profileViewBasic' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#profileViewBasic' } -export function validateProfileViewBasic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileViewBasic', v) +export function validateProfileViewBasic(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#profileViewBasic', + v, + ) as ValidationResult } export interface ProfileView { + $type?: 'app.bsky.actor.defs#profileView' did: string handle: string displayName?: string @@ -44,22 +46,23 @@ export interface ProfileView { createdAt?: string viewer?: ViewerState labels?: ComAtprotoLabelDefs.Label[] - [k: string]: unknown } -export function isProfileView(v: unknown): v is ProfileView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#profileView' - ) +export function isProfileView( + v: unknown, +): v is ProfileView & { $type: 'app.bsky.actor.defs#profileView' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#profileView' } -export function validateProfileView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileView', v) +export function validateProfileView(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#profileView', + v, + ) as ValidationResult } export interface ProfileViewDetailed { + $type?: 'app.bsky.actor.defs#profileViewDetailed' did: string handle: string displayName?: string @@ -76,63 +79,68 @@ export interface ProfileViewDetailed { viewer?: ViewerState labels?: ComAtprotoLabelDefs.Label[] pinnedPost?: ComAtprotoRepoStrongRef.Main - [k: string]: unknown } -export function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#profileViewDetailed' - ) +export function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed & { + $type: 'app.bsky.actor.defs#profileViewDetailed' +} { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#profileViewDetailed' } -export function validateProfileViewDetailed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v) +export function validateProfileViewDetailed(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#profileViewDetailed', + v, + ) as ValidationResult } export interface ProfileAssociated { + $type?: 'app.bsky.actor.defs#profileAssociated' lists?: number feedgens?: number starterPacks?: number labeler?: boolean chat?: ProfileAssociatedChat - [k: string]: unknown } -export function isProfileAssociated(v: unknown): v is ProfileAssociated { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#profileAssociated' - ) +export function isProfileAssociated( + v: unknown, +): v is ProfileAssociated & { $type: 'app.bsky.actor.defs#profileAssociated' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#profileAssociated' } -export function validateProfileAssociated(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileAssociated', v) +export function validateProfileAssociated(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#profileAssociated', + v, + ) as ValidationResult } export interface ProfileAssociatedChat { + $type?: 'app.bsky.actor.defs#profileAssociatedChat' allowIncoming: 'all' | 'none' | 'following' | (string & {}) - [k: string]: unknown } export function isProfileAssociatedChat( v: unknown, -): v is ProfileAssociatedChat { +): v is ProfileAssociatedChat & { + $type: 'app.bsky.actor.defs#profileAssociatedChat' +} { return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#profileAssociatedChat' + isTypedObj(v) && v.$type === 'app.bsky.actor.defs#profileAssociatedChat' ) } -export function validateProfileAssociatedChat(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileAssociatedChat', v) +export function validateProfileAssociatedChat(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#profileAssociatedChat', + v, + ) as ValidationResult } /** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */ export interface ViewerState { + $type?: 'app.bsky.actor.defs#viewerState' muted?: boolean mutedByList?: AppBskyGraphDefs.ListViewBasic blockedBy?: boolean @@ -141,38 +149,39 @@ export interface ViewerState { following?: string followedBy?: string knownFollowers?: KnownFollowers - [k: string]: unknown } -export function isViewerState(v: unknown): v is ViewerState { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#viewerState' - ) +export function isViewerState( + v: unknown, +): v is ViewerState & { $type: 'app.bsky.actor.defs#viewerState' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#viewerState' } -export function validateViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#viewerState', v) +export function validateViewerState(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#viewerState', + v, + ) as ValidationResult } /** The subject's followers whom you also follow */ export interface KnownFollowers { + $type?: 'app.bsky.actor.defs#knownFollowers' count: number followers: ProfileViewBasic[] - [k: string]: unknown } -export function isKnownFollowers(v: unknown): v is KnownFollowers { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#knownFollowers' - ) +export function isKnownFollowers( + v: unknown, +): v is KnownFollowers & { $type: 'app.bsky.actor.defs#knownFollowers' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#knownFollowers' } -export function validateKnownFollowers(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#knownFollowers', v) +export function validateKnownFollowers(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#knownFollowers', + v, + ) as ValidationResult } export type Preferences = ( @@ -192,117 +201,124 @@ export type Preferences = ( )[] export interface AdultContentPref { + $type?: 'app.bsky.actor.defs#adultContentPref' enabled: boolean - [k: string]: unknown } -export function isAdultContentPref(v: unknown): v is AdultContentPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#adultContentPref' - ) +export function isAdultContentPref( + v: unknown, +): v is AdultContentPref & { $type: 'app.bsky.actor.defs#adultContentPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#adultContentPref' } -export function validateAdultContentPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#adultContentPref', v) +export function validateAdultContentPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#adultContentPref', + v, + ) as ValidationResult } export interface ContentLabelPref { + $type?: 'app.bsky.actor.defs#contentLabelPref' /** Which labeler does this preference apply to? If undefined, applies globally. */ labelerDid?: string label: string visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {}) - [k: string]: unknown } -export function isContentLabelPref(v: unknown): v is ContentLabelPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#contentLabelPref' - ) +export function isContentLabelPref( + v: unknown, +): v is ContentLabelPref & { $type: 'app.bsky.actor.defs#contentLabelPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#contentLabelPref' } -export function validateContentLabelPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v) +export function validateContentLabelPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#contentLabelPref', + v, + ) as ValidationResult } export interface SavedFeed { + $type?: 'app.bsky.actor.defs#savedFeed' id: string type: 'feed' | 'list' | 'timeline' | (string & {}) value: string pinned: boolean - [k: string]: unknown } -export function isSavedFeed(v: unknown): v is SavedFeed { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#savedFeed' - ) +export function isSavedFeed( + v: unknown, +): v is SavedFeed & { $type: 'app.bsky.actor.defs#savedFeed' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#savedFeed' } -export function validateSavedFeed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#savedFeed', v) +export function validateSavedFeed(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#savedFeed', + v, + ) as ValidationResult } export interface SavedFeedsPrefV2 { + $type?: 'app.bsky.actor.defs#savedFeedsPrefV2' items: SavedFeed[] - [k: string]: unknown } -export function isSavedFeedsPrefV2(v: unknown): v is SavedFeedsPrefV2 { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#savedFeedsPrefV2' - ) +export function isSavedFeedsPrefV2( + v: unknown, +): v is SavedFeedsPrefV2 & { $type: 'app.bsky.actor.defs#savedFeedsPrefV2' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#savedFeedsPrefV2' } -export function validateSavedFeedsPrefV2(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#savedFeedsPrefV2', v) +export function validateSavedFeedsPrefV2(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#savedFeedsPrefV2', + v, + ) as ValidationResult } export interface SavedFeedsPref { + $type?: 'app.bsky.actor.defs#savedFeedsPref' pinned: string[] saved: string[] timelineIndex?: number - [k: string]: unknown } -export function isSavedFeedsPref(v: unknown): v is SavedFeedsPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#savedFeedsPref' - ) +export function isSavedFeedsPref( + v: unknown, +): v is SavedFeedsPref & { $type: 'app.bsky.actor.defs#savedFeedsPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#savedFeedsPref' } -export function validateSavedFeedsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#savedFeedsPref', v) +export function validateSavedFeedsPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#savedFeedsPref', + v, + ) as ValidationResult } export interface PersonalDetailsPref { + $type?: 'app.bsky.actor.defs#personalDetailsPref' /** The birth date of account owner. */ birthDate?: string - [k: string]: unknown } -export function isPersonalDetailsPref(v: unknown): v is PersonalDetailsPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#personalDetailsPref' - ) +export function isPersonalDetailsPref(v: unknown): v is PersonalDetailsPref & { + $type: 'app.bsky.actor.defs#personalDetailsPref' +} { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#personalDetailsPref' } -export function validatePersonalDetailsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#personalDetailsPref', v) +export function validatePersonalDetailsPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#personalDetailsPref', + v, + ) as ValidationResult } export interface FeedViewPref { + $type?: 'app.bsky.actor.defs#feedViewPref' /** The URI of the feed, or an identifier which describes the feed. */ feed: string /** Hide replies in the feed. */ @@ -315,63 +331,66 @@ export interface FeedViewPref { hideReposts?: boolean /** Hide quote posts in the feed. */ hideQuotePosts?: boolean - [k: string]: unknown } -export function isFeedViewPref(v: unknown): v is FeedViewPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#feedViewPref' - ) +export function isFeedViewPref( + v: unknown, +): v is FeedViewPref & { $type: 'app.bsky.actor.defs#feedViewPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#feedViewPref' } -export function validateFeedViewPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#feedViewPref', v) +export function validateFeedViewPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#feedViewPref', + v, + ) as ValidationResult } export interface ThreadViewPref { + $type?: 'app.bsky.actor.defs#threadViewPref' /** Sorting mode for threads. */ sort?: 'oldest' | 'newest' | 'most-likes' | 'random' | (string & {}) /** Show followed users at the top of all replies. */ prioritizeFollowedUsers?: boolean - [k: string]: unknown } -export function isThreadViewPref(v: unknown): v is ThreadViewPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#threadViewPref' - ) +export function isThreadViewPref( + v: unknown, +): v is ThreadViewPref & { $type: 'app.bsky.actor.defs#threadViewPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#threadViewPref' } -export function validateThreadViewPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#threadViewPref', v) +export function validateThreadViewPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#threadViewPref', + v, + ) as ValidationResult } export interface InterestsPref { + $type?: 'app.bsky.actor.defs#interestsPref' /** A list of tags which describe the account owner's interests gathered during onboarding. */ tags: string[] - [k: string]: unknown } -export function isInterestsPref(v: unknown): v is InterestsPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#interestsPref' - ) +export function isInterestsPref( + v: unknown, +): v is InterestsPref & { $type: 'app.bsky.actor.defs#interestsPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#interestsPref' } -export function validateInterestsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#interestsPref', v) +export function validateInterestsPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#interestsPref', + v, + ) as ValidationResult } export type MutedWordTarget = 'content' | 'tag' | (string & {}) /** A word that the account owner has muted. */ export interface MutedWord { + $type?: 'app.bsky.actor.defs#mutedWord' id?: string /** The muted word itself. */ value: string @@ -381,148 +400,159 @@ export interface MutedWord { actorTarget: 'all' | 'exclude-following' | (string & {}) /** The date and time at which the muted word will expire and no longer be applied. */ expiresAt?: string - [k: string]: unknown } -export function isMutedWord(v: unknown): v is MutedWord { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#mutedWord' - ) +export function isMutedWord( + v: unknown, +): v is MutedWord & { $type: 'app.bsky.actor.defs#mutedWord' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#mutedWord' } -export function validateMutedWord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#mutedWord', v) +export function validateMutedWord(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#mutedWord', + v, + ) as ValidationResult } export interface MutedWordsPref { + $type?: 'app.bsky.actor.defs#mutedWordsPref' /** A list of words the account owner has muted. */ items: MutedWord[] - [k: string]: unknown } -export function isMutedWordsPref(v: unknown): v is MutedWordsPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#mutedWordsPref' - ) +export function isMutedWordsPref( + v: unknown, +): v is MutedWordsPref & { $type: 'app.bsky.actor.defs#mutedWordsPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#mutedWordsPref' } -export function validateMutedWordsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#mutedWordsPref', v) +export function validateMutedWordsPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#mutedWordsPref', + v, + ) as ValidationResult } export interface HiddenPostsPref { + $type?: 'app.bsky.actor.defs#hiddenPostsPref' /** A list of URIs of posts the account owner has hidden. */ items: string[] - [k: string]: unknown } -export function isHiddenPostsPref(v: unknown): v is HiddenPostsPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#hiddenPostsPref' - ) +export function isHiddenPostsPref( + v: unknown, +): v is HiddenPostsPref & { $type: 'app.bsky.actor.defs#hiddenPostsPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#hiddenPostsPref' } -export function validateHiddenPostsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#hiddenPostsPref', v) +export function validateHiddenPostsPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#hiddenPostsPref', + v, + ) as ValidationResult } export interface LabelersPref { + $type?: 'app.bsky.actor.defs#labelersPref' labelers: LabelerPrefItem[] - [k: string]: unknown } -export function isLabelersPref(v: unknown): v is LabelersPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#labelersPref' - ) +export function isLabelersPref( + v: unknown, +): v is LabelersPref & { $type: 'app.bsky.actor.defs#labelersPref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#labelersPref' } -export function validateLabelersPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#labelersPref', v) +export function validateLabelersPref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#labelersPref', + v, + ) as ValidationResult } export interface LabelerPrefItem { + $type?: 'app.bsky.actor.defs#labelerPrefItem' did: string - [k: string]: unknown } -export function isLabelerPrefItem(v: unknown): v is LabelerPrefItem { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#labelerPrefItem' - ) +export function isLabelerPrefItem( + v: unknown, +): v is LabelerPrefItem & { $type: 'app.bsky.actor.defs#labelerPrefItem' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#labelerPrefItem' } -export function validateLabelerPrefItem(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#labelerPrefItem', v) +export function validateLabelerPrefItem(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#labelerPrefItem', + v, + ) as ValidationResult } /** A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. */ export interface BskyAppStatePref { + $type?: 'app.bsky.actor.defs#bskyAppStatePref' activeProgressGuide?: BskyAppProgressGuide /** An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. */ queuedNudges?: string[] /** Storage for NUXs the user has encountered. */ nuxs?: Nux[] - [k: string]: unknown } -export function isBskyAppStatePref(v: unknown): v is BskyAppStatePref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#bskyAppStatePref' - ) +export function isBskyAppStatePref( + v: unknown, +): v is BskyAppStatePref & { $type: 'app.bsky.actor.defs#bskyAppStatePref' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#bskyAppStatePref' } -export function validateBskyAppStatePref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#bskyAppStatePref', v) +export function validateBskyAppStatePref(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#bskyAppStatePref', + v, + ) as ValidationResult } /** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. */ export interface BskyAppProgressGuide { + $type?: 'app.bsky.actor.defs#bskyAppProgressGuide' guide: string - [k: string]: unknown } -export function isBskyAppProgressGuide(v: unknown): v is BskyAppProgressGuide { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#bskyAppProgressGuide' - ) +export function isBskyAppProgressGuide( + v: unknown, +): v is BskyAppProgressGuide & { + $type: 'app.bsky.actor.defs#bskyAppProgressGuide' +} { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#bskyAppProgressGuide' } -export function validateBskyAppProgressGuide(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#bskyAppProgressGuide', v) +export function validateBskyAppProgressGuide(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#bskyAppProgressGuide', + v, + ) as ValidationResult } /** A new user experiences (NUX) storage object */ export interface Nux { + $type?: 'app.bsky.actor.defs#nux' id: string completed: boolean /** Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. */ data?: string /** The date and time at which the NUX will expire and should be considered completed. */ expiresAt?: string - [k: string]: unknown } -export function isNux(v: unknown): v is Nux { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.actor.defs#nux' - ) +export function isNux( + v: unknown, +): v is Nux & { $type: 'app.bsky.actor.defs#nux' } { + return isTypedObj(v) && v.$type === 'app.bsky.actor.defs#nux' } -export function validateNux(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#nux', v) +export function validateNux(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.defs#nux', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/actor/getPreferences.ts b/packages/api/src/client/types/app/bsky/actor/getPreferences.ts index 6cc35cc3c62..1bdaa6ef522 100644 --- a/packages/api/src/client/types/app/bsky/actor/getPreferences.ts +++ b/packages/api/src/client/types/app/bsky/actor/getPreferences.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' @@ -14,7 +14,6 @@ export type InputSchema = undefined export interface OutputSchema { preferences: AppBskyActorDefs.Preferences - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/actor/getProfile.ts b/packages/api/src/client/types/app/bsky/actor/getProfile.ts index 13618b6c2f7..56e3edf4984 100644 --- a/packages/api/src/client/types/app/bsky/actor/getProfile.ts +++ b/packages/api/src/client/types/app/bsky/actor/getProfile.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' diff --git a/packages/api/src/client/types/app/bsky/actor/getProfiles.ts b/packages/api/src/client/types/app/bsky/actor/getProfiles.ts index 2207218ac69..55b5bf75bdb 100644 --- a/packages/api/src/client/types/app/bsky/actor/getProfiles.ts +++ b/packages/api/src/client/types/app/bsky/actor/getProfiles.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { profiles: AppBskyActorDefs.ProfileViewDetailed[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/actor/getSuggestions.ts b/packages/api/src/client/types/app/bsky/actor/getSuggestions.ts index 48553fd1b85..f5354ea47d5 100644 --- a/packages/api/src/client/types/app/bsky/actor/getSuggestions.ts +++ b/packages/api/src/client/types/app/bsky/actor/getSuggestions.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string actors: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/actor/profile.ts b/packages/api/src/client/types/app/bsky/actor/profile.ts index c109e93f9ab..3c936df0e94 100644 --- a/packages/api/src/client/types/app/bsky/actor/profile.ts +++ b/packages/api/src/client/types/app/bsky/actor/profile.ts @@ -2,13 +2,14 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' export interface Record { + $type?: 'app.bsky.actor.profile' | 'app.bsky.actor.profile#main' displayName?: string /** Free-form profile description text. */ description?: string @@ -25,15 +26,19 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.actor.profile#main' | 'app.bsky.actor.profile' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.actor.profile#main' || v.$type === 'app.bsky.actor.profile') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.profile#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.actor.profile#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/actor/putPreferences.ts b/packages/api/src/client/types/app/bsky/actor/putPreferences.ts index 834b1bd247c..3058af5290f 100644 --- a/packages/api/src/client/types/app/bsky/actor/putPreferences.ts +++ b/packages/api/src/client/types/app/bsky/actor/putPreferences.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' @@ -12,7 +12,6 @@ export interface QueryParams {} export interface InputSchema { preferences: AppBskyActorDefs.Preferences - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/actor/searchActors.ts b/packages/api/src/client/types/app/bsky/actor/searchActors.ts index bcbde2b7bfb..29ea38338bd 100644 --- a/packages/api/src/client/types/app/bsky/actor/searchActors.ts +++ b/packages/api/src/client/types/app/bsky/actor/searchActors.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' @@ -22,7 +22,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string actors: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts b/packages/api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts index abed0289f27..d662a82e9bb 100644 --- a/packages/api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts +++ b/packages/api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from './defs' @@ -20,7 +20,6 @@ export type InputSchema = undefined export interface OutputSchema { actors: AppBskyActorDefs.ProfileViewBasic[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/embed/defs.ts b/packages/api/src/client/types/app/bsky/embed/defs.ts index b7b753d65f6..f4f8e59c03d 100644 --- a/packages/api/src/client/types/app/bsky/embed/defs.ts +++ b/packages/api/src/client/types/app/bsky/embed/defs.ts @@ -2,25 +2,26 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' /** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */ export interface AspectRatio { + $type?: 'app.bsky.embed.defs#aspectRatio' width: number height: number - [k: string]: unknown } -export function isAspectRatio(v: unknown): v is AspectRatio { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.defs#aspectRatio' - ) +export function isAspectRatio( + v: unknown, +): v is AspectRatio & { $type: 'app.bsky.embed.defs#aspectRatio' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.defs#aspectRatio' } -export function validateAspectRatio(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.defs#aspectRatio', v) +export function validateAspectRatio(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.defs#aspectRatio', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/embed/external.ts b/packages/api/src/client/types/app/bsky/embed/external.ts index 5832cbb3987..0ee1f9e1a3e 100644 --- a/packages/api/src/client/types/app/bsky/embed/external.ts +++ b/packages/api/src/client/types/app/bsky/embed/external.ts @@ -2,82 +2,89 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' /** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */ export interface Main { + $type?: 'app.bsky.embed.external' | 'app.bsky.embed.external#main' external: External - [k: string]: unknown } -export function isMain(v: unknown): v is Main { +export function isMain(v: unknown): v is Main & { + $type: 'app.bsky.embed.external#main' | 'app.bsky.embed.external' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.embed.external#main' || v.$type === 'app.bsky.embed.external') ) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#main', v) +export function validateMain(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.external#main', + v, + ) as ValidationResult
} export interface External { + $type?: 'app.bsky.embed.external#external' uri: string title: string description: string thumb?: BlobRef - [k: string]: unknown } -export function isExternal(v: unknown): v is External { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.external#external' - ) +export function isExternal( + v: unknown, +): v is External & { $type: 'app.bsky.embed.external#external' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.external#external' } -export function validateExternal(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#external', v) +export function validateExternal(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.external#external', + v, + ) as ValidationResult } export interface View { + $type?: 'app.bsky.embed.external#view' external: ViewExternal - [k: string]: unknown } -export function isView(v: unknown): v is View { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.external#view' - ) +export function isView( + v: unknown, +): v is View & { $type: 'app.bsky.embed.external#view' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.external#view' } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#view', v) +export function validateView(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.external#view', + v, + ) as ValidationResult } export interface ViewExternal { + $type?: 'app.bsky.embed.external#viewExternal' uri: string title: string description: string thumb?: string - [k: string]: unknown } -export function isViewExternal(v: unknown): v is ViewExternal { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.external#viewExternal' - ) +export function isViewExternal( + v: unknown, +): v is ViewExternal & { $type: 'app.bsky.embed.external#viewExternal' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.external#viewExternal' } -export function validateViewExternal(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#viewExternal', v) +export function validateViewExternal(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.external#viewExternal', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/embed/images.ts b/packages/api/src/client/types/app/bsky/embed/images.ts index 886ad7c5c5b..63e39073c5f 100644 --- a/packages/api/src/client/types/app/bsky/embed/images.ts +++ b/packages/api/src/client/types/app/bsky/embed/images.ts @@ -2,63 +2,74 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyEmbedDefs from './defs' export interface Main { + $type?: 'app.bsky.embed.images' | 'app.bsky.embed.images#main' images: Image[] - [k: string]: unknown } -export function isMain(v: unknown): v is Main { +export function isMain(v: unknown): v is Main & { + $type: 'app.bsky.embed.images#main' | 'app.bsky.embed.images' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.embed.images#main' || v.$type === 'app.bsky.embed.images') ) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#main', v) +export function validateMain(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.images#main', + v, + ) as ValidationResult
} export interface Image { + $type?: 'app.bsky.embed.images#image' image: BlobRef /** Alt text description of the image, for accessibility. */ alt: string aspectRatio?: AppBskyEmbedDefs.AspectRatio - [k: string]: unknown } -export function isImage(v: unknown): v is Image { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#image' - ) +export function isImage( + v: unknown, +): v is Image & { $type: 'app.bsky.embed.images#image' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.images#image' } -export function validateImage(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#image', v) +export function validateImage(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.images#image', + v, + ) as ValidationResult } export interface View { + $type?: 'app.bsky.embed.images#view' images: ViewImage[] - [k: string]: unknown } -export function isView(v: unknown): v is View { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#view' - ) +export function isView( + v: unknown, +): v is View & { $type: 'app.bsky.embed.images#view' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.images#view' } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#view', v) +export function validateView(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.images#view', + v, + ) as ValidationResult } export interface ViewImage { + $type?: 'app.bsky.embed.images#viewImage' /** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. */ thumb: string /** Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. */ @@ -66,17 +77,17 @@ export interface ViewImage { /** Alt text description of the image, for accessibility. */ alt: string aspectRatio?: AppBskyEmbedDefs.AspectRatio - [k: string]: unknown } -export function isViewImage(v: unknown): v is ViewImage { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.images#viewImage' - ) +export function isViewImage( + v: unknown, +): v is ViewImage & { $type: 'app.bsky.embed.images#viewImage' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.images#viewImage' } -export function validateViewImage(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#viewImage', v) +export function validateViewImage(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.images#viewImage', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/embed/record.ts b/packages/api/src/client/types/app/bsky/embed/record.ts index a3744c29246..0c4896e1010 100644 --- a/packages/api/src/client/types/app/bsky/embed/record.ts +++ b/packages/api/src/client/types/app/bsky/embed/record.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' @@ -17,24 +17,29 @@ import * as AppBskyEmbedExternal from './external' import * as AppBskyEmbedRecordWithMedia from './recordWithMedia' export interface Main { + $type?: 'app.bsky.embed.record' | 'app.bsky.embed.record#main' record: ComAtprotoRepoStrongRef.Main - [k: string]: unknown } -export function isMain(v: unknown): v is Main { +export function isMain(v: unknown): v is Main & { + $type: 'app.bsky.embed.record#main' | 'app.bsky.embed.record' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.embed.record#main' || v.$type === 'app.bsky.embed.record') ) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#main', v) +export function validateMain(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.record#main', + v, + ) as ValidationResult
} export interface View { + $type?: 'app.bsky.embed.record#view' record: | ViewRecord | ViewNotFound @@ -45,25 +50,28 @@ export interface View { | AppBskyLabelerDefs.LabelerView | AppBskyGraphDefs.StarterPackViewBasic | { $type: string; [k: string]: unknown } - [k: string]: unknown } -export function isView(v: unknown): v is View { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.record#view' - ) +export function isView( + v: unknown, +): v is View & { $type: 'app.bsky.embed.record#view' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.record#view' } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#view', v) +export function validateView(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.record#view', + v, + ) as ValidationResult } export interface ViewRecord { + $type?: 'app.bsky.embed.record#viewRecord' uri: string cid: string author: AppBskyActorDefs.ProfileViewBasic /** The record data itself. */ - value: {} + value: { [_ in string]: unknown } labels?: ComAtprotoLabelDefs.Label[] replyCount?: number repostCount?: number @@ -78,72 +86,75 @@ export interface ViewRecord { | { $type: string; [k: string]: unknown } )[] indexedAt: string - [k: string]: unknown } -export function isViewRecord(v: unknown): v is ViewRecord { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.record#viewRecord' - ) +export function isViewRecord( + v: unknown, +): v is ViewRecord & { $type: 'app.bsky.embed.record#viewRecord' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.record#viewRecord' } -export function validateViewRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewRecord', v) +export function validateViewRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.record#viewRecord', + v, + ) as ValidationResult } export interface ViewNotFound { + $type?: 'app.bsky.embed.record#viewNotFound' uri: string notFound: true - [k: string]: unknown } -export function isViewNotFound(v: unknown): v is ViewNotFound { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.record#viewNotFound' - ) +export function isViewNotFound( + v: unknown, +): v is ViewNotFound & { $type: 'app.bsky.embed.record#viewNotFound' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.record#viewNotFound' } -export function validateViewNotFound(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewNotFound', v) +export function validateViewNotFound(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.record#viewNotFound', + v, + ) as ValidationResult } export interface ViewBlocked { + $type?: 'app.bsky.embed.record#viewBlocked' uri: string blocked: true author: AppBskyFeedDefs.BlockedAuthor - [k: string]: unknown } -export function isViewBlocked(v: unknown): v is ViewBlocked { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.record#viewBlocked' - ) +export function isViewBlocked( + v: unknown, +): v is ViewBlocked & { $type: 'app.bsky.embed.record#viewBlocked' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.record#viewBlocked' } -export function validateViewBlocked(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewBlocked', v) +export function validateViewBlocked(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.record#viewBlocked', + v, + ) as ValidationResult } export interface ViewDetached { + $type?: 'app.bsky.embed.record#viewDetached' uri: string detached: true - [k: string]: unknown } -export function isViewDetached(v: unknown): v is ViewDetached { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.record#viewDetached' - ) +export function isViewDetached( + v: unknown, +): v is ViewDetached & { $type: 'app.bsky.embed.record#viewDetached' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.record#viewDetached' } -export function validateViewDetached(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewDetached', v) +export function validateViewDetached(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.record#viewDetached', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/embed/recordWithMedia.ts b/packages/api/src/client/types/app/bsky/embed/recordWithMedia.ts index 2b2b3ae6251..4eaa45c4e6d 100644 --- a/packages/api/src/client/types/app/bsky/embed/recordWithMedia.ts +++ b/packages/api/src/client/types/app/bsky/embed/recordWithMedia.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyEmbedRecord from './record' @@ -11,46 +11,55 @@ import * as AppBskyEmbedVideo from './video' import * as AppBskyEmbedExternal from './external' export interface Main { + $type?: + | 'app.bsky.embed.recordWithMedia' + | 'app.bsky.embed.recordWithMedia#main' record: AppBskyEmbedRecord.Main media: | AppBskyEmbedImages.Main | AppBskyEmbedVideo.Main | AppBskyEmbedExternal.Main | { $type: string; [k: string]: unknown } - [k: string]: unknown } -export function isMain(v: unknown): v is Main { +export function isMain(v: unknown): v is Main & { + $type: + | 'app.bsky.embed.recordWithMedia#main' + | 'app.bsky.embed.recordWithMedia' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.embed.recordWithMedia#main' || v.$type === 'app.bsky.embed.recordWithMedia') ) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.recordWithMedia#main', v) +export function validateMain(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.recordWithMedia#main', + v, + ) as ValidationResult
} export interface View { + $type?: 'app.bsky.embed.recordWithMedia#view' record: AppBskyEmbedRecord.View media: | AppBskyEmbedImages.View | AppBskyEmbedVideo.View | AppBskyEmbedExternal.View | { $type: string; [k: string]: unknown } - [k: string]: unknown } -export function isView(v: unknown): v is View { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.recordWithMedia#view' - ) +export function isView( + v: unknown, +): v is View & { $type: 'app.bsky.embed.recordWithMedia#view' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.recordWithMedia#view' } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.recordWithMedia#view', v) +export function validateView(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.recordWithMedia#view', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/embed/video.ts b/packages/api/src/client/types/app/bsky/embed/video.ts index 2be451b85ed..0d3f7c521bc 100644 --- a/packages/api/src/client/types/app/bsky/embed/video.ts +++ b/packages/api/src/client/types/app/bsky/embed/video.ts @@ -2,66 +2,74 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyEmbedDefs from './defs' export interface Main { + $type?: 'app.bsky.embed.video' | 'app.bsky.embed.video#main' video: BlobRef captions?: Caption[] /** Alt text description of the video, for accessibility. */ alt?: string aspectRatio?: AppBskyEmbedDefs.AspectRatio - [k: string]: unknown } -export function isMain(v: unknown): v is Main { +export function isMain( + v: unknown, +): v is Main & { $type: 'app.bsky.embed.video#main' | 'app.bsky.embed.video' } { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.embed.video#main' || v.$type === 'app.bsky.embed.video') ) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.video#main', v) +export function validateMain(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.video#main', + v, + ) as ValidationResult
} export interface Caption { + $type?: 'app.bsky.embed.video#caption' lang: string file: BlobRef - [k: string]: unknown } -export function isCaption(v: unknown): v is Caption { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.video#caption' - ) +export function isCaption( + v: unknown, +): v is Caption & { $type: 'app.bsky.embed.video#caption' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.video#caption' } -export function validateCaption(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.video#caption', v) +export function validateCaption(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.video#caption', + v, + ) as ValidationResult } export interface View { + $type?: 'app.bsky.embed.video#view' cid: string playlist: string thumbnail?: string alt?: string aspectRatio?: AppBskyEmbedDefs.AspectRatio - [k: string]: unknown } -export function isView(v: unknown): v is View { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.video#view' - ) +export function isView( + v: unknown, +): v is View & { $type: 'app.bsky.embed.video#view' } { + return isTypedObj(v) && v.$type === 'app.bsky.embed.video#view' } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.video#view', v) +export function validateView(v: unknown) { + return lexicons.validate( + 'app.bsky.embed.video#view', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/defs.ts b/packages/api/src/client/types/app/bsky/feed/defs.ts index bc50067c1da..3f465dbc495 100644 --- a/packages/api/src/client/types/app/bsky/feed/defs.ts +++ b/packages/api/src/client/types/app/bsky/feed/defs.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -16,10 +16,11 @@ import * as AppBskyRichtextFacet from '../richtext/facet' import * as AppBskyGraphDefs from '../graph/defs' export interface PostView { + $type?: 'app.bsky.feed.defs#postView' uri: string cid: string author: AppBskyActorDefs.ProfileViewBasic - record: {} + record: { [_ in string]: unknown } embed?: | AppBskyEmbedImages.View | AppBskyEmbedVideo.View @@ -35,64 +36,69 @@ export interface PostView { viewer?: ViewerState labels?: ComAtprotoLabelDefs.Label[] threadgate?: ThreadgateView - [k: string]: unknown } -export function isPostView(v: unknown): v is PostView { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#postView' - ) +export function isPostView( + v: unknown, +): v is PostView & { $type: 'app.bsky.feed.defs#postView' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#postView' } -export function validatePostView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#postView', v) +export function validatePostView(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#postView', + v, + ) as ValidationResult } /** Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. */ export interface ViewerState { + $type?: 'app.bsky.feed.defs#viewerState' repost?: string like?: string threadMuted?: boolean replyDisabled?: boolean embeddingDisabled?: boolean pinned?: boolean - [k: string]: unknown } -export function isViewerState(v: unknown): v is ViewerState { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#viewerState' - ) +export function isViewerState( + v: unknown, +): v is ViewerState & { $type: 'app.bsky.feed.defs#viewerState' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#viewerState' } -export function validateViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#viewerState', v) +export function validateViewerState(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#viewerState', + v, + ) as ValidationResult } export interface FeedViewPost { + $type?: 'app.bsky.feed.defs#feedViewPost' post: PostView reply?: ReplyRef reason?: ReasonRepost | ReasonPin | { $type: string; [k: string]: unknown } /** Context provided by feed generator that may be passed back alongside interactions. */ feedContext?: string - [k: string]: unknown } -export function isFeedViewPost(v: unknown): v is FeedViewPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#feedViewPost' - ) +export function isFeedViewPost( + v: unknown, +): v is FeedViewPost & { $type: 'app.bsky.feed.defs#feedViewPost' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#feedViewPost' } -export function validateFeedViewPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#feedViewPost', v) +export function validateFeedViewPost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#feedViewPost', + v, + ) as ValidationResult } export interface ReplyRef { + $type?: 'app.bsky.feed.defs#replyRef' root: | PostView | NotFoundPost @@ -104,54 +110,59 @@ export interface ReplyRef { | BlockedPost | { $type: string; [k: string]: unknown } grandparentAuthor?: AppBskyActorDefs.ProfileViewBasic - [k: string]: unknown } -export function isReplyRef(v: unknown): v is ReplyRef { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#replyRef' - ) +export function isReplyRef( + v: unknown, +): v is ReplyRef & { $type: 'app.bsky.feed.defs#replyRef' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#replyRef' } -export function validateReplyRef(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#replyRef', v) +export function validateReplyRef(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#replyRef', + v, + ) as ValidationResult } export interface ReasonRepost { + $type?: 'app.bsky.feed.defs#reasonRepost' by: AppBskyActorDefs.ProfileViewBasic indexedAt: string - [k: string]: unknown } -export function isReasonRepost(v: unknown): v is ReasonRepost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#reasonRepost' - ) +export function isReasonRepost( + v: unknown, +): v is ReasonRepost & { $type: 'app.bsky.feed.defs#reasonRepost' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#reasonRepost' } -export function validateReasonRepost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#reasonRepost', v) +export function validateReasonRepost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#reasonRepost', + v, + ) as ValidationResult } export interface ReasonPin { - [k: string]: unknown + $type?: 'app.bsky.feed.defs#reasonPin' } -export function isReasonPin(v: unknown): v is ReasonPin { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#reasonPin' - ) +export function isReasonPin( + v: unknown, +): v is ReasonPin & { $type: 'app.bsky.feed.defs#reasonPin' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#reasonPin' } -export function validateReasonPin(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#reasonPin', v) +export function validateReasonPin(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#reasonPin', + v, + ) as ValidationResult } export interface ThreadViewPost { + $type?: 'app.bsky.feed.defs#threadViewPost' post: PostView parent?: | ThreadViewPost @@ -164,77 +175,81 @@ export interface ThreadViewPost { | BlockedPost | { $type: string; [k: string]: unknown } )[] - [k: string]: unknown } -export function isThreadViewPost(v: unknown): v is ThreadViewPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#threadViewPost' - ) +export function isThreadViewPost( + v: unknown, +): v is ThreadViewPost & { $type: 'app.bsky.feed.defs#threadViewPost' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#threadViewPost' } -export function validateThreadViewPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#threadViewPost', v) +export function validateThreadViewPost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#threadViewPost', + v, + ) as ValidationResult } export interface NotFoundPost { + $type?: 'app.bsky.feed.defs#notFoundPost' uri: string notFound: true - [k: string]: unknown } -export function isNotFoundPost(v: unknown): v is NotFoundPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#notFoundPost' - ) +export function isNotFoundPost( + v: unknown, +): v is NotFoundPost & { $type: 'app.bsky.feed.defs#notFoundPost' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#notFoundPost' } -export function validateNotFoundPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#notFoundPost', v) +export function validateNotFoundPost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#notFoundPost', + v, + ) as ValidationResult } export interface BlockedPost { + $type?: 'app.bsky.feed.defs#blockedPost' uri: string blocked: true author: BlockedAuthor - [k: string]: unknown } -export function isBlockedPost(v: unknown): v is BlockedPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#blockedPost' - ) +export function isBlockedPost( + v: unknown, +): v is BlockedPost & { $type: 'app.bsky.feed.defs#blockedPost' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#blockedPost' } -export function validateBlockedPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#blockedPost', v) +export function validateBlockedPost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#blockedPost', + v, + ) as ValidationResult } export interface BlockedAuthor { + $type?: 'app.bsky.feed.defs#blockedAuthor' did: string viewer?: AppBskyActorDefs.ViewerState - [k: string]: unknown } -export function isBlockedAuthor(v: unknown): v is BlockedAuthor { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#blockedAuthor' - ) +export function isBlockedAuthor( + v: unknown, +): v is BlockedAuthor & { $type: 'app.bsky.feed.defs#blockedAuthor' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#blockedAuthor' } -export function validateBlockedAuthor(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#blockedAuthor', v) +export function validateBlockedAuthor(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#blockedAuthor', + v, + ) as ValidationResult } export interface GeneratorView { + $type?: 'app.bsky.feed.defs#generatorView' uri: string cid: string did: string @@ -248,39 +263,43 @@ export interface GeneratorView { labels?: ComAtprotoLabelDefs.Label[] viewer?: GeneratorViewerState indexedAt: string - [k: string]: unknown } -export function isGeneratorView(v: unknown): v is GeneratorView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#generatorView' - ) +export function isGeneratorView( + v: unknown, +): v is GeneratorView & { $type: 'app.bsky.feed.defs#generatorView' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#generatorView' } -export function validateGeneratorView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#generatorView', v) +export function validateGeneratorView(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#generatorView', + v, + ) as ValidationResult } export interface GeneratorViewerState { + $type?: 'app.bsky.feed.defs#generatorViewerState' like?: string - [k: string]: unknown } -export function isGeneratorViewerState(v: unknown): v is GeneratorViewerState { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#generatorViewerState' - ) +export function isGeneratorViewerState( + v: unknown, +): v is GeneratorViewerState & { + $type: 'app.bsky.feed.defs#generatorViewerState' +} { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#generatorViewerState' } -export function validateGeneratorViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#generatorViewerState', v) +export function validateGeneratorViewerState(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#generatorViewerState', + v, + ) as ValidationResult } export interface SkeletonFeedPost { + $type?: 'app.bsky.feed.defs#skeletonFeedPost' post: string reason?: | SkeletonReasonRepost @@ -288,75 +307,81 @@ export interface SkeletonFeedPost { | { $type: string; [k: string]: unknown } /** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */ feedContext?: string - [k: string]: unknown } -export function isSkeletonFeedPost(v: unknown): v is SkeletonFeedPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#skeletonFeedPost' - ) +export function isSkeletonFeedPost( + v: unknown, +): v is SkeletonFeedPost & { $type: 'app.bsky.feed.defs#skeletonFeedPost' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#skeletonFeedPost' } -export function validateSkeletonFeedPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#skeletonFeedPost', v) +export function validateSkeletonFeedPost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#skeletonFeedPost', + v, + ) as ValidationResult } export interface SkeletonReasonRepost { + $type?: 'app.bsky.feed.defs#skeletonReasonRepost' repost: string - [k: string]: unknown } -export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#skeletonReasonRepost' - ) +export function isSkeletonReasonRepost( + v: unknown, +): v is SkeletonReasonRepost & { + $type: 'app.bsky.feed.defs#skeletonReasonRepost' +} { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#skeletonReasonRepost' } -export function validateSkeletonReasonRepost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v) +export function validateSkeletonReasonRepost(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#skeletonReasonRepost', + v, + ) as ValidationResult } export interface SkeletonReasonPin { - [k: string]: unknown + $type?: 'app.bsky.feed.defs#skeletonReasonPin' } -export function isSkeletonReasonPin(v: unknown): v is SkeletonReasonPin { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#skeletonReasonPin' - ) +export function isSkeletonReasonPin( + v: unknown, +): v is SkeletonReasonPin & { $type: 'app.bsky.feed.defs#skeletonReasonPin' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#skeletonReasonPin' } -export function validateSkeletonReasonPin(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#skeletonReasonPin', v) +export function validateSkeletonReasonPin(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#skeletonReasonPin', + v, + ) as ValidationResult } export interface ThreadgateView { + $type?: 'app.bsky.feed.defs#threadgateView' uri?: string cid?: string - record?: {} + record?: { [_ in string]: unknown } lists?: AppBskyGraphDefs.ListViewBasic[] - [k: string]: unknown } -export function isThreadgateView(v: unknown): v is ThreadgateView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#threadgateView' - ) +export function isThreadgateView( + v: unknown, +): v is ThreadgateView & { $type: 'app.bsky.feed.defs#threadgateView' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#threadgateView' } -export function validateThreadgateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#threadgateView', v) +export function validateThreadgateView(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#threadgateView', + v, + ) as ValidationResult } export interface Interaction { + $type?: 'app.bsky.feed.defs#interaction' item?: string event?: | 'app.bsky.feed.defs#requestLess' @@ -374,19 +399,19 @@ export interface Interaction { | (string & {}) /** Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. */ feedContext?: string - [k: string]: unknown } -export function isInteraction(v: unknown): v is Interaction { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#interaction' - ) +export function isInteraction( + v: unknown, +): v is Interaction & { $type: 'app.bsky.feed.defs#interaction' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.defs#interaction' } -export function validateInteraction(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#interaction', v) +export function validateInteraction(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.defs#interaction', + v, + ) as ValidationResult } /** Request that less content like the given feed item be shown in the feed */ diff --git a/packages/api/src/client/types/app/bsky/feed/describeFeedGenerator.ts b/packages/api/src/client/types/app/bsky/feed/describeFeedGenerator.ts index b974f496144..55dd8b280cb 100644 --- a/packages/api/src/client/types/app/bsky/feed/describeFeedGenerator.ts +++ b/packages/api/src/client/types/app/bsky/feed/describeFeedGenerator.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -15,7 +15,6 @@ export interface OutputSchema { did: string feeds: Feed[] links?: Links - [k: string]: unknown } export interface CallOptions { @@ -34,36 +33,40 @@ export function toKnownErr(e: any) { } export interface Feed { + $type?: 'app.bsky.feed.describeFeedGenerator#feed' uri: string - [k: string]: unknown } -export function isFeed(v: unknown): v is Feed { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.describeFeedGenerator#feed' - ) +export function isFeed( + v: unknown, +): v is Feed & { $type: 'app.bsky.feed.describeFeedGenerator#feed' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.describeFeedGenerator#feed' } -export function validateFeed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.describeFeedGenerator#feed', v) +export function validateFeed(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.describeFeedGenerator#feed', + v, + ) as ValidationResult } export interface Links { + $type?: 'app.bsky.feed.describeFeedGenerator#links' privacyPolicy?: string termsOfService?: string - [k: string]: unknown } -export function isLinks(v: unknown): v is Links { +export function isLinks( + v: unknown, +): v is Links & { $type: 'app.bsky.feed.describeFeedGenerator#links' } { return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.describeFeedGenerator#links' + isTypedObj(v) && v.$type === 'app.bsky.feed.describeFeedGenerator#links' ) } -export function validateLinks(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.describeFeedGenerator#links', v) +export function validateLinks(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.describeFeedGenerator#links', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/generator.ts b/packages/api/src/client/types/app/bsky/feed/generator.ts index b36796dd353..9e4acfb126e 100644 --- a/packages/api/src/client/types/app/bsky/feed/generator.ts +++ b/packages/api/src/client/types/app/bsky/feed/generator.ts @@ -2,13 +2,14 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyRichtextFacet from '../richtext/facet' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface Record { + $type?: 'app.bsky.feed.generator' | 'app.bsky.feed.generator#main' did: string displayName: string description?: string @@ -23,15 +24,19 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.feed.generator#main' | 'app.bsky.feed.generator' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.feed.generator#main' || v.$type === 'app.bsky.feed.generator') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.generator#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.generator#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/getActorFeeds.ts b/packages/api/src/client/types/app/bsky/feed/getActorFeeds.ts index e8a0cb94bd3..9dd0eface87 100644 --- a/packages/api/src/client/types/app/bsky/feed/getActorFeeds.ts +++ b/packages/api/src/client/types/app/bsky/feed/getActorFeeds.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feeds: AppBskyFeedDefs.GeneratorView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getActorLikes.ts b/packages/api/src/client/types/app/bsky/feed/getActorLikes.ts index 1da239d96f3..fc7037c9b40 100644 --- a/packages/api/src/client/types/app/bsky/feed/getActorLikes.ts +++ b/packages/api/src/client/types/app/bsky/feed/getActorLikes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getAuthorFeed.ts b/packages/api/src/client/types/app/bsky/feed/getAuthorFeed.ts index 77319f28d40..5cc4090d033 100644 --- a/packages/api/src/client/types/app/bsky/feed/getAuthorFeed.ts +++ b/packages/api/src/client/types/app/bsky/feed/getAuthorFeed.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -27,7 +27,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getFeed.ts b/packages/api/src/client/types/app/bsky/feed/getFeed.ts index b61a1248e2a..ad537bc36bc 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeed.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeed.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getFeedGenerator.ts b/packages/api/src/client/types/app/bsky/feed/getFeedGenerator.ts index 8d222f8d521..f1740b3b9a2 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeedGenerator.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeedGenerator.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -21,7 +21,6 @@ export interface OutputSchema { isOnline: boolean /** Indicates whether the feed generator service is compatible with the record declaration. */ isValid: boolean - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getFeedGenerators.ts b/packages/api/src/client/types/app/bsky/feed/getFeedGenerators.ts index 1d99fd6608c..81302a78a01 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeedGenerators.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeedGenerators.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { feeds: AppBskyFeedDefs.GeneratorView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getFeedSkeleton.ts b/packages/api/src/client/types/app/bsky/feed/getFeedSkeleton.ts index bf859cc1e87..951732f72f9 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeedSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeedSkeleton.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -20,7 +20,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feed: AppBskyFeedDefs.SkeletonFeedPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getLikes.ts b/packages/api/src/client/types/app/bsky/feed/getLikes.ts index 35af1b3aae5..4a5de59fa09 100644 --- a/packages/api/src/client/types/app/bsky/feed/getLikes.ts +++ b/packages/api/src/client/types/app/bsky/feed/getLikes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -24,7 +24,6 @@ export interface OutputSchema { cid?: string cursor?: string likes: Like[] - [k: string]: unknown } export interface CallOptions { @@ -43,18 +42,21 @@ export function toKnownErr(e: any) { } export interface Like { + $type?: 'app.bsky.feed.getLikes#like' indexedAt: string createdAt: string actor: AppBskyActorDefs.ProfileView - [k: string]: unknown } -export function isLike(v: unknown): v is Like { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.getLikes#like' - ) +export function isLike( + v: unknown, +): v is Like & { $type: 'app.bsky.feed.getLikes#like' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.getLikes#like' } -export function validateLike(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.getLikes#like', v) +export function validateLike(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.getLikes#like', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/getListFeed.ts b/packages/api/src/client/types/app/bsky/feed/getListFeed.ts index 4e47e597afd..37e5f061473 100644 --- a/packages/api/src/client/types/app/bsky/feed/getListFeed.ts +++ b/packages/api/src/client/types/app/bsky/feed/getListFeed.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -20,7 +20,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getPostThread.ts b/packages/api/src/client/types/app/bsky/feed/getPostThread.ts index df012607df1..48bcc8b459f 100644 --- a/packages/api/src/client/types/app/bsky/feed/getPostThread.ts +++ b/packages/api/src/client/types/app/bsky/feed/getPostThread.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -26,7 +26,6 @@ export interface OutputSchema { | AppBskyFeedDefs.BlockedPost | { $type: string; [k: string]: unknown } threadgate?: AppBskyFeedDefs.ThreadgateView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getPosts.ts b/packages/api/src/client/types/app/bsky/feed/getPosts.ts index 0ae8657de94..6d306e256b3 100644 --- a/packages/api/src/client/types/app/bsky/feed/getPosts.ts +++ b/packages/api/src/client/types/app/bsky/feed/getPosts.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -17,7 +17,6 @@ export type InputSchema = undefined export interface OutputSchema { posts: AppBskyFeedDefs.PostView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getQuotes.ts b/packages/api/src/client/types/app/bsky/feed/getQuotes.ts index aafc487cd43..1e5ce49e892 100644 --- a/packages/api/src/client/types/app/bsky/feed/getQuotes.ts +++ b/packages/api/src/client/types/app/bsky/feed/getQuotes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -24,7 +24,6 @@ export interface OutputSchema { cid?: string cursor?: string posts: AppBskyFeedDefs.PostView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getRepostedBy.ts b/packages/api/src/client/types/app/bsky/feed/getRepostedBy.ts index dfbac97453b..ee771424da2 100644 --- a/packages/api/src/client/types/app/bsky/feed/getRepostedBy.ts +++ b/packages/api/src/client/types/app/bsky/feed/getRepostedBy.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -24,7 +24,6 @@ export interface OutputSchema { cid?: string cursor?: string repostedBy: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts b/packages/api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts index 2e9495d8c19..e43a961e25b 100644 --- a/packages/api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts +++ b/packages/api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feeds: AppBskyFeedDefs.GeneratorView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/getTimeline.ts b/packages/api/src/client/types/app/bsky/feed/getTimeline.ts index 6c5280443a9..84eb19cc29f 100644 --- a/packages/api/src/client/types/app/bsky/feed/getTimeline.ts +++ b/packages/api/src/client/types/app/bsky/feed/getTimeline.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -20,7 +20,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/like.ts b/packages/api/src/client/types/app/bsky/feed/like.ts index 10237e45f0d..ec7351a17dd 100644 --- a/packages/api/src/client/types/app/bsky/feed/like.ts +++ b/packages/api/src/client/types/app/bsky/feed/like.ts @@ -2,25 +2,30 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' export interface Record { + $type?: 'app.bsky.feed.like' | 'app.bsky.feed.like#main' subject: ComAtprotoRepoStrongRef.Main createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord( + v: unknown, +): v is Record & { $type: 'app.bsky.feed.like#main' | 'app.bsky.feed.like' } { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.feed.like#main' || v.$type === 'app.bsky.feed.like') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.like#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.like#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/post.ts b/packages/api/src/client/types/app/bsky/feed/post.ts index e358409c0e0..3d33dd41824 100644 --- a/packages/api/src/client/types/app/bsky/feed/post.ts +++ b/packages/api/src/client/types/app/bsky/feed/post.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyRichtextFacet from '../richtext/facet' @@ -15,6 +15,7 @@ import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' export interface Record { + $type?: 'app.bsky.feed.post' | 'app.bsky.feed.post#main' /** The primary post content. May be an empty string, if there are embeds. */ text: string /** DEPRECATED: replaced by app.bsky.richtext.facet. */ @@ -41,68 +42,79 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord( + v: unknown, +): v is Record & { $type: 'app.bsky.feed.post#main' | 'app.bsky.feed.post' } { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.feed.post#main' || v.$type === 'app.bsky.feed.post') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.post#main', + v, + ) as ValidationResult } export interface ReplyRef { + $type?: 'app.bsky.feed.post#replyRef' root: ComAtprotoRepoStrongRef.Main parent: ComAtprotoRepoStrongRef.Main - [k: string]: unknown } -export function isReplyRef(v: unknown): v is ReplyRef { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#replyRef' - ) +export function isReplyRef( + v: unknown, +): v is ReplyRef & { $type: 'app.bsky.feed.post#replyRef' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.post#replyRef' } -export function validateReplyRef(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#replyRef', v) +export function validateReplyRef(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.post#replyRef', + v, + ) as ValidationResult } /** Deprecated: use facets instead. */ export interface Entity { + $type?: 'app.bsky.feed.post#entity' index: TextSlice /** Expected values are 'mention' and 'link'. */ type: string value: string - [k: string]: unknown } -export function isEntity(v: unknown): v is Entity { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#entity' - ) +export function isEntity( + v: unknown, +): v is Entity & { $type: 'app.bsky.feed.post#entity' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.post#entity' } -export function validateEntity(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#entity', v) +export function validateEntity(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.post#entity', + v, + ) as ValidationResult } /** Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. */ export interface TextSlice { + $type?: 'app.bsky.feed.post#textSlice' start: number end: number - [k: string]: unknown } -export function isTextSlice(v: unknown): v is TextSlice { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.post#textSlice' - ) +export function isTextSlice( + v: unknown, +): v is TextSlice & { $type: 'app.bsky.feed.post#textSlice' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.post#textSlice' } -export function validateTextSlice(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#textSlice', v) +export function validateTextSlice(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.post#textSlice', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/postgate.ts b/packages/api/src/client/types/app/bsky/feed/postgate.ts index aad8496699a..b48064d9277 100644 --- a/packages/api/src/client/types/app/bsky/feed/postgate.ts +++ b/packages/api/src/client/types/app/bsky/feed/postgate.ts @@ -2,11 +2,12 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'app.bsky.feed.postgate' | 'app.bsky.feed.postgate#main' createdAt: string /** Reference (AT-URI) to the post record. */ post: string @@ -16,32 +17,37 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.feed.postgate#main' | 'app.bsky.feed.postgate' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.feed.postgate#main' || v.$type === 'app.bsky.feed.postgate') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.postgate#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.postgate#main', + v, + ) as ValidationResult } /** Disables embedding of this post. */ export interface DisableRule { - [k: string]: unknown + $type?: 'app.bsky.feed.postgate#disableRule' } -export function isDisableRule(v: unknown): v is DisableRule { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.postgate#disableRule' - ) +export function isDisableRule( + v: unknown, +): v is DisableRule & { $type: 'app.bsky.feed.postgate#disableRule' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.postgate#disableRule' } -export function validateDisableRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.postgate#disableRule', v) +export function validateDisableRule(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.postgate#disableRule', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/repost.ts b/packages/api/src/client/types/app/bsky/feed/repost.ts index 2e8f6e75548..08c73c24f8b 100644 --- a/packages/api/src/client/types/app/bsky/feed/repost.ts +++ b/packages/api/src/client/types/app/bsky/feed/repost.ts @@ -2,26 +2,31 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' export interface Record { + $type?: 'app.bsky.feed.repost' | 'app.bsky.feed.repost#main' subject: ComAtprotoRepoStrongRef.Main createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.feed.repost#main' | 'app.bsky.feed.repost' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.feed.repost#main' || v.$type === 'app.bsky.feed.repost') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.repost#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.repost#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/feed/searchPosts.ts b/packages/api/src/client/types/app/bsky/feed/searchPosts.ts index 1a2ec64dcd2..59a2b3c3b1c 100644 --- a/packages/api/src/client/types/app/bsky/feed/searchPosts.ts +++ b/packages/api/src/client/types/app/bsky/feed/searchPosts.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -41,7 +41,6 @@ export interface OutputSchema { /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */ hitsTotal?: number posts: AppBskyFeedDefs.PostView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/feed/sendInteractions.ts b/packages/api/src/client/types/app/bsky/feed/sendInteractions.ts index 4d43e26f3dd..7b3dab62c10 100644 --- a/packages/api/src/client/types/app/bsky/feed/sendInteractions.ts +++ b/packages/api/src/client/types/app/bsky/feed/sendInteractions.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from './defs' @@ -12,12 +12,9 @@ export interface QueryParams {} export interface InputSchema { interactions: AppBskyFeedDefs.Interaction[] - [k: string]: unknown } -export interface OutputSchema { - [k: string]: unknown -} +export interface OutputSchema {} export interface CallOptions { signal?: AbortSignal diff --git a/packages/api/src/client/types/app/bsky/feed/threadgate.ts b/packages/api/src/client/types/app/bsky/feed/threadgate.ts index 558027fb8e9..706aedd3c4f 100644 --- a/packages/api/src/client/types/app/bsky/feed/threadgate.ts +++ b/packages/api/src/client/types/app/bsky/feed/threadgate.ts @@ -2,11 +2,12 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'app.bsky.feed.threadgate' | 'app.bsky.feed.threadgate#main' /** Reference (AT-URI) to the post record. */ post: string allow?: ( @@ -21,67 +22,74 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.feed.threadgate#main' | 'app.bsky.feed.threadgate' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.feed.threadgate#main' || v.$type === 'app.bsky.feed.threadgate') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.threadgate#main', + v, + ) as ValidationResult } /** Allow replies from actors mentioned in your post. */ export interface MentionRule { - [k: string]: unknown + $type?: 'app.bsky.feed.threadgate#mentionRule' } -export function isMentionRule(v: unknown): v is MentionRule { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.threadgate#mentionRule' - ) +export function isMentionRule( + v: unknown, +): v is MentionRule & { $type: 'app.bsky.feed.threadgate#mentionRule' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.threadgate#mentionRule' } -export function validateMentionRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#mentionRule', v) +export function validateMentionRule(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.threadgate#mentionRule', + v, + ) as ValidationResult } /** Allow replies from actors you follow. */ export interface FollowingRule { - [k: string]: unknown + $type?: 'app.bsky.feed.threadgate#followingRule' } -export function isFollowingRule(v: unknown): v is FollowingRule { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.threadgate#followingRule' - ) +export function isFollowingRule( + v: unknown, +): v is FollowingRule & { $type: 'app.bsky.feed.threadgate#followingRule' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.threadgate#followingRule' } -export function validateFollowingRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#followingRule', v) +export function validateFollowingRule(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.threadgate#followingRule', + v, + ) as ValidationResult } /** Allow replies from actors on a list. */ export interface ListRule { + $type?: 'app.bsky.feed.threadgate#listRule' list: string - [k: string]: unknown } -export function isListRule(v: unknown): v is ListRule { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.threadgate#listRule' - ) +export function isListRule( + v: unknown, +): v is ListRule & { $type: 'app.bsky.feed.threadgate#listRule' } { + return isTypedObj(v) && v.$type === 'app.bsky.feed.threadgate#listRule' } -export function validateListRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#listRule', v) +export function validateListRule(v: unknown) { + return lexicons.validate( + 'app.bsky.feed.threadgate#listRule', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/block.ts b/packages/api/src/client/types/app/bsky/graph/block.ts index f2455fc08a2..144ba9a3610 100644 --- a/packages/api/src/client/types/app/bsky/graph/block.ts +++ b/packages/api/src/client/types/app/bsky/graph/block.ts @@ -2,26 +2,31 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'app.bsky.graph.block' | 'app.bsky.graph.block#main' /** DID of the account to be blocked. */ subject: string createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.graph.block#main' | 'app.bsky.graph.block' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.graph.block#main' || v.$type === 'app.bsky.graph.block') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.block#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.block#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/defs.ts b/packages/api/src/client/types/app/bsky/graph/defs.ts index aa7e2c068b5..bdbf36d329a 100644 --- a/packages/api/src/client/types/app/bsky/graph/defs.ts +++ b/packages/api/src/client/types/app/bsky/graph/defs.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' @@ -11,6 +11,7 @@ import * as AppBskyRichtextFacet from '../richtext/facet' import * as AppBskyFeedDefs from '../feed/defs' export interface ListViewBasic { + $type?: 'app.bsky.graph.defs#listViewBasic' uri: string cid: string name: string @@ -20,22 +21,23 @@ export interface ListViewBasic { labels?: ComAtprotoLabelDefs.Label[] viewer?: ListViewerState indexedAt?: string - [k: string]: unknown } -export function isListViewBasic(v: unknown): v is ListViewBasic { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#listViewBasic' - ) +export function isListViewBasic( + v: unknown, +): v is ListViewBasic & { $type: 'app.bsky.graph.defs#listViewBasic' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#listViewBasic' } -export function validateListViewBasic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listViewBasic', v) +export function validateListViewBasic(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#listViewBasic', + v, + ) as ValidationResult } export interface ListView { + $type?: 'app.bsky.graph.defs#listView' uri: string cid: string creator: AppBskyActorDefs.ProfileView @@ -48,43 +50,45 @@ export interface ListView { labels?: ComAtprotoLabelDefs.Label[] viewer?: ListViewerState indexedAt: string - [k: string]: unknown } -export function isListView(v: unknown): v is ListView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#listView' - ) +export function isListView( + v: unknown, +): v is ListView & { $type: 'app.bsky.graph.defs#listView' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#listView' } -export function validateListView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listView', v) +export function validateListView(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#listView', + v, + ) as ValidationResult } export interface ListItemView { + $type?: 'app.bsky.graph.defs#listItemView' uri: string subject: AppBskyActorDefs.ProfileView - [k: string]: unknown } -export function isListItemView(v: unknown): v is ListItemView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#listItemView' - ) +export function isListItemView( + v: unknown, +): v is ListItemView & { $type: 'app.bsky.graph.defs#listItemView' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#listItemView' } -export function validateListItemView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listItemView', v) +export function validateListItemView(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#listItemView', + v, + ) as ValidationResult } export interface StarterPackView { + $type?: 'app.bsky.graph.defs#starterPackView' uri: string cid: string - record: {} + record: { [_ in string]: unknown } creator: AppBskyActorDefs.ProfileViewBasic list?: ListViewBasic listItemsSample?: ListItemView[] @@ -93,44 +97,47 @@ export interface StarterPackView { joinedAllTimeCount?: number labels?: ComAtprotoLabelDefs.Label[] indexedAt: string - [k: string]: unknown } -export function isStarterPackView(v: unknown): v is StarterPackView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#starterPackView' - ) +export function isStarterPackView( + v: unknown, +): v is StarterPackView & { $type: 'app.bsky.graph.defs#starterPackView' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#starterPackView' } -export function validateStarterPackView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#starterPackView', v) +export function validateStarterPackView(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#starterPackView', + v, + ) as ValidationResult } export interface StarterPackViewBasic { + $type?: 'app.bsky.graph.defs#starterPackViewBasic' uri: string cid: string - record: {} + record: { [_ in string]: unknown } creator: AppBskyActorDefs.ProfileViewBasic listItemCount?: number joinedWeekCount?: number joinedAllTimeCount?: number labels?: ComAtprotoLabelDefs.Label[] indexedAt: string - [k: string]: unknown } -export function isStarterPackViewBasic(v: unknown): v is StarterPackViewBasic { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#starterPackViewBasic' - ) +export function isStarterPackViewBasic( + v: unknown, +): v is StarterPackViewBasic & { + $type: 'app.bsky.graph.defs#starterPackViewBasic' +} { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#starterPackViewBasic' } -export function validateStarterPackViewBasic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#starterPackViewBasic', v) +export function validateStarterPackViewBasic(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#starterPackViewBasic', + v, + ) as ValidationResult } export type ListPurpose = @@ -147,60 +154,63 @@ export const CURATELIST = 'app.bsky.graph.defs#curatelist' export const REFERENCELIST = 'app.bsky.graph.defs#referencelist' export interface ListViewerState { + $type?: 'app.bsky.graph.defs#listViewerState' muted?: boolean blocked?: string - [k: string]: unknown } -export function isListViewerState(v: unknown): v is ListViewerState { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#listViewerState' - ) +export function isListViewerState( + v: unknown, +): v is ListViewerState & { $type: 'app.bsky.graph.defs#listViewerState' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#listViewerState' } -export function validateListViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listViewerState', v) +export function validateListViewerState(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#listViewerState', + v, + ) as ValidationResult } /** indicates that a handle or DID could not be resolved */ export interface NotFoundActor { + $type?: 'app.bsky.graph.defs#notFoundActor' actor: string notFound: true - [k: string]: unknown } -export function isNotFoundActor(v: unknown): v is NotFoundActor { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#notFoundActor' - ) +export function isNotFoundActor( + v: unknown, +): v is NotFoundActor & { $type: 'app.bsky.graph.defs#notFoundActor' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#notFoundActor' } -export function validateNotFoundActor(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#notFoundActor', v) +export function validateNotFoundActor(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#notFoundActor', + v, + ) as ValidationResult } /** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) */ export interface Relationship { + $type?: 'app.bsky.graph.defs#relationship' did: string /** if the actor follows this DID, this is the AT-URI of the follow record */ following?: string /** if the actor is followed by this DID, contains the AT-URI of the follow record */ followedBy?: string - [k: string]: unknown } -export function isRelationship(v: unknown): v is Relationship { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.defs#relationship' - ) +export function isRelationship( + v: unknown, +): v is Relationship & { $type: 'app.bsky.graph.defs#relationship' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.defs#relationship' } -export function validateRelationship(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#relationship', v) +export function validateRelationship(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.defs#relationship', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/follow.ts b/packages/api/src/client/types/app/bsky/graph/follow.ts index a68f434f3c8..89aa98f8871 100644 --- a/packages/api/src/client/types/app/bsky/graph/follow.ts +++ b/packages/api/src/client/types/app/bsky/graph/follow.ts @@ -2,25 +2,30 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'app.bsky.graph.follow' | 'app.bsky.graph.follow#main' subject: string createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.graph.follow#main' | 'app.bsky.graph.follow' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.graph.follow#main' || v.$type === 'app.bsky.graph.follow') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.follow#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.follow#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/getActorStarterPacks.ts b/packages/api/src/client/types/app/bsky/graph/getActorStarterPacks.ts index bb374e2318d..d3d23a0c005 100644 --- a/packages/api/src/client/types/app/bsky/graph/getActorStarterPacks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getActorStarterPacks.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string starterPacks: AppBskyGraphDefs.StarterPackViewBasic[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getBlocks.ts b/packages/api/src/client/types/app/bsky/graph/getBlocks.ts index f0e4bd96bc8..7c10c2ff811 100644 --- a/packages/api/src/client/types/app/bsky/graph/getBlocks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getBlocks.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string blocks: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getFollowers.ts b/packages/api/src/client/types/app/bsky/graph/getFollowers.ts index f55649dc769..adaa888dca7 100644 --- a/packages/api/src/client/types/app/bsky/graph/getFollowers.ts +++ b/packages/api/src/client/types/app/bsky/graph/getFollowers.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -20,7 +20,6 @@ export interface OutputSchema { subject: AppBskyActorDefs.ProfileView cursor?: string followers: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getFollows.ts b/packages/api/src/client/types/app/bsky/graph/getFollows.ts index 8570c4a14c0..037234a84ef 100644 --- a/packages/api/src/client/types/app/bsky/graph/getFollows.ts +++ b/packages/api/src/client/types/app/bsky/graph/getFollows.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -20,7 +20,6 @@ export interface OutputSchema { subject: AppBskyActorDefs.ProfileView cursor?: string follows: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getKnownFollowers.ts b/packages/api/src/client/types/app/bsky/graph/getKnownFollowers.ts index f55649dc769..adaa888dca7 100644 --- a/packages/api/src/client/types/app/bsky/graph/getKnownFollowers.ts +++ b/packages/api/src/client/types/app/bsky/graph/getKnownFollowers.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -20,7 +20,6 @@ export interface OutputSchema { subject: AppBskyActorDefs.ProfileView cursor?: string followers: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getList.ts b/packages/api/src/client/types/app/bsky/graph/getList.ts index bebde2b49c3..48d75b12d6f 100644 --- a/packages/api/src/client/types/app/bsky/graph/getList.ts +++ b/packages/api/src/client/types/app/bsky/graph/getList.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -21,7 +21,6 @@ export interface OutputSchema { cursor?: string list: AppBskyGraphDefs.ListView items: AppBskyGraphDefs.ListItemView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getListBlocks.ts b/packages/api/src/client/types/app/bsky/graph/getListBlocks.ts index d3c7ad5ed7b..e8214758626 100644 --- a/packages/api/src/client/types/app/bsky/graph/getListBlocks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getListBlocks.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string lists: AppBskyGraphDefs.ListView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getListMutes.ts b/packages/api/src/client/types/app/bsky/graph/getListMutes.ts index d3c7ad5ed7b..e8214758626 100644 --- a/packages/api/src/client/types/app/bsky/graph/getListMutes.ts +++ b/packages/api/src/client/types/app/bsky/graph/getListMutes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string lists: AppBskyGraphDefs.ListView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getLists.ts b/packages/api/src/client/types/app/bsky/graph/getLists.ts index 89a4bfd58df..e9e137e7c17 100644 --- a/packages/api/src/client/types/app/bsky/graph/getLists.ts +++ b/packages/api/src/client/types/app/bsky/graph/getLists.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -20,7 +20,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string lists: AppBskyGraphDefs.ListView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getMutes.ts b/packages/api/src/client/types/app/bsky/graph/getMutes.ts index 0ee441cf9eb..edfb22e642b 100644 --- a/packages/api/src/client/types/app/bsky/graph/getMutes.ts +++ b/packages/api/src/client/types/app/bsky/graph/getMutes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string mutes: AppBskyActorDefs.ProfileView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getRelationships.ts b/packages/api/src/client/types/app/bsky/graph/getRelationships.ts index 20194662b71..2caa0690946 100644 --- a/packages/api/src/client/types/app/bsky/graph/getRelationships.ts +++ b/packages/api/src/client/types/app/bsky/graph/getRelationships.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -24,7 +24,6 @@ export interface OutputSchema { | AppBskyGraphDefs.NotFoundActor | { $type: string; [k: string]: unknown } )[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getStarterPack.ts b/packages/api/src/client/types/app/bsky/graph/getStarterPack.ts index 7eafb2d228d..394dd073150 100644 --- a/packages/api/src/client/types/app/bsky/graph/getStarterPack.ts +++ b/packages/api/src/client/types/app/bsky/graph/getStarterPack.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -17,7 +17,6 @@ export type InputSchema = undefined export interface OutputSchema { starterPack: AppBskyGraphDefs.StarterPackView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getStarterPacks.ts b/packages/api/src/client/types/app/bsky/graph/getStarterPacks.ts index 50dbfdbaeda..e10aa3ec7bb 100644 --- a/packages/api/src/client/types/app/bsky/graph/getStarterPacks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getStarterPacks.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { starterPacks: AppBskyGraphDefs.StarterPackViewBasic[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts b/packages/api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts index 4747afb19fc..c6852f5355f 100644 --- a/packages/api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts +++ b/packages/api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -15,10 +15,9 @@ export interface QueryParams { export type InputSchema = undefined export interface OutputSchema { - suggestions: AppBskyActorDefs.ProfileView[] + suggestions: AppBskyActorDefs.ProfileViewDetailed[] /** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */ isFallback: boolean - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/list.ts b/packages/api/src/client/types/app/bsky/graph/list.ts index fec652ccb12..7998f52db8f 100644 --- a/packages/api/src/client/types/app/bsky/graph/list.ts +++ b/packages/api/src/client/types/app/bsky/graph/list.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyGraphDefs from './defs' @@ -10,6 +10,7 @@ import * as AppBskyRichtextFacet from '../richtext/facet' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface Record { + $type?: 'app.bsky.graph.list' | 'app.bsky.graph.list#main' purpose: AppBskyGraphDefs.ListPurpose /** Display name for list; can not be empty. */ name: string @@ -23,15 +24,19 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord( + v: unknown, +): v is Record & { $type: 'app.bsky.graph.list#main' | 'app.bsky.graph.list' } { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.graph.list#main' || v.$type === 'app.bsky.graph.list') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.list#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.list#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/listblock.ts b/packages/api/src/client/types/app/bsky/graph/listblock.ts index e0f02be268f..03a78e54d3c 100644 --- a/packages/api/src/client/types/app/bsky/graph/listblock.ts +++ b/packages/api/src/client/types/app/bsky/graph/listblock.ts @@ -2,26 +2,31 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'app.bsky.graph.listblock' | 'app.bsky.graph.listblock#main' /** Reference (AT-URI) to the mod list record. */ subject: string createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.graph.listblock#main' | 'app.bsky.graph.listblock' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.graph.listblock#main' || v.$type === 'app.bsky.graph.listblock') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.listblock#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.listblock#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/listitem.ts b/packages/api/src/client/types/app/bsky/graph/listitem.ts index d4fb5631e84..36eb42b9119 100644 --- a/packages/api/src/client/types/app/bsky/graph/listitem.ts +++ b/packages/api/src/client/types/app/bsky/graph/listitem.ts @@ -2,11 +2,12 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'app.bsky.graph.listitem' | 'app.bsky.graph.listitem#main' /** The account which is included on the list. */ subject: string /** Reference (AT-URI) to the list record (app.bsky.graph.list). */ @@ -15,15 +16,19 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.graph.listitem#main' | 'app.bsky.graph.listitem' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.graph.listitem#main' || v.$type === 'app.bsky.graph.listitem') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.listitem#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.listitem#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/muteActor.ts b/packages/api/src/client/types/app/bsky/graph/muteActor.ts index c21c00b2069..5dee0511e44 100644 --- a/packages/api/src/client/types/app/bsky/graph/muteActor.ts +++ b/packages/api/src/client/types/app/bsky/graph/muteActor.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { actor: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/muteActorList.ts b/packages/api/src/client/types/app/bsky/graph/muteActorList.ts index 8a0e8586deb..b29649f233b 100644 --- a/packages/api/src/client/types/app/bsky/graph/muteActorList.ts +++ b/packages/api/src/client/types/app/bsky/graph/muteActorList.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { list: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/muteThread.ts b/packages/api/src/client/types/app/bsky/graph/muteThread.ts index 275ba7a0f22..41d246e05a6 100644 --- a/packages/api/src/client/types/app/bsky/graph/muteThread.ts +++ b/packages/api/src/client/types/app/bsky/graph/muteThread.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { root: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/starterpack.ts b/packages/api/src/client/types/app/bsky/graph/starterpack.ts index 7cb0aa26c3f..5044d4f1e7f 100644 --- a/packages/api/src/client/types/app/bsky/graph/starterpack.ts +++ b/packages/api/src/client/types/app/bsky/graph/starterpack.ts @@ -2,12 +2,13 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyRichtextFacet from '../richtext/facet' export interface Record { + $type?: 'app.bsky.graph.starterpack' | 'app.bsky.graph.starterpack#main' /** Display name for starter pack; can not be empty. */ name: string description?: string @@ -19,32 +20,37 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.graph.starterpack#main' | 'app.bsky.graph.starterpack' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.graph.starterpack#main' || v.$type === 'app.bsky.graph.starterpack') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.starterpack#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.starterpack#main', + v, + ) as ValidationResult } export interface FeedItem { + $type?: 'app.bsky.graph.starterpack#feedItem' uri: string - [k: string]: unknown } -export function isFeedItem(v: unknown): v is FeedItem { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.graph.starterpack#feedItem' - ) +export function isFeedItem( + v: unknown, +): v is FeedItem & { $type: 'app.bsky.graph.starterpack#feedItem' } { + return isTypedObj(v) && v.$type === 'app.bsky.graph.starterpack#feedItem' } -export function validateFeedItem(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.starterpack#feedItem', v) +export function validateFeedItem(v: unknown) { + return lexicons.validate( + 'app.bsky.graph.starterpack#feedItem', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/graph/unmuteActor.ts b/packages/api/src/client/types/app/bsky/graph/unmuteActor.ts index c21c00b2069..5dee0511e44 100644 --- a/packages/api/src/client/types/app/bsky/graph/unmuteActor.ts +++ b/packages/api/src/client/types/app/bsky/graph/unmuteActor.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { actor: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/unmuteActorList.ts b/packages/api/src/client/types/app/bsky/graph/unmuteActorList.ts index 8a0e8586deb..b29649f233b 100644 --- a/packages/api/src/client/types/app/bsky/graph/unmuteActorList.ts +++ b/packages/api/src/client/types/app/bsky/graph/unmuteActorList.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { list: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/graph/unmuteThread.ts b/packages/api/src/client/types/app/bsky/graph/unmuteThread.ts index 275ba7a0f22..41d246e05a6 100644 --- a/packages/api/src/client/types/app/bsky/graph/unmuteThread.ts +++ b/packages/api/src/client/types/app/bsky/graph/unmuteThread.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { root: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/labeler/defs.ts b/packages/api/src/client/types/app/bsky/labeler/defs.ts index 3d9b1d77f8a..83137453cda 100644 --- a/packages/api/src/client/types/app/bsky/labeler/defs.ts +++ b/packages/api/src/client/types/app/bsky/labeler/defs.ts @@ -2,13 +2,14 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface LabelerView { + $type?: 'app.bsky.labeler.defs#labelerView' uri: string cid: string creator: AppBskyActorDefs.ProfileView @@ -16,22 +17,23 @@ export interface LabelerView { viewer?: LabelerViewerState indexedAt: string labels?: ComAtprotoLabelDefs.Label[] - [k: string]: unknown } -export function isLabelerView(v: unknown): v is LabelerView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.labeler.defs#labelerView' - ) +export function isLabelerView( + v: unknown, +): v is LabelerView & { $type: 'app.bsky.labeler.defs#labelerView' } { + return isTypedObj(v) && v.$type === 'app.bsky.labeler.defs#labelerView' } -export function validateLabelerView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerView', v) +export function validateLabelerView(v: unknown) { + return lexicons.validate( + 'app.bsky.labeler.defs#labelerView', + v, + ) as ValidationResult } export interface LabelerViewDetailed { + $type?: 'app.bsky.labeler.defs#labelerViewDetailed' uri: string cid: string creator: AppBskyActorDefs.ProfileView @@ -40,54 +42,58 @@ export interface LabelerViewDetailed { viewer?: LabelerViewerState indexedAt: string labels?: ComAtprotoLabelDefs.Label[] - [k: string]: unknown } -export function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed { +export function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed & { + $type: 'app.bsky.labeler.defs#labelerViewDetailed' +} { return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.labeler.defs#labelerViewDetailed' + isTypedObj(v) && v.$type === 'app.bsky.labeler.defs#labelerViewDetailed' ) } -export function validateLabelerViewDetailed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerViewDetailed', v) +export function validateLabelerViewDetailed(v: unknown) { + return lexicons.validate( + 'app.bsky.labeler.defs#labelerViewDetailed', + v, + ) as ValidationResult } export interface LabelerViewerState { + $type?: 'app.bsky.labeler.defs#labelerViewerState' like?: string - [k: string]: unknown } -export function isLabelerViewerState(v: unknown): v is LabelerViewerState { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.labeler.defs#labelerViewerState' - ) +export function isLabelerViewerState(v: unknown): v is LabelerViewerState & { + $type: 'app.bsky.labeler.defs#labelerViewerState' +} { + return isTypedObj(v) && v.$type === 'app.bsky.labeler.defs#labelerViewerState' } -export function validateLabelerViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerViewerState', v) +export function validateLabelerViewerState(v: unknown) { + return lexicons.validate( + 'app.bsky.labeler.defs#labelerViewerState', + v, + ) as ValidationResult } export interface LabelerPolicies { + $type?: 'app.bsky.labeler.defs#labelerPolicies' /** The label values which this labeler publishes. May include global or custom labels. */ labelValues: ComAtprotoLabelDefs.LabelValue[] /** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. */ labelValueDefinitions?: ComAtprotoLabelDefs.LabelValueDefinition[] - [k: string]: unknown } -export function isLabelerPolicies(v: unknown): v is LabelerPolicies { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.labeler.defs#labelerPolicies' - ) +export function isLabelerPolicies( + v: unknown, +): v is LabelerPolicies & { $type: 'app.bsky.labeler.defs#labelerPolicies' } { + return isTypedObj(v) && v.$type === 'app.bsky.labeler.defs#labelerPolicies' } -export function validateLabelerPolicies(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerPolicies', v) +export function validateLabelerPolicies(v: unknown) { + return lexicons.validate( + 'app.bsky.labeler.defs#labelerPolicies', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/labeler/getServices.ts b/packages/api/src/client/types/app/bsky/labeler/getServices.ts index 688f847d508..49b81842ffe 100644 --- a/packages/api/src/client/types/app/bsky/labeler/getServices.ts +++ b/packages/api/src/client/types/app/bsky/labeler/getServices.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyLabelerDefs from './defs' @@ -21,7 +21,6 @@ export interface OutputSchema { | AppBskyLabelerDefs.LabelerViewDetailed | { $type: string; [k: string]: unknown } )[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/labeler/service.ts b/packages/api/src/client/types/app/bsky/labeler/service.ts index 818249468ec..cc65a26419a 100644 --- a/packages/api/src/client/types/app/bsky/labeler/service.ts +++ b/packages/api/src/client/types/app/bsky/labeler/service.ts @@ -2,13 +2,14 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyLabelerDefs from './defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface Record { + $type?: 'app.bsky.labeler.service' | 'app.bsky.labeler.service#main' policies: AppBskyLabelerDefs.LabelerPolicies labels?: | ComAtprotoLabelDefs.SelfLabels @@ -17,15 +18,19 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'app.bsky.labeler.service#main' | 'app.bsky.labeler.service' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.labeler.service#main' || v.$type === 'app.bsky.labeler.service') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.service#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'app.bsky.labeler.service#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/notification/getUnreadCount.ts b/packages/api/src/client/types/app/bsky/notification/getUnreadCount.ts index 00600ea54e7..4eca7627f8a 100644 --- a/packages/api/src/client/types/app/bsky/notification/getUnreadCount.ts +++ b/packages/api/src/client/types/app/bsky/notification/getUnreadCount.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { count: number - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/notification/listNotifications.ts b/packages/api/src/client/types/app/bsky/notification/listNotifications.ts index 10a5b7148f2..f4a181e1857 100644 --- a/packages/api/src/client/types/app/bsky/notification/listNotifications.ts +++ b/packages/api/src/client/types/app/bsky/notification/listNotifications.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../actor/defs' @@ -23,7 +23,6 @@ export interface OutputSchema { notifications: Notification[] priority?: boolean seenAt?: string - [k: string]: unknown } export interface CallOptions { @@ -42,6 +41,7 @@ export function toKnownErr(e: any) { } export interface Notification { + $type?: 'app.bsky.notification.listNotifications#notification' uri: string cid: string author: AppBskyActorDefs.ProfileView @@ -56,24 +56,24 @@ export interface Notification { | 'starterpack-joined' | (string & {}) reasonSubject?: string - record: {} + record: { [_ in string]: unknown } isRead: boolean indexedAt: string labels?: ComAtprotoLabelDefs.Label[] - [k: string]: unknown } -export function isNotification(v: unknown): v is Notification { +export function isNotification(v: unknown): v is Notification & { + $type: 'app.bsky.notification.listNotifications#notification' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && v.$type === 'app.bsky.notification.listNotifications#notification' ) } -export function validateNotification(v: unknown): ValidationResult { +export function validateNotification(v: unknown) { return lexicons.validate( 'app.bsky.notification.listNotifications#notification', v, - ) + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/notification/putPreferences.ts b/packages/api/src/client/types/app/bsky/notification/putPreferences.ts index bc79909f459..c48addb1bed 100644 --- a/packages/api/src/client/types/app/bsky/notification/putPreferences.ts +++ b/packages/api/src/client/types/app/bsky/notification/putPreferences.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { priority: boolean - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/notification/registerPush.ts b/packages/api/src/client/types/app/bsky/notification/registerPush.ts index ddc9d438537..36c7dc70c38 100644 --- a/packages/api/src/client/types/app/bsky/notification/registerPush.ts +++ b/packages/api/src/client/types/app/bsky/notification/registerPush.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -14,7 +14,6 @@ export interface InputSchema { token: string platform: 'ios' | 'android' | 'web' | (string & {}) appId: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/notification/updateSeen.ts b/packages/api/src/client/types/app/bsky/notification/updateSeen.ts index 7151e9b0cd4..c7eb43f181b 100644 --- a/packages/api/src/client/types/app/bsky/notification/updateSeen.ts +++ b/packages/api/src/client/types/app/bsky/notification/updateSeen.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { seenAt: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/richtext/facet.ts b/packages/api/src/client/types/app/bsky/richtext/facet.ts index 836136b7dac..0f3216d9e5c 100644 --- a/packages/api/src/client/types/app/bsky/richtext/facet.ts +++ b/packages/api/src/client/types/app/bsky/richtext/facet.ts @@ -2,97 +2,107 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' /** Annotation of a sub-string within rich text. */ export interface Main { + $type?: 'app.bsky.richtext.facet' | 'app.bsky.richtext.facet#main' index: ByteSlice features: (Mention | Link | Tag | { $type: string; [k: string]: unknown })[] - [k: string]: unknown } -export function isMain(v: unknown): v is Main { +export function isMain(v: unknown): v is Main & { + $type: 'app.bsky.richtext.facet#main' | 'app.bsky.richtext.facet' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'app.bsky.richtext.facet#main' || v.$type === 'app.bsky.richtext.facet') ) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#main', v) +export function validateMain(v: unknown) { + return lexicons.validate( + 'app.bsky.richtext.facet#main', + v, + ) as ValidationResult
} /** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ export interface Mention { + $type?: 'app.bsky.richtext.facet#mention' did: string - [k: string]: unknown } -export function isMention(v: unknown): v is Mention { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.richtext.facet#mention' - ) +export function isMention( + v: unknown, +): v is Mention & { $type: 'app.bsky.richtext.facet#mention' } { + return isTypedObj(v) && v.$type === 'app.bsky.richtext.facet#mention' } -export function validateMention(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#mention', v) +export function validateMention(v: unknown) { + return lexicons.validate( + 'app.bsky.richtext.facet#mention', + v, + ) as ValidationResult } /** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ export interface Link { + $type?: 'app.bsky.richtext.facet#link' uri: string - [k: string]: unknown } -export function isLink(v: unknown): v is Link { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.richtext.facet#link' - ) +export function isLink( + v: unknown, +): v is Link & { $type: 'app.bsky.richtext.facet#link' } { + return isTypedObj(v) && v.$type === 'app.bsky.richtext.facet#link' } -export function validateLink(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#link', v) +export function validateLink(v: unknown) { + return lexicons.validate( + 'app.bsky.richtext.facet#link', + v, + ) as ValidationResult } /** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). */ export interface Tag { + $type?: 'app.bsky.richtext.facet#tag' tag: string - [k: string]: unknown } -export function isTag(v: unknown): v is Tag { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.richtext.facet#tag' - ) +export function isTag( + v: unknown, +): v is Tag & { $type: 'app.bsky.richtext.facet#tag' } { + return isTypedObj(v) && v.$type === 'app.bsky.richtext.facet#tag' } -export function validateTag(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#tag', v) +export function validateTag(v: unknown) { + return lexicons.validate( + 'app.bsky.richtext.facet#tag', + v, + ) as ValidationResult } /** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. */ export interface ByteSlice { + $type?: 'app.bsky.richtext.facet#byteSlice' byteStart: number byteEnd: number - [k: string]: unknown } -export function isByteSlice(v: unknown): v is ByteSlice { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.richtext.facet#byteSlice' - ) +export function isByteSlice( + v: unknown, +): v is ByteSlice & { $type: 'app.bsky.richtext.facet#byteSlice' } { + return isTypedObj(v) && v.$type === 'app.bsky.richtext.facet#byteSlice' } -export function validateByteSlice(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#byteSlice', v) +export function validateByteSlice(v: unknown) { + return lexicons.validate( + 'app.bsky.richtext.facet#byteSlice', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/unspecced/defs.ts b/packages/api/src/client/types/app/bsky/unspecced/defs.ts index ecee03578af..b81dc8bf6f4 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/defs.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/defs.ts @@ -2,40 +2,46 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface SkeletonSearchPost { + $type?: 'app.bsky.unspecced.defs#skeletonSearchPost' uri: string - [k: string]: unknown } -export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost { +export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost & { + $type: 'app.bsky.unspecced.defs#skeletonSearchPost' +} { return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost' + isTypedObj(v) && v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost' ) } -export function validateSkeletonSearchPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v) +export function validateSkeletonSearchPost(v: unknown) { + return lexicons.validate( + 'app.bsky.unspecced.defs#skeletonSearchPost', + v, + ) as ValidationResult } export interface SkeletonSearchActor { + $type?: 'app.bsky.unspecced.defs#skeletonSearchActor' did: string - [k: string]: unknown } -export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor { +export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor & { + $type: 'app.bsky.unspecced.defs#skeletonSearchActor' +} { return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor' + isTypedObj(v) && v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor' ) } -export function validateSkeletonSearchActor(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v) +export function validateSkeletonSearchActor(v: unknown) { + return lexicons.validate( + 'app.bsky.unspecced.defs#skeletonSearchActor', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/unspecced/getConfig.ts b/packages/api/src/client/types/app/bsky/unspecced/getConfig.ts index d1ee6f7957d..77cb1cc6d4f 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getConfig.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getConfig.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -13,7 +13,6 @@ export type InputSchema = undefined export interface OutputSchema { checkEmailConfirmed?: boolean - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts b/packages/api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts index 780b4b6641c..5a158594132 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyFeedDefs from '../feed/defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string feeds: AppBskyFeedDefs.GeneratorView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts b/packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts index 6ed519ef212..59f4d695089 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyUnspeccedDefs from './defs' @@ -24,7 +24,6 @@ export interface OutputSchema { actors: AppBskyUnspeccedDefs.SkeletonSearchActor[] /** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */ relativeToDid?: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts b/packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts index 0ee04b8e85d..51a23fd25d0 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -13,7 +13,6 @@ export type InputSchema = undefined export interface OutputSchema { suggestions: Suggestion[] - [k: string]: unknown } export interface CallOptions { @@ -32,23 +31,24 @@ export function toKnownErr(e: any) { } export interface Suggestion { + $type?: 'app.bsky.unspecced.getTaggedSuggestions#suggestion' tag: string subjectType: 'actor' | 'feed' | (string & {}) subject: string - [k: string]: unknown } -export function isSuggestion(v: unknown): v is Suggestion { +export function isSuggestion(v: unknown): v is Suggestion & { + $type: 'app.bsky.unspecced.getTaggedSuggestions#suggestion' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion' ) } -export function validateSuggestion(v: unknown): ValidationResult { +export function validateSuggestion(v: unknown) { return lexicons.validate( 'app.bsky.unspecced.getTaggedSuggestions#suggestion', v, - ) + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts b/packages/api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts index d9fe6737d37..98a662a245c 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyUnspeccedDefs from './defs' @@ -27,7 +27,6 @@ export interface OutputSchema { /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */ hitsTotal?: number actors: AppBskyUnspeccedDefs.SkeletonSearchActor[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts b/packages/api/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts index ea0135dde83..5f1a3e26937 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyUnspeccedDefs from './defs' @@ -43,7 +43,6 @@ export interface OutputSchema { /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */ hitsTotal?: number posts: AppBskyUnspeccedDefs.SkeletonSearchPost[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/video/defs.ts b/packages/api/src/client/types/app/bsky/video/defs.ts index a7ec84316b6..5b9d82102cf 100644 --- a/packages/api/src/client/types/app/bsky/video/defs.ts +++ b/packages/api/src/client/types/app/bsky/video/defs.ts @@ -2,11 +2,12 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface JobStatus { + $type?: 'app.bsky.video.defs#jobStatus' jobId: string did: string /** The state of the video processing job. All values not listed as a known value indicate that the job is in process. */ @@ -16,17 +17,17 @@ export interface JobStatus { blob?: BlobRef error?: string message?: string - [k: string]: unknown } -export function isJobStatus(v: unknown): v is JobStatus { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.video.defs#jobStatus' - ) +export function isJobStatus( + v: unknown, +): v is JobStatus & { $type: 'app.bsky.video.defs#jobStatus' } { + return isTypedObj(v) && v.$type === 'app.bsky.video.defs#jobStatus' } -export function validateJobStatus(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.video.defs#jobStatus', v) +export function validateJobStatus(v: unknown) { + return lexicons.validate( + 'app.bsky.video.defs#jobStatus', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/app/bsky/video/getJobStatus.ts b/packages/api/src/client/types/app/bsky/video/getJobStatus.ts index 0e9638311c0..3d03b98efd8 100644 --- a/packages/api/src/client/types/app/bsky/video/getJobStatus.ts +++ b/packages/api/src/client/types/app/bsky/video/getJobStatus.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyVideoDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { jobStatus: AppBskyVideoDefs.JobStatus - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/video/getUploadLimits.ts b/packages/api/src/client/types/app/bsky/video/getUploadLimits.ts index 4a2f13617b3..97c03d227b9 100644 --- a/packages/api/src/client/types/app/bsky/video/getUploadLimits.ts +++ b/packages/api/src/client/types/app/bsky/video/getUploadLimits.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -17,7 +17,6 @@ export interface OutputSchema { remainingDailyBytes?: number message?: string error?: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/app/bsky/video/uploadVideo.ts b/packages/api/src/client/types/app/bsky/video/uploadVideo.ts index f51ba897bbe..2f26f11d153 100644 --- a/packages/api/src/client/types/app/bsky/video/uploadVideo.ts +++ b/packages/api/src/client/types/app/bsky/video/uploadVideo.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyVideoDefs from './defs' @@ -14,7 +14,6 @@ export type InputSchema = string | Uint8Array | Blob export interface OutputSchema { jobStatus: AppBskyVideoDefs.JobStatus - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/actor/declaration.ts b/packages/api/src/client/types/chat/bsky/actor/declaration.ts index 99b14f45608..658bec056f7 100644 --- a/packages/api/src/client/types/chat/bsky/actor/declaration.ts +++ b/packages/api/src/client/types/chat/bsky/actor/declaration.ts @@ -2,24 +2,29 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface Record { + $type?: 'chat.bsky.actor.declaration' | 'chat.bsky.actor.declaration#main' allowIncoming: 'all' | 'none' | 'following' | (string & {}) [k: string]: unknown } -export function isRecord(v: unknown): v is Record { +export function isRecord(v: unknown): v is Record & { + $type: 'chat.bsky.actor.declaration#main' | 'chat.bsky.actor.declaration' +} { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && (v.$type === 'chat.bsky.actor.declaration#main' || v.$type === 'chat.bsky.actor.declaration') ) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.actor.declaration#main', v) +export function validateRecord(v: unknown) { + return lexicons.validate( + 'chat.bsky.actor.declaration#main', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/chat/bsky/actor/defs.ts b/packages/api/src/client/types/chat/bsky/actor/defs.ts index 87aaac96218..5920d1dc47a 100644 --- a/packages/api/src/client/types/chat/bsky/actor/defs.ts +++ b/packages/api/src/client/types/chat/bsky/actor/defs.ts @@ -2,13 +2,14 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyActorDefs from '../../../app/bsky/actor/defs' import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' export interface ProfileViewBasic { + $type?: 'chat.bsky.actor.defs#profileViewBasic' did: string handle: string displayName?: string @@ -18,17 +19,17 @@ export interface ProfileViewBasic { labels?: ComAtprotoLabelDefs.Label[] /** Set to true when the actor cannot actively participate in converations */ chatDisabled?: boolean - [k: string]: unknown } -export function isProfileViewBasic(v: unknown): v is ProfileViewBasic { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.actor.defs#profileViewBasic' - ) +export function isProfileViewBasic( + v: unknown, +): v is ProfileViewBasic & { $type: 'chat.bsky.actor.defs#profileViewBasic' } { + return isTypedObj(v) && v.$type === 'chat.bsky.actor.defs#profileViewBasic' } -export function validateProfileViewBasic(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.actor.defs#profileViewBasic', v) +export function validateProfileViewBasic(v: unknown) { + return lexicons.validate( + 'chat.bsky.actor.defs#profileViewBasic', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/chat/bsky/actor/deleteAccount.ts b/packages/api/src/client/types/chat/bsky/actor/deleteAccount.ts index 1a045c21c29..00f3b4f331f 100644 --- a/packages/api/src/client/types/chat/bsky/actor/deleteAccount.ts +++ b/packages/api/src/client/types/chat/bsky/actor/deleteAccount.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,9 +11,7 @@ export interface QueryParams {} export type InputSchema = undefined -export interface OutputSchema { - [k: string]: unknown -} +export interface OutputSchema {} export interface CallOptions { signal?: AbortSignal diff --git a/packages/api/src/client/types/chat/bsky/actor/exportAccountData.ts b/packages/api/src/client/types/chat/bsky/actor/exportAccountData.ts index 0142436b05e..cdec0372323 100644 --- a/packages/api/src/client/types/chat/bsky/actor/exportAccountData.ts +++ b/packages/api/src/client/types/chat/bsky/actor/exportAccountData.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' diff --git a/packages/api/src/client/types/chat/bsky/convo/defs.ts b/packages/api/src/client/types/chat/bsky/convo/defs.ts index 4908b2dc46a..3d411641a31 100644 --- a/packages/api/src/client/types/chat/bsky/convo/defs.ts +++ b/packages/api/src/client/types/chat/bsky/convo/defs.ts @@ -2,7 +2,7 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as AppBskyRichtextFacet from '../../../app/bsky/richtext/facet' @@ -10,45 +10,48 @@ import * as AppBskyEmbedRecord from '../../../app/bsky/embed/record' import * as ChatBskyActorDefs from '../actor/defs' export interface MessageRef { + $type?: 'chat.bsky.convo.defs#messageRef' did: string convoId: string messageId: string - [k: string]: unknown } -export function isMessageRef(v: unknown): v is MessageRef { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#messageRef' - ) +export function isMessageRef( + v: unknown, +): v is MessageRef & { $type: 'chat.bsky.convo.defs#messageRef' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#messageRef' } -export function validateMessageRef(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageRef', v) +export function validateMessageRef(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#messageRef', + v, + ) as ValidationResult } export interface MessageInput { + $type?: 'chat.bsky.convo.defs#messageInput' text: string /** Annotations of text (mentions, URLs, hashtags, etc) */ facets?: AppBskyRichtextFacet.Main[] embed?: AppBskyEmbedRecord.Main | { $type: string; [k: string]: unknown } - [k: string]: unknown } -export function isMessageInput(v: unknown): v is MessageInput { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#messageInput' - ) +export function isMessageInput( + v: unknown, +): v is MessageInput & { $type: 'chat.bsky.convo.defs#messageInput' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#messageInput' } -export function validateMessageInput(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageInput', v) +export function validateMessageInput(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#messageInput', + v, + ) as ValidationResult } export interface MessageView { + $type?: 'chat.bsky.convo.defs#messageView' id: string rev: string text: string @@ -57,59 +60,62 @@ export interface MessageView { embed?: AppBskyEmbedRecord.View | { $type: string; [k: string]: unknown } sender: MessageViewSender sentAt: string - [k: string]: unknown } -export function isMessageView(v: unknown): v is MessageView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#messageView' - ) +export function isMessageView( + v: unknown, +): v is MessageView & { $type: 'chat.bsky.convo.defs#messageView' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#messageView' } -export function validateMessageView(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageView', v) +export function validateMessageView(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#messageView', + v, + ) as ValidationResult } export interface DeletedMessageView { + $type?: 'chat.bsky.convo.defs#deletedMessageView' id: string rev: string sender: MessageViewSender sentAt: string - [k: string]: unknown } -export function isDeletedMessageView(v: unknown): v is DeletedMessageView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#deletedMessageView' - ) +export function isDeletedMessageView(v: unknown): v is DeletedMessageView & { + $type: 'chat.bsky.convo.defs#deletedMessageView' +} { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#deletedMessageView' } -export function validateDeletedMessageView(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#deletedMessageView', v) +export function validateDeletedMessageView(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#deletedMessageView', + v, + ) as ValidationResult } export interface MessageViewSender { + $type?: 'chat.bsky.convo.defs#messageViewSender' did: string - [k: string]: unknown } -export function isMessageViewSender(v: unknown): v is MessageViewSender { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#messageViewSender' - ) +export function isMessageViewSender(v: unknown): v is MessageViewSender & { + $type: 'chat.bsky.convo.defs#messageViewSender' +} { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#messageViewSender' } -export function validateMessageViewSender(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageViewSender', v) +export function validateMessageViewSender(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#messageViewSender', + v, + ) as ValidationResult } export interface ConvoView { + $type?: 'chat.bsky.convo.defs#convoView' id: string rev: string members: ChatBskyActorDefs.ProfileViewBasic[] @@ -120,97 +126,101 @@ export interface ConvoView { muted: boolean opened?: boolean unreadCount: number - [k: string]: unknown } -export function isConvoView(v: unknown): v is ConvoView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#convoView' - ) +export function isConvoView( + v: unknown, +): v is ConvoView & { $type: 'chat.bsky.convo.defs#convoView' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#convoView' } -export function validateConvoView(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#convoView', v) +export function validateConvoView(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#convoView', + v, + ) as ValidationResult } export interface LogBeginConvo { + $type?: 'chat.bsky.convo.defs#logBeginConvo' rev: string convoId: string - [k: string]: unknown } -export function isLogBeginConvo(v: unknown): v is LogBeginConvo { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#logBeginConvo' - ) +export function isLogBeginConvo( + v: unknown, +): v is LogBeginConvo & { $type: 'chat.bsky.convo.defs#logBeginConvo' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#logBeginConvo' } -export function validateLogBeginConvo(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logBeginConvo', v) +export function validateLogBeginConvo(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#logBeginConvo', + v, + ) as ValidationResult } export interface LogLeaveConvo { + $type?: 'chat.bsky.convo.defs#logLeaveConvo' rev: string convoId: string - [k: string]: unknown } -export function isLogLeaveConvo(v: unknown): v is LogLeaveConvo { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#logLeaveConvo' - ) +export function isLogLeaveConvo( + v: unknown, +): v is LogLeaveConvo & { $type: 'chat.bsky.convo.defs#logLeaveConvo' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#logLeaveConvo' } -export function validateLogLeaveConvo(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logLeaveConvo', v) +export function validateLogLeaveConvo(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#logLeaveConvo', + v, + ) as ValidationResult } export interface LogCreateMessage { + $type?: 'chat.bsky.convo.defs#logCreateMessage' rev: string convoId: string message: | MessageView | DeletedMessageView | { $type: string; [k: string]: unknown } - [k: string]: unknown } -export function isLogCreateMessage(v: unknown): v is LogCreateMessage { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#logCreateMessage' - ) +export function isLogCreateMessage( + v: unknown, +): v is LogCreateMessage & { $type: 'chat.bsky.convo.defs#logCreateMessage' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#logCreateMessage' } -export function validateLogCreateMessage(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logCreateMessage', v) +export function validateLogCreateMessage(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#logCreateMessage', + v, + ) as ValidationResult } export interface LogDeleteMessage { + $type?: 'chat.bsky.convo.defs#logDeleteMessage' rev: string convoId: string message: | MessageView | DeletedMessageView | { $type: string; [k: string]: unknown } - [k: string]: unknown } -export function isLogDeleteMessage(v: unknown): v is LogDeleteMessage { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#logDeleteMessage' - ) +export function isLogDeleteMessage( + v: unknown, +): v is LogDeleteMessage & { $type: 'chat.bsky.convo.defs#logDeleteMessage' } { + return isTypedObj(v) && v.$type === 'chat.bsky.convo.defs#logDeleteMessage' } -export function validateLogDeleteMessage(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logDeleteMessage', v) +export function validateLogDeleteMessage(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.defs#logDeleteMessage', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/chat/bsky/convo/deleteMessageForSelf.ts b/packages/api/src/client/types/chat/bsky/convo/deleteMessageForSelf.ts index 863d2208cb8..adebcc34b46 100644 --- a/packages/api/src/client/types/chat/bsky/convo/deleteMessageForSelf.ts +++ b/packages/api/src/client/types/chat/bsky/convo/deleteMessageForSelf.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -13,7 +13,6 @@ export interface QueryParams {} export interface InputSchema { convoId: string messageId: string - [k: string]: unknown } export type OutputSchema = ChatBskyConvoDefs.DeletedMessageView diff --git a/packages/api/src/client/types/chat/bsky/convo/getConvo.ts b/packages/api/src/client/types/chat/bsky/convo/getConvo.ts index b3834234b5f..d55851852d9 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getConvo.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { convo: ChatBskyConvoDefs.ConvoView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/getConvoForMembers.ts b/packages/api/src/client/types/chat/bsky/convo/getConvoForMembers.ts index 9db44887410..c74b9cde1b0 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getConvoForMembers.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getConvoForMembers.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { convo: ChatBskyConvoDefs.ConvoView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/getLog.ts b/packages/api/src/client/types/chat/bsky/convo/getLog.ts index f1470fd89ba..c22c9efc734 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getLog.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getLog.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -23,7 +23,6 @@ export interface OutputSchema { | ChatBskyConvoDefs.LogDeleteMessage | { $type: string; [k: string]: unknown } )[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/getMessages.ts b/packages/api/src/client/types/chat/bsky/convo/getMessages.ts index eea7cba82e1..60463a39ab0 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getMessages.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getMessages.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -23,7 +23,6 @@ export interface OutputSchema { | ChatBskyConvoDefs.DeletedMessageView | { $type: string; [k: string]: unknown } )[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/leaveConvo.ts b/packages/api/src/client/types/chat/bsky/convo/leaveConvo.ts index 4124db1855d..c0749a8c9af 100644 --- a/packages/api/src/client/types/chat/bsky/convo/leaveConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/leaveConvo.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,13 +11,11 @@ export interface QueryParams {} export interface InputSchema { convoId: string - [k: string]: unknown } export interface OutputSchema { convoId: string rev: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/listConvos.ts b/packages/api/src/client/types/chat/bsky/convo/listConvos.ts index 3cd1ad68516..af4974b02f2 100644 --- a/packages/api/src/client/types/chat/bsky/convo/listConvos.ts +++ b/packages/api/src/client/types/chat/bsky/convo/listConvos.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -18,7 +18,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string convos: ChatBskyConvoDefs.ConvoView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/muteConvo.ts b/packages/api/src/client/types/chat/bsky/convo/muteConvo.ts index 93ac8785db7..8fc82ccbaa5 100644 --- a/packages/api/src/client/types/chat/bsky/convo/muteConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/muteConvo.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -12,12 +12,10 @@ export interface QueryParams {} export interface InputSchema { convoId: string - [k: string]: unknown } export interface OutputSchema { convo: ChatBskyConvoDefs.ConvoView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/sendMessage.ts b/packages/api/src/client/types/chat/bsky/convo/sendMessage.ts index e260ba6eee0..9a6c3986fe3 100644 --- a/packages/api/src/client/types/chat/bsky/convo/sendMessage.ts +++ b/packages/api/src/client/types/chat/bsky/convo/sendMessage.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -13,7 +13,6 @@ export interface QueryParams {} export interface InputSchema { convoId: string message: ChatBskyConvoDefs.MessageInput - [k: string]: unknown } export type OutputSchema = ChatBskyConvoDefs.MessageView diff --git a/packages/api/src/client/types/chat/bsky/convo/sendMessageBatch.ts b/packages/api/src/client/types/chat/bsky/convo/sendMessageBatch.ts index 68ff2711df5..1a131b5b79b 100644 --- a/packages/api/src/client/types/chat/bsky/convo/sendMessageBatch.ts +++ b/packages/api/src/client/types/chat/bsky/convo/sendMessageBatch.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -12,12 +12,10 @@ export interface QueryParams {} export interface InputSchema { items: BatchItem[] - [k: string]: unknown } export interface OutputSchema { items: ChatBskyConvoDefs.MessageView[] - [k: string]: unknown } export interface CallOptions { @@ -38,19 +36,22 @@ export function toKnownErr(e: any) { } export interface BatchItem { + $type?: 'chat.bsky.convo.sendMessageBatch#batchItem' convoId: string message: ChatBskyConvoDefs.MessageInput - [k: string]: unknown } -export function isBatchItem(v: unknown): v is BatchItem { +export function isBatchItem( + v: unknown, +): v is BatchItem & { $type: 'chat.bsky.convo.sendMessageBatch#batchItem' } { return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.sendMessageBatch#batchItem' + isTypedObj(v) && v.$type === 'chat.bsky.convo.sendMessageBatch#batchItem' ) } -export function validateBatchItem(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.sendMessageBatch#batchItem', v) +export function validateBatchItem(v: unknown) { + return lexicons.validate( + 'chat.bsky.convo.sendMessageBatch#batchItem', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/chat/bsky/convo/unmuteConvo.ts b/packages/api/src/client/types/chat/bsky/convo/unmuteConvo.ts index 93ac8785db7..8fc82ccbaa5 100644 --- a/packages/api/src/client/types/chat/bsky/convo/unmuteConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/unmuteConvo.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -12,12 +12,10 @@ export interface QueryParams {} export interface InputSchema { convoId: string - [k: string]: unknown } export interface OutputSchema { convo: ChatBskyConvoDefs.ConvoView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/convo/updateRead.ts b/packages/api/src/client/types/chat/bsky/convo/updateRead.ts index b7a8041dbd7..32dc9e9582c 100644 --- a/packages/api/src/client/types/chat/bsky/convo/updateRead.ts +++ b/packages/api/src/client/types/chat/bsky/convo/updateRead.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from './defs' @@ -13,12 +13,10 @@ export interface QueryParams {} export interface InputSchema { convoId: string messageId?: string - [k: string]: unknown } export interface OutputSchema { convo: ChatBskyConvoDefs.ConvoView - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/moderation/getActorMetadata.ts b/packages/api/src/client/types/chat/bsky/moderation/getActorMetadata.ts index 6761c9939b5..5d2532cf3ce 100644 --- a/packages/api/src/client/types/chat/bsky/moderation/getActorMetadata.ts +++ b/packages/api/src/client/types/chat/bsky/moderation/getActorMetadata.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -17,7 +17,6 @@ export interface OutputSchema { day: Metadata month: Metadata all: Metadata - [k: string]: unknown } export interface CallOptions { @@ -36,21 +35,25 @@ export function toKnownErr(e: any) { } export interface Metadata { + $type?: 'chat.bsky.moderation.getActorMetadata#metadata' messagesSent: number messagesReceived: number convos: number convosStarted: number - [k: string]: unknown } -export function isMetadata(v: unknown): v is Metadata { +export function isMetadata( + v: unknown, +): v is Metadata & { $type: 'chat.bsky.moderation.getActorMetadata#metadata' } { return ( - isObj(v) && - hasProp(v, '$type') && + isTypedObj(v) && v.$type === 'chat.bsky.moderation.getActorMetadata#metadata' ) } -export function validateMetadata(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.moderation.getActorMetadata#metadata', v) +export function validateMetadata(v: unknown) { + return lexicons.validate( + 'chat.bsky.moderation.getActorMetadata#metadata', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/chat/bsky/moderation/getMessageContext.ts b/packages/api/src/client/types/chat/bsky/moderation/getMessageContext.ts index 2315bfd4ad8..36fbf72607e 100644 --- a/packages/api/src/client/types/chat/bsky/moderation/getMessageContext.ts +++ b/packages/api/src/client/types/chat/bsky/moderation/getMessageContext.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ChatBskyConvoDefs from '../convo/defs' @@ -24,7 +24,6 @@ export interface OutputSchema { | ChatBskyConvoDefs.DeletedMessageView | { $type: string; [k: string]: unknown } )[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/chat/bsky/moderation/updateActorAccess.ts b/packages/api/src/client/types/chat/bsky/moderation/updateActorAccess.ts index d6f0205672e..0952a10c4b4 100644 --- a/packages/api/src/client/types/chat/bsky/moderation/updateActorAccess.ts +++ b/packages/api/src/client/types/chat/bsky/moderation/updateActorAccess.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -13,7 +13,6 @@ export interface InputSchema { actor: string allowAccess: boolean ref?: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/defs.ts b/packages/api/src/client/types/com/atproto/admin/defs.ts index 26510680347..3bf7fed256f 100644 --- a/packages/api/src/client/types/com/atproto/admin/defs.ts +++ b/packages/api/src/client/types/com/atproto/admin/defs.ts @@ -2,34 +2,36 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoServerDefs from '../server/defs' export interface StatusAttr { + $type?: 'com.atproto.admin.defs#statusAttr' applied: boolean ref?: string - [k: string]: unknown } -export function isStatusAttr(v: unknown): v is StatusAttr { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#statusAttr' - ) +export function isStatusAttr( + v: unknown, +): v is StatusAttr & { $type: 'com.atproto.admin.defs#statusAttr' } { + return isTypedObj(v) && v.$type === 'com.atproto.admin.defs#statusAttr' } -export function validateStatusAttr(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#statusAttr', v) +export function validateStatusAttr(v: unknown) { + return lexicons.validate( + 'com.atproto.admin.defs#statusAttr', + v, + ) as ValidationResult } export interface AccountView { + $type?: 'com.atproto.admin.defs#accountView' did: string handle: string email?: string - relatedRecords?: {}[] + relatedRecords?: { [_ in string]: unknown }[] indexedAt: string invitedBy?: ComAtprotoServerDefs.InviteCode invites?: ComAtprotoServerDefs.InviteCode[] @@ -38,71 +40,74 @@ export interface AccountView { inviteNote?: string deactivatedAt?: string threatSignatures?: ThreatSignature[] - [k: string]: unknown } -export function isAccountView(v: unknown): v is AccountView { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#accountView' - ) +export function isAccountView( + v: unknown, +): v is AccountView & { $type: 'com.atproto.admin.defs#accountView' } { + return isTypedObj(v) && v.$type === 'com.atproto.admin.defs#accountView' } -export function validateAccountView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#accountView', v) +export function validateAccountView(v: unknown) { + return lexicons.validate( + 'com.atproto.admin.defs#accountView', + v, + ) as ValidationResult } export interface RepoRef { + $type?: 'com.atproto.admin.defs#repoRef' did: string - [k: string]: unknown } -export function isRepoRef(v: unknown): v is RepoRef { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoRef' - ) +export function isRepoRef( + v: unknown, +): v is RepoRef & { $type: 'com.atproto.admin.defs#repoRef' } { + return isTypedObj(v) && v.$type === 'com.atproto.admin.defs#repoRef' } -export function validateRepoRef(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoRef', v) +export function validateRepoRef(v: unknown) { + return lexicons.validate( + 'com.atproto.admin.defs#repoRef', + v, + ) as ValidationResult } export interface RepoBlobRef { + $type?: 'com.atproto.admin.defs#repoBlobRef' did: string cid: string recordUri?: string - [k: string]: unknown } -export function isRepoBlobRef(v: unknown): v is RepoBlobRef { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#repoBlobRef' - ) +export function isRepoBlobRef( + v: unknown, +): v is RepoBlobRef & { $type: 'com.atproto.admin.defs#repoBlobRef' } { + return isTypedObj(v) && v.$type === 'com.atproto.admin.defs#repoBlobRef' } -export function validateRepoBlobRef(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v) +export function validateRepoBlobRef(v: unknown) { + return lexicons.validate( + 'com.atproto.admin.defs#repoBlobRef', + v, + ) as ValidationResult } export interface ThreatSignature { + $type?: 'com.atproto.admin.defs#threatSignature' property: string value: string - [k: string]: unknown } -export function isThreatSignature(v: unknown): v is ThreatSignature { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.admin.defs#threatSignature' - ) +export function isThreatSignature( + v: unknown, +): v is ThreatSignature & { $type: 'com.atproto.admin.defs#threatSignature' } { + return isTypedObj(v) && v.$type === 'com.atproto.admin.defs#threatSignature' } -export function validateThreatSignature(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#threatSignature', v) +export function validateThreatSignature(v: unknown) { + return lexicons.validate( + 'com.atproto.admin.defs#threatSignature', + v, + ) as ValidationResult } diff --git a/packages/api/src/client/types/com/atproto/admin/deleteAccount.ts b/packages/api/src/client/types/com/atproto/admin/deleteAccount.ts index 72066a656b7..264274d01f7 100644 --- a/packages/api/src/client/types/com/atproto/admin/deleteAccount.ts +++ b/packages/api/src/client/types/com/atproto/admin/deleteAccount.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -11,7 +11,6 @@ export interface QueryParams {} export interface InputSchema { did: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/disableAccountInvites.ts b/packages/api/src/client/types/com/atproto/admin/disableAccountInvites.ts index 8df420239de..ca41a768f71 100644 --- a/packages/api/src/client/types/com/atproto/admin/disableAccountInvites.ts +++ b/packages/api/src/client/types/com/atproto/admin/disableAccountInvites.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -13,7 +13,6 @@ export interface InputSchema { account: string /** Optional reason for disabled invites. */ note?: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/disableInviteCodes.ts b/packages/api/src/client/types/com/atproto/admin/disableInviteCodes.ts index c264b65dbc2..c326da40a15 100644 --- a/packages/api/src/client/types/com/atproto/admin/disableInviteCodes.ts +++ b/packages/api/src/client/types/com/atproto/admin/disableInviteCodes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -12,7 +12,6 @@ export interface QueryParams {} export interface InputSchema { codes?: string[] accounts?: string[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/enableAccountInvites.ts b/packages/api/src/client/types/com/atproto/admin/enableAccountInvites.ts index 094b3dfe0af..49a7f820167 100644 --- a/packages/api/src/client/types/com/atproto/admin/enableAccountInvites.ts +++ b/packages/api/src/client/types/com/atproto/admin/enableAccountInvites.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -13,7 +13,6 @@ export interface InputSchema { account: string /** Optional reason for enabled invites. */ note?: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/getAccountInfo.ts b/packages/api/src/client/types/com/atproto/admin/getAccountInfo.ts index 645b9e613ff..291880a73d3 100644 --- a/packages/api/src/client/types/com/atproto/admin/getAccountInfo.ts +++ b/packages/api/src/client/types/com/atproto/admin/getAccountInfo.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoAdminDefs from './defs' diff --git a/packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts b/packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts index 9c1c273b9d9..b6799db7fbc 100644 --- a/packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts +++ b/packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoAdminDefs from './defs' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { infos: ComAtprotoAdminDefs.AccountView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/getInviteCodes.ts b/packages/api/src/client/types/com/atproto/admin/getInviteCodes.ts index faa4c8bed25..acc5bc168d6 100644 --- a/packages/api/src/client/types/com/atproto/admin/getInviteCodes.ts +++ b/packages/api/src/client/types/com/atproto/admin/getInviteCodes.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoServerDefs from '../server/defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string codes: ComAtprotoServerDefs.InviteCode[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/getSubjectStatus.ts b/packages/api/src/client/types/com/atproto/admin/getSubjectStatus.ts index f11b514507d..15ccb6ed497 100644 --- a/packages/api/src/client/types/com/atproto/admin/getSubjectStatus.ts +++ b/packages/api/src/client/types/com/atproto/admin/getSubjectStatus.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoAdminDefs from './defs' @@ -25,7 +25,6 @@ export interface OutputSchema { | { $type: string; [k: string]: unknown } takedown?: ComAtprotoAdminDefs.StatusAttr deactivated?: ComAtprotoAdminDefs.StatusAttr - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/searchAccounts.ts b/packages/api/src/client/types/com/atproto/admin/searchAccounts.ts index 2d22806238c..6c92aed3ac4 100644 --- a/packages/api/src/client/types/com/atproto/admin/searchAccounts.ts +++ b/packages/api/src/client/types/com/atproto/admin/searchAccounts.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoAdminDefs from './defs' @@ -19,7 +19,6 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string accounts: ComAtprotoAdminDefs.AccountView[] - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/sendEmail.ts b/packages/api/src/client/types/com/atproto/admin/sendEmail.ts index 3f7c06d7070..581e544c9a8 100644 --- a/packages/api/src/client/types/com/atproto/admin/sendEmail.ts +++ b/packages/api/src/client/types/com/atproto/admin/sendEmail.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -16,12 +16,10 @@ export interface InputSchema { senderDid: string /** Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers */ comment?: string - [k: string]: unknown } export interface OutputSchema { sent: boolean - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/updateAccountEmail.ts b/packages/api/src/client/types/com/atproto/admin/updateAccountEmail.ts index d13878711a6..eda27ee8f0c 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateAccountEmail.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateAccountEmail.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -13,7 +13,6 @@ export interface InputSchema { /** The handle or DID of the repo. */ account: string email: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/updateAccountHandle.ts b/packages/api/src/client/types/com/atproto/admin/updateAccountHandle.ts index 38fbcae1681..8f811fdeb8f 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateAccountHandle.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateAccountHandle.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -12,7 +12,6 @@ export interface QueryParams {} export interface InputSchema { did: string handle: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/updateAccountPassword.ts b/packages/api/src/client/types/com/atproto/admin/updateAccountPassword.ts index 412f0facca2..dec6291e86d 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateAccountPassword.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateAccountPassword.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -12,7 +12,6 @@ export interface QueryParams {} export interface InputSchema { did: string password: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/admin/updateSubjectStatus.ts b/packages/api/src/client/types/com/atproto/admin/updateSubjectStatus.ts index d890993cf3a..7ea3cfa36b0 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateSubjectStatus.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateSubjectStatus.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' import * as ComAtprotoAdminDefs from './defs' @@ -19,7 +19,6 @@ export interface InputSchema { | { $type: string; [k: string]: unknown } takedown?: ComAtprotoAdminDefs.StatusAttr deactivated?: ComAtprotoAdminDefs.StatusAttr - [k: string]: unknown } export interface OutputSchema { @@ -29,7 +28,6 @@ export interface OutputSchema { | ComAtprotoAdminDefs.RepoBlobRef | { $type: string; [k: string]: unknown } takedown?: ComAtprotoAdminDefs.StatusAttr - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/identity/getRecommendedDidCredentials.ts b/packages/api/src/client/types/com/atproto/identity/getRecommendedDidCredentials.ts index a5e4a0296de..fabc912af73 100644 --- a/packages/api/src/client/types/com/atproto/identity/getRecommendedDidCredentials.ts +++ b/packages/api/src/client/types/com/atproto/identity/getRecommendedDidCredentials.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -15,9 +15,8 @@ export interface OutputSchema { /** Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. */ rotationKeys?: string[] alsoKnownAs?: string[] - verificationMethods?: {} - services?: {} - [k: string]: unknown + verificationMethods?: { [_ in string]: unknown } + services?: { [_ in string]: unknown } } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/identity/requestPlcOperationSignature.ts b/packages/api/src/client/types/com/atproto/identity/requestPlcOperationSignature.ts index dcab71e2558..d2669424af0 100644 --- a/packages/api/src/client/types/com/atproto/identity/requestPlcOperationSignature.ts +++ b/packages/api/src/client/types/com/atproto/identity/requestPlcOperationSignature.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' diff --git a/packages/api/src/client/types/com/atproto/identity/resolveHandle.ts b/packages/api/src/client/types/com/atproto/identity/resolveHandle.ts index 32db72138f7..0e134769e51 100644 --- a/packages/api/src/client/types/com/atproto/identity/resolveHandle.ts +++ b/packages/api/src/client/types/com/atproto/identity/resolveHandle.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -16,7 +16,6 @@ export type InputSchema = undefined export interface OutputSchema { did: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/identity/signPlcOperation.ts b/packages/api/src/client/types/com/atproto/identity/signPlcOperation.ts index 88c04c5993c..efcd9ee7c42 100644 --- a/packages/api/src/client/types/com/atproto/identity/signPlcOperation.ts +++ b/packages/api/src/client/types/com/atproto/identity/signPlcOperation.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -14,15 +14,13 @@ export interface InputSchema { token?: string rotationKeys?: string[] alsoKnownAs?: string[] - verificationMethods?: {} - services?: {} - [k: string]: unknown + verificationMethods?: { [_ in string]: unknown } + services?: { [_ in string]: unknown } } export interface OutputSchema { /** A signed DID PLC operation. */ - operation: {} - [k: string]: unknown + operation: { [_ in string]: unknown } } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/identity/submitPlcOperation.ts b/packages/api/src/client/types/com/atproto/identity/submitPlcOperation.ts index 74dea9f196d..4fc4bd1ddfe 100644 --- a/packages/api/src/client/types/com/atproto/identity/submitPlcOperation.ts +++ b/packages/api/src/client/types/com/atproto/identity/submitPlcOperation.ts @@ -3,15 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' export interface QueryParams {} export interface InputSchema { - operation: {} - [k: string]: unknown + operation: { [_ in string]: unknown } } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/identity/updateHandle.ts b/packages/api/src/client/types/com/atproto/identity/updateHandle.ts index c01d4887a4a..23e69ada361 100644 --- a/packages/api/src/client/types/com/atproto/identity/updateHandle.ts +++ b/packages/api/src/client/types/com/atproto/identity/updateHandle.ts @@ -3,7 +3,7 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' @@ -12,7 +12,6 @@ export interface QueryParams {} export interface InputSchema { /** The new handle. */ handle: string - [k: string]: unknown } export interface CallOptions { diff --git a/packages/api/src/client/types/com/atproto/label/defs.ts b/packages/api/src/client/types/com/atproto/label/defs.ts index 131682e550c..1d24db9ee72 100644 --- a/packages/api/src/client/types/com/atproto/label/defs.ts +++ b/packages/api/src/client/types/com/atproto/label/defs.ts @@ -2,12 +2,13 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' +import { isTypedObj, OmitKey } from '../../../../util' import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' /** Metadata tag on an atproto resource (eg, repo or record). */ export interface Label { + $type?: 'com.atproto.label.defs#label' /** The AT Protocol version of the label object. */ ver?: number /** DID of the actor who created this label. */ @@ -26,60 +27,63 @@ export interface Label { exp?: string /** Signature of dag-cbor encoded label. */ sig?: Uint8Array - [k: string]: unknown } -export function isLabel(v: unknown): v is Label { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'com.atproto.label.defs#label' - ) +export function isLabel( + v: unknown, +): v is Label & { $type: 'com.atproto.label.defs#label' } { + return isTypedObj(v) && v.$type === 'com.atproto.label.defs#label' } -export function validateLabel(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.label.defs#label', v) +export function validateLabel(v: unknown) { + return lexicons.validate( + 'com.atproto.label.defs#label', + v, + ) as ValidationResult