diff --git a/.changeset/beige-trees-float.md b/.changeset/beige-trees-float.md new file mode 100644 index 00000000000..06b11c8fd2d --- /dev/null +++ b/.changeset/beige-trees-float.md @@ -0,0 +1,5 @@ +--- +"@atproto/api": patch +--- + +Fixes a bug that would clear interests prefs when updating hidden posts diff --git a/.changeset/brown-flies-stare.md b/.changeset/brown-flies-stare.md new file mode 100644 index 00000000000..e31e8c5f2f4 --- /dev/null +++ b/.changeset/brown-flies-stare.md @@ -0,0 +1,10 @@ +--- +"@atproto/ozone": patch +"@atproto/bsky": patch +"@atproto/api": minor +"@atproto/pds": patch +--- + +Update Lexicon derived code to better reflect data typings. In particular, Lexicon derived interfaces will now explicitly include the `$type` property that can be present in the data. + + diff --git a/.changeset/fast-points-walk.md b/.changeset/fast-points-walk.md new file mode 100644 index 00000000000..697405d5178 --- /dev/null +++ b/.changeset/fast-points-walk.md @@ -0,0 +1,5 @@ +--- +"@atproto/syntax": patch +--- + +Improve performance of isValidTid diff --git a/.changeset/fast-waves-jog.md b/.changeset/fast-waves-jog.md new file mode 100644 index 00000000000..17daee73935 --- /dev/null +++ b/.changeset/fast-waves-jog.md @@ -0,0 +1,5 @@ +--- +"@atproto/lex-cli": minor +--- + +Update the code generation to better reflect the data typings. In particular this change will cause generated code to explicit the `$type` property that can be present in the data. diff --git a/.changeset/green-cherries-shave.md b/.changeset/green-cherries-shave.md new file mode 100644 index 00000000000..13326d6d967 --- /dev/null +++ b/.changeset/green-cherries-shave.md @@ -0,0 +1,5 @@ +--- +"@atproto/pds": patch +--- + +Minor typing fixes diff --git a/.changeset/green-forks-lie.md b/.changeset/green-forks-lie.md new file mode 100644 index 00000000000..d00a1e5b694 --- /dev/null +++ b/.changeset/green-forks-lie.md @@ -0,0 +1,5 @@ +--- +"@atproto/api": minor +--- + +Helper functions (e.g. `NS.isRecord`) no longer casts the output value. Use `asPredicate(NS.validateRecord)` to create a predicate function that will ensure that an unknown value is indeed an `NS.Record`. The `isX` helper function's purpose is to discriminate between `$type`d values from unions. diff --git a/.changeset/late-worms-travel.md b/.changeset/late-worms-travel.md new file mode 100644 index 00000000000..68f63285d98 --- /dev/null +++ b/.changeset/late-worms-travel.md @@ -0,0 +1,5 @@ +--- +"@atproto/lex-cli": patch +--- + +Add `.js` file extension to `import` statements in generated code. diff --git a/.changeset/popular-shirts-rescue.md b/.changeset/popular-shirts-rescue.md new file mode 100644 index 00000000000..3e7b8ed68bb --- /dev/null +++ b/.changeset/popular-shirts-rescue.md @@ -0,0 +1,5 @@ +--- +"@atproto/lexicon": patch +--- + +Various performance improvements diff --git a/.changeset/shiny-suns-walk.md b/.changeset/shiny-suns-walk.md new file mode 100644 index 00000000000..65068e336df --- /dev/null +++ b/.changeset/shiny-suns-walk.md @@ -0,0 +1,5 @@ +--- +"@atproto/lex-cli": patch +--- + +Type the generated `ids` object (that contains all the lexicon namespace ids) as `const`. diff --git a/.changeset/silly-starfishes-pay.md b/.changeset/silly-starfishes-pay.md new file mode 100644 index 00000000000..af95fb425c4 --- /dev/null +++ b/.changeset/silly-starfishes-pay.md @@ -0,0 +1,5 @@ +--- +"@atproto/lexicon": patch +--- + +Fully type `ValidationResult`'s `value` property, allowing `NS.validateMyType` helper functions to return a typed value in case of success. diff --git a/.changeset/spotty-bottles-march.md b/.changeset/spotty-bottles-march.md new file mode 100644 index 00000000000..9dfc33703aa --- /dev/null +++ b/.changeset/spotty-bottles-march.md @@ -0,0 +1,5 @@ +--- +"@atproto/lex-cli": minor +--- + +Remove `[string]: unknown` index signature from custom user objects, input and output schemas. diff --git a/.changeset/tiny-carpets-impress.md b/.changeset/tiny-carpets-impress.md new file mode 100644 index 00000000000..8d7699990dc --- /dev/null +++ b/.changeset/tiny-carpets-impress.md @@ -0,0 +1,5 @@ +--- +"@atproto/lex-cli": patch +--- + +Ensures that empty `schemas` arrays are typed as `LexiconDoc[]`. diff --git a/.prettierignore b/.prettierignore index 681b5d03670..e6453c5dfbb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,3 +6,9 @@ pnpm-lock.yaml .pnpm* .changeset CHANGELOG.md + +# Prettier is used to format the code during codegen +packages/api/src/client +packages/bsky/src/lexicon +packages/pds/src/lexicon +packages/ozone/src/lexicon diff --git a/packages/api/jest.config.js b/packages/api/jest.config.js index 1c938059f3e..d6611c66952 100644 --- a/packages/api/jest.config.js +++ b/packages/api/jest.config.js @@ -5,4 +5,5 @@ module.exports = { testTimeout: 60000, setupFiles: ['/../../jest.setup.ts'], setupFilesAfterEnv: ['/jest.setup.ts'], + moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] }, } diff --git a/packages/api/src/agent.ts b/packages/api/src/agent.ts index ec4cda02fb4..769c6be0127 100644 --- a/packages/api/src/agent.ts +++ b/packages/api/src/agent.ts @@ -1,5 +1,5 @@ import AwaitLock from 'await-lock' -import { TID } from '@atproto/common-web' +import { TID, retry } from '@atproto/common-web' import { AtUri, ensureValidDid } from '@atproto/syntax' import { FetchHandler, XrpcClient, buildFetchHandler } from '@atproto/xrpc' import { @@ -15,6 +15,7 @@ import { } from './client/index' import { schemas } from './client/lexicons' import { MutedWord, Nux } from './client/types/app/bsky/actor/defs' +import { $Typed, Un$Typed } from './client/util' import { BSKY_LABELER_DID } from './const' import { interpretLabelValueDefinitions } from './moderation' import { DEFAULT_LABEL_SETTINGS } from './moderation/const/labels' @@ -23,6 +24,7 @@ import { LabelPreference, ModerationPrefs, } from './moderation/types' +import * as predicate from './predicate' import { SessionManager } from './session-manager' import { AtpAgentGlobalOpts, @@ -56,15 +58,6 @@ const THREAD_VIEW_PREF_DEFAULTS = { prioritizeFollowedUsers: true, } -declare global { - interface Array { - findLast( - predicate: (value: T, index: number, obj: T[]) => unknown, - thisArg?: any, - ): T - } -} - export type { FetchHandler } /** @@ -447,59 +440,56 @@ export class Agent extends XrpcClient { }) } + /** + * @note: Using this method will reset the whole profile record if it + * previously contained invalid values (wrt to the profile lexicon). + */ async upsertProfile( updateFn: ( existing: AppBskyActorProfile.Record | undefined, - ) => AppBskyActorProfile.Record | Promise, - ) { - const repo = this.accountDid + ) => + | Un$Typed + | Promise>, + ): Promise { + const upsert = async () => { + const repo = this.assertDid + const collection = 'app.bsky.actor.profile' - let retriesRemaining = 5 - while (retriesRemaining >= 0) { - // fetch existing const existing = await this.com.atproto.repo - .getRecord({ - repo, - collection: 'app.bsky.actor.profile', - rkey: 'self', - }) + .getRecord({ repo, collection, rkey: 'self' }) .catch((_) => undefined) + const existingRecord: AppBskyActorProfile.Record | undefined = + existing && predicate.isValidProfile(existing.data.value) + ? existing.data.value + : undefined + // run the update - const updated = await updateFn(existing?.data.value) - if (updated) { - updated.$type = 'app.bsky.actor.profile' - } + const updated = await updateFn(existingRecord) + + // validate the value returned by the update function + const validation = AppBskyActorProfile.validateRecord({ + $type: collection, + ...updated, + }) - // validate the record - const validation = AppBskyActorProfile.validateRecord(updated) if (!validation.success) { throw validation.error } - try { - // attempt the put - await this.com.atproto.repo.putRecord({ - repo, - collection: 'app.bsky.actor.profile', - rkey: 'self', - record: updated, - swapRecord: existing?.data.cid || null, - }) - } catch (e: unknown) { - if ( - retriesRemaining > 0 && - e instanceof ComAtprotoRepoPutRecord.InvalidSwapError - ) { - // try again - retriesRemaining-- - continue - } else { - throw e - } - } - break + await this.com.atproto.repo.putRecord({ + repo, + collection, + rkey: 'self', + record: validation.value, + swapRecord: existing?.data.cid || null, + }) } + + return retry(upsert, { + maxRetries: 5, + retryable: (e) => e instanceof ComAtprotoRepoPutRecord.InvalidSwapError, + }) } async mute(actor: string) { @@ -591,23 +581,14 @@ export class Agent extends XrpcClient { const res = await this.app.bsky.actor.getPreferences({}) const labelPrefs: AppBskyActorDefs.ContentLabelPref[] = [] for (const pref of res.data.preferences) { - if ( - AppBskyActorDefs.isAdultContentPref(pref) && - AppBskyActorDefs.validateAdultContentPref(pref).success - ) { + if (predicate.isValidAdultContentPref(pref)) { // adult content preferences prefs.moderationPrefs.adultContentEnabled = pref.enabled - } else if ( - AppBskyActorDefs.isContentLabelPref(pref) && - AppBskyActorDefs.validateContentLabelPref(pref).success - ) { + } else if (predicate.isValidContentLabelPref(pref)) { // content label preference const adjustedPref = adjustLegacyContentLabelPref(pref) labelPrefs.push(adjustedPref) - } else if ( - AppBskyActorDefs.isLabelersPref(pref) && - AppBskyActorDefs.validateLabelersPref(pref).success - ) { + } else if (predicate.isValidLabelersPref(pref)) { // labelers preferences prefs.moderationPrefs.labelers = this.appLabelers .map((did: string) => ({ did, labels: {} })) @@ -617,56 +598,30 @@ export class Agent extends XrpcClient { labels: {}, })), ) - } else if ( - AppBskyActorDefs.isSavedFeedsPrefV2(pref) && - AppBskyActorDefs.validateSavedFeedsPrefV2(pref).success - ) { + } else if (predicate.isValidSavedFeedsPrefV2(pref)) { prefs.savedFeeds = pref.items - } else if ( - AppBskyActorDefs.isSavedFeedsPref(pref) && - AppBskyActorDefs.validateSavedFeedsPref(pref).success - ) { + } else if (predicate.isValidSavedFeedsPref(pref)) { // saved and pinned feeds prefs.feeds.saved = pref.saved prefs.feeds.pinned = pref.pinned - } else if ( - AppBskyActorDefs.isPersonalDetailsPref(pref) && - AppBskyActorDefs.validatePersonalDetailsPref(pref).success - ) { + } else if (predicate.isValidPersonalDetailsPref(pref)) { // birth date (irl) if (pref.birthDate) { prefs.birthDate = new Date(pref.birthDate) } - } else if ( - AppBskyActorDefs.isFeedViewPref(pref) && - AppBskyActorDefs.validateFeedViewPref(pref).success - ) { + } else if (predicate.isValidFeedViewPref(pref)) { // feed view preferences - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { $type, feed, ...v } = pref - prefs.feedViewPrefs[pref.feed] = { ...FEED_VIEW_PREF_DEFAULTS, ...v } - } else if ( - AppBskyActorDefs.isThreadViewPref(pref) && - AppBskyActorDefs.validateThreadViewPref(pref).success - ) { + const { $type: _, feed, ...v } = pref + prefs.feedViewPrefs[feed] = { ...FEED_VIEW_PREF_DEFAULTS, ...v } + } else if (predicate.isValidThreadViewPref(pref)) { // thread view preferences - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { $type, ...v } = pref + const { $type: _, ...v } = pref prefs.threadViewPrefs = { ...prefs.threadViewPrefs, ...v } - } else if ( - AppBskyActorDefs.isInterestsPref(pref) && - AppBskyActorDefs.validateInterestsPref(pref).success - ) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { $type, ...v } = pref + } else if (predicate.isValidInterestsPref(pref)) { + const { $type: _, ...v } = pref prefs.interests = { ...prefs.interests, ...v } - } else if ( - AppBskyActorDefs.isMutedWordsPref(pref) && - AppBskyActorDefs.validateMutedWordsPref(pref).success - ) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { $type, ...v } = pref - prefs.moderationPrefs.mutedWords = v.items + } else if (predicate.isValidMutedWordsPref(pref)) { + prefs.moderationPrefs.mutedWords = pref.items if (prefs.moderationPrefs.mutedWords.length) { prefs.moderationPrefs.mutedWords = @@ -675,26 +630,13 @@ export class Agent extends XrpcClient { return word }) } - } else if ( - AppBskyActorDefs.isHiddenPostsPref(pref) && - AppBskyActorDefs.validateHiddenPostsPref(pref).success - ) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { $type, ...v } = pref - prefs.moderationPrefs.hiddenPosts = v.items - } else if ( - AppBskyActorDefs.isBskyAppStatePref(pref) && - AppBskyActorDefs.validateBskyAppStatePref(pref).success - ) { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { $type, ...v } = pref - prefs.bskyAppState.queuedNudges = v.queuedNudges || [] - prefs.bskyAppState.activeProgressGuide = v.activeProgressGuide - prefs.bskyAppState.nuxs = v.nuxs || [] - } else if ( - AppBskyActorDefs.isPostInteractionSettingsPref(pref) && - AppBskyActorDefs.validatePostInteractionSettingsPref(pref).success - ) { + } else if (predicate.isValidHiddenPostsPref(pref)) { + prefs.moderationPrefs.hiddenPosts = pref.items + } else if (predicate.isValidBskyAppStatePref(pref)) { + prefs.bskyAppState.queuedNudges = pref.queuedNudges || [] + prefs.bskyAppState.activeProgressGuide = pref.activeProgressGuide + prefs.bskyAppState.nuxs = pref.nuxs || [] + } else if (predicate.isValidPostInteractionSettingsPref(pref)) { prefs.postInteractionSettings.threadgateAllowRules = pref.threadgateAllowRules prefs.postInteractionSettings.postgateEmbeddingRules = @@ -900,23 +842,19 @@ export class Agent extends XrpcClient { } async setAdultContentEnabled(v: boolean) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let adultContentPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isAdultContentPref(pref) && - AppBskyActorDefs.validateAdultContentPref(pref).success, - ) - if (adultContentPref) { - adultContentPref.enabled = v - } else { - adultContentPref = { - $type: 'app.bsky.actor.defs#adultContentPref', - enabled: v, - } + await this.updatePreferences((prefs) => { + const adultContentPref = prefs.findLast( + predicate.isValidAdultContentPref, + ) || { + $type: 'app.bsky.actor.defs#adultContentPref', + enabled: v, } + + adultContentPref.enabled = v + return prefs .filter((pref) => !AppBskyActorDefs.isAdultContentPref(pref)) - .concat([adultContentPref]) + .concat(adultContentPref) }) } @@ -928,27 +866,21 @@ export class Agent extends XrpcClient { if (labelerDid) { ensureValidDid(labelerDid) } - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let labelPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isContentLabelPref(pref) && - AppBskyActorDefs.validateContentLabelPref(pref).success && - pref.label === key && - pref.labelerDid === labelerDid, - ) - let legacyLabelPref: AppBskyActorDefs.ContentLabelPref | undefined - - if (labelPref) { - labelPref.visibility = value - } else { - labelPref = { - $type: 'app.bsky.actor.defs#contentLabelPref', - label: key, - labelerDid, - visibility: value, - } + await this.updatePreferences((prefs) => { + const labelPref = prefs + .filter(predicate.isValidContentLabelPref) + .findLast( + (pref) => pref.label === key && pref.labelerDid === labelerDid, + ) || { + $type: 'app.bsky.actor.defs#contentLabelPref', + label: key, + labelerDid, + visibility: value, } + labelPref.visibility = value + + let legacyLabelPref: $Typed | undefined if (AppBskyActorDefs.isContentLabelPref(labelPref)) { // is global if (!labelPref.labelerDid) { @@ -956,28 +888,26 @@ export class Agent extends XrpcClient { 'graphic-media': 'gore', porn: 'nsfw', sexual: 'suggestive', + // Protect against using toString, hasOwnProperty, etc. as a label: + __proto__: null, }[labelPref.label] // if it's a legacy label, double-write the legacy label if (legacyLabelValue) { - legacyLabelPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isContentLabelPref(pref) && - AppBskyActorDefs.validateContentLabelPref(pref).success && - pref.label === legacyLabelValue && - pref.labelerDid === undefined, - ) as AppBskyActorDefs.ContentLabelPref | undefined - - if (legacyLabelPref) { - legacyLabelPref.visibility = value - } else { - legacyLabelPref = { - $type: 'app.bsky.actor.defs#contentLabelPref', - label: legacyLabelValue, - labelerDid: undefined, - visibility: value, - } + legacyLabelPref = prefs + .filter(predicate.isValidContentLabelPref) + .findLast( + (pref) => + pref.label === legacyLabelValue && + pref.labelerDid === undefined, + ) || { + $type: 'app.bsky.actor.defs#contentLabelPref', + label: legacyLabelValue, + labelerDid: undefined, + visibility: value, } + + legacyLabelPref!.visibility = value } } } @@ -988,7 +918,7 @@ export class Agent extends XrpcClient { !AppBskyActorDefs.isContentLabelPref(pref) || !(pref.label === key && pref.labelerDid === labelerDid), ) - .concat([labelPref]) + .concat(labelPref) .filter((pref) => { if (!legacyLabelPref) return true return ( @@ -1004,63 +934,37 @@ export class Agent extends XrpcClient { } async addLabeler(did: string) { - const prefs = await this.updatePreferences( - (prefs: AppBskyActorDefs.Preferences) => { - let labelersPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isLabelersPref(pref) && - AppBskyActorDefs.validateLabelersPref(pref).success, - ) - if (!labelersPref) { - labelersPref = { - $type: 'app.bsky.actor.defs#labelersPref', - labelers: [], - } - } - if (AppBskyActorDefs.isLabelersPref(labelersPref)) { - let labelerPrefItem = labelersPref.labelers.find( - (labeler) => labeler.did === did, - ) - if (!labelerPrefItem) { - labelerPrefItem = { - did, - } - labelersPref.labelers.push(labelerPrefItem) - } - } - return prefs - .filter((pref) => !AppBskyActorDefs.isLabelersPref(pref)) - .concat([labelersPref]) - }, - ) + const prefs = await this.updatePreferences((prefs) => { + const labelersPref = prefs.findLast(predicate.isValidLabelersPref) || { + $type: 'app.bsky.actor.defs#labelersPref', + labelers: [], + } + + if (!labelersPref.labelers.some((labeler) => labeler.did === did)) { + labelersPref.labelers.push({ did }) + } + + return prefs + .filter((pref) => !AppBskyActorDefs.isLabelersPref(pref)) + .concat(labelersPref) + }) // automatically configure the client this.configureLabelers(prefsArrayToLabelerDids(prefs)) } async removeLabeler(did: string) { - const prefs = await this.updatePreferences( - (prefs: AppBskyActorDefs.Preferences) => { - let labelersPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isLabelersPref(pref) && - AppBskyActorDefs.validateLabelersPref(pref).success, - ) - if (!labelersPref) { - labelersPref = { - $type: 'app.bsky.actor.defs#labelersPref', - labelers: [], - } - } - if (AppBskyActorDefs.isLabelersPref(labelersPref)) { - labelersPref.labelers = labelersPref.labelers.filter( - (labeler) => labeler.did !== did, - ) - } - return prefs - .filter((pref) => !AppBskyActorDefs.isLabelersPref(pref)) - .concat([labelersPref]) - }, - ) + const prefs = await this.updatePreferences((prefs) => { + const labelersPref = prefs.findLast(predicate.isValidLabelersPref) || { + $type: 'app.bsky.actor.defs#labelersPref', + labelers: [], + } + + labelersPref.labelers = labelersPref.labelers.filter((l) => l.did !== did) + + return prefs + .filter((pref) => !AppBskyActorDefs.isLabelersPref(pref)) + .concat(labelersPref) + }) // automatically configure the client this.configureLabelers(prefsArrayToLabelerDids(prefs)) } @@ -1070,75 +974,64 @@ export class Agent extends XrpcClient { }: { birthDate: string | Date | undefined }) { - birthDate = birthDate instanceof Date ? birthDate.toISOString() : birthDate - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let personalDetailsPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isPersonalDetailsPref(pref) && - AppBskyActorDefs.validatePersonalDetailsPref(pref).success, - ) - if (personalDetailsPref) { - personalDetailsPref.birthDate = birthDate - } else { - personalDetailsPref = { - $type: 'app.bsky.actor.defs#personalDetailsPref', - birthDate, - } + await this.updatePreferences((prefs) => { + const personalDetailsPref = prefs.findLast( + predicate.isValidPersonalDetailsPref, + ) || { + $type: 'app.bsky.actor.defs#personalDetailsPref', } + + personalDetailsPref.birthDate = + birthDate instanceof Date ? birthDate.toISOString() : birthDate + return prefs .filter((pref) => !AppBskyActorDefs.isPersonalDetailsPref(pref)) - .concat([personalDetailsPref]) + .concat(personalDetailsPref) }) } async setFeedViewPrefs(feed: string, pref: Partial) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - const existing = prefs.findLast( - (pref) => - AppBskyActorDefs.isFeedViewPref(pref) && - AppBskyActorDefs.validateFeedViewPref(pref).success && - pref.feed === feed, - ) - if (existing) { - pref = { ...existing, ...pref } - } + await this.updatePreferences((prefs) => { + const existing = prefs + .filter(predicate.isValidFeedViewPref) + .findLast((pref) => pref.feed === feed) + return prefs - .filter( - (p) => !AppBskyActorDefs.isFeedViewPref(pref) || p.feed !== feed, - ) - .concat([{ ...pref, $type: 'app.bsky.actor.defs#feedViewPref', feed }]) + .filter((p) => !AppBskyActorDefs.isFeedViewPref(p) || p.feed !== feed) + .concat({ + ...existing, + ...pref, + $type: 'app.bsky.actor.defs#feedViewPref', + feed, + }) }) } async setThreadViewPrefs(pref: Partial) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - const existing = prefs.findLast( - (pref) => - AppBskyActorDefs.isThreadViewPref(pref) && - AppBskyActorDefs.validateThreadViewPref(pref).success, - ) - if (existing) { - pref = { ...existing, ...pref } - } + await this.updatePreferences((prefs) => { + const existing = prefs.findLast(predicate.isValidThreadViewPref) + return prefs .filter((p) => !AppBskyActorDefs.isThreadViewPref(p)) - .concat([{ ...pref, $type: 'app.bsky.actor.defs#threadViewPref' }]) + .concat({ + ...existing, + ...pref, + $type: 'app.bsky.actor.defs#threadViewPref', + }) }) } async setInterestsPref(pref: Partial) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - const existing = prefs.findLast( - (pref) => - AppBskyActorDefs.isInterestsPref(pref) && - AppBskyActorDefs.validateInterestsPref(pref).success, - ) - if (existing) { - pref = { ...existing, ...pref } - } + await this.updatePreferences((prefs) => { + const existing = prefs.findLast(predicate.isValidInterestsPref) + return prefs .filter((p) => !AppBskyActorDefs.isInterestsPref(p)) - .concat([{ ...pref, $type: 'app.bsky.actor.defs#interestsPref' }]) + .concat({ + ...existing, + ...pref, + $type: 'app.bsky.actor.defs#interestsPref', + }) }) } @@ -1155,12 +1048,8 @@ export class Agent extends XrpcClient { if (!sanitizedValue) return - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let mutedWordsPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isMutedWordsPref(pref) && - AppBskyActorDefs.validateMutedWordsPref(pref).success, - ) + await this.updatePreferences((prefs) => { + let mutedWordsPref = prefs.findLast(predicate.isValidMutedWordsPref) const newMutedWord: AppBskyActorDefs.MutedWord = { id: TID.nextStr(), @@ -1170,7 +1059,7 @@ export class Agent extends XrpcClient { expiresAt: mutedWord.expiresAt || undefined, } - if (mutedWordsPref && AppBskyActorDefs.isMutedWordsPref(mutedWordsPref)) { + if (mutedWordsPref) { mutedWordsPref.items.push(newMutedWord) /** @@ -1182,15 +1071,14 @@ export class Agent extends XrpcClient { } else { // if the pref doesn't exist, create it mutedWordsPref = { + $type: 'app.bsky.actor.defs#mutedWordsPref', items: [newMutedWord], } } return prefs .filter((p) => !AppBskyActorDefs.isMutedWordsPref(p)) - .concat([ - { ...mutedWordsPref, $type: 'app.bsky.actor.defs#mutedWordsPref' }, - ]) + .concat(mutedWordsPref) }) } @@ -1217,14 +1105,10 @@ export class Agent extends XrpcClient { * Update a muted word in user preferences. */ async updateMutedWord(mutedWord: AppBskyActorDefs.MutedWord) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - const mutedWordsPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isMutedWordsPref(pref) && - AppBskyActorDefs.validateMutedWordsPref(pref).success, - ) + await this.updatePreferences((prefs) => { + const mutedWordsPref = prefs.findLast(predicate.isValidMutedWordsPref) - if (mutedWordsPref && AppBskyActorDefs.isMutedWordsPref(mutedWordsPref)) { + if (mutedWordsPref) { mutedWordsPref.items = mutedWordsPref.items.map((existingItem) => { const match = matchMutedWord(existingItem, mutedWord) @@ -1255,9 +1139,7 @@ export class Agent extends XrpcClient { return prefs .filter((p) => !AppBskyActorDefs.isMutedWordsPref(p)) - .concat([ - { ...mutedWordsPref, $type: 'app.bsky.actor.defs#mutedWordsPref' }, - ]) + .concat(mutedWordsPref) } return prefs @@ -1268,14 +1150,10 @@ export class Agent extends XrpcClient { * Remove a muted word from user preferences. */ async removeMutedWord(mutedWord: AppBskyActorDefs.MutedWord) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - const mutedWordsPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isMutedWordsPref(pref) && - AppBskyActorDefs.validateMutedWordsPref(pref).success, - ) + await this.updatePreferences((prefs) => { + const mutedWordsPref = prefs.findLast(predicate.isValidMutedWordsPref) - if (mutedWordsPref && AppBskyActorDefs.isMutedWordsPref(mutedWordsPref)) { + if (mutedWordsPref) { for (let i = 0; i < mutedWordsPref.items.length; i++) { const match = matchMutedWord(mutedWordsPref.items[i], mutedWord) @@ -1294,9 +1172,7 @@ export class Agent extends XrpcClient { return prefs .filter((p) => !AppBskyActorDefs.isMutedWordsPref(p)) - .concat([ - { ...mutedWordsPref, $type: 'app.bsky.actor.defs#mutedWordsPref' }, - ]) + .concat(mutedWordsPref) } return prefs @@ -1319,83 +1195,54 @@ export class Agent extends XrpcClient { } async bskyAppQueueNudges(nudges: string | string[]) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let bskyAppStatePref: AppBskyActorDefs.BskyAppStatePref = prefs.findLast( - (pref) => - AppBskyActorDefs.isBskyAppStatePref(pref) && - AppBskyActorDefs.validateBskyAppStatePref(pref).success, - ) + await this.updatePreferences((prefs) => { + const pref = prefs.findLast(predicate.isValidBskyAppStatePref) || { + $type: 'app.bsky.actor.defs#bskyAppStatePref', + } - bskyAppStatePref = bskyAppStatePref || {} - nudges = Array.isArray(nudges) ? nudges : [nudges] - bskyAppStatePref.queuedNudges = ( - bskyAppStatePref.queuedNudges || [] - ).concat(nudges) + pref.queuedNudges = (pref.queuedNudges || []).concat(nudges) return prefs .filter((p) => !AppBskyActorDefs.isBskyAppStatePref(p)) - .concat([ - { - ...bskyAppStatePref, - $type: 'app.bsky.actor.defs#bskyAppStatePref', - }, - ]) + .concat(pref) }) } async bskyAppDismissNudges(nudges: string | string[]) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let bskyAppStatePref: AppBskyActorDefs.BskyAppStatePref = prefs.findLast( - (pref) => - AppBskyActorDefs.isBskyAppStatePref(pref) && - AppBskyActorDefs.validateBskyAppStatePref(pref).success, - ) + await this.updatePreferences((prefs) => { + const pref = prefs.findLast(predicate.isValidBskyAppStatePref) || { + $type: 'app.bsky.actor.defs#bskyAppStatePref', + } - bskyAppStatePref = bskyAppStatePref || {} nudges = Array.isArray(nudges) ? nudges : [nudges] - bskyAppStatePref.queuedNudges = ( - bskyAppStatePref.queuedNudges || [] - ).filter((nudge) => !nudges.includes(nudge)) + pref.queuedNudges = (pref.queuedNudges || []).filter( + (nudge) => !nudges.includes(nudge), + ) return prefs .filter((p) => !AppBskyActorDefs.isBskyAppStatePref(p)) - .concat([ - { - ...bskyAppStatePref, - $type: 'app.bsky.actor.defs#bskyAppStatePref', - }, - ]) + .concat(pref) }) } async bskyAppSetActiveProgressGuide( guide: AppBskyActorDefs.BskyAppProgressGuide | undefined, ) { - if ( - guide && - !AppBskyActorDefs.validateBskyAppProgressGuide(guide).success - ) { - throw new Error('Invalid progress guide') + if (guide) { + const result = AppBskyActorDefs.validateBskyAppProgressGuide(guide) + if (!result.success) throw result.error } - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let bskyAppStatePref: AppBskyActorDefs.BskyAppStatePref = prefs.findLast( - (pref) => - AppBskyActorDefs.isBskyAppStatePref(pref) && - AppBskyActorDefs.validateBskyAppStatePref(pref).success, - ) + await this.updatePreferences((prefs) => { + const pref = prefs.findLast(predicate.isValidBskyAppStatePref) || { + $type: 'app.bsky.actor.defs#bskyAppStatePref', + } - bskyAppStatePref = bskyAppStatePref || {} - bskyAppStatePref.activeProgressGuide = guide + pref.activeProgressGuide = guide return prefs .filter((p) => !AppBskyActorDefs.isBskyAppStatePref(p)) - .concat([ - { - ...bskyAppStatePref, - $type: 'app.bsky.actor.defs#bskyAppStatePref', - }, - ]) + .concat(pref) }) } @@ -1405,17 +1252,14 @@ export class Agent extends XrpcClient { async bskyAppUpsertNux(nux: Nux) { validateNux(nux) - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let bskyAppStatePref: AppBskyActorDefs.BskyAppStatePref = prefs.findLast( - (pref) => - AppBskyActorDefs.isBskyAppStatePref(pref) && - AppBskyActorDefs.validateBskyAppStatePref(pref).success, - ) + await this.updatePreferences((prefs) => { + const pref = prefs.findLast(predicate.isValidBskyAppStatePref) || { + $type: 'app.bsky.actor.defs#bskyAppStatePref', + } - bskyAppStatePref = bskyAppStatePref || {} - bskyAppStatePref.nuxs = bskyAppStatePref.nuxs || [] + pref.nuxs = pref.nuxs || [] - const existing = bskyAppStatePref.nuxs?.find((n) => { + const existing = pref.nuxs?.find((n) => { return n.id === nux.id }) @@ -1433,18 +1277,11 @@ export class Agent extends XrpcClient { } // remove duplicates and append - bskyAppStatePref.nuxs = bskyAppStatePref.nuxs - .filter((n) => n.id !== nux.id) - .concat(next) + pref.nuxs = pref.nuxs.filter((n) => n.id !== nux.id).concat(next) return prefs .filter((p) => !AppBskyActorDefs.isBskyAppStatePref(p)) - .concat([ - { - ...bskyAppStatePref, - $type: 'app.bsky.actor.defs#bskyAppStatePref', - }, - ]) + .concat(pref) }) } @@ -1452,69 +1289,43 @@ export class Agent extends XrpcClient { * Removes NUXs from user preferences. */ async bskyAppRemoveNuxs(ids: string[]) { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let bskyAppStatePref: AppBskyActorDefs.BskyAppStatePref = prefs.findLast( - (pref) => - AppBskyActorDefs.isBskyAppStatePref(pref) && - AppBskyActorDefs.validateBskyAppStatePref(pref).success, - ) + await this.updatePreferences((prefs) => { + const pref = prefs.findLast(predicate.isValidBskyAppStatePref) || { + $type: 'app.bsky.actor.defs#bskyAppStatePref', + } - bskyAppStatePref = bskyAppStatePref || {} - bskyAppStatePref.nuxs = (bskyAppStatePref.nuxs || []).filter((nux) => { - return !ids.includes(nux.id) - }) + pref.nuxs = (pref.nuxs || []).filter((nux) => !ids.includes(nux.id)) return prefs .filter((p) => !AppBskyActorDefs.isBskyAppStatePref(p)) - .concat([ - { - ...bskyAppStatePref, - $type: 'app.bsky.actor.defs#bskyAppStatePref', - }, - ]) + .concat(pref) }) } async setPostInteractionSettings( settings: AppBskyActorDefs.PostInteractionSettingsPref, ) { - if ( - !AppBskyActorDefs.validatePostInteractionSettingsPref(settings).success - ) { - throw new Error('Invalid post interaction settings') - } - - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let prev = prefs.findLast( - (pref) => - AppBskyActorDefs.isPostInteractionSettingsPref(pref) && - AppBskyActorDefs.validatePostInteractionSettingsPref(pref).success, - ) as AppBskyActorDefs.PostInteractionSettingsPref - - if (!prev) { - prev = { - /** - * Matches handling of `threadgate.allow` where `undefined` means "everyone" - */ - threadgateAllowRules: undefined, - postgateEmbeddingRules: undefined, - } + const result = + AppBskyActorDefs.validatePostInteractionSettingsPref(settings) + // Fool-proofing (should not be needed because of type safety) + if (!result.success) throw result.error + + await this.updatePreferences((prefs) => { + const pref = prefs.findLast( + predicate.isValidPostInteractionSettingsPref, + ) || { + $type: 'app.bsky.actor.defs#postInteractionSettingsPref', } /** * Matches handling of `threadgate.allow` where `undefined` means "everyone" */ - prev.threadgateAllowRules = settings.threadgateAllowRules - prev.postgateEmbeddingRules = settings.postgateEmbeddingRules + pref.threadgateAllowRules = settings.threadgateAllowRules + pref.postgateEmbeddingRules = settings.postgateEmbeddingRules return prefs .filter((p) => !AppBskyActorDefs.isPostInteractionSettingsPref(p)) - .concat([ - { - ...prev, - $type: 'app.bsky.actor.defs#postInteractionSettingsPref', - }, - ]) + .concat(pref) }) } @@ -1552,28 +1363,22 @@ export class Agent extends XrpcClient { } private async updateHiddenPost(postUri: string, action: 'hide' | 'unhide') { - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let pref = prefs.findLast( - (pref) => - AppBskyActorDefs.isHiddenPostsPref(pref) && - AppBskyActorDefs.validateHiddenPostsPref(pref).success, - ) - if (pref && AppBskyActorDefs.isHiddenPostsPref(pref)) { - pref.items = - action === 'hide' - ? Array.from(new Set([...pref.items, postUri])) - : pref.items.filter((uri) => uri !== postUri) - } else { - if (action === 'hide') { - pref = { - $type: 'app.bsky.actor.defs#hiddenPostsPref', - items: [postUri], - } - } + await this.updatePreferences((prefs) => { + const pref = prefs.findLast(predicate.isValidHiddenPostsPref) || { + $type: 'app.bsky.actor.defs#hiddenPostsPref', + items: [], } + + const hiddenItems = new Set(pref.items) + + if (action === 'hide') hiddenItems.add(postUri) + else hiddenItems.delete(postUri) + + pref.items = [...hiddenItems] + return prefs - .filter((p) => !AppBskyActorDefs.isInterestsPref(p)) - .concat([{ ...pref, $type: 'app.bsky.actor.defs#hiddenPostsPref' }]) + .filter((p) => !AppBskyActorDefs.isHiddenPostsPref(p)) + .concat(pref) }) } @@ -1587,27 +1392,20 @@ export class Agent extends XrpcClient { ) => { saved: string[]; pinned: string[] }, ): Promise<{ saved: string[]; pinned: string[] }> { let res - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let feedsPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isSavedFeedsPref(pref) && - AppBskyActorDefs.validateSavedFeedsPref(pref).success, - ) as AppBskyActorDefs.SavedFeedsPref | undefined - if (feedsPref) { - res = cb(feedsPref.saved, feedsPref.pinned) - feedsPref.saved = res.saved - feedsPref.pinned = res.pinned - } else { - res = cb([], []) - feedsPref = { - $type: 'app.bsky.actor.defs#savedFeedsPref', - saved: res.saved, - pinned: res.pinned, - } + await this.updatePreferences((prefs) => { + const feedsPref = prefs.findLast(predicate.isValidSavedFeedsPref) || { + $type: 'app.bsky.actor.defs#savedFeedsPref', + saved: [], + pinned: [], } + + res = cb(feedsPref.saved, feedsPref.pinned) + feedsPref.saved = res.saved + feedsPref.pinned = res.pinned + return prefs .filter((pref) => !AppBskyActorDefs.isSavedFeedsPref(pref)) - .concat([feedsPref]) + .concat(feedsPref) }) return res } @@ -1619,36 +1417,24 @@ export class Agent extends XrpcClient { ): Promise { let maybeMutatedSavedFeeds: AppBskyActorDefs.SavedFeed[] = [] - await this.updatePreferences((prefs: AppBskyActorDefs.Preferences) => { - let existingV2Pref = prefs.findLast( - (pref) => - AppBskyActorDefs.isSavedFeedsPrefV2(pref) && - AppBskyActorDefs.validateSavedFeedsPrefV2(pref).success, - ) as AppBskyActorDefs.SavedFeedsPrefV2 | undefined - let existingV1Pref = prefs.findLast( - (pref) => - AppBskyActorDefs.isSavedFeedsPref(pref) && - AppBskyActorDefs.validateSavedFeedsPref(pref).success, - ) as AppBskyActorDefs.SavedFeedsPref | undefined - - if (existingV2Pref) { - maybeMutatedSavedFeeds = cb(existingV2Pref.items) - existingV2Pref = { - ...existingV2Pref, - items: maybeMutatedSavedFeeds, - } - } else { - maybeMutatedSavedFeeds = cb([]) - existingV2Pref = { - $type: 'app.bsky.actor.defs#savedFeedsPrefV2', - items: maybeMutatedSavedFeeds, - } + await this.updatePreferences((prefs) => { + const existingV2Pref = prefs.findLast( + predicate.isValidSavedFeedsPrefV2, + ) || { + $type: 'app.bsky.actor.defs#savedFeedsPrefV2', + items: [], } - // enforce ordering, pinned then saved - const pinned = existingV2Pref.items.filter((i) => i.pinned) - const saved = existingV2Pref.items.filter((i) => !i.pinned) - existingV2Pref.items = pinned.concat(saved) + const newSavedFeeds = cb(existingV2Pref.items) + + // enforce ordering: pinned first, then saved + existingV2Pref.items = [...newSavedFeeds].sort((a, b) => + // @NOTE: preserve order of items with the same pinned status + a.pinned === b.pinned ? 0 : a.pinned ? -1 : 1, + ) + + // Store the return value + maybeMutatedSavedFeeds = newSavedFeeds let updatedPrefs = prefs .filter((pref) => !AppBskyActorDefs.isSavedFeedsPrefV2(pref)) @@ -1659,6 +1445,7 @@ export class Agent extends XrpcClient { * to v2. During the transition period, we double write v2 prefs back to * v1, but NOT the other way around. */ + let existingV1Pref = prefs.findLast(predicate.isValidSavedFeedsPref) if (existingV1Pref) { const { saved, pinned } = existingV1Pref const v2Compat = savedFeedsToUriArrays( @@ -1730,11 +1517,7 @@ function remapLegacyLabels( function prefsArrayToLabelerDids( prefs: AppBskyActorDefs.Preferences, ): string[] { - const labelersPref = prefs.findLast( - (pref) => - AppBskyActorDefs.isLabelersPref(pref) && - AppBskyActorDefs.validateLabelersPref(pref).success, - ) + const labelersPref = prefs.findLast(predicate.isValidLabelersPref) let dids: string[] = [] if (labelersPref) { dids = (labelersPref as AppBskyActorDefs.LabelersPref).labelers.map( diff --git a/packages/api/src/client/index.ts b/packages/api/src/client/index.ts index 5f46b6b277c..691d9cab6cc 100644 --- a/packages/api/src/client/index.ts +++ b/packages/api/src/client/index.ts @@ -2,465 +2,466 @@ * GENERATED CODE - DO NOT MODIFY */ import { XrpcClient, FetchHandler, FetchHandlerOptions } from '@atproto/xrpc' -import { schemas } from './lexicons' +import { schemas } from './lexicons.js' import { CID } from 'multiformats/cid' -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' -import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -import * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' -import * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' -import * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' -import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -import * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -import * as ComAtprotoAdminSearchAccounts from './types/com/atproto/admin/searchAccounts' -import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' -import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' -import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' -import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' -import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' -import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' -import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle' -import * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation' -import * as ComAtprotoIdentitySubmitPlcOperation from './types/com/atproto/identity/submitPlcOperation' -import * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle' -import * as ComAtprotoLabelDefs from './types/com/atproto/label/defs' -import * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels' -import * as ComAtprotoLabelSubscribeLabels from './types/com/atproto/label/subscribeLabels' -import * as ComAtprotoLexiconSchema from './types/com/atproto/lexicon/schema' -import * as ComAtprotoModerationCreateReport from './types/com/atproto/moderation/createReport' -import * as ComAtprotoModerationDefs from './types/com/atproto/moderation/defs' -import * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites' -import * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord' -import * as ComAtprotoRepoDefs from './types/com/atproto/repo/defs' -import * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord' -import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo' -import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord' -import * as ComAtprotoRepoImportRepo from './types/com/atproto/repo/importRepo' -import * as ComAtprotoRepoListMissingBlobs from './types/com/atproto/repo/listMissingBlobs' -import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords' -import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord' -import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef' -import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob' -import * as ComAtprotoServerActivateAccount from './types/com/atproto/server/activateAccount' -import * as ComAtprotoServerCheckAccountStatus from './types/com/atproto/server/checkAccountStatus' -import * as ComAtprotoServerConfirmEmail from './types/com/atproto/server/confirmEmail' -import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount' -import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword' -import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode' -import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes' -import * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession' -import * as ComAtprotoServerDeactivateAccount from './types/com/atproto/server/deactivateAccount' -import * as ComAtprotoServerDefs from './types/com/atproto/server/defs' -import * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount' -import * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession' -import * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer' -import * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes' -import * as ComAtprotoServerGetServiceAuth from './types/com/atproto/server/getServiceAuth' -import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession' -import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords' -import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession' -import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete' -import * as ComAtprotoServerRequestEmailConfirmation from './types/com/atproto/server/requestEmailConfirmation' -import * as ComAtprotoServerRequestEmailUpdate from './types/com/atproto/server/requestEmailUpdate' -import * as ComAtprotoServerRequestPasswordReset from './types/com/atproto/server/requestPasswordReset' -import * as ComAtprotoServerReserveSigningKey from './types/com/atproto/server/reserveSigningKey' -import * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword' -import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword' -import * as ComAtprotoServerUpdateEmail from './types/com/atproto/server/updateEmail' -import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob' -import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks' -import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout' -import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead' -import * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit' -import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord' -import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo' -import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus' -import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs' -import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos' -import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate' -import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl' -import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos' -import * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle' -import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue' -import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels' -import * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification' -import * as AppBskyActorDefs from './types/app/bsky/actor/defs' -import * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences' -import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile' -import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles' -import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions' -import * as AppBskyActorProfile from './types/app/bsky/actor/profile' -import * as AppBskyActorPutPreferences from './types/app/bsky/actor/putPreferences' -import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors' -import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead' -import * as AppBskyEmbedDefs from './types/app/bsky/embed/defs' -import * as AppBskyEmbedExternal from './types/app/bsky/embed/external' -import * as AppBskyEmbedImages from './types/app/bsky/embed/images' -import * as AppBskyEmbedRecord from './types/app/bsky/embed/record' -import * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia' -import * as AppBskyEmbedVideo from './types/app/bsky/embed/video' -import * as AppBskyFeedDefs from './types/app/bsky/feed/defs' -import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator' -import * as AppBskyFeedGenerator from './types/app/bsky/feed/generator' -import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds' -import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes' -import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed' -import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed' -import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator' -import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators' -import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton' -import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes' -import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed' -import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread' -import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts' -import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes' -import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy' -import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds' -import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline' -import * as AppBskyFeedLike from './types/app/bsky/feed/like' -import * as AppBskyFeedPost from './types/app/bsky/feed/post' -import * as AppBskyFeedPostgate from './types/app/bsky/feed/postgate' -import * as AppBskyFeedRepost from './types/app/bsky/feed/repost' -import * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts' -import * as AppBskyFeedSendInteractions from './types/app/bsky/feed/sendInteractions' -import * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate' -import * as AppBskyGraphBlock from './types/app/bsky/graph/block' -import * as AppBskyGraphDefs from './types/app/bsky/graph/defs' -import * as AppBskyGraphFollow from './types/app/bsky/graph/follow' -import * as AppBskyGraphGetActorStarterPacks from './types/app/bsky/graph/getActorStarterPacks' -import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks' -import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers' -import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows' -import * as AppBskyGraphGetKnownFollowers from './types/app/bsky/graph/getKnownFollowers' -import * as AppBskyGraphGetList from './types/app/bsky/graph/getList' -import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks' -import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes' -import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists' -import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes' -import * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships' -import * as AppBskyGraphGetStarterPack from './types/app/bsky/graph/getStarterPack' -import * as AppBskyGraphGetStarterPacks from './types/app/bsky/graph/getStarterPacks' -import * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor' -import * as AppBskyGraphList from './types/app/bsky/graph/list' -import * as AppBskyGraphListblock from './types/app/bsky/graph/listblock' -import * as AppBskyGraphListitem from './types/app/bsky/graph/listitem' -import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor' -import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList' -import * as AppBskyGraphMuteThread from './types/app/bsky/graph/muteThread' -import * as AppBskyGraphSearchStarterPacks from './types/app/bsky/graph/searchStarterPacks' -import * as AppBskyGraphStarterpack from './types/app/bsky/graph/starterpack' -import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor' -import * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList' -import * as AppBskyGraphUnmuteThread from './types/app/bsky/graph/unmuteThread' -import * as AppBskyLabelerDefs from './types/app/bsky/labeler/defs' -import * as AppBskyLabelerGetServices from './types/app/bsky/labeler/getServices' -import * as AppBskyLabelerService from './types/app/bsky/labeler/service' -import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount' -import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications' -import * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' -import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' -import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' -import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet' -import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs' -import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' -import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' -import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton' -import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions' -import * as AppBskyUnspeccedGetTrendingTopics from './types/app/bsky/unspecced/getTrendingTopics' -import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' -import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -import * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton' -import * as AppBskyVideoDefs from './types/app/bsky/video/defs' -import * as AppBskyVideoGetJobStatus from './types/app/bsky/video/getJobStatus' -import * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLimits' -import * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo' -import * as ChatBskyActorDeclaration from './types/chat/bsky/actor/declaration' -import * as ChatBskyActorDefs from './types/chat/bsky/actor/defs' -import * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount' -import * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData' -import * as ChatBskyConvoDefs from './types/chat/bsky/convo/defs' -import * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf' -import * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo' -import * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers' -import * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog' -import * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages' -import * as ChatBskyConvoLeaveConvo from './types/chat/bsky/convo/leaveConvo' -import * as ChatBskyConvoListConvos from './types/chat/bsky/convo/listConvos' -import * as ChatBskyConvoMuteConvo from './types/chat/bsky/convo/muteConvo' -import * as ChatBskyConvoSendMessage from './types/chat/bsky/convo/sendMessage' -import * as ChatBskyConvoSendMessageBatch from './types/chat/bsky/convo/sendMessageBatch' -import * as ChatBskyConvoUnmuteConvo from './types/chat/bsky/convo/unmuteConvo' -import * as ChatBskyConvoUpdateRead from './types/chat/bsky/convo/updateRead' -import * as ChatBskyModerationGetActorMetadata from './types/chat/bsky/moderation/getActorMetadata' -import * as ChatBskyModerationGetMessageContext from './types/chat/bsky/moderation/getMessageContext' -import * as ChatBskyModerationUpdateActorAccess from './types/chat/bsky/moderation/updateActorAccess' -import * as ToolsOzoneCommunicationCreateTemplate from './types/tools/ozone/communication/createTemplate' -import * as ToolsOzoneCommunicationDefs from './types/tools/ozone/communication/defs' -import * as ToolsOzoneCommunicationDeleteTemplate from './types/tools/ozone/communication/deleteTemplate' -import * as ToolsOzoneCommunicationListTemplates from './types/tools/ozone/communication/listTemplates' -import * as ToolsOzoneCommunicationUpdateTemplate from './types/tools/ozone/communication/updateTemplate' -import * as ToolsOzoneModerationDefs from './types/tools/ozone/moderation/defs' -import * as ToolsOzoneModerationEmitEvent from './types/tools/ozone/moderation/emitEvent' -import * as ToolsOzoneModerationGetEvent from './types/tools/ozone/moderation/getEvent' -import * as ToolsOzoneModerationGetRecord from './types/tools/ozone/moderation/getRecord' -import * as ToolsOzoneModerationGetRecords from './types/tools/ozone/moderation/getRecords' -import * as ToolsOzoneModerationGetRepo from './types/tools/ozone/moderation/getRepo' -import * as ToolsOzoneModerationGetRepos from './types/tools/ozone/moderation/getRepos' -import * as ToolsOzoneModerationQueryEvents from './types/tools/ozone/moderation/queryEvents' -import * as ToolsOzoneModerationQueryStatuses from './types/tools/ozone/moderation/queryStatuses' -import * as ToolsOzoneModerationSearchRepos from './types/tools/ozone/moderation/searchRepos' -import * as ToolsOzoneServerGetConfig from './types/tools/ozone/server/getConfig' -import * as ToolsOzoneSetAddValues from './types/tools/ozone/set/addValues' -import * as ToolsOzoneSetDefs from './types/tools/ozone/set/defs' -import * as ToolsOzoneSetDeleteSet from './types/tools/ozone/set/deleteSet' -import * as ToolsOzoneSetDeleteValues from './types/tools/ozone/set/deleteValues' -import * as ToolsOzoneSetGetValues from './types/tools/ozone/set/getValues' -import * as ToolsOzoneSetQuerySets from './types/tools/ozone/set/querySets' -import * as ToolsOzoneSetUpsertSet from './types/tools/ozone/set/upsertSet' -import * as ToolsOzoneSettingDefs from './types/tools/ozone/setting/defs' -import * as ToolsOzoneSettingListOptions from './types/tools/ozone/setting/listOptions' -import * as ToolsOzoneSettingRemoveOptions from './types/tools/ozone/setting/removeOptions' -import * as ToolsOzoneSettingUpsertOption from './types/tools/ozone/setting/upsertOption' -import * as ToolsOzoneSignatureDefs from './types/tools/ozone/signature/defs' -import * as ToolsOzoneSignatureFindCorrelation from './types/tools/ozone/signature/findCorrelation' -import * as ToolsOzoneSignatureFindRelatedAccounts from './types/tools/ozone/signature/findRelatedAccounts' -import * as ToolsOzoneSignatureSearchAccounts from './types/tools/ozone/signature/searchAccounts' -import * as ToolsOzoneTeamAddMember from './types/tools/ozone/team/addMember' -import * as ToolsOzoneTeamDefs from './types/tools/ozone/team/defs' -import * as ToolsOzoneTeamDeleteMember from './types/tools/ozone/team/deleteMember' -import * as ToolsOzoneTeamListMembers from './types/tools/ozone/team/listMembers' -import * as ToolsOzoneTeamUpdateMember from './types/tools/ozone/team/updateMember' - -export * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs' -export * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount' -export * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites' -export * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' -export * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites' -export * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo' -export * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos' -export * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' -export * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus' -export * as ComAtprotoAdminSearchAccounts from './types/com/atproto/admin/searchAccounts' -export * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail' -export * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' -export * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' -export * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword' -export * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus' -export * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials' -export * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature' -export * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle' -export * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation' -export * as ComAtprotoIdentitySubmitPlcOperation from './types/com/atproto/identity/submitPlcOperation' -export * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle' -export * as ComAtprotoLabelDefs from './types/com/atproto/label/defs' -export * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels' -export * as ComAtprotoLabelSubscribeLabels from './types/com/atproto/label/subscribeLabels' -export * as ComAtprotoLexiconSchema from './types/com/atproto/lexicon/schema' -export * as ComAtprotoModerationCreateReport from './types/com/atproto/moderation/createReport' -export * as ComAtprotoModerationDefs from './types/com/atproto/moderation/defs' -export * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites' -export * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord' -export * as ComAtprotoRepoDefs from './types/com/atproto/repo/defs' -export * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord' -export * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo' -export * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord' -export * as ComAtprotoRepoImportRepo from './types/com/atproto/repo/importRepo' -export * as ComAtprotoRepoListMissingBlobs from './types/com/atproto/repo/listMissingBlobs' -export * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords' -export * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord' -export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef' -export * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob' -export * as ComAtprotoServerActivateAccount from './types/com/atproto/server/activateAccount' -export * as ComAtprotoServerCheckAccountStatus from './types/com/atproto/server/checkAccountStatus' -export * as ComAtprotoServerConfirmEmail from './types/com/atproto/server/confirmEmail' -export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount' -export * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword' -export * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode' -export * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes' -export * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession' -export * as ComAtprotoServerDeactivateAccount from './types/com/atproto/server/deactivateAccount' -export * as ComAtprotoServerDefs from './types/com/atproto/server/defs' -export * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount' -export * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession' -export * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer' -export * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes' -export * as ComAtprotoServerGetServiceAuth from './types/com/atproto/server/getServiceAuth' -export * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession' -export * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords' -export * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession' -export * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete' -export * as ComAtprotoServerRequestEmailConfirmation from './types/com/atproto/server/requestEmailConfirmation' -export * as ComAtprotoServerRequestEmailUpdate from './types/com/atproto/server/requestEmailUpdate' -export * as ComAtprotoServerRequestPasswordReset from './types/com/atproto/server/requestPasswordReset' -export * as ComAtprotoServerReserveSigningKey from './types/com/atproto/server/reserveSigningKey' -export * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword' -export * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword' -export * as ComAtprotoServerUpdateEmail from './types/com/atproto/server/updateEmail' -export * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob' -export * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks' -export * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout' -export * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead' -export * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit' -export * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord' -export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo' -export * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus' -export * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs' -export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos' -export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate' -export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl' -export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos' -export * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle' -export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue' -export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels' -export * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification' -export * as AppBskyActorDefs from './types/app/bsky/actor/defs' -export * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences' -export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile' -export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles' -export * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions' -export * as AppBskyActorProfile from './types/app/bsky/actor/profile' -export * as AppBskyActorPutPreferences from './types/app/bsky/actor/putPreferences' -export * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors' -export * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead' -export * as AppBskyEmbedDefs from './types/app/bsky/embed/defs' -export * as AppBskyEmbedExternal from './types/app/bsky/embed/external' -export * as AppBskyEmbedImages from './types/app/bsky/embed/images' -export * as AppBskyEmbedRecord from './types/app/bsky/embed/record' -export * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia' -export * as AppBskyEmbedVideo from './types/app/bsky/embed/video' -export * as AppBskyFeedDefs from './types/app/bsky/feed/defs' -export * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator' -export * as AppBskyFeedGenerator from './types/app/bsky/feed/generator' -export * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds' -export * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes' -export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed' -export * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed' -export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator' -export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators' -export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton' -export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes' -export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed' -export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread' -export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts' -export * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes' -export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy' -export * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds' -export * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline' -export * as AppBskyFeedLike from './types/app/bsky/feed/like' -export * as AppBskyFeedPost from './types/app/bsky/feed/post' -export * as AppBskyFeedPostgate from './types/app/bsky/feed/postgate' -export * as AppBskyFeedRepost from './types/app/bsky/feed/repost' -export * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts' -export * as AppBskyFeedSendInteractions from './types/app/bsky/feed/sendInteractions' -export * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate' -export * as AppBskyGraphBlock from './types/app/bsky/graph/block' -export * as AppBskyGraphDefs from './types/app/bsky/graph/defs' -export * as AppBskyGraphFollow from './types/app/bsky/graph/follow' -export * as AppBskyGraphGetActorStarterPacks from './types/app/bsky/graph/getActorStarterPacks' -export * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks' -export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers' -export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows' -export * as AppBskyGraphGetKnownFollowers from './types/app/bsky/graph/getKnownFollowers' -export * as AppBskyGraphGetList from './types/app/bsky/graph/getList' -export * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks' -export * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes' -export * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists' -export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes' -export * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships' -export * as AppBskyGraphGetStarterPack from './types/app/bsky/graph/getStarterPack' -export * as AppBskyGraphGetStarterPacks from './types/app/bsky/graph/getStarterPacks' -export * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor' -export * as AppBskyGraphList from './types/app/bsky/graph/list' -export * as AppBskyGraphListblock from './types/app/bsky/graph/listblock' -export * as AppBskyGraphListitem from './types/app/bsky/graph/listitem' -export * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor' -export * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList' -export * as AppBskyGraphMuteThread from './types/app/bsky/graph/muteThread' -export * as AppBskyGraphSearchStarterPacks from './types/app/bsky/graph/searchStarterPacks' -export * as AppBskyGraphStarterpack from './types/app/bsky/graph/starterpack' -export * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor' -export * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList' -export * as AppBskyGraphUnmuteThread from './types/app/bsky/graph/unmuteThread' -export * as AppBskyLabelerDefs from './types/app/bsky/labeler/defs' -export * as AppBskyLabelerGetServices from './types/app/bsky/labeler/getServices' -export * as AppBskyLabelerService from './types/app/bsky/labeler/service' -export * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount' -export * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications' -export * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences' -export * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' -export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' -export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet' -export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs' -export * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig' -export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' -export * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton' -export * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions' -export * as AppBskyUnspeccedGetTrendingTopics from './types/app/bsky/unspecced/getTrendingTopics' -export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' -export * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton' -export * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton' -export * as AppBskyVideoDefs from './types/app/bsky/video/defs' -export * as AppBskyVideoGetJobStatus from './types/app/bsky/video/getJobStatus' -export * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLimits' -export * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo' -export * as ChatBskyActorDeclaration from './types/chat/bsky/actor/declaration' -export * as ChatBskyActorDefs from './types/chat/bsky/actor/defs' -export * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount' -export * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData' -export * as ChatBskyConvoDefs from './types/chat/bsky/convo/defs' -export * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf' -export * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo' -export * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers' -export * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog' -export * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages' -export * as ChatBskyConvoLeaveConvo from './types/chat/bsky/convo/leaveConvo' -export * as ChatBskyConvoListConvos from './types/chat/bsky/convo/listConvos' -export * as ChatBskyConvoMuteConvo from './types/chat/bsky/convo/muteConvo' -export * as ChatBskyConvoSendMessage from './types/chat/bsky/convo/sendMessage' -export * as ChatBskyConvoSendMessageBatch from './types/chat/bsky/convo/sendMessageBatch' -export * as ChatBskyConvoUnmuteConvo from './types/chat/bsky/convo/unmuteConvo' -export * as ChatBskyConvoUpdateRead from './types/chat/bsky/convo/updateRead' -export * as ChatBskyModerationGetActorMetadata from './types/chat/bsky/moderation/getActorMetadata' -export * as ChatBskyModerationGetMessageContext from './types/chat/bsky/moderation/getMessageContext' -export * as ChatBskyModerationUpdateActorAccess from './types/chat/bsky/moderation/updateActorAccess' -export * as ToolsOzoneCommunicationCreateTemplate from './types/tools/ozone/communication/createTemplate' -export * as ToolsOzoneCommunicationDefs from './types/tools/ozone/communication/defs' -export * as ToolsOzoneCommunicationDeleteTemplate from './types/tools/ozone/communication/deleteTemplate' -export * as ToolsOzoneCommunicationListTemplates from './types/tools/ozone/communication/listTemplates' -export * as ToolsOzoneCommunicationUpdateTemplate from './types/tools/ozone/communication/updateTemplate' -export * as ToolsOzoneModerationDefs from './types/tools/ozone/moderation/defs' -export * as ToolsOzoneModerationEmitEvent from './types/tools/ozone/moderation/emitEvent' -export * as ToolsOzoneModerationGetEvent from './types/tools/ozone/moderation/getEvent' -export * as ToolsOzoneModerationGetRecord from './types/tools/ozone/moderation/getRecord' -export * as ToolsOzoneModerationGetRecords from './types/tools/ozone/moderation/getRecords' -export * as ToolsOzoneModerationGetRepo from './types/tools/ozone/moderation/getRepo' -export * as ToolsOzoneModerationGetRepos from './types/tools/ozone/moderation/getRepos' -export * as ToolsOzoneModerationQueryEvents from './types/tools/ozone/moderation/queryEvents' -export * as ToolsOzoneModerationQueryStatuses from './types/tools/ozone/moderation/queryStatuses' -export * as ToolsOzoneModerationSearchRepos from './types/tools/ozone/moderation/searchRepos' -export * as ToolsOzoneServerGetConfig from './types/tools/ozone/server/getConfig' -export * as ToolsOzoneSetAddValues from './types/tools/ozone/set/addValues' -export * as ToolsOzoneSetDefs from './types/tools/ozone/set/defs' -export * as ToolsOzoneSetDeleteSet from './types/tools/ozone/set/deleteSet' -export * as ToolsOzoneSetDeleteValues from './types/tools/ozone/set/deleteValues' -export * as ToolsOzoneSetGetValues from './types/tools/ozone/set/getValues' -export * as ToolsOzoneSetQuerySets from './types/tools/ozone/set/querySets' -export * as ToolsOzoneSetUpsertSet from './types/tools/ozone/set/upsertSet' -export * as ToolsOzoneSettingDefs from './types/tools/ozone/setting/defs' -export * as ToolsOzoneSettingListOptions from './types/tools/ozone/setting/listOptions' -export * as ToolsOzoneSettingRemoveOptions from './types/tools/ozone/setting/removeOptions' -export * as ToolsOzoneSettingUpsertOption from './types/tools/ozone/setting/upsertOption' -export * as ToolsOzoneSignatureDefs from './types/tools/ozone/signature/defs' -export * as ToolsOzoneSignatureFindCorrelation from './types/tools/ozone/signature/findCorrelation' -export * as ToolsOzoneSignatureFindRelatedAccounts from './types/tools/ozone/signature/findRelatedAccounts' -export * as ToolsOzoneSignatureSearchAccounts from './types/tools/ozone/signature/searchAccounts' -export * as ToolsOzoneTeamAddMember from './types/tools/ozone/team/addMember' -export * as ToolsOzoneTeamDefs from './types/tools/ozone/team/defs' -export * as ToolsOzoneTeamDeleteMember from './types/tools/ozone/team/deleteMember' -export * as ToolsOzoneTeamListMembers from './types/tools/ozone/team/listMembers' -export * as ToolsOzoneTeamUpdateMember from './types/tools/ozone/team/updateMember' +import { OmitKey, Un$Typed } from './util.js' +import * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs.js' +import * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount.js' +import * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites.js' +import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes.js' +import * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites.js' +import * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo.js' +import * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos.js' +import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes.js' +import * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus.js' +import * as ComAtprotoAdminSearchAccounts from './types/com/atproto/admin/searchAccounts.js' +import * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail.js' +import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail.js' +import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle.js' +import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword.js' +import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus.js' +import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials.js' +import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature.js' +import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle.js' +import * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation.js' +import * as ComAtprotoIdentitySubmitPlcOperation from './types/com/atproto/identity/submitPlcOperation.js' +import * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle.js' +import * as ComAtprotoLabelDefs from './types/com/atproto/label/defs.js' +import * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels.js' +import * as ComAtprotoLabelSubscribeLabels from './types/com/atproto/label/subscribeLabels.js' +import * as ComAtprotoLexiconSchema from './types/com/atproto/lexicon/schema.js' +import * as ComAtprotoModerationCreateReport from './types/com/atproto/moderation/createReport.js' +import * as ComAtprotoModerationDefs from './types/com/atproto/moderation/defs.js' +import * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites.js' +import * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord.js' +import * as ComAtprotoRepoDefs from './types/com/atproto/repo/defs.js' +import * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord.js' +import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo.js' +import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord.js' +import * as ComAtprotoRepoImportRepo from './types/com/atproto/repo/importRepo.js' +import * as ComAtprotoRepoListMissingBlobs from './types/com/atproto/repo/listMissingBlobs.js' +import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords.js' +import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord.js' +import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef.js' +import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob.js' +import * as ComAtprotoServerActivateAccount from './types/com/atproto/server/activateAccount.js' +import * as ComAtprotoServerCheckAccountStatus from './types/com/atproto/server/checkAccountStatus.js' +import * as ComAtprotoServerConfirmEmail from './types/com/atproto/server/confirmEmail.js' +import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount.js' +import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword.js' +import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode.js' +import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes.js' +import * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession.js' +import * as ComAtprotoServerDeactivateAccount from './types/com/atproto/server/deactivateAccount.js' +import * as ComAtprotoServerDefs from './types/com/atproto/server/defs.js' +import * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount.js' +import * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession.js' +import * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer.js' +import * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes.js' +import * as ComAtprotoServerGetServiceAuth from './types/com/atproto/server/getServiceAuth.js' +import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession.js' +import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords.js' +import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession.js' +import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete.js' +import * as ComAtprotoServerRequestEmailConfirmation from './types/com/atproto/server/requestEmailConfirmation.js' +import * as ComAtprotoServerRequestEmailUpdate from './types/com/atproto/server/requestEmailUpdate.js' +import * as ComAtprotoServerRequestPasswordReset from './types/com/atproto/server/requestPasswordReset.js' +import * as ComAtprotoServerReserveSigningKey from './types/com/atproto/server/reserveSigningKey.js' +import * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword.js' +import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword.js' +import * as ComAtprotoServerUpdateEmail from './types/com/atproto/server/updateEmail.js' +import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob.js' +import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks.js' +import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout.js' +import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead.js' +import * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit.js' +import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord.js' +import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js' +import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js' +import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js' +import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js' +import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js' +import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js' +import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js' +import * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle.js' +import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue.js' +import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels.js' +import * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification.js' +import * as AppBskyActorDefs from './types/app/bsky/actor/defs.js' +import * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences.js' +import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile.js' +import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles.js' +import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions.js' +import * as AppBskyActorProfile from './types/app/bsky/actor/profile.js' +import * as AppBskyActorPutPreferences from './types/app/bsky/actor/putPreferences.js' +import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors.js' +import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead.js' +import * as AppBskyEmbedDefs from './types/app/bsky/embed/defs.js' +import * as AppBskyEmbedExternal from './types/app/bsky/embed/external.js' +import * as AppBskyEmbedImages from './types/app/bsky/embed/images.js' +import * as AppBskyEmbedRecord from './types/app/bsky/embed/record.js' +import * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia.js' +import * as AppBskyEmbedVideo from './types/app/bsky/embed/video.js' +import * as AppBskyFeedDefs from './types/app/bsky/feed/defs.js' +import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator.js' +import * as AppBskyFeedGenerator from './types/app/bsky/feed/generator.js' +import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds.js' +import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes.js' +import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed.js' +import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed.js' +import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator.js' +import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators.js' +import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js' +import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js' +import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js' +import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js' +import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js' +import * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js' +import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js' +import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js' +import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline.js' +import * as AppBskyFeedLike from './types/app/bsky/feed/like.js' +import * as AppBskyFeedPost from './types/app/bsky/feed/post.js' +import * as AppBskyFeedPostgate from './types/app/bsky/feed/postgate.js' +import * as AppBskyFeedRepost from './types/app/bsky/feed/repost.js' +import * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts.js' +import * as AppBskyFeedSendInteractions from './types/app/bsky/feed/sendInteractions.js' +import * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate.js' +import * as AppBskyGraphBlock from './types/app/bsky/graph/block.js' +import * as AppBskyGraphDefs from './types/app/bsky/graph/defs.js' +import * as AppBskyGraphFollow from './types/app/bsky/graph/follow.js' +import * as AppBskyGraphGetActorStarterPacks from './types/app/bsky/graph/getActorStarterPacks.js' +import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks.js' +import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers.js' +import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows.js' +import * as AppBskyGraphGetKnownFollowers from './types/app/bsky/graph/getKnownFollowers.js' +import * as AppBskyGraphGetList from './types/app/bsky/graph/getList.js' +import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks.js' +import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes.js' +import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists.js' +import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes.js' +import * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships.js' +import * as AppBskyGraphGetStarterPack from './types/app/bsky/graph/getStarterPack.js' +import * as AppBskyGraphGetStarterPacks from './types/app/bsky/graph/getStarterPacks.js' +import * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor.js' +import * as AppBskyGraphList from './types/app/bsky/graph/list.js' +import * as AppBskyGraphListblock from './types/app/bsky/graph/listblock.js' +import * as AppBskyGraphListitem from './types/app/bsky/graph/listitem.js' +import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor.js' +import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList.js' +import * as AppBskyGraphMuteThread from './types/app/bsky/graph/muteThread.js' +import * as AppBskyGraphSearchStarterPacks from './types/app/bsky/graph/searchStarterPacks.js' +import * as AppBskyGraphStarterpack from './types/app/bsky/graph/starterpack.js' +import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor.js' +import * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList.js' +import * as AppBskyGraphUnmuteThread from './types/app/bsky/graph/unmuteThread.js' +import * as AppBskyLabelerDefs from './types/app/bsky/labeler/defs.js' +import * as AppBskyLabelerGetServices from './types/app/bsky/labeler/getServices.js' +import * as AppBskyLabelerService from './types/app/bsky/labeler/service.js' +import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount.js' +import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications.js' +import * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences.js' +import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush.js' +import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js' +import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js' +import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js' +import * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js' +import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js' +import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton.js' +import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions.js' +import * as AppBskyUnspeccedGetTrendingTopics from './types/app/bsky/unspecced/getTrendingTopics.js' +import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton.js' +import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton.js' +import * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton.js' +import * as AppBskyVideoDefs from './types/app/bsky/video/defs.js' +import * as AppBskyVideoGetJobStatus from './types/app/bsky/video/getJobStatus.js' +import * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLimits.js' +import * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo.js' +import * as ChatBskyActorDeclaration from './types/chat/bsky/actor/declaration.js' +import * as ChatBskyActorDefs from './types/chat/bsky/actor/defs.js' +import * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js' +import * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js' +import * as ChatBskyConvoDefs from './types/chat/bsky/convo/defs.js' +import * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js' +import * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js' +import * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js' +import * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js' +import * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js' +import * as ChatBskyConvoLeaveConvo from './types/chat/bsky/convo/leaveConvo.js' +import * as ChatBskyConvoListConvos from './types/chat/bsky/convo/listConvos.js' +import * as ChatBskyConvoMuteConvo from './types/chat/bsky/convo/muteConvo.js' +import * as ChatBskyConvoSendMessage from './types/chat/bsky/convo/sendMessage.js' +import * as ChatBskyConvoSendMessageBatch from './types/chat/bsky/convo/sendMessageBatch.js' +import * as ChatBskyConvoUnmuteConvo from './types/chat/bsky/convo/unmuteConvo.js' +import * as ChatBskyConvoUpdateRead from './types/chat/bsky/convo/updateRead.js' +import * as ChatBskyModerationGetActorMetadata from './types/chat/bsky/moderation/getActorMetadata.js' +import * as ChatBskyModerationGetMessageContext from './types/chat/bsky/moderation/getMessageContext.js' +import * as ChatBskyModerationUpdateActorAccess from './types/chat/bsky/moderation/updateActorAccess.js' +import * as ToolsOzoneCommunicationCreateTemplate from './types/tools/ozone/communication/createTemplate.js' +import * as ToolsOzoneCommunicationDefs from './types/tools/ozone/communication/defs.js' +import * as ToolsOzoneCommunicationDeleteTemplate from './types/tools/ozone/communication/deleteTemplate.js' +import * as ToolsOzoneCommunicationListTemplates from './types/tools/ozone/communication/listTemplates.js' +import * as ToolsOzoneCommunicationUpdateTemplate from './types/tools/ozone/communication/updateTemplate.js' +import * as ToolsOzoneModerationDefs from './types/tools/ozone/moderation/defs.js' +import * as ToolsOzoneModerationEmitEvent from './types/tools/ozone/moderation/emitEvent.js' +import * as ToolsOzoneModerationGetEvent from './types/tools/ozone/moderation/getEvent.js' +import * as ToolsOzoneModerationGetRecord from './types/tools/ozone/moderation/getRecord.js' +import * as ToolsOzoneModerationGetRecords from './types/tools/ozone/moderation/getRecords.js' +import * as ToolsOzoneModerationGetRepo from './types/tools/ozone/moderation/getRepo.js' +import * as ToolsOzoneModerationGetRepos from './types/tools/ozone/moderation/getRepos.js' +import * as ToolsOzoneModerationQueryEvents from './types/tools/ozone/moderation/queryEvents.js' +import * as ToolsOzoneModerationQueryStatuses from './types/tools/ozone/moderation/queryStatuses.js' +import * as ToolsOzoneModerationSearchRepos from './types/tools/ozone/moderation/searchRepos.js' +import * as ToolsOzoneServerGetConfig from './types/tools/ozone/server/getConfig.js' +import * as ToolsOzoneSetAddValues from './types/tools/ozone/set/addValues.js' +import * as ToolsOzoneSetDefs from './types/tools/ozone/set/defs.js' +import * as ToolsOzoneSetDeleteSet from './types/tools/ozone/set/deleteSet.js' +import * as ToolsOzoneSetDeleteValues from './types/tools/ozone/set/deleteValues.js' +import * as ToolsOzoneSetGetValues from './types/tools/ozone/set/getValues.js' +import * as ToolsOzoneSetQuerySets from './types/tools/ozone/set/querySets.js' +import * as ToolsOzoneSetUpsertSet from './types/tools/ozone/set/upsertSet.js' +import * as ToolsOzoneSettingDefs from './types/tools/ozone/setting/defs.js' +import * as ToolsOzoneSettingListOptions from './types/tools/ozone/setting/listOptions.js' +import * as ToolsOzoneSettingRemoveOptions from './types/tools/ozone/setting/removeOptions.js' +import * as ToolsOzoneSettingUpsertOption from './types/tools/ozone/setting/upsertOption.js' +import * as ToolsOzoneSignatureDefs from './types/tools/ozone/signature/defs.js' +import * as ToolsOzoneSignatureFindCorrelation from './types/tools/ozone/signature/findCorrelation.js' +import * as ToolsOzoneSignatureFindRelatedAccounts from './types/tools/ozone/signature/findRelatedAccounts.js' +import * as ToolsOzoneSignatureSearchAccounts from './types/tools/ozone/signature/searchAccounts.js' +import * as ToolsOzoneTeamAddMember from './types/tools/ozone/team/addMember.js' +import * as ToolsOzoneTeamDefs from './types/tools/ozone/team/defs.js' +import * as ToolsOzoneTeamDeleteMember from './types/tools/ozone/team/deleteMember.js' +import * as ToolsOzoneTeamListMembers from './types/tools/ozone/team/listMembers.js' +import * as ToolsOzoneTeamUpdateMember from './types/tools/ozone/team/updateMember.js' + +export * as ComAtprotoAdminDefs from './types/com/atproto/admin/defs.js' +export * as ComAtprotoAdminDeleteAccount from './types/com/atproto/admin/deleteAccount.js' +export * as ComAtprotoAdminDisableAccountInvites from './types/com/atproto/admin/disableAccountInvites.js' +export * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes.js' +export * as ComAtprotoAdminEnableAccountInvites from './types/com/atproto/admin/enableAccountInvites.js' +export * as ComAtprotoAdminGetAccountInfo from './types/com/atproto/admin/getAccountInfo.js' +export * as ComAtprotoAdminGetAccountInfos from './types/com/atproto/admin/getAccountInfos.js' +export * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes.js' +export * as ComAtprotoAdminGetSubjectStatus from './types/com/atproto/admin/getSubjectStatus.js' +export * as ComAtprotoAdminSearchAccounts from './types/com/atproto/admin/searchAccounts.js' +export * as ComAtprotoAdminSendEmail from './types/com/atproto/admin/sendEmail.js' +export * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail.js' +export * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle.js' +export * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword.js' +export * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus.js' +export * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials.js' +export * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature.js' +export * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle.js' +export * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation.js' +export * as ComAtprotoIdentitySubmitPlcOperation from './types/com/atproto/identity/submitPlcOperation.js' +export * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle.js' +export * as ComAtprotoLabelDefs from './types/com/atproto/label/defs.js' +export * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels.js' +export * as ComAtprotoLabelSubscribeLabels from './types/com/atproto/label/subscribeLabels.js' +export * as ComAtprotoLexiconSchema from './types/com/atproto/lexicon/schema.js' +export * as ComAtprotoModerationCreateReport from './types/com/atproto/moderation/createReport.js' +export * as ComAtprotoModerationDefs from './types/com/atproto/moderation/defs.js' +export * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites.js' +export * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord.js' +export * as ComAtprotoRepoDefs from './types/com/atproto/repo/defs.js' +export * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord.js' +export * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo.js' +export * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord.js' +export * as ComAtprotoRepoImportRepo from './types/com/atproto/repo/importRepo.js' +export * as ComAtprotoRepoListMissingBlobs from './types/com/atproto/repo/listMissingBlobs.js' +export * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords.js' +export * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord.js' +export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef.js' +export * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob.js' +export * as ComAtprotoServerActivateAccount from './types/com/atproto/server/activateAccount.js' +export * as ComAtprotoServerCheckAccountStatus from './types/com/atproto/server/checkAccountStatus.js' +export * as ComAtprotoServerConfirmEmail from './types/com/atproto/server/confirmEmail.js' +export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount.js' +export * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword.js' +export * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode.js' +export * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes.js' +export * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession.js' +export * as ComAtprotoServerDeactivateAccount from './types/com/atproto/server/deactivateAccount.js' +export * as ComAtprotoServerDefs from './types/com/atproto/server/defs.js' +export * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount.js' +export * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession.js' +export * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer.js' +export * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes.js' +export * as ComAtprotoServerGetServiceAuth from './types/com/atproto/server/getServiceAuth.js' +export * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession.js' +export * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords.js' +export * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession.js' +export * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete.js' +export * as ComAtprotoServerRequestEmailConfirmation from './types/com/atproto/server/requestEmailConfirmation.js' +export * as ComAtprotoServerRequestEmailUpdate from './types/com/atproto/server/requestEmailUpdate.js' +export * as ComAtprotoServerRequestPasswordReset from './types/com/atproto/server/requestPasswordReset.js' +export * as ComAtprotoServerReserveSigningKey from './types/com/atproto/server/reserveSigningKey.js' +export * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword.js' +export * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword.js' +export * as ComAtprotoServerUpdateEmail from './types/com/atproto/server/updateEmail.js' +export * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob.js' +export * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks.js' +export * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout.js' +export * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead.js' +export * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit.js' +export * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord.js' +export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js' +export * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js' +export * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js' +export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js' +export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js' +export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl.js' +export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos.js' +export * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle.js' +export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue.js' +export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels.js' +export * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification.js' +export * as AppBskyActorDefs from './types/app/bsky/actor/defs.js' +export * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences.js' +export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile.js' +export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles.js' +export * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions.js' +export * as AppBskyActorProfile from './types/app/bsky/actor/profile.js' +export * as AppBskyActorPutPreferences from './types/app/bsky/actor/putPreferences.js' +export * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors.js' +export * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead.js' +export * as AppBskyEmbedDefs from './types/app/bsky/embed/defs.js' +export * as AppBskyEmbedExternal from './types/app/bsky/embed/external.js' +export * as AppBskyEmbedImages from './types/app/bsky/embed/images.js' +export * as AppBskyEmbedRecord from './types/app/bsky/embed/record.js' +export * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia.js' +export * as AppBskyEmbedVideo from './types/app/bsky/embed/video.js' +export * as AppBskyFeedDefs from './types/app/bsky/feed/defs.js' +export * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator.js' +export * as AppBskyFeedGenerator from './types/app/bsky/feed/generator.js' +export * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds.js' +export * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes.js' +export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed.js' +export * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed.js' +export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator.js' +export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators.js' +export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton.js' +export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes.js' +export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed.js' +export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread.js' +export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.js' +export * as AppBskyFeedGetQuotes from './types/app/bsky/feed/getQuotes.js' +export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy.js' +export * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds.js' +export * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline.js' +export * as AppBskyFeedLike from './types/app/bsky/feed/like.js' +export * as AppBskyFeedPost from './types/app/bsky/feed/post.js' +export * as AppBskyFeedPostgate from './types/app/bsky/feed/postgate.js' +export * as AppBskyFeedRepost from './types/app/bsky/feed/repost.js' +export * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts.js' +export * as AppBskyFeedSendInteractions from './types/app/bsky/feed/sendInteractions.js' +export * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate.js' +export * as AppBskyGraphBlock from './types/app/bsky/graph/block.js' +export * as AppBskyGraphDefs from './types/app/bsky/graph/defs.js' +export * as AppBskyGraphFollow from './types/app/bsky/graph/follow.js' +export * as AppBskyGraphGetActorStarterPacks from './types/app/bsky/graph/getActorStarterPacks.js' +export * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks.js' +export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers.js' +export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows.js' +export * as AppBskyGraphGetKnownFollowers from './types/app/bsky/graph/getKnownFollowers.js' +export * as AppBskyGraphGetList from './types/app/bsky/graph/getList.js' +export * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks.js' +export * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes.js' +export * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists.js' +export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes.js' +export * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships.js' +export * as AppBskyGraphGetStarterPack from './types/app/bsky/graph/getStarterPack.js' +export * as AppBskyGraphGetStarterPacks from './types/app/bsky/graph/getStarterPacks.js' +export * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor.js' +export * as AppBskyGraphList from './types/app/bsky/graph/list.js' +export * as AppBskyGraphListblock from './types/app/bsky/graph/listblock.js' +export * as AppBskyGraphListitem from './types/app/bsky/graph/listitem.js' +export * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor.js' +export * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList.js' +export * as AppBskyGraphMuteThread from './types/app/bsky/graph/muteThread.js' +export * as AppBskyGraphSearchStarterPacks from './types/app/bsky/graph/searchStarterPacks.js' +export * as AppBskyGraphStarterpack from './types/app/bsky/graph/starterpack.js' +export * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor.js' +export * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList.js' +export * as AppBskyGraphUnmuteThread from './types/app/bsky/graph/unmuteThread.js' +export * as AppBskyLabelerDefs from './types/app/bsky/labeler/defs.js' +export * as AppBskyLabelerGetServices from './types/app/bsky/labeler/getServices.js' +export * as AppBskyLabelerService from './types/app/bsky/labeler/service.js' +export * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount.js' +export * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications.js' +export * as AppBskyNotificationPutPreferences from './types/app/bsky/notification/putPreferences.js' +export * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush.js' +export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen.js' +export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet.js' +export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs.js' +export * as AppBskyUnspeccedGetConfig from './types/app/bsky/unspecced/getConfig.js' +export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators.js' +export * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspecced/getSuggestionsSkeleton.js' +export * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions.js' +export * as AppBskyUnspeccedGetTrendingTopics from './types/app/bsky/unspecced/getTrendingTopics.js' +export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton.js' +export * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton.js' +export * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton.js' +export * as AppBskyVideoDefs from './types/app/bsky/video/defs.js' +export * as AppBskyVideoGetJobStatus from './types/app/bsky/video/getJobStatus.js' +export * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLimits.js' +export * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo.js' +export * as ChatBskyActorDeclaration from './types/chat/bsky/actor/declaration.js' +export * as ChatBskyActorDefs from './types/chat/bsky/actor/defs.js' +export * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js' +export * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js' +export * as ChatBskyConvoDefs from './types/chat/bsky/convo/defs.js' +export * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js' +export * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js' +export * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js' +export * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js' +export * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js' +export * as ChatBskyConvoLeaveConvo from './types/chat/bsky/convo/leaveConvo.js' +export * as ChatBskyConvoListConvos from './types/chat/bsky/convo/listConvos.js' +export * as ChatBskyConvoMuteConvo from './types/chat/bsky/convo/muteConvo.js' +export * as ChatBskyConvoSendMessage from './types/chat/bsky/convo/sendMessage.js' +export * as ChatBskyConvoSendMessageBatch from './types/chat/bsky/convo/sendMessageBatch.js' +export * as ChatBskyConvoUnmuteConvo from './types/chat/bsky/convo/unmuteConvo.js' +export * as ChatBskyConvoUpdateRead from './types/chat/bsky/convo/updateRead.js' +export * as ChatBskyModerationGetActorMetadata from './types/chat/bsky/moderation/getActorMetadata.js' +export * as ChatBskyModerationGetMessageContext from './types/chat/bsky/moderation/getMessageContext.js' +export * as ChatBskyModerationUpdateActorAccess from './types/chat/bsky/moderation/updateActorAccess.js' +export * as ToolsOzoneCommunicationCreateTemplate from './types/tools/ozone/communication/createTemplate.js' +export * as ToolsOzoneCommunicationDefs from './types/tools/ozone/communication/defs.js' +export * as ToolsOzoneCommunicationDeleteTemplate from './types/tools/ozone/communication/deleteTemplate.js' +export * as ToolsOzoneCommunicationListTemplates from './types/tools/ozone/communication/listTemplates.js' +export * as ToolsOzoneCommunicationUpdateTemplate from './types/tools/ozone/communication/updateTemplate.js' +export * as ToolsOzoneModerationDefs from './types/tools/ozone/moderation/defs.js' +export * as ToolsOzoneModerationEmitEvent from './types/tools/ozone/moderation/emitEvent.js' +export * as ToolsOzoneModerationGetEvent from './types/tools/ozone/moderation/getEvent.js' +export * as ToolsOzoneModerationGetRecord from './types/tools/ozone/moderation/getRecord.js' +export * as ToolsOzoneModerationGetRecords from './types/tools/ozone/moderation/getRecords.js' +export * as ToolsOzoneModerationGetRepo from './types/tools/ozone/moderation/getRepo.js' +export * as ToolsOzoneModerationGetRepos from './types/tools/ozone/moderation/getRepos.js' +export * as ToolsOzoneModerationQueryEvents from './types/tools/ozone/moderation/queryEvents.js' +export * as ToolsOzoneModerationQueryStatuses from './types/tools/ozone/moderation/queryStatuses.js' +export * as ToolsOzoneModerationSearchRepos from './types/tools/ozone/moderation/searchRepos.js' +export * as ToolsOzoneServerGetConfig from './types/tools/ozone/server/getConfig.js' +export * as ToolsOzoneSetAddValues from './types/tools/ozone/set/addValues.js' +export * as ToolsOzoneSetDefs from './types/tools/ozone/set/defs.js' +export * as ToolsOzoneSetDeleteSet from './types/tools/ozone/set/deleteSet.js' +export * as ToolsOzoneSetDeleteValues from './types/tools/ozone/set/deleteValues.js' +export * as ToolsOzoneSetGetValues from './types/tools/ozone/set/getValues.js' +export * as ToolsOzoneSetQuerySets from './types/tools/ozone/set/querySets.js' +export * as ToolsOzoneSetUpsertSet from './types/tools/ozone/set/upsertSet.js' +export * as ToolsOzoneSettingDefs from './types/tools/ozone/setting/defs.js' +export * as ToolsOzoneSettingListOptions from './types/tools/ozone/setting/listOptions.js' +export * as ToolsOzoneSettingRemoveOptions from './types/tools/ozone/setting/removeOptions.js' +export * as ToolsOzoneSettingUpsertOption from './types/tools/ozone/setting/upsertOption.js' +export * as ToolsOzoneSignatureDefs from './types/tools/ozone/signature/defs.js' +export * as ToolsOzoneSignatureFindCorrelation from './types/tools/ozone/signature/findCorrelation.js' +export * as ToolsOzoneSignatureFindRelatedAccounts from './types/tools/ozone/signature/findRelatedAccounts.js' +export * as ToolsOzoneSignatureSearchAccounts from './types/tools/ozone/signature/searchAccounts.js' +export * as ToolsOzoneTeamAddMember from './types/tools/ozone/team/addMember.js' +export * as ToolsOzoneTeamDefs from './types/tools/ozone/team/defs.js' +export * as ToolsOzoneTeamDeleteMember from './types/tools/ozone/team/deleteMember.js' +export * as ToolsOzoneTeamListMembers from './types/tools/ozone/team/listMembers.js' +export * as ToolsOzoneTeamUpdateMember from './types/tools/ozone/team/updateMember.js' export const COM_ATPROTO_MODERATION = { DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', @@ -854,7 +855,7 @@ export class SchemaRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: ComAtprotoLexiconSchema.Record }[] @@ -867,7 +868,7 @@ export class SchemaRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -881,25 +882,25 @@ export class SchemaRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: ComAtprotoLexiconSchema.Record, + record: Un$Typed, headers?: Record, ): Promise<{ uri: string; cid: string }> { - record.$type = 'com.atproto.lexicon.schema' + const collection = 'com.atproto.lexicon.schema' const res = await this._client.call( 'com.atproto.repo.createRecord', undefined, - { collection: 'com.atproto.lexicon.schema', ...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( @@ -1689,7 +1690,7 @@ export class ProfileRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyActorProfile.Record }[] @@ -1702,7 +1703,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', @@ -1712,25 +1713,30 @@ export class ProfileRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyActorProfile.Record, + record: Un$Typed, 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( @@ -1972,7 +1978,7 @@ export class GeneratorRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedGenerator.Record }[] @@ -1985,7 +1991,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', @@ -1995,25 +2001,25 @@ export class GeneratorRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyFeedGenerator.Record, + record: Un$Typed, 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( @@ -2033,7 +2039,7 @@ export class LikeRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedLike.Record }[] @@ -2046,7 +2052,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', @@ -2056,25 +2062,25 @@ export class LikeRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyFeedLike.Record, + record: Un$Typed, 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( @@ -2094,7 +2100,7 @@ export class PostRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedPost.Record }[] @@ -2107,7 +2113,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', @@ -2117,25 +2123,25 @@ export class PostRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyFeedPost.Record, + record: Un$Typed, 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( @@ -2155,7 +2161,7 @@ export class PostgateRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedPostgate.Record }[] @@ -2168,7 +2174,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', @@ -2178,25 +2184,25 @@ export class PostgateRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyFeedPostgate.Record, + record: Un$Typed, 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( @@ -2216,7 +2222,7 @@ export class RepostRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedRepost.Record }[] @@ -2229,7 +2235,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', @@ -2239,25 +2245,25 @@ export class RepostRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyFeedRepost.Record, + record: Un$Typed, 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( @@ -2277,7 +2283,7 @@ export class ThreadgateRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyFeedThreadgate.Record }[] @@ -2290,7 +2296,7 @@ export class ThreadgateRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2304,25 +2310,25 @@ export class ThreadgateRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyFeedThreadgate.Record, + record: Un$Typed, 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( @@ -2583,7 +2589,7 @@ export class BlockRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphBlock.Record }[] @@ -2596,7 +2602,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', @@ -2606,25 +2612,25 @@ export class BlockRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyGraphBlock.Record, + record: Un$Typed, 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( @@ -2644,7 +2650,7 @@ export class FollowRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphFollow.Record }[] @@ -2657,7 +2663,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', @@ -2667,25 +2673,25 @@ export class FollowRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyGraphFollow.Record, + record: Un$Typed, 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( @@ -2705,7 +2711,7 @@ export class ListRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphList.Record }[] @@ -2718,7 +2724,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', @@ -2728,25 +2734,25 @@ export class ListRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyGraphList.Record, + record: Un$Typed, 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( @@ -2766,7 +2772,7 @@ export class ListblockRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphListblock.Record }[] @@ -2779,7 +2785,7 @@ export class ListblockRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2793,25 +2799,25 @@ export class ListblockRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyGraphListblock.Record, + record: Un$Typed, 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( @@ -2831,7 +2837,7 @@ export class ListitemRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphListitem.Record }[] @@ -2844,7 +2850,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', @@ -2854,25 +2860,25 @@ export class ListitemRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyGraphListitem.Record, + record: Un$Typed, 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( @@ -2892,7 +2898,7 @@ export class StarterpackRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyGraphStarterpack.Record }[] @@ -2905,7 +2911,7 @@ export class StarterpackRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -2919,25 +2925,25 @@ export class StarterpackRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyGraphStarterpack.Record, + record: Un$Typed, 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( @@ -2979,7 +2985,7 @@ export class ServiceRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: AppBskyLabelerService.Record }[] @@ -2992,7 +2998,7 @@ export class ServiceRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -3006,22 +3012,22 @@ export class ServiceRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: AppBskyLabelerService.Record, + record: Un$Typed, 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 }, ) @@ -3029,7 +3035,7 @@ export class ServiceRecord { } async delete( - params: Omit, + params: OmitKey, headers?: Record, ): Promise { await this._client.call( @@ -3328,7 +3334,7 @@ export class DeclarationRecord { } async list( - params: Omit, + params: OmitKey, ): Promise<{ cursor?: string records: { uri: string; value: ChatBskyActorDeclaration.Record }[] @@ -3341,7 +3347,7 @@ export class DeclarationRecord { } async get( - params: Omit, + params: OmitKey, ): Promise<{ uri: string cid: string @@ -3355,22 +3361,22 @@ export class DeclarationRecord { } async create( - params: Omit< + params: OmitKey< ComAtprotoRepoCreateRecord.InputSchema, 'collection' | 'record' >, - record: ChatBskyActorDeclaration.Record, + record: Un$Typed, 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 }, ) @@ -3378,7 +3384,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 6e709774761..c2bfa933c42 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -1,7 +1,13 @@ /** * GENERATED CODE - DO NOT MODIFY */ -import { LexiconDoc, Lexicons } from '@atproto/lexicon' +import { + LexiconDoc, + Lexicons, + ValidationError, + ValidationResult, +} from '@atproto/lexicon' +import { $Typed, is$typed, maybe$typed } from './util.js' export const schemaDict = { ComAtprotoAdminDefs: { @@ -13871,8 +13877,37 @@ export const schemaDict = { }, } as const satisfies Record -export const schemas = Object.values(schemaDict) +export const schemas = Object.values(schemaDict) satisfies LexiconDoc[] export const lexicons: Lexicons = new Lexicons(schemas) + +export function validate( + v: unknown, + id: string, + hash: string, + requiredType: true, +): ValidationResult +export function validate( + v: unknown, + id: string, + hash: string, + requiredType?: false, +): ValidationResult +export function validate( + v: unknown, + id: string, + hash: string, + requiredType?: boolean, +): ValidationResult { + return (requiredType ? is$typed : maybe$typed)(v, id, hash) + ? lexicons.validate(`${id}#${hash}`, v) + : { + success: false, + error: new ValidationError( + `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`, + ), + } +} + export const ids = { ComAtprotoAdminDefs: 'com.atproto.admin.defs', ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount', @@ -14124,4 +14159,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 84234ed2d08..d905d955114 100644 --- a/packages/api/src/client/types/app/bsky/actor/defs.ts +++ b/packages/api/src/client/types/app/bsky/actor/defs.ts @@ -2,16 +2,21 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' -import * as AppBskyGraphDefs from '../graph/defs' -import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' -import * as AppBskyFeedThreadgate from '../feed/threadgate' -import * as AppBskyFeedPostgate from '../feed/postgate' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyGraphDefs from '../graph/defs.js' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' +import type * as AppBskyFeedThreadgate from '../feed/threadgate.js' +import type * as AppBskyFeedPostgate from '../feed/postgate.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.defs' export interface ProfileViewBasic { + $type?: 'app.bsky.actor.defs#profileViewBasic' did: string handle: string displayName?: string @@ -20,22 +25,20 @@ 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' - ) +const hashProfileViewBasic = 'profileViewBasic' + +export function isProfileViewBasic(v: V) { + return is$typed(v, id, hashProfileViewBasic) } -export function validateProfileViewBasic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileViewBasic', v) +export function validateProfileViewBasic(v: V) { + return validate(v, id, hashProfileViewBasic) } export interface ProfileView { + $type?: 'app.bsky.actor.defs#profileView' did: string handle: string displayName?: string @@ -46,22 +49,20 @@ 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' - ) +const hashProfileView = 'profileView' + +export function isProfileView(v: V) { + return is$typed(v, id, hashProfileView) } -export function validateProfileView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileView', v) +export function validateProfileView(v: V) { + return validate(v, id, hashProfileView) } export interface ProfileViewDetailed { + $type?: 'app.bsky.actor.defs#profileViewDetailed' did: string handle: string displayName?: string @@ -78,63 +79,55 @@ 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' - ) +const hashProfileViewDetailed = 'profileViewDetailed' + +export function isProfileViewDetailed(v: V) { + return is$typed(v, id, hashProfileViewDetailed) } -export function validateProfileViewDetailed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v) +export function validateProfileViewDetailed(v: V) { + return validate(v, id, hashProfileViewDetailed) } 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' - ) +const hashProfileAssociated = 'profileAssociated' + +export function isProfileAssociated(v: V) { + return is$typed(v, id, hashProfileAssociated) } -export function validateProfileAssociated(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileAssociated', v) +export function validateProfileAssociated(v: V) { + return validate(v, id, hashProfileAssociated) } 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 { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#profileAssociatedChat' - ) +const hashProfileAssociatedChat = 'profileAssociatedChat' + +export function isProfileAssociatedChat(v: V) { + return is$typed(v, id, hashProfileAssociatedChat) } -export function validateProfileAssociatedChat(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#profileAssociatedChat', v) +export function validateProfileAssociatedChat(v: V) { + return validate(v, id, hashProfileAssociatedChat) } /** 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 @@ -143,169 +136,153 @@ 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' - ) +const hashViewerState = 'viewerState' + +export function isViewerState(v: V) { + return is$typed(v, id, hashViewerState) } -export function validateViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#viewerState', v) +export function validateViewerState(v: V) { + return validate(v, id, hashViewerState) } /** 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' - ) +const hashKnownFollowers = 'knownFollowers' + +export function isKnownFollowers(v: V) { + return is$typed(v, id, hashKnownFollowers) } -export function validateKnownFollowers(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#knownFollowers', v) +export function validateKnownFollowers(v: V) { + return validate(v, id, hashKnownFollowers) } export type Preferences = ( - | AdultContentPref - | ContentLabelPref - | SavedFeedsPref - | SavedFeedsPrefV2 - | PersonalDetailsPref - | FeedViewPref - | ThreadViewPref - | InterestsPref - | MutedWordsPref - | HiddenPostsPref - | BskyAppStatePref - | LabelersPref - | PostInteractionSettingsPref - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } )[] 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' - ) +const hashAdultContentPref = 'adultContentPref' + +export function isAdultContentPref(v: V) { + return is$typed(v, id, hashAdultContentPref) } -export function validateAdultContentPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#adultContentPref', v) +export function validateAdultContentPref(v: V) { + return validate(v, id, hashAdultContentPref) } 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' - ) +const hashContentLabelPref = 'contentLabelPref' + +export function isContentLabelPref(v: V) { + return is$typed(v, id, hashContentLabelPref) } -export function validateContentLabelPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v) +export function validateContentLabelPref(v: V) { + return validate(v, id, hashContentLabelPref) } 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' - ) +const hashSavedFeed = 'savedFeed' + +export function isSavedFeed(v: V) { + return is$typed(v, id, hashSavedFeed) } -export function validateSavedFeed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#savedFeed', v) +export function validateSavedFeed(v: V) { + return validate(v, id, hashSavedFeed) } 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' - ) +const hashSavedFeedsPrefV2 = 'savedFeedsPrefV2' + +export function isSavedFeedsPrefV2(v: V) { + return is$typed(v, id, hashSavedFeedsPrefV2) } -export function validateSavedFeedsPrefV2(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#savedFeedsPrefV2', v) +export function validateSavedFeedsPrefV2(v: V) { + return validate(v, id, hashSavedFeedsPrefV2) } 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' - ) +const hashSavedFeedsPref = 'savedFeedsPref' + +export function isSavedFeedsPref(v: V) { + return is$typed(v, id, hashSavedFeedsPref) } -export function validateSavedFeedsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#savedFeedsPref', v) +export function validateSavedFeedsPref(v: V) { + return validate(v, id, hashSavedFeedsPref) } 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' - ) +const hashPersonalDetailsPref = 'personalDetailsPref' + +export function isPersonalDetailsPref(v: V) { + return is$typed(v, id, hashPersonalDetailsPref) } -export function validatePersonalDetailsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#personalDetailsPref', v) +export function validatePersonalDetailsPref(v: V) { + return validate(v, id, hashPersonalDetailsPref) } 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. */ @@ -318,22 +295,20 @@ 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' - ) +const hashFeedViewPref = 'feedViewPref' + +export function isFeedViewPref(v: V) { + return is$typed(v, id, hashFeedViewPref) } -export function validateFeedViewPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#feedViewPref', v) +export function validateFeedViewPref(v: V) { + return validate(v, id, hashFeedViewPref) } export interface ThreadViewPref { + $type?: 'app.bsky.actor.defs#threadViewPref' /** Sorting mode for threads. */ sort?: | 'oldest' @@ -344,43 +319,39 @@ export interface ThreadViewPref { | (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' - ) +const hashThreadViewPref = 'threadViewPref' + +export function isThreadViewPref(v: V) { + return is$typed(v, id, hashThreadViewPref) } -export function validateThreadViewPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#threadViewPref', v) +export function validateThreadViewPref(v: V) { + return validate(v, id, hashThreadViewPref) } 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' - ) +const hashInterestsPref = 'interestsPref' + +export function isInterestsPref(v: V) { + return is$typed(v, id, hashInterestsPref) } -export function validateInterestsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#interestsPref', v) +export function validateInterestsPref(v: V) { + return validate(v, id, hashInterestsPref) } 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 @@ -390,182 +361,165 @@ 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' - ) +const hashMutedWord = 'mutedWord' + +export function isMutedWord(v: V) { + return is$typed(v, id, hashMutedWord) } -export function validateMutedWord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#mutedWord', v) +export function validateMutedWord(v: V) { + return validate(v, id, hashMutedWord) } 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' - ) +const hashMutedWordsPref = 'mutedWordsPref' + +export function isMutedWordsPref(v: V) { + return is$typed(v, id, hashMutedWordsPref) } -export function validateMutedWordsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#mutedWordsPref', v) +export function validateMutedWordsPref(v: V) { + return validate(v, id, hashMutedWordsPref) } 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' - ) +const hashHiddenPostsPref = 'hiddenPostsPref' + +export function isHiddenPostsPref(v: V) { + return is$typed(v, id, hashHiddenPostsPref) } -export function validateHiddenPostsPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#hiddenPostsPref', v) +export function validateHiddenPostsPref(v: V) { + return validate(v, id, hashHiddenPostsPref) } 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' - ) +const hashLabelersPref = 'labelersPref' + +export function isLabelersPref(v: V) { + return is$typed(v, id, hashLabelersPref) } -export function validateLabelersPref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#labelersPref', v) +export function validateLabelersPref(v: V) { + return validate(v, id, hashLabelersPref) } 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' - ) +const hashLabelerPrefItem = 'labelerPrefItem' + +export function isLabelerPrefItem(v: V) { + return is$typed(v, id, hashLabelerPrefItem) } -export function validateLabelerPrefItem(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#labelerPrefItem', v) +export function validateLabelerPrefItem(v: V) { + return validate(v, id, hashLabelerPrefItem) } /** 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' - ) +const hashBskyAppStatePref = 'bskyAppStatePref' + +export function isBskyAppStatePref(v: V) { + return is$typed(v, id, hashBskyAppStatePref) } -export function validateBskyAppStatePref(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#bskyAppStatePref', v) +export function validateBskyAppStatePref(v: V) { + return validate(v, id, hashBskyAppStatePref) } /** 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' - ) +const hashBskyAppProgressGuide = 'bskyAppProgressGuide' + +export function isBskyAppProgressGuide(v: V) { + return is$typed(v, id, hashBskyAppProgressGuide) } -export function validateBskyAppProgressGuide(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#bskyAppProgressGuide', v) +export function validateBskyAppProgressGuide(v: V) { + return validate(v, id, hashBskyAppProgressGuide) } /** 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' - ) +const hashNux = 'nux' + +export function isNux(v: V) { + return is$typed(v, id, hashNux) } -export function validateNux(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#nux', v) +export function validateNux(v: V) { + return validate(v, id, hashNux) } /** Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. */ export interface PostInteractionSettingsPref { + $type?: 'app.bsky.actor.defs#postInteractionSettingsPref' /** Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. */ threadgateAllowRules?: ( - | AppBskyFeedThreadgate.MentionRule - | AppBskyFeedThreadgate.FollowerRule - | AppBskyFeedThreadgate.FollowingRule - | AppBskyFeedThreadgate.ListRule - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } )[] /** Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */ postgateEmbeddingRules?: ( - | AppBskyFeedPostgate.DisableRule - | { $type: string; [k: string]: unknown } + | $Typed + | { $type: string } )[] - [k: string]: unknown } -export function isPostInteractionSettingsPref( - v: unknown, -): v is PostInteractionSettingsPref { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.actor.defs#postInteractionSettingsPref' - ) +const hashPostInteractionSettingsPref = 'postInteractionSettingsPref' + +export function isPostInteractionSettingsPref(v: V) { + return is$typed(v, id, hashPostInteractionSettingsPref) } -export function validatePostInteractionSettingsPref( - v: unknown, -): ValidationResult { - return lexicons.validate('app.bsky.actor.defs#postInteractionSettingsPref', v) +export function validatePostInteractionSettingsPref(v: V) { + return validate( + v, + id, + hashPostInteractionSettingsPref, + ) } 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..93d459356af 100644 --- a/packages/api/src/client/types/app/bsky/actor/getPreferences.ts +++ b/packages/api/src/client/types/app/bsky/actor/getPreferences.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.getPreferences' export interface QueryParams {} @@ -14,7 +18,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..89a28a6e77d 100644 --- a/packages/api/src/client/types/app/bsky/actor/getProfile.ts +++ b/packages/api/src/client/types/app/bsky/actor/getProfile.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.getProfile' export interface QueryParams { /** Handle or DID of account to fetch profile of. */ 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..1c8cd6d9e68 100644 --- a/packages/api/src/client/types/app/bsky/actor/getProfiles.ts +++ b/packages/api/src/client/types/app/bsky/actor/getProfiles.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.getProfiles' export interface QueryParams { actors: string[] @@ -16,7 +20,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 4bce936a4dd..3af53eb2798 100644 --- a/packages/api/src/client/types/app/bsky/actor/getSuggestions.ts +++ b/packages/api/src/client/types/app/bsky/actor/getSuggestions.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.getSuggestions' export interface QueryParams { limit?: number @@ -20,7 +24,6 @@ export interface OutputSchema { actors: AppBskyActorDefs.ProfileView[] /** Snowflake for this recommendation, use when submitting recommendation events. */ recId?: number - [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..e5bb9da321b 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,18 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } 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' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.profile' export interface Record { + $type: 'app.bsky.actor.profile' displayName?: string /** Free-form profile description text. */ description?: string @@ -16,24 +21,19 @@ export interface Record { avatar?: BlobRef /** Larger horizontal image to display behind profile view. */ banner?: BlobRef - labels?: - | ComAtprotoLabelDefs.SelfLabels - | { $type: string; [k: string]: unknown } + labels?: $Typed | { $type: string } joinedViaStarterPack?: ComAtprotoRepoStrongRef.Main pinnedPost?: ComAtprotoRepoStrongRef.Main createdAt?: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.actor.profile#main' || - v.$type === 'app.bsky.actor.profile') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.actor.profile#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..76c120101d8 100644 --- a/packages/api/src/client/types/app/bsky/actor/putPreferences.ts +++ b/packages/api/src/client/types/app/bsky/actor/putPreferences.ts @@ -3,16 +3,19 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.putPreferences' 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..cfc1679fe89 100644 --- a/packages/api/src/client/types/app/bsky/actor/searchActors.ts +++ b/packages/api/src/client/types/app/bsky/actor/searchActors.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.searchActors' export interface QueryParams { /** DEPRECATED: use 'q' instead. */ @@ -22,7 +26,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..bacf32803a9 100644 --- a/packages/api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts +++ b/packages/api/src/client/types/app/bsky/actor/searchActorsTypeahead.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.actor.searchActorsTypeahead' export interface QueryParams { /** DEPRECATED: use 'q' instead. */ @@ -20,7 +24,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..adf61115464 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,27 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.defs' /** 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' - ) +const hashAspectRatio = 'aspectRatio' + +export function isAspectRatio(v: V) { + return is$typed(v, id, hashAspectRatio) } -export function validateAspectRatio(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.defs#aspectRatio', v) +export function validateAspectRatio(v: V) { + return validate(v, id, hashAspectRatio) } 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..5a38d1e3846 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,77 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.external' /** 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' external: External - [k: string]: unknown } -export function isMain(v: unknown): v is Main { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.embed.external#main' || - v.$type === 'app.bsky.embed.external') - ) +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#main', v) +export function validateMain(v: V) { + return validate
(v, id, hashMain) } 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' - ) +const hashExternal = 'external' + +export function isExternal(v: V) { + return is$typed(v, id, hashExternal) } -export function validateExternal(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#external', v) +export function validateExternal(v: V) { + return validate(v, id, hashExternal) } 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' - ) +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#view', v) +export function validateView(v: V) { + return validate(v, id, hashView) } 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' - ) +const hashViewExternal = 'viewExternal' + +export function isViewExternal(v: V) { + return is$typed(v, id, hashViewExternal) } -export function validateViewExternal(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.external#viewExternal', v) +export function validateViewExternal(v: V) { + return validate(v, id, hashViewExternal) } 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..26b6d965235 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,65 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyEmbedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyEmbedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.images' export interface Main { + $type?: 'app.bsky.embed.images' images: Image[] - [k: string]: unknown } -export function isMain(v: unknown): v is Main { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.embed.images#main' || - v.$type === 'app.bsky.embed.images') - ) +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#main', v) +export function validateMain(v: V) { + return validate
(v, id, hashMain) } 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' - ) +const hashImage = 'image' + +export function isImage(v: V) { + return is$typed(v, id, hashImage) } -export function validateImage(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#image', v) +export function validateImage(v: V) { + return validate(v, id, hashImage) } 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' - ) +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#view', v) +export function validateView(v: V) { + return validate(v, id, hashView) } 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 +68,14 @@ 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' - ) +const hashViewImage = 'viewImage' + +export function isViewImage(v: V) { + return is$typed(v, id, hashViewImage) } -export function validateViewImage(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.images#viewImage', v) +export function validateViewImage(v: V) { + return validate(v, id, hashViewImage) } 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..9fd1aee2be3 100644 --- a/packages/api/src/client/types/app/bsky/embed/record.ts +++ b/packages/api/src/client/types/app/bsky/embed/record.ts @@ -2,148 +2,141 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' -import * as AppBskyFeedDefs from '../feed/defs' -import * as AppBskyGraphDefs from '../graph/defs' -import * as AppBskyLabelerDefs from '../labeler/defs' -import * as AppBskyActorDefs from '../actor/defs' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' -import * as AppBskyEmbedImages from './images' -import * as AppBskyEmbedVideo from './video' -import * as AppBskyEmbedExternal from './external' -import * as AppBskyEmbedRecordWithMedia from './recordWithMedia' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' +import type * as AppBskyFeedDefs from '../feed/defs.js' +import type * as AppBskyGraphDefs from '../graph/defs.js' +import type * as AppBskyLabelerDefs from '../labeler/defs.js' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyEmbedImages from './images.js' +import type * as AppBskyEmbedVideo from './video.js' +import type * as AppBskyEmbedExternal from './external.js' +import type * as AppBskyEmbedRecordWithMedia from './recordWithMedia.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.record' export interface Main { + $type?: 'app.bsky.embed.record' record: ComAtprotoRepoStrongRef.Main - [k: string]: unknown } -export function isMain(v: unknown): v is Main { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.embed.record#main' || - v.$type === 'app.bsky.embed.record') - ) +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#main', v) +export function validateMain(v: V) { + return validate
(v, id, hashMain) } export interface View { + $type?: 'app.bsky.embed.record#view' record: - | ViewRecord - | ViewNotFound - | ViewBlocked - | ViewDetached - | AppBskyFeedDefs.GeneratorView - | AppBskyGraphDefs.ListView - | AppBskyLabelerDefs.LabelerView - | AppBskyGraphDefs.StarterPackViewBasic - | { $type: string; [k: string]: unknown } - [k: string]: unknown + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } } -export function isView(v: unknown): v is View { - return ( - isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.record#view' - ) +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#view', v) +export function validateView(v: V) { + return validate(v, id, hashView) } 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 likeCount?: number quoteCount?: number embeds?: ( - | AppBskyEmbedImages.View - | AppBskyEmbedVideo.View - | AppBskyEmbedExternal.View - | View - | AppBskyEmbedRecordWithMedia.View - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } )[] 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' - ) +const hashViewRecord = 'viewRecord' + +export function isViewRecord(v: V) { + return is$typed(v, id, hashViewRecord) } -export function validateViewRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewRecord', v) +export function validateViewRecord(v: V) { + return validate(v, id, hashViewRecord) } 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' - ) +const hashViewNotFound = 'viewNotFound' + +export function isViewNotFound(v: V) { + return is$typed(v, id, hashViewNotFound) } -export function validateViewNotFound(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewNotFound', v) +export function validateViewNotFound(v: V) { + return validate(v, id, hashViewNotFound) } 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' - ) +const hashViewBlocked = 'viewBlocked' + +export function isViewBlocked(v: V) { + return is$typed(v, id, hashViewBlocked) } -export function validateViewBlocked(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewBlocked', v) +export function validateViewBlocked(v: V) { + return validate(v, id, hashViewBlocked) } 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' - ) +const hashViewDetached = 'viewDetached' + +export function isViewDetached(v: V) { + return is$typed(v, id, hashViewDetached) } -export function validateViewDetached(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.record#viewDetached', v) +export function validateViewDetached(v: V) { + return validate(v, id, hashViewDetached) } 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..2c36a988cc7 100644 --- a/packages/api/src/client/types/app/bsky/embed/recordWithMedia.ts +++ b/packages/api/src/client/types/app/bsky/embed/recordWithMedia.ts @@ -2,55 +2,54 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyEmbedRecord from './record' -import * as AppBskyEmbedImages from './images' -import * as AppBskyEmbedVideo from './video' -import * as AppBskyEmbedExternal from './external' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyEmbedRecord from './record.js' +import type * as AppBskyEmbedImages from './images.js' +import type * as AppBskyEmbedVideo from './video.js' +import type * as AppBskyEmbedExternal from './external.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.recordWithMedia' export interface Main { + $type?: 'app.bsky.embed.recordWithMedia' record: AppBskyEmbedRecord.Main media: - | AppBskyEmbedImages.Main - | AppBskyEmbedVideo.Main - | AppBskyEmbedExternal.Main - | { $type: string; [k: string]: unknown } - [k: string]: unknown + | $Typed + | $Typed + | $Typed + | { $type: string } } -export function isMain(v: unknown): v is Main { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.embed.recordWithMedia#main' || - v.$type === 'app.bsky.embed.recordWithMedia') - ) +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.recordWithMedia#main', v) +export function validateMain(v: V) { + return validate
(v, id, hashMain) } 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 + | $Typed + | $Typed + | $Typed + | { $type: string } } -export function isView(v: unknown): v is View { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.embed.recordWithMedia#view' - ) +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.recordWithMedia#view', v) +export function validateView(v: V) { + return validate(v, id, hashView) } 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..10e59e37539 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,65 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyEmbedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyEmbedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.embed.video' export interface Main { + $type?: 'app.bsky.embed.video' 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 { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.embed.video#main' || - v.$type === 'app.bsky.embed.video') - ) +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.video#main', v) +export function validateMain(v: V) { + return validate
(v, id, hashMain) } 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' - ) +const hashCaption = 'caption' + +export function isCaption(v: V) { + return is$typed(v, id, hashCaption) } -export function validateCaption(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.video#caption', v) +export function validateCaption(v: V) { + return validate(v, id, hashCaption) } 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' - ) +const hashView = 'view' + +export function isView(v: V) { + return is$typed(v, id, hashView) } -export function validateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.embed.video#view', v) +export function validateView(v: V) { + return validate(v, id, hashView) } 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 760c634d35f..f94aaefa7e9 100644 --- a/packages/api/src/client/types/app/bsky/feed/defs.ts +++ b/packages/api/src/client/types/app/bsky/feed/defs.ts @@ -2,31 +2,36 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' -import * as AppBskyEmbedImages from '../embed/images' -import * as AppBskyEmbedVideo from '../embed/video' -import * as AppBskyEmbedExternal from '../embed/external' -import * as AppBskyEmbedRecord from '../embed/record' -import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' -import * as AppBskyRichtextFacet from '../richtext/facet' -import * as AppBskyGraphDefs from '../graph/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as AppBskyEmbedImages from '../embed/images.js' +import type * as AppBskyEmbedVideo from '../embed/video.js' +import type * as AppBskyEmbedExternal from '../embed/external.js' +import type * as AppBskyEmbedRecord from '../embed/record.js' +import type * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as AppBskyGraphDefs from '../graph/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.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 - | AppBskyEmbedExternal.View - | AppBskyEmbedRecord.View - | AppBskyEmbedRecordWithMedia.View - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } replyCount?: number repostCount?: number likeCount?: number @@ -35,225 +40,207 @@ 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' - ) +const hashPostView = 'postView' + +export function isPostView(v: V) { + return is$typed(v, id, hashPostView) } -export function validatePostView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#postView', v) +export function validatePostView(v: V) { + return validate(v, id, hashPostView) } /** 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' - ) +const hashViewerState = 'viewerState' + +export function isViewerState(v: V) { + return is$typed(v, id, hashViewerState) } -export function validateViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#viewerState', v) +export function validateViewerState(v: V) { + return validate(v, id, hashViewerState) } /** Metadata about this post within the context of the thread it is in. */ export interface ThreadContext { + $type?: 'app.bsky.feed.defs#threadContext' rootAuthorLike?: string - [k: string]: unknown } -export function isThreadContext(v: unknown): v is ThreadContext { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#threadContext' - ) +const hashThreadContext = 'threadContext' + +export function isThreadContext(v: V) { + return is$typed(v, id, hashThreadContext) } -export function validateThreadContext(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#threadContext', v) +export function validateThreadContext(v: V) { + return validate(v, id, hashThreadContext) } export interface FeedViewPost { + $type?: 'app.bsky.feed.defs#feedViewPost' post: PostView reply?: ReplyRef - reason?: ReasonRepost | ReasonPin | { $type: string; [k: string]: unknown } + reason?: $Typed | $Typed | { $type: string } /** 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' - ) +const hashFeedViewPost = 'feedViewPost' + +export function isFeedViewPost(v: V) { + return is$typed(v, id, hashFeedViewPost) } -export function validateFeedViewPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#feedViewPost', v) +export function validateFeedViewPost(v: V) { + return validate(v, id, hashFeedViewPost) } export interface ReplyRef { + $type?: 'app.bsky.feed.defs#replyRef' root: - | PostView - | NotFoundPost - | BlockedPost - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } parent: - | PostView - | NotFoundPost - | BlockedPost - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } 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' - ) +const hashReplyRef = 'replyRef' + +export function isReplyRef(v: V) { + return is$typed(v, id, hashReplyRef) } -export function validateReplyRef(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#replyRef', v) +export function validateReplyRef(v: V) { + return validate(v, id, hashReplyRef) } 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' - ) +const hashReasonRepost = 'reasonRepost' + +export function isReasonRepost(v: V) { + return is$typed(v, id, hashReasonRepost) } -export function validateReasonRepost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#reasonRepost', v) +export function validateReasonRepost(v: V) { + return validate(v, id, hashReasonRepost) } 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' - ) +const hashReasonPin = 'reasonPin' + +export function isReasonPin(v: V) { + return is$typed(v, id, hashReasonPin) } -export function validateReasonPin(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#reasonPin', v) +export function validateReasonPin(v: V) { + return validate(v, id, hashReasonPin) } export interface ThreadViewPost { + $type?: 'app.bsky.feed.defs#threadViewPost' post: PostView parent?: - | ThreadViewPost - | NotFoundPost - | BlockedPost - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } replies?: ( - | ThreadViewPost - | NotFoundPost - | BlockedPost - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } )[] threadContext?: ThreadContext - [k: string]: unknown } -export function isThreadViewPost(v: unknown): v is ThreadViewPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.defs#threadViewPost' - ) +const hashThreadViewPost = 'threadViewPost' + +export function isThreadViewPost(v: V) { + return is$typed(v, id, hashThreadViewPost) } -export function validateThreadViewPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#threadViewPost', v) +export function validateThreadViewPost(v: V) { + return validate(v, id, hashThreadViewPost) } 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' - ) +const hashNotFoundPost = 'notFoundPost' + +export function isNotFoundPost(v: V) { + return is$typed(v, id, hashNotFoundPost) } -export function validateNotFoundPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#notFoundPost', v) +export function validateNotFoundPost(v: V) { + return validate(v, id, hashNotFoundPost) } 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' - ) +const hashBlockedPost = 'blockedPost' + +export function isBlockedPost(v: V) { + return is$typed(v, id, hashBlockedPost) } -export function validateBlockedPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#blockedPost', v) +export function validateBlockedPost(v: V) { + return validate(v, id, hashBlockedPost) } 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' - ) +const hashBlockedAuthor = 'blockedAuthor' + +export function isBlockedAuthor(v: V) { + return is$typed(v, id, hashBlockedAuthor) } -export function validateBlockedAuthor(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#blockedAuthor', v) +export function validateBlockedAuthor(v: V) { + return validate(v, id, hashBlockedAuthor) } export interface GeneratorView { + $type?: 'app.bsky.feed.defs#generatorView' uri: string cid: string did: string @@ -271,115 +258,103 @@ export interface GeneratorView { | 'app.bsky.feed.defs#contentModeVideo' | (string & {}) 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' - ) +const hashGeneratorView = 'generatorView' + +export function isGeneratorView(v: V) { + return is$typed(v, id, hashGeneratorView) } -export function validateGeneratorView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#generatorView', v) +export function validateGeneratorView(v: V) { + return validate(v, id, hashGeneratorView) } 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' - ) +const hashGeneratorViewerState = 'generatorViewerState' + +export function isGeneratorViewerState(v: V) { + return is$typed(v, id, hashGeneratorViewerState) } -export function validateGeneratorViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#generatorViewerState', v) +export function validateGeneratorViewerState(v: V) { + return validate(v, id, hashGeneratorViewerState) } export interface SkeletonFeedPost { + $type?: 'app.bsky.feed.defs#skeletonFeedPost' post: string reason?: - | SkeletonReasonRepost - | SkeletonReasonPin - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | { $type: string } /** 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' - ) +const hashSkeletonFeedPost = 'skeletonFeedPost' + +export function isSkeletonFeedPost(v: V) { + return is$typed(v, id, hashSkeletonFeedPost) } -export function validateSkeletonFeedPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#skeletonFeedPost', v) +export function validateSkeletonFeedPost(v: V) { + return validate(v, id, hashSkeletonFeedPost) } 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' - ) +const hashSkeletonReasonRepost = 'skeletonReasonRepost' + +export function isSkeletonReasonRepost(v: V) { + return is$typed(v, id, hashSkeletonReasonRepost) } -export function validateSkeletonReasonRepost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v) +export function validateSkeletonReasonRepost(v: V) { + return validate(v, id, hashSkeletonReasonRepost) } 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' - ) +const hashSkeletonReasonPin = 'skeletonReasonPin' + +export function isSkeletonReasonPin(v: V) { + return is$typed(v, id, hashSkeletonReasonPin) } -export function validateSkeletonReasonPin(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#skeletonReasonPin', v) +export function validateSkeletonReasonPin(v: V) { + return validate(v, id, hashSkeletonReasonPin) } 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' - ) +const hashThreadgateView = 'threadgateView' + +export function isThreadgateView(v: V) { + return is$typed(v, id, hashThreadgateView) } -export function validateThreadgateView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#threadgateView', v) +export function validateThreadgateView(v: V) { + return validate(v, id, hashThreadgateView) } export interface Interaction { + $type?: 'app.bsky.feed.defs#interaction' item?: string event?: | 'app.bsky.feed.defs#requestLess' @@ -397,47 +372,43 @@ 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' - ) +const hashInteraction = 'interaction' + +export function isInteraction(v: V) { + return is$typed(v, id, hashInteraction) } -export function validateInteraction(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.defs#interaction', v) +export function validateInteraction(v: V) { + return validate(v, id, hashInteraction) } /** Request that less content like the given feed item be shown in the feed */ -export const REQUESTLESS = 'app.bsky.feed.defs#requestLess' +export const REQUESTLESS = `${id}#requestLess` /** Request that more content like the given feed item be shown in the feed */ -export const REQUESTMORE = 'app.bsky.feed.defs#requestMore' +export const REQUESTMORE = `${id}#requestMore` /** User clicked through to the feed item */ -export const CLICKTHROUGHITEM = 'app.bsky.feed.defs#clickthroughItem' +export const CLICKTHROUGHITEM = `${id}#clickthroughItem` /** User clicked through to the author of the feed item */ -export const CLICKTHROUGHAUTHOR = 'app.bsky.feed.defs#clickthroughAuthor' +export const CLICKTHROUGHAUTHOR = `${id}#clickthroughAuthor` /** User clicked through to the reposter of the feed item */ -export const CLICKTHROUGHREPOSTER = 'app.bsky.feed.defs#clickthroughReposter' +export const CLICKTHROUGHREPOSTER = `${id}#clickthroughReposter` /** User clicked through to the embedded content of the feed item */ -export const CLICKTHROUGHEMBED = 'app.bsky.feed.defs#clickthroughEmbed' +export const CLICKTHROUGHEMBED = `${id}#clickthroughEmbed` /** Declares the feed generator returns any types of posts. */ -export const CONTENTMODEUNSPECIFIED = - 'app.bsky.feed.defs#contentModeUnspecified' +export const CONTENTMODEUNSPECIFIED = `${id}#contentModeUnspecified` /** Declares the feed generator returns posts containing app.bsky.embed.video embeds. */ -export const CONTENTMODEVIDEO = 'app.bsky.feed.defs#contentModeVideo' +export const CONTENTMODEVIDEO = `${id}#contentModeVideo` /** Feed item was seen by user */ -export const INTERACTIONSEEN = 'app.bsky.feed.defs#interactionSeen' +export const INTERACTIONSEEN = `${id}#interactionSeen` /** User liked the feed item */ -export const INTERACTIONLIKE = 'app.bsky.feed.defs#interactionLike' +export const INTERACTIONLIKE = `${id}#interactionLike` /** User reposted the feed item */ -export const INTERACTIONREPOST = 'app.bsky.feed.defs#interactionRepost' +export const INTERACTIONREPOST = `${id}#interactionRepost` /** User replied to the feed item */ -export const INTERACTIONREPLY = 'app.bsky.feed.defs#interactionReply' +export const INTERACTIONREPLY = `${id}#interactionReply` /** User quoted the feed item */ -export const INTERACTIONQUOTE = 'app.bsky.feed.defs#interactionQuote' +export const INTERACTIONQUOTE = `${id}#interactionQuote` /** User shared the feed item */ -export const INTERACTIONSHARE = 'app.bsky.feed.defs#interactionShare' +export const INTERACTIONSHARE = `${id}#interactionShare` 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..6792d3a377f 100644 --- a/packages/api/src/client/types/app/bsky/feed/describeFeedGenerator.ts +++ b/packages/api/src/client/types/app/bsky/feed/describeFeedGenerator.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.describeFeedGenerator' export interface QueryParams {} @@ -15,7 +19,6 @@ export interface OutputSchema { did: string feeds: Feed[] links?: Links - [k: string]: unknown } export interface CallOptions { @@ -34,36 +37,32 @@ 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' - ) +const hashFeed = 'feed' + +export function isFeed(v: V) { + return is$typed(v, id, hashFeed) } -export function validateFeed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.describeFeedGenerator#feed', v) +export function validateFeed(v: V) { + return validate(v, id, hashFeed) } export interface Links { + $type?: 'app.bsky.feed.describeFeedGenerator#links' privacyPolicy?: string termsOfService?: string - [k: string]: unknown } -export function isLinks(v: unknown): v is Links { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.describeFeedGenerator#links' - ) +const hashLinks = 'links' + +export function isLinks(v: V) { + return is$typed(v, id, hashLinks) } -export function validateLinks(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.describeFeedGenerator#links', v) +export function validateLinks(v: V) { + return validate(v, id, hashLinks) } 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 8e1dd9e9c80..3cddbae534b 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,18 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } 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' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.generator' export interface Record { + $type: 'app.bsky.feed.generator' did: string displayName: string description?: string @@ -16,9 +21,7 @@ export interface Record { avatar?: BlobRef /** Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions */ acceptsInteractions?: boolean - labels?: - | ComAtprotoLabelDefs.SelfLabels - | { $type: string; [k: string]: unknown } + labels?: $Typed | { $type: string } contentMode?: | 'app.bsky.feed.defs#contentModeUnspecified' | 'app.bsky.feed.defs#contentModeVideo' @@ -27,15 +30,12 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.feed.generator#main' || - v.$type === 'app.bsky.feed.generator') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.generator#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..f44942711ac 100644 --- a/packages/api/src/client/types/app/bsky/feed/getActorFeeds.ts +++ b/packages/api/src/client/types/app/bsky/feed/getActorFeeds.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getActorFeeds' export interface QueryParams { actor: string @@ -19,7 +23,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..0552f5a18b3 100644 --- a/packages/api/src/client/types/app/bsky/feed/getActorLikes.ts +++ b/packages/api/src/client/types/app/bsky/feed/getActorLikes.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getActorLikes' export interface QueryParams { actor: string @@ -19,7 +23,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 8fc58a4e46c..5e25ae8ed88 100644 --- a/packages/api/src/client/types/app/bsky/feed/getAuthorFeed.ts +++ b/packages/api/src/client/types/app/bsky/feed/getAuthorFeed.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getAuthorFeed' export interface QueryParams { actor: string @@ -28,7 +32,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..abc65bfe8aa 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeed.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeed.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getFeed' export interface QueryParams { feed: string @@ -19,7 +23,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..7ff259ec8cb 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeedGenerator.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeedGenerator.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getFeedGenerator' export interface QueryParams { /** AT-URI of the feed generator record. */ @@ -21,7 +25,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..2b51e794beb 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeedGenerators.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeedGenerators.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getFeedGenerators' export interface QueryParams { feeds: string[] @@ -16,7 +20,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..9ebcd480e7e 100644 --- a/packages/api/src/client/types/app/bsky/feed/getFeedSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/feed/getFeedSkeleton.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getFeedSkeleton' export interface QueryParams { /** Reference to feed generator record describing the specific feed being requested. */ @@ -20,7 +24,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..f1448981f77 100644 --- a/packages/api/src/client/types/app/bsky/feed/getLikes.ts +++ b/packages/api/src/client/types/app/bsky/feed/getLikes.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getLikes' export interface QueryParams { /** AT-URI of the subject (eg, a post record). */ @@ -24,7 +28,6 @@ export interface OutputSchema { cid?: string cursor?: string likes: Like[] - [k: string]: unknown } export interface CallOptions { @@ -43,18 +46,18 @@ 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' - ) +const hashLike = 'like' + +export function isLike(v: V) { + return is$typed(v, id, hashLike) } -export function validateLike(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.getLikes#like', v) +export function validateLike(v: V) { + return validate(v, id, hashLike) } 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..484b3213139 100644 --- a/packages/api/src/client/types/app/bsky/feed/getListFeed.ts +++ b/packages/api/src/client/types/app/bsky/feed/getListFeed.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getListFeed' export interface QueryParams { /** Reference (AT-URI) to the list record. */ @@ -20,7 +24,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..5782a534529 100644 --- a/packages/api/src/client/types/app/bsky/feed/getPostThread.ts +++ b/packages/api/src/client/types/app/bsky/feed/getPostThread.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getPostThread' export interface QueryParams { /** Reference (AT-URI) to post record. */ @@ -21,12 +25,11 @@ export type InputSchema = undefined export interface OutputSchema { thread: - | AppBskyFeedDefs.ThreadViewPost - | AppBskyFeedDefs.NotFoundPost - | AppBskyFeedDefs.BlockedPost - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } 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..2467a092a4d 100644 --- a/packages/api/src/client/types/app/bsky/feed/getPosts.ts +++ b/packages/api/src/client/types/app/bsky/feed/getPosts.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getPosts' export interface QueryParams { /** List of post AT-URIs to return hydrated views for. */ @@ -17,7 +21,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..7397d3bb51b 100644 --- a/packages/api/src/client/types/app/bsky/feed/getQuotes.ts +++ b/packages/api/src/client/types/app/bsky/feed/getQuotes.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getQuotes' export interface QueryParams { /** Reference (AT-URI) of post record */ @@ -24,7 +28,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..d8666e827f2 100644 --- a/packages/api/src/client/types/app/bsky/feed/getRepostedBy.ts +++ b/packages/api/src/client/types/app/bsky/feed/getRepostedBy.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getRepostedBy' export interface QueryParams { /** Reference (AT-URI) of post record */ @@ -24,7 +28,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..38b63d048e9 100644 --- a/packages/api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts +++ b/packages/api/src/client/types/app/bsky/feed/getSuggestedFeeds.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getSuggestedFeeds' export interface QueryParams { limit?: number @@ -18,7 +22,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..66202f764e7 100644 --- a/packages/api/src/client/types/app/bsky/feed/getTimeline.ts +++ b/packages/api/src/client/types/app/bsky/feed/getTimeline.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.getTimeline' export interface QueryParams { /** Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. */ @@ -20,7 +24,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..504023db951 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,28 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.like' export interface Record { + $type: 'app.bsky.feed.like' subject: ComAtprotoRepoStrongRef.Main createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.feed.like#main' || v.$type === 'app.bsky.feed.like') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.like#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..1c921bf4331 100644 --- a/packages/api/src/client/types/app/bsky/feed/post.ts +++ b/packages/api/src/client/types/app/bsky/feed/post.ts @@ -2,19 +2,24 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyRichtextFacet from '../richtext/facet' -import * as AppBskyEmbedImages from '../embed/images' -import * as AppBskyEmbedVideo from '../embed/video' -import * as AppBskyEmbedExternal from '../embed/external' -import * as AppBskyEmbedRecord from '../embed/record' -import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' -import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as AppBskyEmbedImages from '../embed/images.js' +import type * as AppBskyEmbedVideo from '../embed/video.js' +import type * as AppBskyEmbedExternal from '../embed/external.js' +import type * as AppBskyEmbedRecord from '../embed/record.js' +import type * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.post' export interface Record { + $type: 'app.bsky.feed.post' /** The primary post content. May be an empty string, if there are embeds. */ text: string /** DEPRECATED: replaced by app.bsky.richtext.facet. */ @@ -23,17 +28,15 @@ export interface Record { facets?: AppBskyRichtextFacet.Main[] reply?: ReplyRef embed?: - | AppBskyEmbedImages.Main - | AppBskyEmbedVideo.Main - | AppBskyEmbedExternal.Main - | AppBskyEmbedRecord.Main - | AppBskyEmbedRecordWithMedia.Main - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } /** Indicates human language of post primary text content. */ langs?: string[] - labels?: - | ComAtprotoLabelDefs.SelfLabels - | { $type: string; [k: string]: unknown } + labels?: $Typed | { $type: string } /** Additional hashtags, in addition to any included in post text and facets. */ tags?: string[] /** Client-declared timestamp when this post was originally created. */ @@ -41,68 +44,64 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.feed.post#main' || v.$type === 'app.bsky.feed.post') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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' - ) +const hashReplyRef = 'replyRef' + +export function isReplyRef(v: V) { + return is$typed(v, id, hashReplyRef) } -export function validateReplyRef(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#replyRef', v) +export function validateReplyRef(v: V) { + return validate(v, id, hashReplyRef) } /** 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' - ) +const hashEntity = 'entity' + +export function isEntity(v: V) { + return is$typed(v, id, hashEntity) } -export function validateEntity(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#entity', v) +export function validateEntity(v: V) { + return validate(v, id, hashEntity) } /** 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' - ) +const hashTextSlice = 'textSlice' + +export function isTextSlice(v: V) { + return is$typed(v, id, hashTextSlice) } -export function validateTextSlice(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.post#textSlice', v) +export function validateTextSlice(v: V) { + return validate(v, id, hashTextSlice) } 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 e3028385873..3bb6fa929ef 100644 --- a/packages/api/src/client/types/app/bsky/feed/postgate.ts +++ b/packages/api/src/client/types/app/bsky/feed/postgate.ts @@ -2,47 +2,47 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.postgate' export interface Record { + $type: 'app.bsky.feed.postgate' createdAt: string /** Reference (AT-URI) to the post record. */ post: string /** List of AT-URIs embedding this post that the author has detached from. */ detachedEmbeddingUris?: string[] /** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */ - embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[] + embeddingRules?: ($Typed | { $type: string })[] [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.feed.postgate#main' || - v.$type === 'app.bsky.feed.postgate') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.postgate#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } /** 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' - ) +const hashDisableRule = 'disableRule' + +export function isDisableRule(v: V) { + return is$typed(v, id, hashDisableRule) } -export function validateDisableRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.postgate#disableRule', v) +export function validateDisableRule(v: V) { + return validate(v, id, hashDisableRule) } 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..00a74c8b617 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,28 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.repost' export interface Record { + $type: 'app.bsky.feed.repost' subject: ComAtprotoRepoStrongRef.Main createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.feed.repost#main' || - v.$type === 'app.bsky.feed.repost') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.repost#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..0d477a7d7ae 100644 --- a/packages/api/src/client/types/app/bsky/feed/searchPosts.ts +++ b/packages/api/src/client/types/app/bsky/feed/searchPosts.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.searchPosts' export interface QueryParams { /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */ @@ -41,7 +45,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..8535c458f08 100644 --- a/packages/api/src/client/types/app/bsky/feed/sendInteractions.ts +++ b/packages/api/src/client/types/app/bsky/feed/sendInteractions.ts @@ -3,21 +3,22 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.sendInteractions' 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 1fe87016dce..e15cda096aa 100644 --- a/packages/api/src/client/types/app/bsky/feed/threadgate.ts +++ b/packages/api/src/client/types/app/bsky/feed/threadgate.ts @@ -2,20 +2,25 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.feed.threadgate' export interface Record { + $type: 'app.bsky.feed.threadgate' /** Reference (AT-URI) to the post record. */ post: string /** List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply. */ allow?: ( - | MentionRule - | FollowerRule - | FollowingRule - | ListRule - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } )[] createdAt: string /** List of hidden reply URIs. */ @@ -23,84 +28,73 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.feed.threadgate#main' || - v.$type === 'app.bsky.feed.threadgate') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } /** 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' - ) +const hashMentionRule = 'mentionRule' + +export function isMentionRule(v: V) { + return is$typed(v, id, hashMentionRule) } -export function validateMentionRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#mentionRule', v) +export function validateMentionRule(v: V) { + return validate(v, id, hashMentionRule) } /** Allow replies from actors who follow you. */ export interface FollowerRule { - [k: string]: unknown + $type?: 'app.bsky.feed.threadgate#followerRule' } -export function isFollowerRule(v: unknown): v is FollowerRule { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.feed.threadgate#followerRule' - ) +const hashFollowerRule = 'followerRule' + +export function isFollowerRule(v: V) { + return is$typed(v, id, hashFollowerRule) } -export function validateFollowerRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#followerRule', v) +export function validateFollowerRule(v: V) { + return validate(v, id, hashFollowerRule) } /** 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' - ) +const hashFollowingRule = 'followingRule' + +export function isFollowingRule(v: V) { + return is$typed(v, id, hashFollowingRule) } -export function validateFollowingRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#followingRule', v) +export function validateFollowingRule(v: V) { + return validate(v, id, hashFollowingRule) } /** 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' - ) +const hashListRule = 'listRule' + +export function isListRule(v: V) { + return is$typed(v, id, hashListRule) } -export function validateListRule(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.feed.threadgate#listRule', v) +export function validateListRule(v: V) { + return validate(v, id, hashListRule) } 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..25ff38bd60d 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,28 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.block' export interface Record { + $type: 'app.bsky.graph.block' /** DID of the account to be blocked. */ subject: string createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.graph.block#main' || - v.$type === 'app.bsky.graph.block') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.block#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..bd9a4d6c07e 100644 --- a/packages/api/src/client/types/app/bsky/graph/defs.ts +++ b/packages/api/src/client/types/app/bsky/graph/defs.ts @@ -2,15 +2,20 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' -import * as AppBskyActorDefs from '../actor/defs' -import * as AppBskyRichtextFacet from '../richtext/facet' -import * as AppBskyFeedDefs from '../feed/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as AppBskyFeedDefs from '../feed/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.defs' export interface ListViewBasic { + $type?: 'app.bsky.graph.defs#listViewBasic' uri: string cid: string name: string @@ -20,22 +25,20 @@ 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' - ) +const hashListViewBasic = 'listViewBasic' + +export function isListViewBasic(v: V) { + return is$typed(v, id, hashListViewBasic) } -export function validateListViewBasic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listViewBasic', v) +export function validateListViewBasic(v: V) { + return validate(v, id, hashListViewBasic) } export interface ListView { + $type?: 'app.bsky.graph.defs#listView' uri: string cid: string creator: AppBskyActorDefs.ProfileView @@ -48,43 +51,39 @@ 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' - ) +const hashListView = 'listView' + +export function isListView(v: V) { + return is$typed(v, id, hashListView) } -export function validateListView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listView', v) +export function validateListView(v: V) { + return validate(v, id, hashListView) } 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' - ) +const hashListItemView = 'listItemView' + +export function isListItemView(v: V) { + return is$typed(v, id, hashListItemView) } -export function validateListItemView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listItemView', v) +export function validateListItemView(v: V) { + return validate(v, id, hashListItemView) } 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 +92,39 @@ 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' - ) +const hashStarterPackView = 'starterPackView' + +export function isStarterPackView(v: V) { + return is$typed(v, id, hashStarterPackView) } -export function validateStarterPackView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#starterPackView', v) +export function validateStarterPackView(v: V) { + return validate(v, id, hashStarterPackView) } 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' - ) +const hashStarterPackViewBasic = 'starterPackViewBasic' + +export function isStarterPackViewBasic(v: V) { + return is$typed(v, id, hashStarterPackViewBasic) } -export function validateStarterPackViewBasic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#starterPackViewBasic', v) +export function validateStarterPackViewBasic(v: V) { + return validate(v, id, hashStarterPackViewBasic) } export type ListPurpose = @@ -140,67 +134,61 @@ export type ListPurpose = | (string & {}) /** A list of actors to apply an aggregate moderation action (mute/block) on. */ -export const MODLIST = 'app.bsky.graph.defs#modlist' +export const MODLIST = `${id}#modlist` /** A list of actors used for curation purposes such as list feeds or interaction gating. */ -export const CURATELIST = 'app.bsky.graph.defs#curatelist' +export const CURATELIST = `${id}#curatelist` /** A list of actors used for only for reference purposes such as within a starter pack. */ -export const REFERENCELIST = 'app.bsky.graph.defs#referencelist' +export const REFERENCELIST = `${id}#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' - ) +const hashListViewerState = 'listViewerState' + +export function isListViewerState(v: V) { + return is$typed(v, id, hashListViewerState) } -export function validateListViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#listViewerState', v) +export function validateListViewerState(v: V) { + return validate(v, id, hashListViewerState) } /** 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' - ) +const hashNotFoundActor = 'notFoundActor' + +export function isNotFoundActor(v: V) { + return is$typed(v, id, hashNotFoundActor) } -export function validateNotFoundActor(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#notFoundActor', v) +export function validateNotFoundActor(v: V) { + return validate(v, id, hashNotFoundActor) } /** 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' - ) +const hashRelationship = 'relationship' + +export function isRelationship(v: V) { + return is$typed(v, id, hashRelationship) } -export function validateRelationship(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.defs#relationship', v) +export function validateRelationship(v: V) { + return validate(v, id, hashRelationship) } 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..79478d39135 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,27 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.follow' export interface Record { + $type: 'app.bsky.graph.follow' subject: string createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.graph.follow#main' || - v.$type === 'app.bsky.graph.follow') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.follow#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..cb5d0ddea69 100644 --- a/packages/api/src/client/types/app/bsky/graph/getActorStarterPacks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getActorStarterPacks.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getActorStarterPacks' export interface QueryParams { actor: string @@ -19,7 +23,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..3f622163750 100644 --- a/packages/api/src/client/types/app/bsky/graph/getBlocks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getBlocks.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getBlocks' export interface QueryParams { limit?: number @@ -18,7 +22,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..faf9e102588 100644 --- a/packages/api/src/client/types/app/bsky/graph/getFollowers.ts +++ b/packages/api/src/client/types/app/bsky/graph/getFollowers.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getFollowers' export interface QueryParams { actor: string @@ -20,7 +24,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..f56600a6426 100644 --- a/packages/api/src/client/types/app/bsky/graph/getFollows.ts +++ b/packages/api/src/client/types/app/bsky/graph/getFollows.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getFollows' export interface QueryParams { actor: string @@ -20,7 +24,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..c91899bcd81 100644 --- a/packages/api/src/client/types/app/bsky/graph/getKnownFollowers.ts +++ b/packages/api/src/client/types/app/bsky/graph/getKnownFollowers.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getKnownFollowers' export interface QueryParams { actor: string @@ -20,7 +24,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..1e133181af6 100644 --- a/packages/api/src/client/types/app/bsky/graph/getList.ts +++ b/packages/api/src/client/types/app/bsky/graph/getList.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getList' export interface QueryParams { /** Reference (AT-URI) of the list record to hydrate. */ @@ -21,7 +25,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..31a21664739 100644 --- a/packages/api/src/client/types/app/bsky/graph/getListBlocks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getListBlocks.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getListBlocks' export interface QueryParams { limit?: number @@ -18,7 +22,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..82bab605ecc 100644 --- a/packages/api/src/client/types/app/bsky/graph/getListMutes.ts +++ b/packages/api/src/client/types/app/bsky/graph/getListMutes.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getListMutes' export interface QueryParams { limit?: number @@ -18,7 +22,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..4066a3c7c9a 100644 --- a/packages/api/src/client/types/app/bsky/graph/getLists.ts +++ b/packages/api/src/client/types/app/bsky/graph/getLists.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getLists' export interface QueryParams { /** The account (actor) to enumerate lists from. */ @@ -20,7 +24,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..db4ece098be 100644 --- a/packages/api/src/client/types/app/bsky/graph/getMutes.ts +++ b/packages/api/src/client/types/app/bsky/graph/getMutes.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getMutes' export interface QueryParams { limit?: number @@ -18,7 +22,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..5d67dbbf731 100644 --- a/packages/api/src/client/types/app/bsky/graph/getRelationships.ts +++ b/packages/api/src/client/types/app/bsky/graph/getRelationships.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getRelationships' export interface QueryParams { /** Primary account requesting relationships for. */ @@ -20,11 +24,10 @@ export type InputSchema = undefined export interface OutputSchema { actor?: string relationships: ( - | AppBskyGraphDefs.Relationship - | AppBskyGraphDefs.NotFoundActor - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | { $type: string } )[] - [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..11f41a3f3ce 100644 --- a/packages/api/src/client/types/app/bsky/graph/getStarterPack.ts +++ b/packages/api/src/client/types/app/bsky/graph/getStarterPack.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getStarterPack' export interface QueryParams { /** Reference (AT-URI) of the starter pack record. */ @@ -17,7 +21,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..b354f6e5a42 100644 --- a/packages/api/src/client/types/app/bsky/graph/getStarterPacks.ts +++ b/packages/api/src/client/types/app/bsky/graph/getStarterPacks.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getStarterPacks' export interface QueryParams { uris: string[] @@ -16,7 +20,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 fb27392d1b7..744c34a5dd4 100644 --- a/packages/api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts +++ b/packages/api/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.getSuggestedFollowsByActor' export interface QueryParams { actor: string @@ -20,7 +24,6 @@ export interface OutputSchema { isFallback: boolean /** Snowflake for this recommendation, use when submitting recommendation events. */ recId?: number - [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..f899e73317a 100644 --- a/packages/api/src/client/types/app/bsky/graph/list.ts +++ b/packages/api/src/client/types/app/bsky/graph/list.ts @@ -2,36 +2,36 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' -import * as AppBskyRichtextFacet from '../richtext/facet' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.list' export interface Record { + $type: 'app.bsky.graph.list' purpose: AppBskyGraphDefs.ListPurpose /** Display name for list; can not be empty. */ name: string description?: string descriptionFacets?: AppBskyRichtextFacet.Main[] avatar?: BlobRef - labels?: - | ComAtprotoLabelDefs.SelfLabels - | { $type: string; [k: string]: unknown } + labels?: $Typed | { $type: string } createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.graph.list#main' || - v.$type === 'app.bsky.graph.list') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.list#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..05a204fa3b5 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,28 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.listblock' export interface Record { + $type: 'app.bsky.graph.listblock' /** Reference (AT-URI) to the mod list record. */ subject: string createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.graph.listblock#main' || - v.$type === 'app.bsky.graph.listblock') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.listblock#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..46e0ccbf206 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,16 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.listitem' export interface Record { + $type: 'app.bsky.graph.listitem' /** The account which is included on the list. */ subject: string /** Reference (AT-URI) to the list record (app.bsky.graph.list). */ @@ -15,15 +20,12 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.graph.listitem#main' || - v.$type === 'app.bsky.graph.listitem') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.listitem#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..87007e9b0ec 100644 --- a/packages/api/src/client/types/app/bsky/graph/muteActor.ts +++ b/packages/api/src/client/types/app/bsky/graph/muteActor.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.muteActor' 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..8b4b818d2e9 100644 --- a/packages/api/src/client/types/app/bsky/graph/muteActorList.ts +++ b/packages/api/src/client/types/app/bsky/graph/muteActorList.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.muteActorList' 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..fb8bc07bc14 100644 --- a/packages/api/src/client/types/app/bsky/graph/muteThread.ts +++ b/packages/api/src/client/types/app/bsky/graph/muteThread.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.muteThread' 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/searchStarterPacks.ts b/packages/api/src/client/types/app/bsky/graph/searchStarterPacks.ts index 8291b219a62..162234851e5 100644 --- a/packages/api/src/client/types/app/bsky/graph/searchStarterPacks.ts +++ b/packages/api/src/client/types/app/bsky/graph/searchStarterPacks.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyGraphDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyGraphDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.searchStarterPacks' export interface QueryParams { /** Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */ @@ -20,7 +24,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/starterpack.ts b/packages/api/src/client/types/app/bsky/graph/starterpack.ts index 7cb0aa26c3f..d7761245080 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,17 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyRichtextFacet from '../richtext/facet' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyRichtextFacet from '../richtext/facet.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.starterpack' export interface Record { + $type: 'app.bsky.graph.starterpack' /** Display name for starter pack; can not be empty. */ name: string description?: string @@ -19,32 +24,27 @@ export interface Record { [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.graph.starterpack#main' || - v.$type === 'app.bsky.graph.starterpack') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.starterpack#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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' - ) +const hashFeedItem = 'feedItem' + +export function isFeedItem(v: V) { + return is$typed(v, id, hashFeedItem) } -export function validateFeedItem(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.graph.starterpack#feedItem', v) +export function validateFeedItem(v: V) { + return validate(v, id, hashFeedItem) } 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..b6e4394b5be 100644 --- a/packages/api/src/client/types/app/bsky/graph/unmuteActor.ts +++ b/packages/api/src/client/types/app/bsky/graph/unmuteActor.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.unmuteActor' 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..de8f3676ebe 100644 --- a/packages/api/src/client/types/app/bsky/graph/unmuteActorList.ts +++ b/packages/api/src/client/types/app/bsky/graph/unmuteActorList.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.unmuteActorList' 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..fafceb748b5 100644 --- a/packages/api/src/client/types/app/bsky/graph/unmuteThread.ts +++ b/packages/api/src/client/types/app/bsky/graph/unmuteThread.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.graph.unmuteThread' 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..453b010db5e 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,18 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } 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' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.labeler.defs' export interface LabelerView { + $type?: 'app.bsky.labeler.defs#labelerView' uri: string cid: string creator: AppBskyActorDefs.ProfileView @@ -16,22 +21,20 @@ 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' - ) +const hashLabelerView = 'labelerView' + +export function isLabelerView(v: V) { + return is$typed(v, id, hashLabelerView) } -export function validateLabelerView(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerView', v) +export function validateLabelerView(v: V) { + return validate(v, id, hashLabelerView) } export interface LabelerViewDetailed { + $type?: 'app.bsky.labeler.defs#labelerViewDetailed' uri: string cid: string creator: AppBskyActorDefs.ProfileView @@ -40,54 +43,47 @@ export interface LabelerViewDetailed { viewer?: LabelerViewerState indexedAt: string labels?: ComAtprotoLabelDefs.Label[] - [k: string]: unknown } -export function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.labeler.defs#labelerViewDetailed' - ) +const hashLabelerViewDetailed = 'labelerViewDetailed' + +export function isLabelerViewDetailed(v: V) { + return is$typed(v, id, hashLabelerViewDetailed) } -export function validateLabelerViewDetailed(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerViewDetailed', v) +export function validateLabelerViewDetailed(v: V) { + return validate(v, id, hashLabelerViewDetailed) } 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' - ) +const hashLabelerViewerState = 'labelerViewerState' + +export function isLabelerViewerState(v: V) { + return is$typed(v, id, hashLabelerViewerState) } -export function validateLabelerViewerState(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerViewerState', v) +export function validateLabelerViewerState(v: V) { + return validate(v, id, hashLabelerViewerState) } 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' - ) +const hashLabelerPolicies = 'labelerPolicies' + +export function isLabelerPolicies(v: V) { + return is$typed(v, id, hashLabelerPolicies) } -export function validateLabelerPolicies(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.defs#labelerPolicies', v) +export function validateLabelerPolicies(v: V) { + return validate(v, id, hashLabelerPolicies) } 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..51875290cde 100644 --- a/packages/api/src/client/types/app/bsky/labeler/getServices.ts +++ b/packages/api/src/client/types/app/bsky/labeler/getServices.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyLabelerDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyLabelerDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.labeler.getServices' export interface QueryParams { dids: string[] @@ -17,11 +21,10 @@ export type InputSchema = undefined export interface OutputSchema { views: ( - | AppBskyLabelerDefs.LabelerView - | AppBskyLabelerDefs.LabelerViewDetailed - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | { $type: string } )[] - [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..368f71e53bc 100644 --- a/packages/api/src/client/types/app/bsky/labeler/service.ts +++ b/packages/api/src/client/types/app/bsky/labeler/service.ts @@ -2,30 +2,30 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyLabelerDefs from './defs' -import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyLabelerDefs from './defs.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.labeler.service' export interface Record { + $type: 'app.bsky.labeler.service' policies: AppBskyLabelerDefs.LabelerPolicies - labels?: - | ComAtprotoLabelDefs.SelfLabels - | { $type: string; [k: string]: unknown } + labels?: $Typed | { $type: string } createdAt: string [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.labeler.service#main' || - v.$type === 'app.bsky.labeler.service') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.labeler.service#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..77e8c5626be 100644 --- a/packages/api/src/client/types/app/bsky/notification/getUnreadCount.ts +++ b/packages/api/src/client/types/app/bsky/notification/getUnreadCount.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.notification.getUnreadCount' export interface QueryParams { priority?: boolean @@ -16,7 +20,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 92b3a27fece..13cc4367875 100644 --- a/packages/api/src/client/types/app/bsky/notification/listNotifications.ts +++ b/packages/api/src/client/types/app/bsky/notification/listNotifications.ts @@ -3,11 +3,15 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } 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' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../actor/defs.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.notification.listNotifications' export interface QueryParams { /** Notification reasons to include in response. */ @@ -25,7 +29,6 @@ export interface OutputSchema { notifications: Notification[] priority?: boolean seenAt?: string - [k: string]: unknown } export interface CallOptions { @@ -44,6 +47,7 @@ export function toKnownErr(e: any) { } export interface Notification { + $type?: 'app.bsky.notification.listNotifications#notification' uri: string cid: string author: AppBskyActorDefs.ProfileView @@ -58,24 +62,18 @@ 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 { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.notification.listNotifications#notification' - ) +const hashNotification = 'notification' + +export function isNotification(v: V) { + return is$typed(v, id, hashNotification) } -export function validateNotification(v: unknown): ValidationResult { - return lexicons.validate( - 'app.bsky.notification.listNotifications#notification', - v, - ) +export function validateNotification(v: V) { + return validate(v, id, hashNotification) } 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..fb6f0054c05 100644 --- a/packages/api/src/client/types/app/bsky/notification/putPreferences.ts +++ b/packages/api/src/client/types/app/bsky/notification/putPreferences.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.notification.putPreferences' 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..87ebb721451 100644 --- a/packages/api/src/client/types/app/bsky/notification/registerPush.ts +++ b/packages/api/src/client/types/app/bsky/notification/registerPush.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.notification.registerPush' export interface QueryParams {} @@ -14,7 +18,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..dc2e4905fbe 100644 --- a/packages/api/src/client/types/app/bsky/notification/updateSeen.ts +++ b/packages/api/src/client/types/app/bsky/notification/updateSeen.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.notification.updateSeen' 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..8085d33c8ee 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,92 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.richtext.facet' /** Annotation of a sub-string within rich text. */ export interface Main { + $type?: 'app.bsky.richtext.facet' index: ByteSlice - features: (Mention | Link | Tag | { $type: string; [k: string]: unknown })[] - [k: string]: unknown + features: ($Typed | $Typed | $Typed | { $type: string })[] } -export function isMain(v: unknown): v is Main { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'app.bsky.richtext.facet#main' || - v.$type === 'app.bsky.richtext.facet') - ) +const hashMain = 'main' + +export function isMain(v: V) { + return is$typed(v, id, hashMain) } -export function validateMain(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#main', v) +export function validateMain(v: V) { + return validate
(v, id, hashMain) } /** 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' - ) +const hashMention = 'mention' + +export function isMention(v: V) { + return is$typed(v, id, hashMention) } -export function validateMention(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#mention', v) +export function validateMention(v: V) { + return validate(v, id, hashMention) } /** 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' - ) +const hashLink = 'link' + +export function isLink(v: V) { + return is$typed(v, id, hashLink) } -export function validateLink(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#link', v) +export function validateLink(v: V) { + return validate(v, id, hashLink) } /** 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' - ) +const hashTag = 'tag' + +export function isTag(v: V) { + return is$typed(v, id, hashTag) } -export function validateTag(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#tag', v) +export function validateTag(v: V) { + return validate(v, id, hashTag) } /** 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' - ) +const hashByteSlice = 'byteSlice' + +export function isByteSlice(v: V) { + return is$typed(v, id, hashByteSlice) } -export function validateByteSlice(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.richtext.facet#byteSlice', v) +export function validateByteSlice(v: V) { + return validate(v, id, hashByteSlice) } 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 81f821ecf73..6bde35e5709 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/defs.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/defs.ts @@ -2,84 +2,77 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.defs' export interface SkeletonSearchPost { + $type?: 'app.bsky.unspecced.defs#skeletonSearchPost' uri: string - [k: string]: unknown } -export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost' - ) +const hashSkeletonSearchPost = 'skeletonSearchPost' + +export function isSkeletonSearchPost(v: V) { + return is$typed(v, id, hashSkeletonSearchPost) } -export function validateSkeletonSearchPost(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v) +export function validateSkeletonSearchPost(v: V) { + return validate(v, id, hashSkeletonSearchPost) } export interface SkeletonSearchActor { + $type?: 'app.bsky.unspecced.defs#skeletonSearchActor' did: string - [k: string]: unknown } -export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor' - ) +const hashSkeletonSearchActor = 'skeletonSearchActor' + +export function isSkeletonSearchActor(v: V) { + return is$typed(v, id, hashSkeletonSearchActor) } -export function validateSkeletonSearchActor(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v) +export function validateSkeletonSearchActor(v: V) { + return validate(v, id, hashSkeletonSearchActor) } export interface SkeletonSearchStarterPack { + $type?: 'app.bsky.unspecced.defs#skeletonSearchStarterPack' uri: string - [k: string]: unknown } -export function isSkeletonSearchStarterPack( - v: unknown, -): v is SkeletonSearchStarterPack { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.defs#skeletonSearchStarterPack' - ) +const hashSkeletonSearchStarterPack = 'skeletonSearchStarterPack' + +export function isSkeletonSearchStarterPack(v: V) { + return is$typed(v, id, hashSkeletonSearchStarterPack) } -export function validateSkeletonSearchStarterPack( - v: unknown, -): ValidationResult { - return lexicons.validate( - 'app.bsky.unspecced.defs#skeletonSearchStarterPack', +export function validateSkeletonSearchStarterPack(v: V) { + return validate( v, + id, + hashSkeletonSearchStarterPack, ) } export interface TrendingTopic { + $type?: 'app.bsky.unspecced.defs#trendingTopic' topic: string displayName?: string description?: string link: string - [k: string]: unknown } -export function isTrendingTopic(v: unknown): v is TrendingTopic { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.defs#trendingTopic' - ) +const hashTrendingTopic = 'trendingTopic' + +export function isTrendingTopic(v: V) { + return is$typed(v, id, hashTrendingTopic) } -export function validateTrendingTopic(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.unspecced.defs#trendingTopic', v) +export function validateTrendingTopic(v: V) { + return validate(v, id, hashTrendingTopic) } 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..b75201aec3a 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getConfig.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getConfig.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.getConfig' export interface QueryParams {} @@ -13,7 +17,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..7d08a854ede 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getPopularFeedGenerators.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from '../feed/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyFeedDefs from '../feed/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.getPopularFeedGenerators' export interface QueryParams { limit?: number @@ -19,7 +23,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 0759165f1d0..45d7c11df39 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyUnspeccedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyUnspeccedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.getSuggestionsSkeleton' export interface QueryParams { /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */ @@ -26,7 +30,6 @@ export interface OutputSchema { relativeToDid?: string /** Snowflake for this recommendation, use when submitting recommendation events. */ recId?: number - [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..28efdc1ad7a 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.getTaggedSuggestions' export interface QueryParams {} @@ -13,7 +17,6 @@ export type InputSchema = undefined export interface OutputSchema { suggestions: Suggestion[] - [k: string]: unknown } export interface CallOptions { @@ -32,23 +35,18 @@ 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 { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion' - ) +const hashSuggestion = 'suggestion' + +export function isSuggestion(v: V) { + return is$typed(v, id, hashSuggestion) } -export function validateSuggestion(v: unknown): ValidationResult { - return lexicons.validate( - 'app.bsky.unspecced.getTaggedSuggestions#suggestion', - v, - ) +export function validateSuggestion(v: V) { + return validate(v, id, hashSuggestion) } diff --git a/packages/api/src/client/types/app/bsky/unspecced/getTrendingTopics.ts b/packages/api/src/client/types/app/bsky/unspecced/getTrendingTopics.ts index 70e790e14ba..9877d3744aa 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/getTrendingTopics.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/getTrendingTopics.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyUnspeccedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyUnspeccedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.getTrendingTopics' export interface QueryParams { /** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */ @@ -19,7 +23,6 @@ export type InputSchema = undefined export interface OutputSchema { topics: AppBskyUnspeccedDefs.TrendingTopic[] suggested: AppBskyUnspeccedDefs.TrendingTopic[] - [k: string]: unknown } export interface CallOptions { 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..4bd5de8572a 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/searchActorsSkeleton.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyUnspeccedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyUnspeccedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.searchActorsSkeleton' export interface QueryParams { /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax. */ @@ -27,7 +31,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..a75698c27b7 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/searchPostsSkeleton.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyUnspeccedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyUnspeccedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.searchPostsSkeleton' export interface QueryParams { /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */ @@ -43,7 +47,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/unspecced/searchStarterPacksSkeleton.ts b/packages/api/src/client/types/app/bsky/unspecced/searchStarterPacksSkeleton.ts index c331b86d3e1..525d71af30b 100644 --- a/packages/api/src/client/types/app/bsky/unspecced/searchStarterPacksSkeleton.ts +++ b/packages/api/src/client/types/app/bsky/unspecced/searchStarterPacksSkeleton.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyUnspeccedDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyUnspeccedDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.unspecced.searchStarterPacksSkeleton' export interface QueryParams { /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */ @@ -25,7 +29,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 starterPacks: AppBskyUnspeccedDefs.SkeletonSearchStarterPack[] - [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..15079613e68 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,16 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.video.defs' 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 +21,14 @@ 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' - ) +const hashJobStatus = 'jobStatus' + +export function isJobStatus(v: V) { + return is$typed(v, id, hashJobStatus) } -export function validateJobStatus(v: unknown): ValidationResult { - return lexicons.validate('app.bsky.video.defs#jobStatus', v) +export function validateJobStatus(v: V) { + return validate(v, id, hashJobStatus) } 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..d9ff3c1c2a4 100644 --- a/packages/api/src/client/types/app/bsky/video/getJobStatus.ts +++ b/packages/api/src/client/types/app/bsky/video/getJobStatus.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyVideoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyVideoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.video.getJobStatus' export interface QueryParams { jobId: string @@ -16,7 +20,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..08780b06455 100644 --- a/packages/api/src/client/types/app/bsky/video/getUploadLimits.ts +++ b/packages/api/src/client/types/app/bsky/video/getUploadLimits.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.video.getUploadLimits' export interface QueryParams {} @@ -17,7 +21,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..2881aee071e 100644 --- a/packages/api/src/client/types/app/bsky/video/uploadVideo.ts +++ b/packages/api/src/client/types/app/bsky/video/uploadVideo.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyVideoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyVideoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'app.bsky.video.uploadVideo' export interface QueryParams {} @@ -14,7 +18,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..b153d13a088 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,26 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.actor.declaration' export interface Record { + $type: 'chat.bsky.actor.declaration' allowIncoming: 'all' | 'none' | 'following' | (string & {}) [k: string]: unknown } -export function isRecord(v: unknown): v is Record { - return ( - isObj(v) && - hasProp(v, '$type') && - (v.$type === 'chat.bsky.actor.declaration#main' || - v.$type === 'chat.bsky.actor.declaration') - ) +const hashRecord = 'main' + +export function isRecord(v: V) { + return is$typed(v, id, hashRecord) } -export function validateRecord(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.actor.declaration#main', v) +export function validateRecord(v: V) { + return validate(v, id, hashRecord, true) } 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..031c1d1a87c 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,18 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } 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' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyActorDefs from '../../../app/bsky/actor/defs.js' +import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.actor.defs' export interface ProfileViewBasic { + $type?: 'chat.bsky.actor.defs#profileViewBasic' did: string handle: string displayName?: string @@ -18,17 +23,14 @@ 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' - ) +const hashProfileViewBasic = 'profileViewBasic' + +export function isProfileViewBasic(v: V) { + return is$typed(v, id, hashProfileViewBasic) } -export function validateProfileViewBasic(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.actor.defs#profileViewBasic', v) +export function validateProfileViewBasic(v: V) { + return validate(v, id, hashProfileViewBasic) } 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..7d65ebe0483 100644 --- a/packages/api/src/client/types/chat/bsky/actor/deleteAccount.ts +++ b/packages/api/src/client/types/chat/bsky/actor/deleteAccount.ts @@ -3,17 +3,19 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.actor.deleteAccount' 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..730dbdf381d 100644 --- a/packages/api/src/client/types/chat/bsky/actor/exportAccountData.ts +++ b/packages/api/src/client/types/chat/bsky/actor/exportAccountData.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.actor.exportAccountData' export interface QueryParams {} 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..4d458fb798e 100644 --- a/packages/api/src/client/types/chat/bsky/convo/defs.ts +++ b/packages/api/src/client/types/chat/bsky/convo/defs.ts @@ -2,215 +2,193 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as AppBskyRichtextFacet from '../../../app/bsky/richtext/facet' -import * as AppBskyEmbedRecord from '../../../app/bsky/embed/record' -import * as ChatBskyActorDefs from '../actor/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as AppBskyRichtextFacet from '../../../app/bsky/richtext/facet.js' +import type * as AppBskyEmbedRecord from '../../../app/bsky/embed/record.js' +import type * as ChatBskyActorDefs from '../actor/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.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' - ) +const hashMessageRef = 'messageRef' + +export function isMessageRef(v: V) { + return is$typed(v, id, hashMessageRef) } -export function validateMessageRef(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageRef', v) +export function validateMessageRef(v: V) { + return validate(v, id, hashMessageRef) } 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 + embed?: $Typed | { $type: string } } -export function isMessageInput(v: unknown): v is MessageInput { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#messageInput' - ) +const hashMessageInput = 'messageInput' + +export function isMessageInput(v: V) { + return is$typed(v, id, hashMessageInput) } -export function validateMessageInput(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageInput', v) +export function validateMessageInput(v: V) { + return validate(v, id, hashMessageInput) } export interface MessageView { + $type?: 'chat.bsky.convo.defs#messageView' id: string rev: string text: string /** Annotations of text (mentions, URLs, hashtags, etc) */ facets?: AppBskyRichtextFacet.Main[] - embed?: AppBskyEmbedRecord.View | { $type: string; [k: string]: unknown } + embed?: $Typed | { $type: string } 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' - ) +const hashMessageView = 'messageView' + +export function isMessageView(v: V) { + return is$typed(v, id, hashMessageView) } -export function validateMessageView(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageView', v) +export function validateMessageView(v: V) { + return validate(v, id, hashMessageView) } 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' - ) +const hashDeletedMessageView = 'deletedMessageView' + +export function isDeletedMessageView(v: V) { + return is$typed(v, id, hashDeletedMessageView) } -export function validateDeletedMessageView(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#deletedMessageView', v) +export function validateDeletedMessageView(v: V) { + return validate(v, id, hashDeletedMessageView) } 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' - ) +const hashMessageViewSender = 'messageViewSender' + +export function isMessageViewSender(v: V) { + return is$typed(v, id, hashMessageViewSender) } -export function validateMessageViewSender(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#messageViewSender', v) +export function validateMessageViewSender(v: V) { + return validate(v, id, hashMessageViewSender) } export interface ConvoView { + $type?: 'chat.bsky.convo.defs#convoView' id: string rev: string members: ChatBskyActorDefs.ProfileViewBasic[] lastMessage?: - | MessageView - | DeletedMessageView - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | { $type: string } 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' - ) +const hashConvoView = 'convoView' + +export function isConvoView(v: V) { + return is$typed(v, id, hashConvoView) } -export function validateConvoView(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#convoView', v) +export function validateConvoView(v: V) { + return validate(v, id, hashConvoView) } 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' - ) +const hashLogBeginConvo = 'logBeginConvo' + +export function isLogBeginConvo(v: V) { + return is$typed(v, id, hashLogBeginConvo) } -export function validateLogBeginConvo(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logBeginConvo', v) +export function validateLogBeginConvo(v: V) { + return validate(v, id, hashLogBeginConvo) } 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' - ) +const hashLogLeaveConvo = 'logLeaveConvo' + +export function isLogLeaveConvo(v: V) { + return is$typed(v, id, hashLogLeaveConvo) } -export function validateLogLeaveConvo(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logLeaveConvo', v) +export function validateLogLeaveConvo(v: V) { + return validate(v, id, hashLogLeaveConvo) } export interface LogCreateMessage { + $type?: 'chat.bsky.convo.defs#logCreateMessage' rev: string convoId: string - message: - | MessageView - | DeletedMessageView - | { $type: string; [k: string]: unknown } - [k: string]: unknown + message: $Typed | $Typed | { $type: string } } -export function isLogCreateMessage(v: unknown): v is LogCreateMessage { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#logCreateMessage' - ) +const hashLogCreateMessage = 'logCreateMessage' + +export function isLogCreateMessage(v: V) { + return is$typed(v, id, hashLogCreateMessage) } -export function validateLogCreateMessage(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logCreateMessage', v) +export function validateLogCreateMessage(v: V) { + return validate(v, id, hashLogCreateMessage) } export interface LogDeleteMessage { + $type?: 'chat.bsky.convo.defs#logDeleteMessage' rev: string convoId: string - message: - | MessageView - | DeletedMessageView - | { $type: string; [k: string]: unknown } - [k: string]: unknown + message: $Typed | $Typed | { $type: string } } -export function isLogDeleteMessage(v: unknown): v is LogDeleteMessage { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.defs#logDeleteMessage' - ) +const hashLogDeleteMessage = 'logDeleteMessage' + +export function isLogDeleteMessage(v: V) { + return is$typed(v, id, hashLogDeleteMessage) } -export function validateLogDeleteMessage(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.defs#logDeleteMessage', v) +export function validateLogDeleteMessage(v: V) { + return validate(v, id, hashLogDeleteMessage) } 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..0b26480e9ad 100644 --- a/packages/api/src/client/types/chat/bsky/convo/deleteMessageForSelf.ts +++ b/packages/api/src/client/types/chat/bsky/convo/deleteMessageForSelf.ts @@ -3,17 +3,20 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.deleteMessageForSelf' 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..6a44fb581e4 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getConvo.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.getConvo' export interface QueryParams { convoId: string @@ -16,7 +20,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..bca156adc3b 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getConvoForMembers.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getConvoForMembers.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.getConvoForMembers' export interface QueryParams { members: string[] @@ -16,7 +20,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..27ad0960d93 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getLog.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getLog.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.getLog' export interface QueryParams { cursor?: string @@ -17,13 +21,12 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string logs: ( - | ChatBskyConvoDefs.LogBeginConvo - | ChatBskyConvoDefs.LogLeaveConvo - | ChatBskyConvoDefs.LogCreateMessage - | ChatBskyConvoDefs.LogDeleteMessage - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | $Typed + | { $type: string } )[] - [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..065c8678ad0 100644 --- a/packages/api/src/client/types/chat/bsky/convo/getMessages.ts +++ b/packages/api/src/client/types/chat/bsky/convo/getMessages.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.getMessages' export interface QueryParams { convoId: string @@ -19,11 +23,10 @@ export type InputSchema = undefined export interface OutputSchema { cursor?: string messages: ( - | ChatBskyConvoDefs.MessageView - | ChatBskyConvoDefs.DeletedMessageView - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | { $type: string } )[] - [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..82e044b3d32 100644 --- a/packages/api/src/client/types/chat/bsky/convo/leaveConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/leaveConvo.ts @@ -3,21 +3,23 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.leaveConvo' 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..ae6a16f8661 100644 --- a/packages/api/src/client/types/chat/bsky/convo/listConvos.ts +++ b/packages/api/src/client/types/chat/bsky/convo/listConvos.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.listConvos' export interface QueryParams { limit?: number @@ -18,7 +22,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..d21c235354b 100644 --- a/packages/api/src/client/types/chat/bsky/convo/muteConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/muteConvo.ts @@ -3,21 +3,23 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.muteConvo' 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..f8c69b61ecc 100644 --- a/packages/api/src/client/types/chat/bsky/convo/sendMessage.ts +++ b/packages/api/src/client/types/chat/bsky/convo/sendMessage.ts @@ -3,17 +3,20 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.sendMessage' 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..0a80a238673 100644 --- a/packages/api/src/client/types/chat/bsky/convo/sendMessageBatch.ts +++ b/packages/api/src/client/types/chat/bsky/convo/sendMessageBatch.ts @@ -3,21 +3,23 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.sendMessageBatch' 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 +40,17 @@ 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 { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.convo.sendMessageBatch#batchItem' - ) +const hashBatchItem = 'batchItem' + +export function isBatchItem(v: V) { + return is$typed(v, id, hashBatchItem) } -export function validateBatchItem(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.convo.sendMessageBatch#batchItem', v) +export function validateBatchItem(v: V) { + return validate(v, id, hashBatchItem) } 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..12457078ee3 100644 --- a/packages/api/src/client/types/chat/bsky/convo/unmuteConvo.ts +++ b/packages/api/src/client/types/chat/bsky/convo/unmuteConvo.ts @@ -3,21 +3,23 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.unmuteConvo' 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..7003bf0e544 100644 --- a/packages/api/src/client/types/chat/bsky/convo/updateRead.ts +++ b/packages/api/src/client/types/chat/bsky/convo/updateRead.ts @@ -3,22 +3,24 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.convo.updateRead' 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..ed3fbcb964d 100644 --- a/packages/api/src/client/types/chat/bsky/moderation/getActorMetadata.ts +++ b/packages/api/src/client/types/chat/bsky/moderation/getActorMetadata.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.moderation.getActorMetadata' export interface QueryParams { actor: string @@ -17,7 +21,6 @@ export interface OutputSchema { day: Metadata month: Metadata all: Metadata - [k: string]: unknown } export interface CallOptions { @@ -36,21 +39,19 @@ 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 { - return ( - isObj(v) && - hasProp(v, '$type') && - v.$type === 'chat.bsky.moderation.getActorMetadata#metadata' - ) +const hashMetadata = 'metadata' + +export function isMetadata(v: V) { + return is$typed(v, id, hashMetadata) } -export function validateMetadata(v: unknown): ValidationResult { - return lexicons.validate('chat.bsky.moderation.getActorMetadata#metadata', v) +export function validateMetadata(v: V) { + return validate(v, id, hashMetadata) } 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..fb13f5ac6bb 100644 --- a/packages/api/src/client/types/chat/bsky/moderation/getMessageContext.ts +++ b/packages/api/src/client/types/chat/bsky/moderation/getMessageContext.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ChatBskyConvoDefs from '../convo/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ChatBskyConvoDefs from '../convo/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.moderation.getMessageContext' export interface QueryParams { /** Conversation that the message is from. NOTE: this field will eventually be required. */ @@ -20,11 +24,10 @@ export type InputSchema = undefined export interface OutputSchema { messages: ( - | ChatBskyConvoDefs.MessageView - | ChatBskyConvoDefs.DeletedMessageView - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | { $type: string } )[] - [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..94950f5a5c2 100644 --- a/packages/api/src/client/types/chat/bsky/moderation/updateActorAccess.ts +++ b/packages/api/src/client/types/chat/bsky/moderation/updateActorAccess.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'chat.bsky.moderation.updateActorAccess' export interface QueryParams {} @@ -13,7 +17,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..c130e5bb0c2 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,37 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoServerDefs from '../server/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoServerDefs from '../server/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.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' - ) +const hashStatusAttr = 'statusAttr' + +export function isStatusAttr(v: V) { + return is$typed(v, id, hashStatusAttr) } -export function validateStatusAttr(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#statusAttr', v) +export function validateStatusAttr(v: V) { + return validate(v, id, hashStatusAttr) } 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 +41,62 @@ 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' - ) +const hashAccountView = 'accountView' + +export function isAccountView(v: V) { + return is$typed(v, id, hashAccountView) } -export function validateAccountView(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#accountView', v) +export function validateAccountView(v: V) { + return validate(v, id, hashAccountView) } 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' - ) +const hashRepoRef = 'repoRef' + +export function isRepoRef(v: V) { + return is$typed(v, id, hashRepoRef) } -export function validateRepoRef(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoRef', v) +export function validateRepoRef(v: V) { + return validate(v, id, hashRepoRef) } 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' - ) +const hashRepoBlobRef = 'repoBlobRef' + +export function isRepoBlobRef(v: V) { + return is$typed(v, id, hashRepoBlobRef) } -export function validateRepoBlobRef(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#repoBlobRef', v) +export function validateRepoBlobRef(v: V) { + return validate(v, id, hashRepoBlobRef) } 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' - ) +const hashThreatSignature = 'threatSignature' + +export function isThreatSignature(v: V) { + return is$typed(v, id, hashThreatSignature) } -export function validateThreatSignature(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.admin.defs#threatSignature', v) +export function validateThreatSignature(v: V) { + return validate(v, id, hashThreatSignature) } 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..b8aa22091d8 100644 --- a/packages/api/src/client/types/com/atproto/admin/deleteAccount.ts +++ b/packages/api/src/client/types/com/atproto/admin/deleteAccount.ts @@ -3,15 +3,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.deleteAccount' 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..dcb96b88673 100644 --- a/packages/api/src/client/types/com/atproto/admin/disableAccountInvites.ts +++ b/packages/api/src/client/types/com/atproto/admin/disableAccountInvites.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.disableAccountInvites' export interface QueryParams {} @@ -13,7 +17,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..0afc3772a96 100644 --- a/packages/api/src/client/types/com/atproto/admin/disableInviteCodes.ts +++ b/packages/api/src/client/types/com/atproto/admin/disableInviteCodes.ts @@ -3,16 +3,19 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.disableInviteCodes' 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..71c826d41e3 100644 --- a/packages/api/src/client/types/com/atproto/admin/enableAccountInvites.ts +++ b/packages/api/src/client/types/com/atproto/admin/enableAccountInvites.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.enableAccountInvites' export interface QueryParams {} @@ -13,7 +17,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..9aa44104d7a 100644 --- a/packages/api/src/client/types/com/atproto/admin/getAccountInfo.ts +++ b/packages/api/src/client/types/com/atproto/admin/getAccountInfo.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoAdminDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.getAccountInfo' export interface QueryParams { did: string 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..8fa95fb39ab 100644 --- a/packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts +++ b/packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoAdminDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.getAccountInfos' export interface QueryParams { dids: string[] @@ -16,7 +20,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..125d09b54f5 100644 --- a/packages/api/src/client/types/com/atproto/admin/getInviteCodes.ts +++ b/packages/api/src/client/types/com/atproto/admin/getInviteCodes.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoServerDefs from '../server/defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoServerDefs from '../server/defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.getInviteCodes' export interface QueryParams { sort?: 'recent' | 'usage' | (string & {}) @@ -19,7 +23,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..b5e1ea1fcc7 100644 --- a/packages/api/src/client/types/com/atproto/admin/getSubjectStatus.ts +++ b/packages/api/src/client/types/com/atproto/admin/getSubjectStatus.ts @@ -3,11 +3,15 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoAdminDefs from './defs.js' +import type * as ComAtprotoRepoStrongRef from '../repo/strongRef.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.getSubjectStatus' export interface QueryParams { did?: string @@ -19,13 +23,12 @@ export type InputSchema = undefined export interface OutputSchema { subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | ComAtprotoAdminDefs.RepoBlobRef - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } 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..d51219d3131 100644 --- a/packages/api/src/client/types/com/atproto/admin/searchAccounts.ts +++ b/packages/api/src/client/types/com/atproto/admin/searchAccounts.ts @@ -3,10 +3,14 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoAdminDefs from './defs.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.searchAccounts' export interface QueryParams { email?: string @@ -19,7 +23,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..2e0b39ceeab 100644 --- a/packages/api/src/client/types/com/atproto/admin/sendEmail.ts +++ b/packages/api/src/client/types/com/atproto/admin/sendEmail.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.sendEmail' export interface QueryParams {} @@ -16,12 +20,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..695f6c0f770 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateAccountEmail.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateAccountEmail.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.updateAccountEmail' export interface QueryParams {} @@ -13,7 +17,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..e1d20d19a25 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateAccountHandle.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateAccountHandle.ts @@ -3,16 +3,19 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.updateAccountHandle' 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..8494a8f4a53 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateAccountPassword.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateAccountPassword.ts @@ -3,16 +3,19 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.updateAccountPassword' 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..6ef3a83fdfa 100644 --- a/packages/api/src/client/types/com/atproto/admin/updateSubjectStatus.ts +++ b/packages/api/src/client/types/com/atproto/admin/updateSubjectStatus.ts @@ -3,33 +3,35 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' -import * as ComAtprotoAdminDefs from './defs' -import * as ComAtprotoRepoStrongRef from '../repo/strongRef' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' +import type * as ComAtprotoAdminDefs from './defs.js' +import type * as ComAtprotoRepoStrongRef from '../repo/strongRef.js' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.admin.updateSubjectStatus' export interface QueryParams {} export interface InputSchema { subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | ComAtprotoAdminDefs.RepoBlobRef - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } takedown?: ComAtprotoAdminDefs.StatusAttr deactivated?: ComAtprotoAdminDefs.StatusAttr - [k: string]: unknown } export interface OutputSchema { subject: - | ComAtprotoAdminDefs.RepoRef - | ComAtprotoRepoStrongRef.Main - | ComAtprotoAdminDefs.RepoBlobRef - | { $type: string; [k: string]: unknown } + | $Typed + | $Typed + | $Typed + | { $type: string } 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..39d0436544e 100644 --- a/packages/api/src/client/types/com/atproto/identity/getRecommendedDidCredentials.ts +++ b/packages/api/src/client/types/com/atproto/identity/getRecommendedDidCredentials.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.identity.getRecommendedDidCredentials' export interface QueryParams {} @@ -15,9 +19,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..bea45b12cf9 100644 --- a/packages/api/src/client/types/com/atproto/identity/requestPlcOperationSignature.ts +++ b/packages/api/src/client/types/com/atproto/identity/requestPlcOperationSignature.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.identity.requestPlcOperationSignature' export interface QueryParams {} 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..3610d75c0a2 100644 --- a/packages/api/src/client/types/com/atproto/identity/resolveHandle.ts +++ b/packages/api/src/client/types/com/atproto/identity/resolveHandle.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.identity.resolveHandle' export interface QueryParams { /** The handle to resolve. */ @@ -16,7 +20,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..ee670d1f589 100644 --- a/packages/api/src/client/types/com/atproto/identity/signPlcOperation.ts +++ b/packages/api/src/client/types/com/atproto/identity/signPlcOperation.ts @@ -3,9 +3,13 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.identity.signPlcOperation' export interface QueryParams {} @@ -14,15 +18,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..27706159918 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,18 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.identity.submitPlcOperation' 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..10110120687 100644 --- a/packages/api/src/client/types/com/atproto/identity/updateHandle.ts +++ b/packages/api/src/client/types/com/atproto/identity/updateHandle.ts @@ -3,16 +3,19 @@ */ import { HeadersMap, XRPCError } from '@atproto/xrpc' import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.identity.updateHandle' 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..b5f75bfce0b 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,17 @@ * GENERATED CODE - DO NOT MODIFY */ import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' import { CID } from 'multiformats/cid' +import { validate as _validate } from '../../../../lexicons' +import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util' + +const is$typed = _is$typed, + validate = _validate +const id = 'com.atproto.label.defs' /** 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 +31,54 @@ 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' - ) +const hashLabel = 'label' + +export function isLabel(v: V) { + return is$typed(v, id, hashLabel) } -export function validateLabel(v: unknown): ValidationResult { - return lexicons.validate('com.atproto.label.defs#label', v) +export function validateLabel(v: V) { + return validate