From de82b273854f938513891ccb9e33674ec2ca38b4 Mon Sep 17 00:00:00 2001 From: thribhuvan003 Date: Sun, 5 Jul 2026 08:40:49 +0530 Subject: [PATCH 1/8] fix: check the file tree before the timeline reports removed types --- server/api/registry/timeline/[...pkg].get.ts | 33 +++++++- .../api/registry/timeline/pkg.get.spec.ts | 78 +++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) diff --git a/server/api/registry/timeline/[...pkg].get.ts b/server/api/registry/timeline/[...pkg].get.ts index 948decc7bf..1312bc9427 100644 --- a/server/api/registry/timeline/[...pkg].get.ts +++ b/server/api/registry/timeline/[...pkg].get.ts @@ -1,8 +1,13 @@ import { normalizeLicense } from '#shared/utils/npm' -import { hasBuiltInTypes } from '~~/shared/utils/package-analysis' +import { detectTypesStatus, hasBuiltInTypes } from '~~/shared/utils/package-analysis' +import { flattenFileTree } from '~~/server/utils/import-resolver' const DEFAULT_LIMIT = 25 +// Upper bound on per-request file tree lookups when double-checking +// versions that would otherwise produce a "types removed" event. +const MAX_FILE_TREE_CHECKS = 5 + export interface TimelineVersion { version: string time: string @@ -83,6 +88,32 @@ export default defineCachedEventHandler( }) .sort((a, b) => Date.parse(b.time) - Date.parse(a.time)) + // A missing `types` field doesn't always mean a version stopped + // shipping types: some packages only carry declaration files next + // to their entry points (#2791). Before a "types removed" event + // can show up, re-check those versions against their file tree + // with the same detection the package page uses. Oldest first so + // a corrected version is taken into account by the next pair. + let fileTreeChecks = 0 + for (let i = allVersions.length - 2; i >= 0; i--) { + const current = allVersions[i]! + const previous = allVersions[i + 1]! + if (current.hasTypes || !previous.hasTypes || fileTreeChecks >= MAX_FILE_TREE_CHECKS) { + continue + } + fileTreeChecks++ + try { + const fileTree = await getPackageFileTree(packageName, current.version) + const files = flattenFileTree(fileTree.tree) + const status = detectTypesStatus(packument.versions[current.version]!, undefined, files) + if (status.kind === 'included') { + current.hasTypes = true + } + } catch { + // file tree unavailable, keep the packument-based value + } + } + return { versions: allVersions.slice(offset, offset + limit), total: allVersions.length, diff --git a/test/unit/server/api/registry/timeline/pkg.get.spec.ts b/test/unit/server/api/registry/timeline/pkg.get.spec.ts index 44fea5a101..9ca5d21a40 100644 --- a/test/unit/server/api/registry/timeline/pkg.get.spec.ts +++ b/test/unit/server/api/registry/timeline/pkg.get.spec.ts @@ -4,6 +4,9 @@ import type { Packument, PackumentVersion } from '#shared/types/npm-registry' const fetchNpmPackageMock = vi.fn() vi.stubGlobal('fetchNpmPackage', fetchNpmPackageMock) + +const getPackageFileTreeMock = vi.fn() +vi.stubGlobal('getPackageFileTree', getPackageFileTreeMock) vi.stubGlobal('defineCachedEventHandler', (fn: Function) => fn) vi.stubGlobal('CACHE_MAX_AGE_FIVE_MINUTES', 300) @@ -228,6 +231,81 @@ describe('timeline API', () => { expect(result.versions[0]!.hasTypes).toBe(true) }) + it('sets hasTypes for versions that ship declaration files without a types field', async () => { + routerParam = 'my-pkg' + + fetchNpmPackageMock.mockResolvedValue( + makePackument({ + versions: { + '1.0.0': { types: './index.d.ts' }, + '2.0.0': { main: './dist/index.cjs', module: './dist/index.mjs' }, + }, + time: { + '1.0.0': '2024-01-01T00:00:00Z', + '2.0.0': '2024-02-01T00:00:00Z', + }, + }), + ) + getPackageFileTreeMock.mockResolvedValue({ + package: 'my-pkg', + version: '2.0.0', + tree: [ + { name: 'index.d.mts', path: 'dist/index.d.mts', type: 'file' }, + { name: 'index.d.cts', path: 'dist/index.d.cts', type: 'file' }, + ], + }) + + const result = await handler(fakeEvent) + expect(getPackageFileTreeMock).toHaveBeenCalledWith('my-pkg', '2.0.0') + expect(result.versions[0]!.hasTypes).toBe(true) + }) + + it('leaves hasTypes unset when the file tree has no declaration files', async () => { + routerParam = 'my-pkg' + + fetchNpmPackageMock.mockResolvedValue( + makePackument({ + versions: { + '1.0.0': { types: './index.d.ts' }, + '2.0.0': { main: './dist/index.cjs', module: './dist/index.mjs' }, + }, + time: { + '1.0.0': '2024-01-01T00:00:00Z', + '2.0.0': '2024-02-01T00:00:00Z', + }, + }), + ) + getPackageFileTreeMock.mockResolvedValue({ + package: 'my-pkg', + version: '2.0.0', + tree: [{ name: 'index.mjs', path: 'dist/index.mjs', type: 'file' }], + }) + + const result = await handler(fakeEvent) + expect(result.versions[0]!.hasTypes).toBeUndefined() + }) + + it('keeps the packument value when the file tree lookup fails', async () => { + routerParam = 'my-pkg' + + fetchNpmPackageMock.mockResolvedValue( + makePackument({ + versions: { + '1.0.0': { types: './index.d.ts' }, + '2.0.0': { main: './dist/index.cjs' }, + }, + time: { + '1.0.0': '2024-01-01T00:00:00Z', + '2.0.0': '2024-02-01T00:00:00Z', + }, + }), + ) + getPackageFileTreeMock.mockRejectedValue(new Error('offline')) + + const result = await handler(fakeEvent) + expect(result.versions[0]!.hasTypes).toBeUndefined() + }) + it('sets hasTrustedPublisher when trustedPublisher is true', async () => { routerParam = 'my-pkg' From e8d3d33c7588e635c58eb2f507875472287fcf25 Mon Sep 17 00:00:00 2001 From: thribhuvan003 Date: Sun, 5 Jul 2026 13:10:50 +0530 Subject: [PATCH 2/8] fix: bound timeline file tree lookups with a timeout --- server/api/registry/timeline/[...pkg].get.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/registry/timeline/[...pkg].get.ts b/server/api/registry/timeline/[...pkg].get.ts index 1312bc9427..de0ce6269b 100644 --- a/server/api/registry/timeline/[...pkg].get.ts +++ b/server/api/registry/timeline/[...pkg].get.ts @@ -103,7 +103,7 @@ export default defineCachedEventHandler( } fileTreeChecks++ try { - const fileTree = await getPackageFileTree(packageName, current.version) + const fileTree = await getPackageFileTree(packageName, current.version, AbortSignal.timeout(5000)) const files = flattenFileTree(fileTree.tree) const status = detectTypesStatus(packument.versions[current.version]!, undefined, files) if (status.kind === 'included') { From 1250b7a65b2367a6be1b8d7ef2b857b47c85a94b Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 5 Jul 2026 07:42:39 +0000 Subject: [PATCH 3/8] [autofix.ci] apply automated fixes --- server/api/registry/timeline/[...pkg].get.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/api/registry/timeline/[...pkg].get.ts b/server/api/registry/timeline/[...pkg].get.ts index de0ce6269b..07d8026538 100644 --- a/server/api/registry/timeline/[...pkg].get.ts +++ b/server/api/registry/timeline/[...pkg].get.ts @@ -103,7 +103,11 @@ export default defineCachedEventHandler( } fileTreeChecks++ try { - const fileTree = await getPackageFileTree(packageName, current.version, AbortSignal.timeout(5000)) + const fileTree = await getPackageFileTree( + packageName, + current.version, + AbortSignal.timeout(5000), + ) const files = flattenFileTree(fileTree.tree) const status = detectTypesStatus(packument.versions[current.version]!, undefined, files) if (status.kind === 'included') { From f8a90b7fb29ef69607880a1a015390f48b7d9f92 Mon Sep 17 00:00:00 2001 From: thribhuvan003 Date: Sun, 5 Jul 2026 13:17:56 +0530 Subject: [PATCH 4/8] test: account for the abort signal argument --- test/unit/server/api/registry/timeline/pkg.get.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/server/api/registry/timeline/pkg.get.spec.ts b/test/unit/server/api/registry/timeline/pkg.get.spec.ts index 9ca5d21a40..832125302f 100644 --- a/test/unit/server/api/registry/timeline/pkg.get.spec.ts +++ b/test/unit/server/api/registry/timeline/pkg.get.spec.ts @@ -256,7 +256,7 @@ describe('timeline API', () => { }) const result = await handler(fakeEvent) - expect(getPackageFileTreeMock).toHaveBeenCalledWith('my-pkg', '2.0.0') + expect(getPackageFileTreeMock).toHaveBeenCalledWith('my-pkg', '2.0.0', expect.any(AbortSignal)) expect(result.versions[0]!.hasTypes).toBe(true) }) From 7223b4b05d4780751b039f154b84767a63d4fcb8 Mon Sep 17 00:00:00 2001 From: thribhuvan003 Date: Tue, 7 Jul 2026 15:36:52 +0530 Subject: [PATCH 5/8] refactor: reuse analyzePackage for the timeline types check --- server/api/registry/timeline/[...pkg].get.ts | 14 +- src/lexicons/app.ts | 5 + src/lexicons/app/bsky.ts | 11 + src/lexicons/app/bsky/actor.ts | 8 + src/lexicons/app/bsky/actor/defs.defs.ts | 1279 +++++++++++++++++ src/lexicons/app/bsky/actor/defs.ts | 5 + .../app/bsky/actor/getProfiles.defs.ts | 40 + src/lexicons/app/bsky/actor/getProfiles.ts | 6 + src/lexicons/app/bsky/actor/profile.defs.ts | 118 ++ src/lexicons/app/bsky/actor/profile.ts | 6 + src/lexicons/app/bsky/actor/status.defs.ts | 83 ++ src/lexicons/app/bsky/actor/status.ts | 6 + src/lexicons/app/bsky/embed.ts | 10 + src/lexicons/app/bsky/embed/defs.defs.ts | 30 + src/lexicons/app/bsky/embed/defs.ts | 5 + src/lexicons/app/bsky/embed/external.defs.ts | 100 ++ src/lexicons/app/bsky/embed/external.ts | 6 + src/lexicons/app/bsky/embed/images.defs.ts | 125 ++ src/lexicons/app/bsky/embed/images.ts | 6 + src/lexicons/app/bsky/embed/record.defs.ts | 230 +++ src/lexicons/app/bsky/embed/record.ts | 6 + .../app/bsky/embed/recordWithMedia.defs.ts | 102 ++ .../app/bsky/embed/recordWithMedia.ts | 6 + src/lexicons/app/bsky/embed/video.defs.ts | 133 ++ src/lexicons/app/bsky/embed/video.ts | 6 + src/lexicons/app/bsky/feed.ts | 11 + src/lexicons/app/bsky/feed/defs.defs.ts | 817 +++++++++++ src/lexicons/app/bsky/feed/defs.ts | 5 + src/lexicons/app/bsky/feed/getLikes.defs.ts | 67 + src/lexicons/app/bsky/feed/getLikes.ts | 6 + .../app/bsky/feed/getPostThread.defs.ts | 63 + src/lexicons/app/bsky/feed/getPostThread.ts | 6 + src/lexicons/app/bsky/feed/getPosts.defs.ts | 37 + src/lexicons/app/bsky/feed/getPosts.ts | 6 + src/lexicons/app/bsky/feed/post.defs.ts | 225 +++ src/lexicons/app/bsky/feed/post.ts | 6 + src/lexicons/app/bsky/feed/postgate.defs.ts | 85 ++ src/lexicons/app/bsky/feed/postgate.ts | 6 + src/lexicons/app/bsky/feed/threadgate.defs.ts | 145 ++ src/lexicons/app/bsky/feed/threadgate.ts | 6 + src/lexicons/app/bsky/graph.ts | 5 + src/lexicons/app/bsky/graph/defs.defs.ts | 397 +++++ src/lexicons/app/bsky/graph/defs.ts | 5 + src/lexicons/app/bsky/labeler.ts | 5 + src/lexicons/app/bsky/labeler/defs.defs.ts | 186 +++ src/lexicons/app/bsky/labeler/defs.ts | 5 + src/lexicons/app/bsky/notification.ts | 5 + .../app/bsky/notification/defs.defs.ts | 182 +++ src/lexicons/app/bsky/notification/defs.ts | 5 + src/lexicons/app/bsky/richtext.ts | 5 + src/lexicons/app/bsky/richtext/facet.defs.ts | 122 ++ src/lexicons/app/bsky/richtext/facet.ts | 6 + src/lexicons/blue.ts | 5 + src/lexicons/blue/microcosm.ts | 7 + src/lexicons/blue/microcosm/identity.ts | 5 + .../microcosm/identity/resolveMiniDoc.defs.ts | 35 + .../blue/microcosm/identity/resolveMiniDoc.ts | 6 + src/lexicons/blue/microcosm/links.ts | 7 + .../blue/microcosm/links/getBacklinks.defs.ts | 81 ++ .../blue/microcosm/links/getBacklinks.ts | 6 + .../microcosm/links/getBacklinksCount.defs.ts | 33 + .../blue/microcosm/links/getBacklinksCount.ts | 6 + .../links/getManyToManyCounts.defs.ts | 84 ++ .../microcosm/links/getManyToManyCounts.ts | 6 + src/lexicons/blue/microcosm/repo.ts | 5 + .../microcosm/repo/getRecordByUri.defs.ts | 35 + .../blue/microcosm/repo/getRecordByUri.ts | 6 + src/lexicons/com.ts | 5 + src/lexicons/com/atproto.ts | 9 + src/lexicons/com/atproto/identity.ts | 5 + .../atproto/identity/resolveHandle.defs.ts | 32 + .../com/atproto/identity/resolveHandle.ts | 6 + src/lexicons/com/atproto/label.ts | 5 + src/lexicons/com/atproto/label/defs.defs.ts | 260 ++++ src/lexicons/com/atproto/label/defs.ts | 5 + src/lexicons/com/atproto/moderation.ts | 5 + .../com/atproto/moderation/defs.defs.ts | 197 +++ src/lexicons/com/atproto/moderation/defs.ts | 5 + src/lexicons/com/atproto/repo.ts | 8 + .../com/atproto/repo/applyWrites.defs.ts | 201 +++ src/lexicons/com/atproto/repo/applyWrites.ts | 6 + src/lexicons/com/atproto/repo/defs.defs.ts | 28 + src/lexicons/com/atproto/repo/defs.ts | 5 + .../com/atproto/repo/getRecord.defs.ts | 37 + src/lexicons/com/atproto/repo/getRecord.ts | 6 + .../com/atproto/repo/strongRef.defs.ts | 41 + src/lexicons/com/atproto/repo/strongRef.ts | 6 + src/lexicons/com/atproto/sync.ts | 5 + .../com/atproto/sync/getLatestCommit.defs.ts | 38 + .../com/atproto/sync/getLatestCommit.ts | 6 + src/lexicons/dev.ts | 5 + src/lexicons/dev/npmx.ts | 6 + src/lexicons/dev/npmx/actor.ts | 5 + src/lexicons/dev/npmx/actor/profile.defs.ts | 64 + src/lexicons/dev/npmx/actor/profile.ts | 6 + src/lexicons/dev/npmx/feed.ts | 5 + src/lexicons/dev/npmx/feed/like.defs.ts | 58 + src/lexicons/dev/npmx/feed/like.ts | 6 + src/lexicons/site.ts | 5 + src/lexicons/site/standard.ts | 7 + src/lexicons/site/standard/document.defs.ts | 118 ++ src/lexicons/site/standard/document.ts | 6 + .../site/standard/publication.defs.ts | 109 ++ src/lexicons/site/standard/publication.ts | 6 + src/lexicons/site/standard/theme.ts | 6 + .../site/standard/theme/basic.defs.ts | 76 + src/lexicons/site/standard/theme/basic.ts | 6 + .../site/standard/theme/color.defs.ts | 53 + src/lexicons/site/standard/theme/color.ts | 5 + src/lexicons/tools.ts | 5 + src/lexicons/tools/ozone.ts | 5 + src/lexicons/tools/ozone/report.ts | 5 + src/lexicons/tools/ozone/report/defs.defs.ts | 604 ++++++++ src/lexicons/tools/ozone/report/defs.ts | 5 + .../api/registry/timeline/pkg.get.spec.ts | 25 +- 115 files changed, 7189 insertions(+), 25 deletions(-) create mode 100644 src/lexicons/app.ts create mode 100644 src/lexicons/app/bsky.ts create mode 100644 src/lexicons/app/bsky/actor.ts create mode 100644 src/lexicons/app/bsky/actor/defs.defs.ts create mode 100644 src/lexicons/app/bsky/actor/defs.ts create mode 100644 src/lexicons/app/bsky/actor/getProfiles.defs.ts create mode 100644 src/lexicons/app/bsky/actor/getProfiles.ts create mode 100644 src/lexicons/app/bsky/actor/profile.defs.ts create mode 100644 src/lexicons/app/bsky/actor/profile.ts create mode 100644 src/lexicons/app/bsky/actor/status.defs.ts create mode 100644 src/lexicons/app/bsky/actor/status.ts create mode 100644 src/lexicons/app/bsky/embed.ts create mode 100644 src/lexicons/app/bsky/embed/defs.defs.ts create mode 100644 src/lexicons/app/bsky/embed/defs.ts create mode 100644 src/lexicons/app/bsky/embed/external.defs.ts create mode 100644 src/lexicons/app/bsky/embed/external.ts create mode 100644 src/lexicons/app/bsky/embed/images.defs.ts create mode 100644 src/lexicons/app/bsky/embed/images.ts create mode 100644 src/lexicons/app/bsky/embed/record.defs.ts create mode 100644 src/lexicons/app/bsky/embed/record.ts create mode 100644 src/lexicons/app/bsky/embed/recordWithMedia.defs.ts create mode 100644 src/lexicons/app/bsky/embed/recordWithMedia.ts create mode 100644 src/lexicons/app/bsky/embed/video.defs.ts create mode 100644 src/lexicons/app/bsky/embed/video.ts create mode 100644 src/lexicons/app/bsky/feed.ts create mode 100644 src/lexicons/app/bsky/feed/defs.defs.ts create mode 100644 src/lexicons/app/bsky/feed/defs.ts create mode 100644 src/lexicons/app/bsky/feed/getLikes.defs.ts create mode 100644 src/lexicons/app/bsky/feed/getLikes.ts create mode 100644 src/lexicons/app/bsky/feed/getPostThread.defs.ts create mode 100644 src/lexicons/app/bsky/feed/getPostThread.ts create mode 100644 src/lexicons/app/bsky/feed/getPosts.defs.ts create mode 100644 src/lexicons/app/bsky/feed/getPosts.ts create mode 100644 src/lexicons/app/bsky/feed/post.defs.ts create mode 100644 src/lexicons/app/bsky/feed/post.ts create mode 100644 src/lexicons/app/bsky/feed/postgate.defs.ts create mode 100644 src/lexicons/app/bsky/feed/postgate.ts create mode 100644 src/lexicons/app/bsky/feed/threadgate.defs.ts create mode 100644 src/lexicons/app/bsky/feed/threadgate.ts create mode 100644 src/lexicons/app/bsky/graph.ts create mode 100644 src/lexicons/app/bsky/graph/defs.defs.ts create mode 100644 src/lexicons/app/bsky/graph/defs.ts create mode 100644 src/lexicons/app/bsky/labeler.ts create mode 100644 src/lexicons/app/bsky/labeler/defs.defs.ts create mode 100644 src/lexicons/app/bsky/labeler/defs.ts create mode 100644 src/lexicons/app/bsky/notification.ts create mode 100644 src/lexicons/app/bsky/notification/defs.defs.ts create mode 100644 src/lexicons/app/bsky/notification/defs.ts create mode 100644 src/lexicons/app/bsky/richtext.ts create mode 100644 src/lexicons/app/bsky/richtext/facet.defs.ts create mode 100644 src/lexicons/app/bsky/richtext/facet.ts create mode 100644 src/lexicons/blue.ts create mode 100644 src/lexicons/blue/microcosm.ts create mode 100644 src/lexicons/blue/microcosm/identity.ts create mode 100644 src/lexicons/blue/microcosm/identity/resolveMiniDoc.defs.ts create mode 100644 src/lexicons/blue/microcosm/identity/resolveMiniDoc.ts create mode 100644 src/lexicons/blue/microcosm/links.ts create mode 100644 src/lexicons/blue/microcosm/links/getBacklinks.defs.ts create mode 100644 src/lexicons/blue/microcosm/links/getBacklinks.ts create mode 100644 src/lexicons/blue/microcosm/links/getBacklinksCount.defs.ts create mode 100644 src/lexicons/blue/microcosm/links/getBacklinksCount.ts create mode 100644 src/lexicons/blue/microcosm/links/getManyToManyCounts.defs.ts create mode 100644 src/lexicons/blue/microcosm/links/getManyToManyCounts.ts create mode 100644 src/lexicons/blue/microcosm/repo.ts create mode 100644 src/lexicons/blue/microcosm/repo/getRecordByUri.defs.ts create mode 100644 src/lexicons/blue/microcosm/repo/getRecordByUri.ts create mode 100644 src/lexicons/com.ts create mode 100644 src/lexicons/com/atproto.ts create mode 100644 src/lexicons/com/atproto/identity.ts create mode 100644 src/lexicons/com/atproto/identity/resolveHandle.defs.ts create mode 100644 src/lexicons/com/atproto/identity/resolveHandle.ts create mode 100644 src/lexicons/com/atproto/label.ts create mode 100644 src/lexicons/com/atproto/label/defs.defs.ts create mode 100644 src/lexicons/com/atproto/label/defs.ts create mode 100644 src/lexicons/com/atproto/moderation.ts create mode 100644 src/lexicons/com/atproto/moderation/defs.defs.ts create mode 100644 src/lexicons/com/atproto/moderation/defs.ts create mode 100644 src/lexicons/com/atproto/repo.ts create mode 100644 src/lexicons/com/atproto/repo/applyWrites.defs.ts create mode 100644 src/lexicons/com/atproto/repo/applyWrites.ts create mode 100644 src/lexicons/com/atproto/repo/defs.defs.ts create mode 100644 src/lexicons/com/atproto/repo/defs.ts create mode 100644 src/lexicons/com/atproto/repo/getRecord.defs.ts create mode 100644 src/lexicons/com/atproto/repo/getRecord.ts create mode 100644 src/lexicons/com/atproto/repo/strongRef.defs.ts create mode 100644 src/lexicons/com/atproto/repo/strongRef.ts create mode 100644 src/lexicons/com/atproto/sync.ts create mode 100644 src/lexicons/com/atproto/sync/getLatestCommit.defs.ts create mode 100644 src/lexicons/com/atproto/sync/getLatestCommit.ts create mode 100644 src/lexicons/dev.ts create mode 100644 src/lexicons/dev/npmx.ts create mode 100644 src/lexicons/dev/npmx/actor.ts create mode 100644 src/lexicons/dev/npmx/actor/profile.defs.ts create mode 100644 src/lexicons/dev/npmx/actor/profile.ts create mode 100644 src/lexicons/dev/npmx/feed.ts create mode 100644 src/lexicons/dev/npmx/feed/like.defs.ts create mode 100644 src/lexicons/dev/npmx/feed/like.ts create mode 100644 src/lexicons/site.ts create mode 100644 src/lexicons/site/standard.ts create mode 100644 src/lexicons/site/standard/document.defs.ts create mode 100644 src/lexicons/site/standard/document.ts create mode 100644 src/lexicons/site/standard/publication.defs.ts create mode 100644 src/lexicons/site/standard/publication.ts create mode 100644 src/lexicons/site/standard/theme.ts create mode 100644 src/lexicons/site/standard/theme/basic.defs.ts create mode 100644 src/lexicons/site/standard/theme/basic.ts create mode 100644 src/lexicons/site/standard/theme/color.defs.ts create mode 100644 src/lexicons/site/standard/theme/color.ts create mode 100644 src/lexicons/tools.ts create mode 100644 src/lexicons/tools/ozone.ts create mode 100644 src/lexicons/tools/ozone/report.ts create mode 100644 src/lexicons/tools/ozone/report/defs.defs.ts create mode 100644 src/lexicons/tools/ozone/report/defs.ts diff --git a/server/api/registry/timeline/[...pkg].get.ts b/server/api/registry/timeline/[...pkg].get.ts index 07d8026538..5746ea652f 100644 --- a/server/api/registry/timeline/[...pkg].get.ts +++ b/server/api/registry/timeline/[...pkg].get.ts @@ -1,6 +1,5 @@ import { normalizeLicense } from '#shared/utils/npm' -import { detectTypesStatus, hasBuiltInTypes } from '~~/shared/utils/package-analysis' -import { flattenFileTree } from '~~/server/utils/import-resolver' +import { analyzePackage, hasBuiltInTypes } from '~~/shared/utils/package-analysis' const DEFAULT_LIMIT = 25 @@ -103,14 +102,9 @@ export default defineCachedEventHandler( } fileTreeChecks++ try { - const fileTree = await getPackageFileTree( - packageName, - current.version, - AbortSignal.timeout(5000), - ) - const files = flattenFileTree(fileTree.tree) - const status = detectTypesStatus(packument.versions[current.version]!, undefined, files) - if (status.kind === 'included') { + const { pkg, typesPackage, files } = await fetchPackageWithTypesAndFiles(packageName, current.version) + const { types } = analyzePackage(pkg, { typesPackage, files }) + if (types.kind === 'included') { current.hasTypes = true } } catch { diff --git a/src/lexicons/app.ts b/src/lexicons/app.ts new file mode 100644 index 0000000000..2cd3e3e101 --- /dev/null +++ b/src/lexicons/app.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as bsky from './app/bsky.js' diff --git a/src/lexicons/app/bsky.ts b/src/lexicons/app/bsky.ts new file mode 100644 index 0000000000..9b330e2383 --- /dev/null +++ b/src/lexicons/app/bsky.ts @@ -0,0 +1,11 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as actor from './bsky/actor.js' +export * as embed from './bsky/embed.js' +export * as feed from './bsky/feed.js' +export * as graph from './bsky/graph.js' +export * as labeler from './bsky/labeler.js' +export * as notification from './bsky/notification.js' +export * as richtext from './bsky/richtext.js' diff --git a/src/lexicons/app/bsky/actor.ts b/src/lexicons/app/bsky/actor.ts new file mode 100644 index 0000000000..e57e7da8d1 --- /dev/null +++ b/src/lexicons/app/bsky/actor.ts @@ -0,0 +1,8 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './actor/defs.js' +export * as getProfiles from './actor/getProfiles.js' +export * as profile from './actor/profile.js' +export * as status from './actor/status.js' diff --git a/src/lexicons/app/bsky/actor/defs.defs.ts b/src/lexicons/app/bsky/actor/defs.defs.ts new file mode 100644 index 0000000000..c3393e871c --- /dev/null +++ b/src/lexicons/app/bsky/actor/defs.defs.ts @@ -0,0 +1,1279 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedExternal from './..\\embed\\external.defs.js' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' +import * as GraphDefs from './..\\graph\\defs.defs.js' +import * as NotificationDefs from './..\\notification\\defs.defs.js' +import * as RepoStrongRef from './..\\..\\..\\com\\atproto\\repo\\strongRef.defs.js' +import * as FeedThreadgate from './..\\feed\\threadgate.defs.js' +import * as FeedPostgate from './..\\feed\\postgate.defs.js' + +const $nsid = 'app.bsky.actor.defs' + +export { $nsid } + +/** A new user experiences (NUX) storage object */ +type Nux = { + $type?: 'app.bsky.actor.defs#nux' + id: string + + /** + * Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. + */ + data?: string + completed: boolean + + /** + * The date and time at which the NUX will expire and should be considered completed. + */ + expiresAt?: l.DatetimeString +} + +export type { Nux } + +/** A new user experiences (NUX) storage object */ +const nux = /*#__PURE__*/ l.typedObject( + $nsid, + 'nux', + /*#__PURE__*/ l.object({ + id: /*#__PURE__*/ l.string({ maxLength: 100 }), + data: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 3000, maxGraphemes: 300 }), + ), + completed: /*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false), + expiresAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + }), +) + +export { nux } + +/** A word that the account owner has muted. */ +type MutedWord = { + $type?: 'app.bsky.actor.defs#mutedWord' + id?: string + + /** + * The muted word itself. + */ + value: string + + /** + * The intended targets of the muted word. + */ + targets: MutedWordTarget[] + + /** + * The date and time at which the muted word will expire and no longer be applied. + */ + expiresAt?: l.DatetimeString + + /** + * Groups of users to apply the muted word to. If undefined, applies to all users. + */ + actorTarget?: 'all' | 'exclude-following' | l.UnknownString +} + +export type { MutedWord } + +/** A word that the account owner has muted. */ +const mutedWord = /*#__PURE__*/ l.typedObject( + $nsid, + 'mutedWord', + /*#__PURE__*/ l.object({ + id: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), + value: /*#__PURE__*/ l.string({ maxLength: 10000, maxGraphemes: 1000 }), + targets: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => mutedWordTarget) as any), + ), + expiresAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + actorTarget: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault( + /*#__PURE__*/ l.string<{ knownValues: ['all', 'exclude-following'] }>(), + 'all', + ), + ), + }), +) + +export { mutedWord } + +type SavedFeed = { + $type?: 'app.bsky.actor.defs#savedFeed' + id: string + type: 'feed' | 'list' | 'timeline' | l.UnknownString + value: string + pinned: boolean +} + +export type { SavedFeed } + +const savedFeed = /*#__PURE__*/ l.typedObject( + $nsid, + 'savedFeed', + /*#__PURE__*/ l.object({ + id: /*#__PURE__*/ l.string(), + type: /*#__PURE__*/ l.string<{ + knownValues: ['feed', 'list', 'timeline'] + }>(), + value: /*#__PURE__*/ l.string(), + pinned: /*#__PURE__*/ l.boolean(), + }), +) + +export { savedFeed } + +type StatusView = { + $type?: 'app.bsky.actor.defs#statusView' + cid?: l.CidString + uri?: l.AtUriString + + /** + * An optional embed associated with the status. + */ + embed?: l.$Typed | l.Unknown$TypedObject + record: l.LexMap + + /** + * The status for the account. + */ + status: 'app.bsky.actor.status#live' | l.UnknownString + + /** + * True if the status is not expired, false if it is expired. Only present if expiration was set. + */ + isActive?: boolean + + /** + * The date when this status will expire. The application might choose to no longer return the status after expiration. + */ + expiresAt?: l.DatetimeString + + /** + * True if the user's go-live access has been disabled by a moderator, false otherwise. + */ + isDisabled?: boolean +} + +export type { StatusView } + +const statusView = /*#__PURE__*/ l.typedObject( + $nsid, + 'statusView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), + uri: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'at-uri' })), + embed: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.view) as any, + ), + ], + false, + ), + ), + record: /*#__PURE__*/ l.lexMap(), + status: /*#__PURE__*/ l.string<{ + knownValues: ['app.bsky.actor.status#live'] + }>(), + isActive: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + expiresAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + isDisabled: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + }), +) + +export { statusView } + +type Preferences = ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject +)[] + +export type { Preferences } + +const preferences = /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => adultContentPref) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => contentLabelPref) as any, + ), + /*#__PURE__*/ l.typedRef((() => savedFeedsPref) as any), + /*#__PURE__*/ l.typedRef( + (() => savedFeedsPrefV2) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => personalDetailsPref) as any, + ), + /*#__PURE__*/ l.typedRef((() => declaredAgePref) as any), + /*#__PURE__*/ l.typedRef((() => feedViewPref) as any), + /*#__PURE__*/ l.typedRef((() => threadViewPref) as any), + /*#__PURE__*/ l.typedRef((() => interestsPref) as any), + /*#__PURE__*/ l.typedRef((() => mutedWordsPref) as any), + /*#__PURE__*/ l.typedRef((() => hiddenPostsPref) as any), + /*#__PURE__*/ l.typedRef( + (() => bskyAppStatePref) as any, + ), + /*#__PURE__*/ l.typedRef((() => labelersPref) as any), + /*#__PURE__*/ l.typedRef( + (() => postInteractionSettingsPref) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => verificationPrefs) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => liveEventPreferences) as any, + ), + ], + false, + ), +) + +export { preferences } + +type ProfileView = { + $type?: 'app.bsky.actor.defs#profileView' + did: l.DidString + + /** + * Debug information for internal development + */ + debug?: l.LexMap + avatar?: l.UriString + handle: l.HandleString + labels?: LabelDefs.Label[] + status?: StatusView + viewer?: ViewerState + pronouns?: string + createdAt?: l.DatetimeString + indexedAt?: l.DatetimeString + associated?: ProfileAssociated + description?: string + displayName?: string + verification?: VerificationState +} + +export type { ProfileView } + +const profileView = /*#__PURE__*/ l.typedObject( + $nsid, + 'profileView', + /*#__PURE__*/ l.object({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + debug: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()), + avatar: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + handle: /*#__PURE__*/ l.string({ format: 'handle' }), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + status: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => statusView) as any), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => viewerState) as any), + ), + pronouns: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), + createdAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + indexedAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + associated: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => profileAssociated) as any), + ), + description: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 2560, maxGraphemes: 256 }), + ), + displayName: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + ), + verification: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => verificationState) as any), + ), + }), +) + +export { profileView } + +/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */ +type ViewerState = { + $type?: 'app.bsky.actor.defs#viewerState' + muted?: boolean + blocking?: l.AtUriString + blockedBy?: boolean + following?: l.AtUriString + followedBy?: l.AtUriString + mutedByList?: GraphDefs.ListViewBasic + blockingByList?: GraphDefs.ListViewBasic + + /** + * This property is present only in selected cases, as an optimization. + */ + knownFollowers?: KnownFollowers + + /** + * This property is present only in selected cases, as an optimization. + */ + activitySubscription?: NotificationDefs.ActivitySubscription +} + +export type { ViewerState } + +/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */ +const viewerState = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewerState', + /*#__PURE__*/ l.object({ + muted: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + blocking: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + blockedBy: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + following: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + followedBy: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + mutedByList: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => GraphDefs.listViewBasic) as any, + ), + ), + blockingByList: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => GraphDefs.listViewBasic) as any, + ), + ), + knownFollowers: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => knownFollowers) as any), + ), + activitySubscription: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => NotificationDefs.activitySubscription) as any, + ), + ), + }), +) + +export { viewerState } + +type 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. + */ + hideReplies?: boolean + + /** + * Hide reposts in the feed. + */ + hideReposts?: boolean + + /** + * Hide quote posts in the feed. + */ + hideQuotePosts?: boolean + + /** + * Hide replies in the feed if they do not have this number of likes. + */ + hideRepliesByLikeCount?: number + + /** + * Hide replies in the feed if they are not by followed users. + */ + hideRepliesByUnfollowed?: boolean +} + +export type { FeedViewPref } + +const feedViewPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'feedViewPref', + /*#__PURE__*/ l.object({ + feed: /*#__PURE__*/ l.string(), + hideReplies: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + hideReposts: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + hideQuotePosts: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + hideRepliesByLikeCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + hideRepliesByUnfollowed: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), true), + ), + }), +) + +export { feedViewPref } + +type LabelersPref = { + $type?: 'app.bsky.actor.defs#labelersPref' + labelers: LabelerPrefItem[] +} + +export type { LabelersPref } + +const labelersPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'labelersPref', + /*#__PURE__*/ l.object({ + labelers: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => labelerPrefItem) as any), + ), + }), +) + +export { labelersPref } + +type InterestsPref = { + $type?: 'app.bsky.actor.defs#interestsPref' + + /** + * A list of tags which describe the account owner's interests gathered during onboarding. + */ + tags: string[] +} + +export type { InterestsPref } + +const interestsPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'interestsPref', + /*#__PURE__*/ l.object({ + tags: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + { maxLength: 100 }, + ), + }), +) + +export { interestsPref } + +/** The subject's followers whom you also follow */ +type KnownFollowers = { + $type?: 'app.bsky.actor.defs#knownFollowers' + count: number + followers: ProfileViewBasic[] +} + +export type { KnownFollowers } + +/** The subject's followers whom you also follow */ +const knownFollowers = /*#__PURE__*/ l.typedObject( + $nsid, + 'knownFollowers', + /*#__PURE__*/ l.object({ + count: /*#__PURE__*/ l.integer(), + followers: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => profileViewBasic) as any), + { maxLength: 5, minLength: 0 }, + ), + }), +) + +export { knownFollowers } + +type MutedWordsPref = { + $type?: 'app.bsky.actor.defs#mutedWordsPref' + + /** + * A list of words the account owner has muted. + */ + items: MutedWord[] +} + +export type { MutedWordsPref } + +const mutedWordsPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'mutedWordsPref', + /*#__PURE__*/ l.object({ + items: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => mutedWord) as any), + ), + }), +) + +export { mutedWordsPref } + +type SavedFeedsPref = { + $type?: 'app.bsky.actor.defs#savedFeedsPref' + saved: l.AtUriString[] + pinned: l.AtUriString[] + timelineIndex?: number +} + +export type { SavedFeedsPref } + +const savedFeedsPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'savedFeedsPref', + /*#__PURE__*/ l.object({ + saved: /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'at-uri' })), + pinned: /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'at-uri' })), + timelineIndex: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + }), +) + +export { savedFeedsPref } + +type ThreadViewPref = { + $type?: 'app.bsky.actor.defs#threadViewPref' + + /** + * Sorting mode for threads. + */ + sort?: + | 'oldest' + | 'newest' + | 'most-likes' + | 'random' + | 'hotness' + | l.UnknownString +} + +export type { ThreadViewPref } + +const threadViewPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'threadViewPref', + /*#__PURE__*/ l.object({ + sort: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string<{ + knownValues: ['oldest', 'newest', 'most-likes', 'random', 'hotness'] + }>(), + ), + }), +) + +export { threadViewPref } + +/** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. */ +type DeclaredAgePref = { + $type?: 'app.bsky.actor.defs#declaredAgePref' + + /** + * Indicates if the user has declared that they are over 13 years of age. + */ + isOverAge13?: boolean + + /** + * Indicates if the user has declared that they are over 16 years of age. + */ + isOverAge16?: boolean + + /** + * Indicates if the user has declared that they are over 18 years of age. + */ + isOverAge18?: boolean +} + +export type { DeclaredAgePref } + +/** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. */ +const declaredAgePref = /*#__PURE__*/ l.typedObject( + $nsid, + 'declaredAgePref', + /*#__PURE__*/ l.object({ + isOverAge13: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + isOverAge16: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + isOverAge18: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + }), +) + +export { declaredAgePref } + +type HiddenPostsPref = { + $type?: 'app.bsky.actor.defs#hiddenPostsPref' + + /** + * A list of URIs of posts the account owner has hidden. + */ + items: l.AtUriString[] +} + +export type { HiddenPostsPref } + +const hiddenPostsPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'hiddenPostsPref', + /*#__PURE__*/ l.object({ + items: /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'at-uri' })), + }), +) + +export { hiddenPostsPref } + +type LabelerPrefItem = { + $type?: 'app.bsky.actor.defs#labelerPrefItem' + did: l.DidString +} + +export type { LabelerPrefItem } + +const labelerPrefItem = /*#__PURE__*/ l.typedObject( + $nsid, + 'labelerPrefItem', + /*#__PURE__*/ l.object({ did: /*#__PURE__*/ l.string({ format: 'did' }) }), +) + +export { labelerPrefItem } + +type MutedWordTarget = 'content' | 'tag' | l.UnknownString + +export type { MutedWordTarget } + +const mutedWordTarget = /*#__PURE__*/ l.string<{ + maxLength: 640 + knownValues: ['content', 'tag'] + maxGraphemes: 64 +}>({ maxLength: 640, maxGraphemes: 64 }) + +export { mutedWordTarget } + +type AdultContentPref = { + $type?: 'app.bsky.actor.defs#adultContentPref' + enabled: boolean +} + +export type { AdultContentPref } + +const adultContentPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'adultContentPref', + /*#__PURE__*/ l.object({ + enabled: /*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false), + }), +) + +export { adultContentPref } + +/** A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. */ +type BskyAppStatePref = { + $type?: 'app.bsky.actor.defs#bskyAppStatePref' + + /** + * Storage for NUXs the user has encountered. + */ + nuxs?: Nux[] + + /** + * An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. + */ + queuedNudges?: string[] + activeProgressGuide?: BskyAppProgressGuide +} + +export type { BskyAppStatePref } + +/** A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. */ +const bskyAppStatePref = /*#__PURE__*/ l.typedObject( + $nsid, + 'bskyAppStatePref', + /*#__PURE__*/ l.object({ + nuxs: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => nux) as any), { + maxLength: 100, + }), + ), + queuedNudges: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ maxLength: 100 }), { + maxLength: 1000, + }), + ), + activeProgressGuide: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => bskyAppProgressGuide) as any, + ), + ), + }), +) + +export { bskyAppStatePref } + +type ContentLabelPref = { + $type?: 'app.bsky.actor.defs#contentLabelPref' + label: string + + /** + * Which labeler does this preference apply to? If undefined, applies globally. + */ + labelerDid?: l.DidString + visibility: 'ignore' | 'show' | 'warn' | 'hide' | l.UnknownString +} + +export type { ContentLabelPref } + +const contentLabelPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'contentLabelPref', + /*#__PURE__*/ l.object({ + label: /*#__PURE__*/ l.string(), + labelerDid: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'did' }), + ), + visibility: /*#__PURE__*/ l.string<{ + knownValues: ['ignore', 'show', 'warn', 'hide'] + }>(), + }), +) + +export { contentLabelPref } + +type ProfileViewBasic = { + $type?: 'app.bsky.actor.defs#profileViewBasic' + did: l.DidString + + /** + * Debug information for internal development + */ + debug?: l.LexMap + avatar?: l.UriString + handle: l.HandleString + labels?: LabelDefs.Label[] + status?: StatusView + viewer?: ViewerState + pronouns?: string + createdAt?: l.DatetimeString + associated?: ProfileAssociated + displayName?: string + verification?: VerificationState +} + +export type { ProfileViewBasic } + +const profileViewBasic = /*#__PURE__*/ l.typedObject( + $nsid, + 'profileViewBasic', + /*#__PURE__*/ l.object({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + debug: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()), + avatar: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + handle: /*#__PURE__*/ l.string({ format: 'handle' }), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + status: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => statusView) as any), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => viewerState) as any), + ), + pronouns: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), + createdAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + associated: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => profileAssociated) as any), + ), + displayName: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + ), + verification: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => verificationState) as any), + ), + }), +) + +export { profileViewBasic } + +type SavedFeedsPrefV2 = { + $type?: 'app.bsky.actor.defs#savedFeedsPrefV2' + items: SavedFeed[] +} + +export type { SavedFeedsPrefV2 } + +const savedFeedsPrefV2 = /*#__PURE__*/ l.typedObject( + $nsid, + 'savedFeedsPrefV2', + /*#__PURE__*/ l.object({ + items: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => savedFeed) as any), + ), + }), +) + +export { savedFeedsPrefV2 } + +/** An individual verification for an associated subject. */ +type VerificationView = { + $type?: 'app.bsky.actor.defs#verificationView' + + /** + * The AT-URI of the verification record. + */ + uri: l.AtUriString + + /** + * The user who issued this verification. + */ + issuer: l.DidString + + /** + * True if the verification passes validation; otherwise, false. + */ + isValid: boolean + + /** + * Timestamp when the verification was created. + */ + createdAt: l.DatetimeString +} + +export type { VerificationView } + +/** An individual verification for an associated subject. */ +const verificationView = /*#__PURE__*/ l.typedObject( + $nsid, + 'verificationView', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + issuer: /*#__PURE__*/ l.string({ format: 'did' }), + isValid: /*#__PURE__*/ l.boolean(), + createdAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + }), +) + +export { verificationView } + +type ProfileAssociated = { + $type?: 'app.bsky.actor.defs#profileAssociated' + chat?: ProfileAssociatedChat + germ?: ProfileAssociatedGerm + lists?: number + labeler?: boolean + feedgens?: number + starterPacks?: number + activitySubscription?: ProfileAssociatedActivitySubscription +} + +export type { ProfileAssociated } + +const profileAssociated = /*#__PURE__*/ l.typedObject( + $nsid, + 'profileAssociated', + /*#__PURE__*/ l.object({ + chat: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => profileAssociatedChat) as any, + ), + ), + germ: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => profileAssociatedGerm) as any, + ), + ), + lists: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + labeler: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + feedgens: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + starterPacks: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + activitySubscription: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => profileAssociatedActivitySubscription) as any, + ), + ), + }), +) + +export { profileAssociated } + +/** Preferences for how verified accounts appear in the app. */ +type VerificationPrefs = { + $type?: 'app.bsky.actor.defs#verificationPrefs' + + /** + * Hide the blue check badges for verified accounts and trusted verifiers. + */ + hideBadges?: boolean +} + +export type { VerificationPrefs } + +/** Preferences for how verified accounts appear in the app. */ +const verificationPrefs = /*#__PURE__*/ l.typedObject( + $nsid, + 'verificationPrefs', + /*#__PURE__*/ l.object({ + hideBadges: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false), + ), + }), +) + +export { verificationPrefs } + +/** Represents the verification information about the user this object is attached to. */ +type VerificationState = { + $type?: 'app.bsky.actor.defs#verificationState' + + /** + * All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. + */ + verifications: VerificationView[] + + /** + * The user's status as a verified account. + */ + verifiedStatus: 'valid' | 'invalid' | 'none' | l.UnknownString + + /** + * The user's status as a trusted verifier. + */ + trustedVerifierStatus: 'valid' | 'invalid' | 'none' | l.UnknownString +} + +export type { VerificationState } + +/** Represents the verification information about the user this object is attached to. */ +const verificationState = /*#__PURE__*/ l.typedObject( + $nsid, + 'verificationState', + /*#__PURE__*/ l.object({ + verifications: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => verificationView) as any), + ), + verifiedStatus: /*#__PURE__*/ l.string<{ + knownValues: ['valid', 'invalid', 'none'] + }>(), + trustedVerifierStatus: /*#__PURE__*/ l.string<{ + knownValues: ['valid', 'invalid', 'none'] + }>(), + }), +) + +export { verificationState } + +type PersonalDetailsPref = { + $type?: 'app.bsky.actor.defs#personalDetailsPref' + + /** + * The birth date of account owner. + */ + birthDate?: l.DatetimeString +} + +export type { PersonalDetailsPref } + +const personalDetailsPref = /*#__PURE__*/ l.typedObject( + $nsid, + 'personalDetailsPref', + /*#__PURE__*/ l.object({ + birthDate: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + }), +) + +export { personalDetailsPref } + +type ProfileViewDetailed = { + $type?: 'app.bsky.actor.defs#profileViewDetailed' + did: l.DidString + + /** + * Debug information for internal development + */ + debug?: l.LexMap + avatar?: l.UriString + banner?: l.UriString + handle: l.HandleString + labels?: LabelDefs.Label[] + status?: StatusView + viewer?: ViewerState + website?: l.UriString + pronouns?: string + createdAt?: l.DatetimeString + indexedAt?: l.DatetimeString + associated?: ProfileAssociated + pinnedPost?: RepoStrongRef.Main + postsCount?: number + description?: string + displayName?: string + followsCount?: number + verification?: VerificationState + followersCount?: number + joinedViaStarterPack?: GraphDefs.StarterPackViewBasic +} + +export type { ProfileViewDetailed } + +const profileViewDetailed = /*#__PURE__*/ l.typedObject( + $nsid, + 'profileViewDetailed', + /*#__PURE__*/ l.object({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + debug: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()), + avatar: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + banner: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + handle: /*#__PURE__*/ l.string({ format: 'handle' }), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + status: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => statusView) as any), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => viewerState) as any), + ), + website: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'uri' }), + ), + pronouns: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), + createdAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + indexedAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + associated: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => profileAssociated) as any), + ), + pinnedPost: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => RepoStrongRef.main) as any, + ), + ), + postsCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + description: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 2560, maxGraphemes: 256 }), + ), + displayName: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + ), + followsCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + verification: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => verificationState) as any), + ), + followersCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + joinedViaStarterPack: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => GraphDefs.starterPackViewBasic) as any, + ), + ), + }), +) + +export { profileViewDetailed } + +/** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. */ +type BskyAppProgressGuide = { + $type?: 'app.bsky.actor.defs#bskyAppProgressGuide' + guide: string +} + +export type { BskyAppProgressGuide } + +/** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. */ +const bskyAppProgressGuide = /*#__PURE__*/ l.typedObject( + $nsid, + 'bskyAppProgressGuide', + /*#__PURE__*/ l.object({ guide: /*#__PURE__*/ l.string({ maxLength: 100 }) }), +) + +export { bskyAppProgressGuide } + +/** Preferences for live events. */ +type LiveEventPreferences = { + $type?: 'app.bsky.actor.defs#liveEventPreferences' + + /** + * Whether to hide all feeds from live events. + */ + hideAllFeeds?: boolean + + /** + * A list of feed IDs that the user has hidden from live events. + */ + hiddenFeedIds?: string[] +} + +export type { LiveEventPreferences } + +/** Preferences for live events. */ +const liveEventPreferences = /*#__PURE__*/ l.typedObject( + $nsid, + 'liveEventPreferences', + /*#__PURE__*/ l.object({ + hideAllFeeds: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault(/*#__PURE__*/ l.boolean(), false), + ), + hiddenFeedIds: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string()), + ), + }), +) + +export { liveEventPreferences } + +type ProfileAssociatedChat = { + $type?: 'app.bsky.actor.defs#profileAssociatedChat' + allowIncoming: 'all' | 'none' | 'following' | l.UnknownString +} + +export type { ProfileAssociatedChat } + +const profileAssociatedChat = + /*#__PURE__*/ l.typedObject( + $nsid, + 'profileAssociatedChat', + /*#__PURE__*/ l.object({ + allowIncoming: /*#__PURE__*/ l.string<{ + knownValues: ['all', 'none', 'following'] + }>(), + }), + ) + +export { profileAssociatedChat } + +type ProfileAssociatedGerm = { + $type?: 'app.bsky.actor.defs#profileAssociatedGerm' + messageMeUrl: l.UriString + showButtonTo: 'usersIFollow' | 'everyone' | l.UnknownString +} + +export type { ProfileAssociatedGerm } + +const profileAssociatedGerm = + /*#__PURE__*/ l.typedObject( + $nsid, + 'profileAssociatedGerm', + /*#__PURE__*/ l.object({ + messageMeUrl: /*#__PURE__*/ l.string({ format: 'uri' }), + showButtonTo: /*#__PURE__*/ l.string<{ + knownValues: ['usersIFollow', 'everyone'] + }>(), + }), + ) + +export { profileAssociatedGerm } + +/** 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. */ +type 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?: ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + )[] + + /** + * 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?: ( + | l.$Typed + | l.Unknown$TypedObject + )[] +} + +export type { PostInteractionSettingsPref } + +/** 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. */ +const postInteractionSettingsPref = + /*#__PURE__*/ l.typedObject( + $nsid, + 'postInteractionSettingsPref', + /*#__PURE__*/ l.object({ + threadgateAllowRules: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => FeedThreadgate.mentionRule) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => FeedThreadgate.followerRule) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => FeedThreadgate.followingRule) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => FeedThreadgate.listRule) as any, + ), + ], + false, + ), + { maxLength: 5 }, + ), + ), + postgateEmbeddingRules: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => FeedPostgate.disableRule) as any, + ), + ], + false, + ), + { maxLength: 5 }, + ), + ), + }), + ) + +export { postInteractionSettingsPref } + +type ProfileAssociatedActivitySubscription = { + $type?: 'app.bsky.actor.defs#profileAssociatedActivitySubscription' + allowSubscriptions: 'followers' | 'mutuals' | 'none' | l.UnknownString +} + +export type { ProfileAssociatedActivitySubscription } + +const profileAssociatedActivitySubscription = + /*#__PURE__*/ l.typedObject( + $nsid, + 'profileAssociatedActivitySubscription', + /*#__PURE__*/ l.object({ + allowSubscriptions: /*#__PURE__*/ l.string<{ + knownValues: ['followers', 'mutuals', 'none'] + }>(), + }), + ) + +export { profileAssociatedActivitySubscription } diff --git a/src/lexicons/app/bsky/actor/defs.ts b/src/lexicons/app/bsky/actor/defs.ts new file mode 100644 index 0000000000..1e9dcf01c1 --- /dev/null +++ b/src/lexicons/app/bsky/actor/defs.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './defs.defs.js' diff --git a/src/lexicons/app/bsky/actor/getProfiles.defs.ts b/src/lexicons/app/bsky/actor/getProfiles.defs.ts new file mode 100644 index 0000000000..b21a850a72 --- /dev/null +++ b/src/lexicons/app/bsky/actor/getProfiles.defs.ts @@ -0,0 +1,40 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as ActorDefs from './defs.defs.js' + +const $nsid = 'app.bsky.actor.getProfiles' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + actors: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.string({ format: 'at-identifier' }), + { maxLength: 25 }, + ), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + profiles: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewDetailed) as any, + ), + ), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Get detailed profile views of multiple actors. */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/app/bsky/actor/getProfiles.ts b/src/lexicons/app/bsky/actor/getProfiles.ts new file mode 100644 index 0000000000..439b88019e --- /dev/null +++ b/src/lexicons/app/bsky/actor/getProfiles.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getProfiles.defs.js' +export { main as default } from './getProfiles.defs.js' diff --git a/src/lexicons/app/bsky/actor/profile.defs.ts b/src/lexicons/app/bsky/actor/profile.defs.ts new file mode 100644 index 0000000000..a3dc01f86b --- /dev/null +++ b/src/lexicons/app/bsky/actor/profile.defs.ts @@ -0,0 +1,118 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' +import * as RepoStrongRef from './..\\..\\..\\com\\atproto\\repo\\strongRef.defs.js' + +const $nsid = 'app.bsky.actor.profile' + +export { $nsid } + +/** A declaration of a Bluesky account profile. */ +type Main = { + $type: 'app.bsky.actor.profile' + + /** + * Small image to be displayed next to posts from account. AKA, 'profile picture' + */ + avatar?: l.BlobRef + + /** + * Larger horizontal image to display behind profile view. + */ + banner?: l.BlobRef + + /** + * Self-label values, specific to the Bluesky application, on the overall account. + */ + labels?: l.$Typed | l.Unknown$TypedObject + website?: l.UriString + + /** + * Free-form pronouns text. + */ + pronouns?: string + createdAt?: l.DatetimeString + pinnedPost?: RepoStrongRef.Main + + /** + * Free-form profile description text. + */ + description?: string + displayName?: string + joinedViaStarterPack?: RepoStrongRef.Main +} + +export type { Main } + +/** A declaration of a Bluesky account profile. */ +const main = /*#__PURE__*/ l.record<'literal:self', Main>( + 'literal:self', + $nsid, + /*#__PURE__*/ l.object({ + avatar: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.blob({ + accept: ['image/png', 'image/jpeg'], + maxSize: 1000000, + }), + ), + banner: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.blob({ + accept: ['image/png', 'image/jpeg'], + maxSize: 1000000, + }), + ), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => LabelDefs.selfLabels) as any, + ), + ], + false, + ), + ), + website: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'uri' }), + ), + pronouns: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 200, maxGraphemes: 20 }), + ), + createdAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + pinnedPost: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => RepoStrongRef.main) as any, + ), + ), + description: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 2560, maxGraphemes: 256 }), + ), + displayName: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + ), + joinedViaStarterPack: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => RepoStrongRef.main) as any, + ), + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) diff --git a/src/lexicons/app/bsky/actor/profile.ts b/src/lexicons/app/bsky/actor/profile.ts new file mode 100644 index 0000000000..080e297379 --- /dev/null +++ b/src/lexicons/app/bsky/actor/profile.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './profile.defs.js' +export { main as default } from './profile.defs.js' diff --git a/src/lexicons/app/bsky/actor/status.defs.ts b/src/lexicons/app/bsky/actor/status.defs.ts new file mode 100644 index 0000000000..872415129a --- /dev/null +++ b/src/lexicons/app/bsky/actor/status.defs.ts @@ -0,0 +1,83 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedExternal from './..\\embed\\external.defs.js' + +const $nsid = 'app.bsky.actor.status' + +export { $nsid } + +/** Advertises an account as currently offering live content. */ +type Live = 'app.bsky.actor.status#live' + +export type { Live } + +/** Advertises an account as currently offering live content. */ +const live = /*#__PURE__*/ l.token($nsid, 'live') + +export { live } + +/** A declaration of a Bluesky account status. */ +type Main = { + $type: 'app.bsky.actor.status' + + /** + * An optional embed associated with the status. + */ + embed?: l.$Typed | l.Unknown$TypedObject + + /** + * The status for the account. + */ + status: 'app.bsky.actor.status#live' | l.UnknownString + createdAt: l.DatetimeString + + /** + * The duration of the status in minutes. Applications can choose to impose minimum and maximum limits. + */ + durationMinutes?: number +} + +export type { Main } + +/** A declaration of a Bluesky account status. */ +const main = /*#__PURE__*/ l.record<'literal:self', Main>( + 'literal:self', + $nsid, + /*#__PURE__*/ l.object({ + embed: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.main) as any, + ), + ], + false, + ), + ), + status: /*#__PURE__*/ l.string<{ + knownValues: ['app.bsky.actor.status#live'] + }>(), + createdAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + durationMinutes: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 1 }), + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) diff --git a/src/lexicons/app/bsky/actor/status.ts b/src/lexicons/app/bsky/actor/status.ts new file mode 100644 index 0000000000..8ed2a4133c --- /dev/null +++ b/src/lexicons/app/bsky/actor/status.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './status.defs.js' +export { main as default } from './status.defs.js' diff --git a/src/lexicons/app/bsky/embed.ts b/src/lexicons/app/bsky/embed.ts new file mode 100644 index 0000000000..3173209529 --- /dev/null +++ b/src/lexicons/app/bsky/embed.ts @@ -0,0 +1,10 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './embed/defs.js' +export * as external from './embed/external.js' +export * as images from './embed/images.js' +export * as record from './embed/record.js' +export * as recordWithMedia from './embed/recordWithMedia.js' +export * as video from './embed/video.js' diff --git a/src/lexicons/app/bsky/embed/defs.defs.ts b/src/lexicons/app/bsky/embed/defs.defs.ts new file mode 100644 index 0000000000..dfc606f552 --- /dev/null +++ b/src/lexicons/app/bsky/embed/defs.defs.ts @@ -0,0 +1,30 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.embed.defs' + +export { $nsid } + +/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */ +type AspectRatio = { + $type?: 'app.bsky.embed.defs#aspectRatio' + width: number + height: number +} + +export type { AspectRatio } + +/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */ +const aspectRatio = /*#__PURE__*/ l.typedObject( + $nsid, + 'aspectRatio', + /*#__PURE__*/ l.object({ + width: /*#__PURE__*/ l.integer({ minimum: 1 }), + height: /*#__PURE__*/ l.integer({ minimum: 1 }), + }), +) + +export { aspectRatio } diff --git a/src/lexicons/app/bsky/embed/defs.ts b/src/lexicons/app/bsky/embed/defs.ts new file mode 100644 index 0000000000..1e9dcf01c1 --- /dev/null +++ b/src/lexicons/app/bsky/embed/defs.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './defs.defs.js' diff --git a/src/lexicons/app/bsky/embed/external.defs.ts b/src/lexicons/app/bsky/embed/external.defs.ts new file mode 100644 index 0000000000..ee65cf60ce --- /dev/null +++ b/src/lexicons/app/bsky/embed/external.defs.ts @@ -0,0 +1,100 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.embed.external' + +export { $nsid } + +/** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */ +type Main = { $type?: 'app.bsky.embed.external'; external: External } + +export type { Main } + +/** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */ +const main = /*#__PURE__*/ l.typedObject
( + $nsid, + 'main', + /*#__PURE__*/ l.object({ + external: /*#__PURE__*/ l.ref((() => external) as any), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +type View = { $type?: 'app.bsky.embed.external#view'; external: ViewExternal } + +export type { View } + +const view = /*#__PURE__*/ l.typedObject( + $nsid, + 'view', + /*#__PURE__*/ l.object({ + external: /*#__PURE__*/ l.ref((() => viewExternal) as any), + }), +) + +export { view } + +type External = { + $type?: 'app.bsky.embed.external#external' + uri: l.UriString + thumb?: l.BlobRef + title: string + description: string +} + +export type { External } + +const external = /*#__PURE__*/ l.typedObject( + $nsid, + 'external', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'uri' }), + thumb: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.blob({ accept: ['image/*'], maxSize: 1000000 }), + ), + title: /*#__PURE__*/ l.string(), + description: /*#__PURE__*/ l.string(), + }), +) + +export { external } + +type ViewExternal = { + $type?: 'app.bsky.embed.external#viewExternal' + uri: l.UriString + thumb?: l.UriString + title: string + description: string +} + +export type { ViewExternal } + +const viewExternal = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewExternal', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'uri' }), + thumb: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + title: /*#__PURE__*/ l.string(), + description: /*#__PURE__*/ l.string(), + }), +) + +export { viewExternal } diff --git a/src/lexicons/app/bsky/embed/external.ts b/src/lexicons/app/bsky/embed/external.ts new file mode 100644 index 0000000000..46c0838b57 --- /dev/null +++ b/src/lexicons/app/bsky/embed/external.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './external.defs.js' +export { main as default } from './external.defs.js' diff --git a/src/lexicons/app/bsky/embed/images.defs.ts b/src/lexicons/app/bsky/embed/images.defs.ts new file mode 100644 index 0000000000..08198a7d5d --- /dev/null +++ b/src/lexicons/app/bsky/embed/images.defs.ts @@ -0,0 +1,125 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedDefs from './defs.defs.js' + +const $nsid = 'app.bsky.embed.images' + +export { $nsid } + +type Main = { $type?: 'app.bsky.embed.images'; images: Image[] } + +export type { Main } + +const main = /*#__PURE__*/ l.typedObject
( + $nsid, + 'main', + /*#__PURE__*/ l.object({ + images: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => image) as any), + { maxLength: 4 }, + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +type View = { $type?: 'app.bsky.embed.images#view'; images: ViewImage[] } + +export type { View } + +const view = /*#__PURE__*/ l.typedObject( + $nsid, + 'view', + /*#__PURE__*/ l.object({ + images: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => viewImage) as any), + { maxLength: 4 }, + ), + }), +) + +export { view } + +type Image = { + $type?: 'app.bsky.embed.images#image' + + /** + * Alt text description of the image, for accessibility. + */ + alt: string + image: l.BlobRef + aspectRatio?: EmbedDefs.AspectRatio +} + +export type { Image } + +const image = /*#__PURE__*/ l.typedObject( + $nsid, + 'image', + /*#__PURE__*/ l.object({ + alt: /*#__PURE__*/ l.string(), + image: /*#__PURE__*/ l.blob({ accept: ['image/*'], maxSize: 1000000 }), + aspectRatio: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => EmbedDefs.aspectRatio) as any, + ), + ), + }), +) + +export { image } + +type ViewImage = { + $type?: 'app.bsky.embed.images#viewImage' + + /** + * Alt text description of the image, for accessibility. + */ + alt: string + + /** + * Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. + */ + thumb: l.UriString + + /** + * 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. + */ + fullsize: l.UriString + aspectRatio?: EmbedDefs.AspectRatio +} + +export type { ViewImage } + +const viewImage = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewImage', + /*#__PURE__*/ l.object({ + alt: /*#__PURE__*/ l.string(), + thumb: /*#__PURE__*/ l.string({ format: 'uri' }), + fullsize: /*#__PURE__*/ l.string({ format: 'uri' }), + aspectRatio: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => EmbedDefs.aspectRatio) as any, + ), + ), + }), +) + +export { viewImage } diff --git a/src/lexicons/app/bsky/embed/images.ts b/src/lexicons/app/bsky/embed/images.ts new file mode 100644 index 0000000000..7e88d20667 --- /dev/null +++ b/src/lexicons/app/bsky/embed/images.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './images.defs.js' +export { main as default } from './images.defs.js' diff --git a/src/lexicons/app/bsky/embed/record.defs.ts b/src/lexicons/app/bsky/embed/record.defs.ts new file mode 100644 index 0000000000..65b99975db --- /dev/null +++ b/src/lexicons/app/bsky/embed/record.defs.ts @@ -0,0 +1,230 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as RepoStrongRef from './..\\..\\..\\com\\atproto\\repo\\strongRef.defs.js' +import * as FeedDefs from './..\\feed\\defs.defs.js' +import * as GraphDefs from './..\\graph\\defs.defs.js' +import * as LabelerDefs from './..\\labeler\\defs.defs.js' +import * as ActorDefs from './..\\actor\\defs.defs.js' +import * as EmbedImages from './images.defs.js' +import * as EmbedVideo from './video.defs.js' +import * as EmbedExternal from './external.defs.js' +import * as EmbedRecordWithMedia from './recordWithMedia.defs.js' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' + +const $nsid = 'app.bsky.embed.record' + +export { $nsid } + +type Main = { $type?: 'app.bsky.embed.record'; record: RepoStrongRef.Main } + +export type { Main } + +const main = /*#__PURE__*/ l.typedObject
( + $nsid, + 'main', + /*#__PURE__*/ l.object({ + record: /*#__PURE__*/ l.ref( + (() => RepoStrongRef.main) as any, + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +type View = { + $type?: 'app.bsky.embed.record#view' + record: + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject +} + +export type { View } + +const view = /*#__PURE__*/ l.typedObject( + $nsid, + 'view', + /*#__PURE__*/ l.object({ + record: /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef((() => viewRecord) as any), + /*#__PURE__*/ l.typedRef((() => viewNotFound) as any), + /*#__PURE__*/ l.typedRef((() => viewBlocked) as any), + /*#__PURE__*/ l.typedRef((() => viewDetached) as any), + /*#__PURE__*/ l.typedRef( + (() => FeedDefs.generatorView) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => GraphDefs.listView) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => LabelerDefs.labelerView) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => GraphDefs.starterPackViewBasic) as any, + ), + ], + false, + ), + }), +) + +export { view } + +type ViewRecord = { + $type?: 'app.bsky.embed.record#viewRecord' + cid: l.CidString + uri: l.AtUriString + + /** + * The record data itself. + */ + value: l.LexMap + author: ActorDefs.ProfileViewBasic + embeds?: ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + )[] + labels?: LabelDefs.Label[] + indexedAt: l.DatetimeString + likeCount?: number + quoteCount?: number + replyCount?: number + repostCount?: number +} + +export type { ViewRecord } + +const viewRecord = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewRecord', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + value: /*#__PURE__*/ l.lexMap(), + author: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewBasic) as any, + ), + embeds: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedImages.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedVideo.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.view) as any, + ), + /*#__PURE__*/ l.typedRef((() => view) as any), + /*#__PURE__*/ l.typedRef( + (() => EmbedRecordWithMedia.view) as any, + ), + ], + false, + ), + ), + ), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + likeCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + quoteCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + replyCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + repostCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + }), +) + +export { viewRecord } + +type ViewBlocked = { + $type?: 'app.bsky.embed.record#viewBlocked' + uri: l.AtUriString + author: FeedDefs.BlockedAuthor + blocked: true +} + +export type { ViewBlocked } + +const viewBlocked = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewBlocked', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + author: /*#__PURE__*/ l.ref( + (() => FeedDefs.blockedAuthor) as any, + ), + blocked: /*#__PURE__*/ l.literal(true), + }), +) + +export { viewBlocked } + +type ViewDetached = { + $type?: 'app.bsky.embed.record#viewDetached' + uri: l.AtUriString + detached: true +} + +export type { ViewDetached } + +const viewDetached = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewDetached', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + detached: /*#__PURE__*/ l.literal(true), + }), +) + +export { viewDetached } + +type ViewNotFound = { + $type?: 'app.bsky.embed.record#viewNotFound' + uri: l.AtUriString + notFound: true +} + +export type { ViewNotFound } + +const viewNotFound = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewNotFound', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + notFound: /*#__PURE__*/ l.literal(true), + }), +) + +export { viewNotFound } diff --git a/src/lexicons/app/bsky/embed/record.ts b/src/lexicons/app/bsky/embed/record.ts new file mode 100644 index 0000000000..3bbe37de93 --- /dev/null +++ b/src/lexicons/app/bsky/embed/record.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './record.defs.js' +export { main as default } from './record.defs.js' diff --git a/src/lexicons/app/bsky/embed/recordWithMedia.defs.ts b/src/lexicons/app/bsky/embed/recordWithMedia.defs.ts new file mode 100644 index 0000000000..bc90027c73 --- /dev/null +++ b/src/lexicons/app/bsky/embed/recordWithMedia.defs.ts @@ -0,0 +1,102 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedImages from './images.defs.js' +import * as EmbedVideo from './video.defs.js' +import * as EmbedExternal from './external.defs.js' +import * as EmbedRecord from './record.defs.js' + +const $nsid = 'app.bsky.embed.recordWithMedia' + +export { $nsid } + +type Main = { + $type?: 'app.bsky.embed.recordWithMedia' + media: + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + record: EmbedRecord.Main +} + +export type { Main } + +const main = /*#__PURE__*/ l.typedObject
( + $nsid, + 'main', + /*#__PURE__*/ l.object({ + media: /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedImages.main) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedVideo.main) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.main) as any, + ), + ], + false, + ), + record: /*#__PURE__*/ l.ref( + (() => EmbedRecord.main) as any, + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +type View = { + $type?: 'app.bsky.embed.recordWithMedia#view' + media: + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + record: EmbedRecord.View +} + +export type { View } + +const view = /*#__PURE__*/ l.typedObject( + $nsid, + 'view', + /*#__PURE__*/ l.object({ + media: /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedImages.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedVideo.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.view) as any, + ), + ], + false, + ), + record: /*#__PURE__*/ l.ref( + (() => EmbedRecord.view) as any, + ), + }), +) + +export { view } diff --git a/src/lexicons/app/bsky/embed/recordWithMedia.ts b/src/lexicons/app/bsky/embed/recordWithMedia.ts new file mode 100644 index 0000000000..11234f4c75 --- /dev/null +++ b/src/lexicons/app/bsky/embed/recordWithMedia.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './recordWithMedia.defs.js' +export { main as default } from './recordWithMedia.defs.js' diff --git a/src/lexicons/app/bsky/embed/video.defs.ts b/src/lexicons/app/bsky/embed/video.defs.ts new file mode 100644 index 0000000000..1289962734 --- /dev/null +++ b/src/lexicons/app/bsky/embed/video.defs.ts @@ -0,0 +1,133 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedDefs from './defs.defs.js' + +const $nsid = 'app.bsky.embed.video' + +export { $nsid } + +type Main = { + $type?: 'app.bsky.embed.video' + + /** + * Alt text description of the video, for accessibility. + */ + alt?: string + + /** + * The mp4 video file. May be up to 100mb, formerly limited to 50mb. + */ + video: l.BlobRef + captions?: Caption[] + aspectRatio?: EmbedDefs.AspectRatio + + /** + * A hint to the client about how to present the video. + */ + presentation?: 'default' | 'gif' | l.UnknownString +} + +export type { Main } + +const main = /*#__PURE__*/ l.typedObject
( + $nsid, + 'main', + /*#__PURE__*/ l.object({ + alt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 10000, maxGraphemes: 1000 }), + ), + video: /*#__PURE__*/ l.blob({ accept: ['video/mp4'], maxSize: 100000000 }), + captions: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => caption) as any), + { maxLength: 20 }, + ), + ), + aspectRatio: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => EmbedDefs.aspectRatio) as any, + ), + ), + presentation: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string<{ knownValues: ['default', 'gif'] }>(), + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +type View = { + $type?: 'app.bsky.embed.video#view' + alt?: string + cid: l.CidString + playlist: l.UriString + thumbnail?: l.UriString + aspectRatio?: EmbedDefs.AspectRatio + + /** + * A hint to the client about how to present the video. + */ + presentation?: 'default' | 'gif' | l.UnknownString +} + +export type { View } + +const view = /*#__PURE__*/ l.typedObject( + $nsid, + 'view', + /*#__PURE__*/ l.object({ + alt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 10000, maxGraphemes: 1000 }), + ), + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + playlist: /*#__PURE__*/ l.string({ format: 'uri' }), + thumbnail: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'uri' }), + ), + aspectRatio: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => EmbedDefs.aspectRatio) as any, + ), + ), + presentation: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string<{ knownValues: ['default', 'gif'] }>(), + ), + }), +) + +export { view } + +type Caption = { + $type?: 'app.bsky.embed.video#caption' + file: l.BlobRef + lang: l.LanguageString +} + +export type { Caption } + +const caption = /*#__PURE__*/ l.typedObject( + $nsid, + 'caption', + /*#__PURE__*/ l.object({ + file: /*#__PURE__*/ l.blob({ accept: ['text/vtt'], maxSize: 20000 }), + lang: /*#__PURE__*/ l.string({ format: 'language' }), + }), +) + +export { caption } diff --git a/src/lexicons/app/bsky/embed/video.ts b/src/lexicons/app/bsky/embed/video.ts new file mode 100644 index 0000000000..450bf49bbf --- /dev/null +++ b/src/lexicons/app/bsky/embed/video.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './video.defs.js' +export { main as default } from './video.defs.js' diff --git a/src/lexicons/app/bsky/feed.ts b/src/lexicons/app/bsky/feed.ts new file mode 100644 index 0000000000..be281d7ec9 --- /dev/null +++ b/src/lexicons/app/bsky/feed.ts @@ -0,0 +1,11 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './feed/defs.js' +export * as getLikes from './feed/getLikes.js' +export * as getPosts from './feed/getPosts.js' +export * as getPostThread from './feed/getPostThread.js' +export * as post from './feed/post.js' +export * as postgate from './feed/postgate.js' +export * as threadgate from './feed/threadgate.js' diff --git a/src/lexicons/app/bsky/feed/defs.defs.ts b/src/lexicons/app/bsky/feed/defs.defs.ts new file mode 100644 index 0000000000..8305346c06 --- /dev/null +++ b/src/lexicons/app/bsky/feed/defs.defs.ts @@ -0,0 +1,817 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedImages from './..\\embed\\images.defs.js' +import * as EmbedVideo from './..\\embed\\video.defs.js' +import * as EmbedExternal from './..\\embed\\external.defs.js' +import * as EmbedRecord from './..\\embed\\record.defs.js' +import * as EmbedRecordWithMedia from './..\\embed\\recordWithMedia.defs.js' +import * as ActorDefs from './..\\actor\\defs.defs.js' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' +import * as RichtextFacet from './..\\richtext\\facet.defs.js' +import * as GraphDefs from './..\\graph\\defs.defs.js' + +const $nsid = 'app.bsky.feed.defs' + +export { $nsid } + +type PostView = { + $type?: 'app.bsky.feed.defs#postView' + cid: l.CidString + uri: l.AtUriString + + /** + * Debug information for internal development + */ + debug?: l.LexMap + embed?: + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + author: ActorDefs.ProfileViewBasic + labels?: LabelDefs.Label[] + record: l.LexMap + viewer?: ViewerState + indexedAt: l.DatetimeString + likeCount?: number + quoteCount?: number + replyCount?: number + threadgate?: ThreadgateView + repostCount?: number + bookmarkCount?: number +} + +export type { PostView } + +const postView = /*#__PURE__*/ l.typedObject( + $nsid, + 'postView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + debug: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()), + embed: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedImages.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedVideo.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedRecord.view) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedRecordWithMedia.view) as any, + ), + ], + false, + ), + ), + author: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewBasic) as any, + ), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + record: /*#__PURE__*/ l.lexMap(), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => viewerState) as any), + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + likeCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + quoteCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + replyCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + threadgate: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => threadgateView) as any), + ), + repostCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + bookmarkCount: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.integer()), + }), +) + +export { postView } + +type ReplyRef = { + $type?: 'app.bsky.feed.defs#replyRef' + root: + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + parent: + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + + /** + * When parent is a reply to another post, this is the author of that post. + */ + grandparentAuthor?: ActorDefs.ProfileViewBasic +} + +export type { ReplyRef } + +const replyRef = /*#__PURE__*/ l.typedObject( + $nsid, + 'replyRef', + /*#__PURE__*/ l.object({ + root: /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef((() => postView) as any), + /*#__PURE__*/ l.typedRef((() => notFoundPost) as any), + /*#__PURE__*/ l.typedRef((() => blockedPost) as any), + ], + false, + ), + parent: /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef((() => postView) as any), + /*#__PURE__*/ l.typedRef((() => notFoundPost) as any), + /*#__PURE__*/ l.typedRef((() => blockedPost) as any), + ], + false, + ), + grandparentAuthor: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewBasic) as any, + ), + ), + }), +) + +export { replyRef } + +type ReasonPin = { $type?: 'app.bsky.feed.defs#reasonPin' } + +export type { ReasonPin } + +const reasonPin = /*#__PURE__*/ l.typedObject( + $nsid, + 'reasonPin', + /*#__PURE__*/ l.object({}), +) + +export { reasonPin } + +type BlockedPost = { + $type?: 'app.bsky.feed.defs#blockedPost' + uri: l.AtUriString + author: BlockedAuthor + blocked: true +} + +export type { BlockedPost } + +const blockedPost = /*#__PURE__*/ l.typedObject( + $nsid, + 'blockedPost', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + author: /*#__PURE__*/ l.ref((() => blockedAuthor) as any), + blocked: /*#__PURE__*/ l.literal(true), + }), +) + +export { blockedPost } + +type Interaction = { + $type?: 'app.bsky.feed.defs#interaction' + item?: l.AtUriString + event?: + | 'app.bsky.feed.defs#requestLess' + | 'app.bsky.feed.defs#requestMore' + | 'app.bsky.feed.defs#clickthroughItem' + | 'app.bsky.feed.defs#clickthroughAuthor' + | 'app.bsky.feed.defs#clickthroughReposter' + | 'app.bsky.feed.defs#clickthroughEmbed' + | 'app.bsky.feed.defs#interactionSeen' + | 'app.bsky.feed.defs#interactionLike' + | 'app.bsky.feed.defs#interactionRepost' + | 'app.bsky.feed.defs#interactionReply' + | 'app.bsky.feed.defs#interactionQuote' + | 'app.bsky.feed.defs#interactionShare' + | l.UnknownString + + /** + * Unique identifier per request that may be passed back alongside interactions. + */ + reqId?: string + + /** + * Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. + */ + feedContext?: string +} + +export type { Interaction } + +const interaction = /*#__PURE__*/ l.typedObject( + $nsid, + 'interaction', + /*#__PURE__*/ l.object({ + item: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + event: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string<{ + knownValues: [ + 'app.bsky.feed.defs#requestLess', + 'app.bsky.feed.defs#requestMore', + 'app.bsky.feed.defs#clickthroughItem', + 'app.bsky.feed.defs#clickthroughAuthor', + 'app.bsky.feed.defs#clickthroughReposter', + 'app.bsky.feed.defs#clickthroughEmbed', + 'app.bsky.feed.defs#interactionSeen', + 'app.bsky.feed.defs#interactionLike', + 'app.bsky.feed.defs#interactionRepost', + 'app.bsky.feed.defs#interactionReply', + 'app.bsky.feed.defs#interactionQuote', + 'app.bsky.feed.defs#interactionShare', + ] + }>(), + ), + reqId: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ maxLength: 100 })), + feedContext: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 2000 }), + ), + }), +) + +export { interaction } + +/** Request that less content like the given feed item be shown in the feed */ +type RequestLess = 'app.bsky.feed.defs#requestLess' + +export type { RequestLess } + +/** Request that less content like the given feed item be shown in the feed */ +const requestLess = /*#__PURE__*/ l.token($nsid, 'requestLess') + +export { requestLess } + +/** Request that more content like the given feed item be shown in the feed */ +type RequestMore = 'app.bsky.feed.defs#requestMore' + +export type { RequestMore } + +/** Request that more content like the given feed item be shown in the feed */ +const requestMore = /*#__PURE__*/ l.token($nsid, 'requestMore') + +export { requestMore } + +/** Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. */ +type ViewerState = { + $type?: 'app.bsky.feed.defs#viewerState' + like?: l.AtUriString + pinned?: boolean + repost?: l.AtUriString + bookmarked?: boolean + threadMuted?: boolean + replyDisabled?: boolean + embeddingDisabled?: boolean +} + +export type { ViewerState } + +/** Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. */ +const viewerState = /*#__PURE__*/ l.typedObject( + $nsid, + 'viewerState', + /*#__PURE__*/ l.object({ + like: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + pinned: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + repost: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + bookmarked: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + threadMuted: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + replyDisabled: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + embeddingDisabled: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + }), +) + +export { viewerState } + +type FeedViewPost = { + $type?: 'app.bsky.feed.defs#feedViewPost' + post: PostView + reply?: ReplyRef + + /** + * Unique identifier per request that may be passed back alongside interactions. + */ + reqId?: string + reason?: l.$Typed | l.$Typed | l.Unknown$TypedObject + + /** + * Context provided by feed generator that may be passed back alongside interactions. + */ + feedContext?: string +} + +export type { FeedViewPost } + +const feedViewPost = /*#__PURE__*/ l.typedObject( + $nsid, + 'feedViewPost', + /*#__PURE__*/ l.object({ + post: /*#__PURE__*/ l.ref((() => postView) as any), + reply: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => replyRef) as any), + ), + reqId: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ maxLength: 100 })), + reason: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef((() => reasonRepost) as any), + /*#__PURE__*/ l.typedRef((() => reasonPin) as any), + ], + false, + ), + ), + feedContext: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 2000 }), + ), + }), +) + +export { feedViewPost } + +type NotFoundPost = { + $type?: 'app.bsky.feed.defs#notFoundPost' + uri: l.AtUriString + notFound: true +} + +export type { NotFoundPost } + +const notFoundPost = /*#__PURE__*/ l.typedObject( + $nsid, + 'notFoundPost', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + notFound: /*#__PURE__*/ l.literal(true), + }), +) + +export { notFoundPost } + +type ReasonRepost = { + $type?: 'app.bsky.feed.defs#reasonRepost' + by: ActorDefs.ProfileViewBasic + cid?: l.CidString + uri?: l.AtUriString + indexedAt: l.DatetimeString +} + +export type { ReasonRepost } + +const reasonRepost = /*#__PURE__*/ l.typedObject( + $nsid, + 'reasonRepost', + /*#__PURE__*/ l.object({ + by: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewBasic) as any, + ), + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), + uri: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'at-uri' })), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + }), +) + +export { reasonRepost } + +type BlockedAuthor = { + $type?: 'app.bsky.feed.defs#blockedAuthor' + did: l.DidString + viewer?: ActorDefs.ViewerState +} + +export type { BlockedAuthor } + +const blockedAuthor = /*#__PURE__*/ l.typedObject( + $nsid, + 'blockedAuthor', + /*#__PURE__*/ l.object({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => ActorDefs.viewerState) as any, + ), + ), + }), +) + +export { blockedAuthor } + +type GeneratorView = { + $type?: 'app.bsky.feed.defs#generatorView' + cid: l.CidString + did: l.DidString + uri: l.AtUriString + avatar?: l.UriString + labels?: LabelDefs.Label[] + viewer?: GeneratorViewerState + creator: ActorDefs.ProfileView + indexedAt: l.DatetimeString + likeCount?: number + contentMode?: + | 'app.bsky.feed.defs#contentModeUnspecified' + | 'app.bsky.feed.defs#contentModeVideo' + | l.UnknownString + description?: string + displayName: string + descriptionFacets?: RichtextFacet.Main[] + acceptsInteractions?: boolean +} + +export type { GeneratorView } + +const generatorView = /*#__PURE__*/ l.typedObject( + $nsid, + 'generatorView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + did: /*#__PURE__*/ l.string({ format: 'did' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + avatar: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => generatorViewerState) as any, + ), + ), + creator: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileView) as any, + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + likeCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + contentMode: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string<{ + knownValues: [ + 'app.bsky.feed.defs#contentModeUnspecified', + 'app.bsky.feed.defs#contentModeVideo', + ] + }>(), + ), + description: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 3000, maxGraphemes: 300 }), + ), + displayName: /*#__PURE__*/ l.string(), + descriptionFacets: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => RichtextFacet.main) as any, + ), + ), + ), + acceptsInteractions: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + }), +) + +export { generatorView } + +/** Metadata about this post within the context of the thread it is in. */ +type ThreadContext = { + $type?: 'app.bsky.feed.defs#threadContext' + rootAuthorLike?: l.AtUriString +} + +export type { ThreadContext } + +/** Metadata about this post within the context of the thread it is in. */ +const threadContext = /*#__PURE__*/ l.typedObject( + $nsid, + 'threadContext', + /*#__PURE__*/ l.object({ + rootAuthorLike: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + }), +) + +export { threadContext } + +type ThreadViewPost = { + $type?: 'app.bsky.feed.defs#threadViewPost' + post: PostView + parent?: + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + replies?: ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + )[] + threadContext?: ThreadContext +} + +export type { ThreadViewPost } + +const threadViewPost = /*#__PURE__*/ l.typedObject( + $nsid, + 'threadViewPost', + /*#__PURE__*/ l.object({ + post: /*#__PURE__*/ l.ref((() => postView) as any), + parent: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => threadViewPost) as any, + ), + /*#__PURE__*/ l.typedRef((() => notFoundPost) as any), + /*#__PURE__*/ l.typedRef((() => blockedPost) as any), + ], + false, + ), + ), + replies: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => threadViewPost) as any, + ), + /*#__PURE__*/ l.typedRef((() => notFoundPost) as any), + /*#__PURE__*/ l.typedRef((() => blockedPost) as any), + ], + false, + ), + ), + ), + threadContext: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => threadContext) as any), + ), + }), +) + +export { threadViewPost } + +type ThreadgateView = { + $type?: 'app.bsky.feed.defs#threadgateView' + cid?: l.CidString + uri?: l.AtUriString + lists?: GraphDefs.ListViewBasic[] + record?: l.LexMap +} + +export type { ThreadgateView } + +const threadgateView = /*#__PURE__*/ l.typedObject( + $nsid, + 'threadgateView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), + uri: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'at-uri' })), + lists: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => GraphDefs.listViewBasic) as any, + ), + ), + ), + record: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.lexMap()), + }), +) + +export { threadgateView } + +/** User liked the feed item */ +type InteractionLike = 'app.bsky.feed.defs#interactionLike' + +export type { InteractionLike } + +/** User liked the feed item */ +const interactionLike = /*#__PURE__*/ l.token($nsid, 'interactionLike') + +export { interactionLike } + +/** Feed item was seen by user */ +type InteractionSeen = 'app.bsky.feed.defs#interactionSeen' + +export type { InteractionSeen } + +/** Feed item was seen by user */ +const interactionSeen = /*#__PURE__*/ l.token($nsid, 'interactionSeen') + +export { interactionSeen } + +/** User clicked through to the feed item */ +type ClickthroughItem = 'app.bsky.feed.defs#clickthroughItem' + +export type { ClickthroughItem } + +/** User clicked through to the feed item */ +const clickthroughItem = /*#__PURE__*/ l.token($nsid, 'clickthroughItem') + +export { clickthroughItem } + +/** Declares the feed generator returns posts containing app.bsky.embed.video embeds. */ +type ContentModeVideo = 'app.bsky.feed.defs#contentModeVideo' + +export type { ContentModeVideo } + +/** Declares the feed generator returns posts containing app.bsky.embed.video embeds. */ +const contentModeVideo = /*#__PURE__*/ l.token($nsid, 'contentModeVideo') + +export { contentModeVideo } + +/** User quoted the feed item */ +type InteractionQuote = 'app.bsky.feed.defs#interactionQuote' + +export type { InteractionQuote } + +/** User quoted the feed item */ +const interactionQuote = /*#__PURE__*/ l.token($nsid, 'interactionQuote') + +export { interactionQuote } + +/** User replied to the feed item */ +type InteractionReply = 'app.bsky.feed.defs#interactionReply' + +export type { InteractionReply } + +/** User replied to the feed item */ +const interactionReply = /*#__PURE__*/ l.token($nsid, 'interactionReply') + +export { interactionReply } + +/** User shared the feed item */ +type InteractionShare = 'app.bsky.feed.defs#interactionShare' + +export type { InteractionShare } + +/** User shared the feed item */ +const interactionShare = /*#__PURE__*/ l.token($nsid, 'interactionShare') + +export { interactionShare } + +type SkeletonFeedPost = { + $type?: 'app.bsky.feed.defs#skeletonFeedPost' + post: l.AtUriString + reason?: + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + + /** + * Context that will be passed through to client and may be passed to feed generator back alongside interactions. + */ + feedContext?: string +} + +export type { SkeletonFeedPost } + +const skeletonFeedPost = /*#__PURE__*/ l.typedObject( + $nsid, + 'skeletonFeedPost', + /*#__PURE__*/ l.object({ + post: /*#__PURE__*/ l.string({ format: 'at-uri' }), + reason: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => skeletonReasonRepost) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => skeletonReasonPin) as any, + ), + ], + false, + ), + ), + feedContext: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 2000 }), + ), + }), +) + +export { skeletonFeedPost } + +/** User clicked through to the embedded content of the feed item */ +type ClickthroughEmbed = 'app.bsky.feed.defs#clickthroughEmbed' + +export type { ClickthroughEmbed } + +/** User clicked through to the embedded content of the feed item */ +const clickthroughEmbed = /*#__PURE__*/ l.token($nsid, 'clickthroughEmbed') + +export { clickthroughEmbed } + +/** User reposted the feed item */ +type InteractionRepost = 'app.bsky.feed.defs#interactionRepost' + +export type { InteractionRepost } + +/** User reposted the feed item */ +const interactionRepost = /*#__PURE__*/ l.token($nsid, 'interactionRepost') + +export { interactionRepost } + +type SkeletonReasonPin = { $type?: 'app.bsky.feed.defs#skeletonReasonPin' } + +export type { SkeletonReasonPin } + +const skeletonReasonPin = /*#__PURE__*/ l.typedObject( + $nsid, + 'skeletonReasonPin', + /*#__PURE__*/ l.object({}), +) + +export { skeletonReasonPin } + +/** User clicked through to the author of the feed item */ +type ClickthroughAuthor = 'app.bsky.feed.defs#clickthroughAuthor' + +export type { ClickthroughAuthor } + +/** User clicked through to the author of the feed item */ +const clickthroughAuthor = /*#__PURE__*/ l.token($nsid, 'clickthroughAuthor') + +export { clickthroughAuthor } + +/** User clicked through to the reposter of the feed item */ +type ClickthroughReposter = 'app.bsky.feed.defs#clickthroughReposter' + +export type { ClickthroughReposter } + +/** User clicked through to the reposter of the feed item */ +const clickthroughReposter = /*#__PURE__*/ l.token( + $nsid, + 'clickthroughReposter', +) + +export { clickthroughReposter } + +type GeneratorViewerState = { + $type?: 'app.bsky.feed.defs#generatorViewerState' + like?: l.AtUriString +} + +export type { GeneratorViewerState } + +const generatorViewerState = /*#__PURE__*/ l.typedObject( + $nsid, + 'generatorViewerState', + /*#__PURE__*/ l.object({ + like: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + }), +) + +export { generatorViewerState } + +type SkeletonReasonRepost = { + $type?: 'app.bsky.feed.defs#skeletonReasonRepost' + repost: l.AtUriString +} + +export type { SkeletonReasonRepost } + +const skeletonReasonRepost = /*#__PURE__*/ l.typedObject( + $nsid, + 'skeletonReasonRepost', + /*#__PURE__*/ l.object({ + repost: /*#__PURE__*/ l.string({ format: 'at-uri' }), + }), +) + +export { skeletonReasonRepost } + +/** Declares the feed generator returns any types of posts. */ +type ContentModeUnspecified = 'app.bsky.feed.defs#contentModeUnspecified' + +export type { ContentModeUnspecified } + +/** Declares the feed generator returns any types of posts. */ +const contentModeUnspecified = /*#__PURE__*/ l.token( + $nsid, + 'contentModeUnspecified', +) + +export { contentModeUnspecified } diff --git a/src/lexicons/app/bsky/feed/defs.ts b/src/lexicons/app/bsky/feed/defs.ts new file mode 100644 index 0000000000..1e9dcf01c1 --- /dev/null +++ b/src/lexicons/app/bsky/feed/defs.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './defs.defs.js' diff --git a/src/lexicons/app/bsky/feed/getLikes.defs.ts b/src/lexicons/app/bsky/feed/getLikes.defs.ts new file mode 100644 index 0000000000..7ac0aec9a0 --- /dev/null +++ b/src/lexicons/app/bsky/feed/getLikes.defs.ts @@ -0,0 +1,67 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as ActorDefs from './..\\actor\\defs.defs.js' + +const $nsid = 'app.bsky.feed.getLikes' + +export { $nsid } + +type Like = { + $type?: 'app.bsky.feed.getLikes#like' + actor: ActorDefs.ProfileView + createdAt: l.DatetimeString + indexedAt: l.DatetimeString +} + +export type { Like } + +const like = /*#__PURE__*/ l.typedObject( + $nsid, + 'like', + /*#__PURE__*/ l.object({ + actor: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileView) as any, + ), + createdAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + }), +) + +export { like } + +export const $params = /*#__PURE__*/ l.params({ + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + limit: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault( + /*#__PURE__*/ l.integer({ maximum: 100, minimum: 1 }), + 50, + ), + ), + cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + likes: /*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => like) as any)), + cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Get like records which reference a subject (by AT-URI and CID). */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/app/bsky/feed/getLikes.ts b/src/lexicons/app/bsky/feed/getLikes.ts new file mode 100644 index 0000000000..b4956263bb --- /dev/null +++ b/src/lexicons/app/bsky/feed/getLikes.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getLikes.defs.js' +export { main as default } from './getLikes.defs.js' diff --git a/src/lexicons/app/bsky/feed/getPostThread.defs.ts b/src/lexicons/app/bsky/feed/getPostThread.defs.ts new file mode 100644 index 0000000000..711abb1277 --- /dev/null +++ b/src/lexicons/app/bsky/feed/getPostThread.defs.ts @@ -0,0 +1,63 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as FeedDefs from './defs.defs.js' + +const $nsid = 'app.bsky.feed.getPostThread' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + depth: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault( + /*#__PURE__*/ l.integer({ maximum: 1000, minimum: 0 }), + 6, + ), + ), + parentHeight: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault( + /*#__PURE__*/ l.integer({ maximum: 1000, minimum: 0 }), + 80, + ), + ), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + thread: /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => FeedDefs.threadViewPost) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => FeedDefs.notFoundPost) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => FeedDefs.blockedPost) as any, + ), + ], + false, + ), + threadgate: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => FeedDefs.threadgateView) as any, + ), + ), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests. */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output, ['NotFound']) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/app/bsky/feed/getPostThread.ts b/src/lexicons/app/bsky/feed/getPostThread.ts new file mode 100644 index 0000000000..a15c45ea65 --- /dev/null +++ b/src/lexicons/app/bsky/feed/getPostThread.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getPostThread.defs.js' +export { main as default } from './getPostThread.defs.js' diff --git a/src/lexicons/app/bsky/feed/getPosts.defs.ts b/src/lexicons/app/bsky/feed/getPosts.defs.ts new file mode 100644 index 0000000000..c31ec17fed --- /dev/null +++ b/src/lexicons/app/bsky/feed/getPosts.defs.ts @@ -0,0 +1,37 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as FeedDefs from './defs.defs.js' + +const $nsid = 'app.bsky.feed.getPosts' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + uris: /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'at-uri' }), { + maxLength: 25, + }), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + posts: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => FeedDefs.postView) as any), + ), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'. */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/app/bsky/feed/getPosts.ts b/src/lexicons/app/bsky/feed/getPosts.ts new file mode 100644 index 0000000000..6df65ec8f8 --- /dev/null +++ b/src/lexicons/app/bsky/feed/getPosts.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getPosts.defs.js' +export { main as default } from './getPosts.defs.js' diff --git a/src/lexicons/app/bsky/feed/post.defs.ts b/src/lexicons/app/bsky/feed/post.defs.ts new file mode 100644 index 0000000000..2cb8ce0ca2 --- /dev/null +++ b/src/lexicons/app/bsky/feed/post.defs.ts @@ -0,0 +1,225 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as EmbedImages from './..\\embed\\images.defs.js' +import * as EmbedVideo from './..\\embed\\video.defs.js' +import * as EmbedExternal from './..\\embed\\external.defs.js' +import * as EmbedRecord from './..\\embed\\record.defs.js' +import * as EmbedRecordWithMedia from './..\\embed\\recordWithMedia.defs.js' +import * as RichtextFacet from './..\\richtext\\facet.defs.js' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' +import * as RepoStrongRef from './..\\..\\..\\com\\atproto\\repo\\strongRef.defs.js' + +const $nsid = 'app.bsky.feed.post' + +export { $nsid } + +/** Record containing a Bluesky post. */ +type Main = { + $type: 'app.bsky.feed.post' + + /** + * Additional hashtags, in addition to any included in post text and facets. + */ + tags?: string[] + + /** + * The primary post content. May be an empty string, if there are embeds. + */ + text: string + embed?: + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + + /** + * Indicates human language of post primary text content. + */ + langs?: l.LanguageString[] + reply?: ReplyRef + + /** + * Annotations of text (mentions, URLs, hashtags, etc) + */ + facets?: RichtextFacet.Main[] + + /** + * Self-label values for this post. Effectively content warnings. + */ + labels?: l.$Typed | l.Unknown$TypedObject + + /** + * @deprecated replaced by app.bsky.richtext.facet. + */ + entities?: Entity[] + + /** + * Client-declared timestamp when this post was originally created. + */ + createdAt: l.DatetimeString +} + +export type { Main } + +/** Record containing a Bluesky post. */ +const main = /*#__PURE__*/ l.record<'tid', Main>( + 'tid', + $nsid, + /*#__PURE__*/ l.object({ + tags: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + { maxLength: 8 }, + ), + ), + text: /*#__PURE__*/ l.string({ maxLength: 3000, maxGraphemes: 300 }), + embed: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => EmbedImages.main) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedVideo.main) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedExternal.main) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedRecord.main) as any, + ), + /*#__PURE__*/ l.typedRef( + (() => EmbedRecordWithMedia.main) as any, + ), + ], + false, + ), + ), + langs: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'language' }), { + maxLength: 3, + }), + ), + reply: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => replyRef) as any), + ), + facets: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => RichtextFacet.main) as any, + ), + ), + ), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef( + (() => LabelDefs.selfLabels) as any, + ), + ], + false, + ), + ), + entities: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.ref((() => entity) as any)), + ), + createdAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +/** @deprecated use facets instead. */ +type Entity = { + $type?: 'app.bsky.feed.post#entity' + + /** + * Expected values are 'mention' and 'link'. + */ + type: string + index: TextSlice + value: string +} + +export type { Entity } + +/** @deprecated use facets instead. */ +const entity = /*#__PURE__*/ l.typedObject( + $nsid, + 'entity', + /*#__PURE__*/ l.object({ + type: /*#__PURE__*/ l.string(), + index: /*#__PURE__*/ l.ref((() => textSlice) as any), + value: /*#__PURE__*/ l.string(), + }), +) + +export { entity } + +type ReplyRef = { + $type?: 'app.bsky.feed.post#replyRef' + root: RepoStrongRef.Main + parent: RepoStrongRef.Main +} + +export type { ReplyRef } + +const replyRef = /*#__PURE__*/ l.typedObject( + $nsid, + 'replyRef', + /*#__PURE__*/ l.object({ + root: /*#__PURE__*/ l.ref( + (() => RepoStrongRef.main) as any, + ), + parent: /*#__PURE__*/ l.ref( + (() => RepoStrongRef.main) as any, + ), + }), +) + +export { replyRef } + +/** + * A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. + * @deprecated . Use app.bsky.richtext instead + */ +type TextSlice = { + $type?: 'app.bsky.feed.post#textSlice' + end: number + start: number +} + +export type { TextSlice } + +/** + * A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. + * @deprecated . Use app.bsky.richtext instead + */ +const textSlice = /*#__PURE__*/ l.typedObject( + $nsid, + 'textSlice', + /*#__PURE__*/ l.object({ + end: /*#__PURE__*/ l.integer({ minimum: 0 }), + start: /*#__PURE__*/ l.integer({ minimum: 0 }), + }), +) + +export { textSlice } diff --git a/src/lexicons/app/bsky/feed/post.ts b/src/lexicons/app/bsky/feed/post.ts new file mode 100644 index 0000000000..801b2f5049 --- /dev/null +++ b/src/lexicons/app/bsky/feed/post.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './post.defs.js' +export { main as default } from './post.defs.js' diff --git a/src/lexicons/app/bsky/feed/postgate.defs.ts b/src/lexicons/app/bsky/feed/postgate.defs.ts new file mode 100644 index 0000000000..f3b075e715 --- /dev/null +++ b/src/lexicons/app/bsky/feed/postgate.defs.ts @@ -0,0 +1,85 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.feed.postgate' + +export { $nsid } + +/** Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository. */ +type Main = { + $type: 'app.bsky.feed.postgate' + + /** + * Reference (AT-URI) to the post record. + */ + post: l.AtUriString + createdAt: l.DatetimeString + + /** + * 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?: (l.$Typed | l.Unknown$TypedObject)[] + + /** + * List of AT-URIs embedding this post that the author has detached from. + */ + detachedEmbeddingUris?: l.AtUriString[] +} + +export type { Main } + +/** Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository. */ +const main = /*#__PURE__*/ l.record<'tid', Main>( + 'tid', + $nsid, + /*#__PURE__*/ l.object({ + post: /*#__PURE__*/ l.string({ format: 'at-uri' }), + createdAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + embeddingRules: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [/*#__PURE__*/ l.typedRef((() => disableRule) as any)], + false, + ), + { maxLength: 5 }, + ), + ), + detachedEmbeddingUris: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'at-uri' }), { + maxLength: 50, + }), + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +/** Disables embedding of this post. */ +type DisableRule = { $type?: 'app.bsky.feed.postgate#disableRule' } + +export type { DisableRule } + +/** Disables embedding of this post. */ +const disableRule = /*#__PURE__*/ l.typedObject( + $nsid, + 'disableRule', + /*#__PURE__*/ l.object({}), +) + +export { disableRule } diff --git a/src/lexicons/app/bsky/feed/postgate.ts b/src/lexicons/app/bsky/feed/postgate.ts new file mode 100644 index 0000000000..9609fc8a0d --- /dev/null +++ b/src/lexicons/app/bsky/feed/postgate.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './postgate.defs.js' +export { main as default } from './postgate.defs.js' diff --git a/src/lexicons/app/bsky/feed/threadgate.defs.ts b/src/lexicons/app/bsky/feed/threadgate.defs.ts new file mode 100644 index 0000000000..4af6375f1a --- /dev/null +++ b/src/lexicons/app/bsky/feed/threadgate.defs.ts @@ -0,0 +1,145 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.feed.threadgate' + +export { $nsid } + +/** Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository. */ +type Main = { + $type: 'app.bsky.feed.threadgate' + + /** + * Reference (AT-URI) to the post record. + */ + post: l.AtUriString + + /** + * 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?: ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + )[] + createdAt: l.DatetimeString + + /** + * List of hidden reply URIs. + */ + hiddenReplies?: l.AtUriString[] +} + +export type { Main } + +/** Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository. */ +const main = /*#__PURE__*/ l.record<'tid', Main>( + 'tid', + $nsid, + /*#__PURE__*/ l.object({ + post: /*#__PURE__*/ l.string({ format: 'at-uri' }), + allow: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef((() => mentionRule) as any), + /*#__PURE__*/ l.typedRef((() => followerRule) as any), + /*#__PURE__*/ l.typedRef( + (() => followingRule) as any, + ), + /*#__PURE__*/ l.typedRef((() => listRule) as any), + ], + false, + ), + { maxLength: 5 }, + ), + ), + createdAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + hiddenReplies: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'at-uri' }), { + maxLength: 300, + }), + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +/** Allow replies from actors on a list. */ +type ListRule = { + $type?: 'app.bsky.feed.threadgate#listRule' + list: l.AtUriString +} + +export type { ListRule } + +/** Allow replies from actors on a list. */ +const listRule = /*#__PURE__*/ l.typedObject( + $nsid, + 'listRule', + /*#__PURE__*/ l.object({ + list: /*#__PURE__*/ l.string({ format: 'at-uri' }), + }), +) + +export { listRule } + +/** Allow replies from actors mentioned in your post. */ +type MentionRule = { $type?: 'app.bsky.feed.threadgate#mentionRule' } + +export type { MentionRule } + +/** Allow replies from actors mentioned in your post. */ +const mentionRule = /*#__PURE__*/ l.typedObject( + $nsid, + 'mentionRule', + /*#__PURE__*/ l.object({}), +) + +export { mentionRule } + +/** Allow replies from actors who follow you. */ +type FollowerRule = { $type?: 'app.bsky.feed.threadgate#followerRule' } + +export type { FollowerRule } + +/** Allow replies from actors who follow you. */ +const followerRule = /*#__PURE__*/ l.typedObject( + $nsid, + 'followerRule', + /*#__PURE__*/ l.object({}), +) + +export { followerRule } + +/** Allow replies from actors you follow. */ +type FollowingRule = { $type?: 'app.bsky.feed.threadgate#followingRule' } + +export type { FollowingRule } + +/** Allow replies from actors you follow. */ +const followingRule = /*#__PURE__*/ l.typedObject( + $nsid, + 'followingRule', + /*#__PURE__*/ l.object({}), +) + +export { followingRule } diff --git a/src/lexicons/app/bsky/feed/threadgate.ts b/src/lexicons/app/bsky/feed/threadgate.ts new file mode 100644 index 0000000000..3e15821661 --- /dev/null +++ b/src/lexicons/app/bsky/feed/threadgate.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './threadgate.defs.js' +export { main as default } from './threadgate.defs.js' diff --git a/src/lexicons/app/bsky/graph.ts b/src/lexicons/app/bsky/graph.ts new file mode 100644 index 0000000000..d31f0d4c0b --- /dev/null +++ b/src/lexicons/app/bsky/graph.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './graph/defs.js' diff --git a/src/lexicons/app/bsky/graph/defs.defs.ts b/src/lexicons/app/bsky/graph/defs.defs.ts new file mode 100644 index 0000000000..9715f8d220 --- /dev/null +++ b/src/lexicons/app/bsky/graph/defs.defs.ts @@ -0,0 +1,397 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' +import * as ActorDefs from './..\\actor\\defs.defs.js' +import * as RichtextFacet from './..\\richtext\\facet.defs.js' +import * as FeedDefs from './..\\feed\\defs.defs.js' + +const $nsid = 'app.bsky.graph.defs' + +export { $nsid } + +/** A list of actors to apply an aggregate moderation action (mute/block) on. */ +type Modlist = 'app.bsky.graph.defs#modlist' + +export type { Modlist } + +/** A list of actors to apply an aggregate moderation action (mute/block) on. */ +const modlist = /*#__PURE__*/ l.token($nsid, 'modlist') + +export { modlist } + +type ListView = { + $type?: 'app.bsky.graph.defs#listView' + cid: l.CidString + uri: l.AtUriString + name: string + avatar?: l.UriString + labels?: LabelDefs.Label[] + viewer?: ListViewerState + creator: ActorDefs.ProfileView + purpose: ListPurpose + indexedAt: l.DatetimeString + description?: string + listItemCount?: number + descriptionFacets?: RichtextFacet.Main[] +} + +export type { ListView } + +const listView = /*#__PURE__*/ l.typedObject( + $nsid, + 'listView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + name: /*#__PURE__*/ l.string({ maxLength: 64, minLength: 1 }), + avatar: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => listViewerState) as any), + ), + creator: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileView) as any, + ), + purpose: /*#__PURE__*/ l.ref((() => listPurpose) as any), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + description: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ maxLength: 3000, maxGraphemes: 300 }), + ), + listItemCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + descriptionFacets: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => RichtextFacet.main) as any, + ), + ), + ), + }), +) + +export { listView } + +/** A list of actors used for curation purposes such as list feeds or interaction gating. */ +type Curatelist = 'app.bsky.graph.defs#curatelist' + +export type { Curatelist } + +/** A list of actors used for curation purposes such as list feeds or interaction gating. */ +const curatelist = /*#__PURE__*/ l.token($nsid, 'curatelist') + +export { curatelist } + +type ListPurpose = + | 'app.bsky.graph.defs#modlist' + | 'app.bsky.graph.defs#curatelist' + | 'app.bsky.graph.defs#referencelist' + | l.UnknownString + +export type { ListPurpose } + +const listPurpose = /*#__PURE__*/ l.string<{ + knownValues: [ + 'app.bsky.graph.defs#modlist', + 'app.bsky.graph.defs#curatelist', + 'app.bsky.graph.defs#referencelist', + ] +}>() + +export { listPurpose } + +type ListItemView = { + $type?: 'app.bsky.graph.defs#listItemView' + uri: l.AtUriString + subject: ActorDefs.ProfileView +} + +export type { ListItemView } + +const listItemView = /*#__PURE__*/ l.typedObject( + $nsid, + 'listItemView', + /*#__PURE__*/ l.object({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + subject: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileView) as any, + ), + }), +) + +export { listItemView } + +/** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) */ +type Relationship = { + $type?: 'app.bsky.graph.defs#relationship' + did: l.DidString + + /** + * if the actor blocks this DID, this is the AT-URI of the block record + */ + blocking?: l.AtUriString + + /** + * if the actor is blocked by this DID, contains the AT-URI of the block record + */ + blockedBy?: l.AtUriString + + /** + * if the actor follows this DID, this is the AT-URI of the follow record + */ + following?: l.AtUriString + + /** + * if the actor is followed by this DID, contains the AT-URI of the follow record + */ + followedBy?: l.AtUriString + + /** + * if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record + */ + blockedByList?: l.AtUriString + + /** + * if the actor blocks this DID via a block list, this is the AT-URI of the listblock record + */ + blockingByList?: l.AtUriString +} + +export type { Relationship } + +/** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) */ +const relationship = /*#__PURE__*/ l.typedObject( + $nsid, + 'relationship', + /*#__PURE__*/ l.object({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + blocking: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + blockedBy: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + following: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + followedBy: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + blockedByList: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + blockingByList: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + }), +) + +export { relationship } + +type ListViewBasic = { + $type?: 'app.bsky.graph.defs#listViewBasic' + cid: l.CidString + uri: l.AtUriString + name: string + avatar?: l.UriString + labels?: LabelDefs.Label[] + viewer?: ListViewerState + purpose: ListPurpose + indexedAt?: l.DatetimeString + listItemCount?: number +} + +export type { ListViewBasic } + +const listViewBasic = /*#__PURE__*/ l.typedObject( + $nsid, + 'listViewBasic', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + name: /*#__PURE__*/ l.string({ maxLength: 64, minLength: 1 }), + avatar: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'uri' })), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => listViewerState) as any), + ), + purpose: /*#__PURE__*/ l.ref((() => listPurpose) as any), + indexedAt: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'datetime' }), + ), + listItemCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + }), +) + +export { listViewBasic } + +/** indicates that a handle or DID could not be resolved */ +type NotFoundActor = { + $type?: 'app.bsky.graph.defs#notFoundActor' + actor: l.AtIdentifierString + notFound: true +} + +export type { NotFoundActor } + +/** indicates that a handle or DID could not be resolved */ +const notFoundActor = /*#__PURE__*/ l.typedObject( + $nsid, + 'notFoundActor', + /*#__PURE__*/ l.object({ + actor: /*#__PURE__*/ l.string({ format: 'at-identifier' }), + notFound: /*#__PURE__*/ l.literal(true), + }), +) + +export { notFoundActor } + +/** A list of actors used for only for reference purposes such as within a starter pack. */ +type Referencelist = 'app.bsky.graph.defs#referencelist' + +export type { Referencelist } + +/** A list of actors used for only for reference purposes such as within a starter pack. */ +const referencelist = /*#__PURE__*/ l.token($nsid, 'referencelist') + +export { referencelist } + +type ListViewerState = { + $type?: 'app.bsky.graph.defs#listViewerState' + muted?: boolean + blocked?: l.AtUriString +} + +export type { ListViewerState } + +const listViewerState = /*#__PURE__*/ l.typedObject( + $nsid, + 'listViewerState', + /*#__PURE__*/ l.object({ + muted: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()), + blocked: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + }), +) + +export { listViewerState } + +type StarterPackView = { + $type?: 'app.bsky.graph.defs#starterPackView' + cid: l.CidString + uri: l.AtUriString + list?: ListViewBasic + feeds?: FeedDefs.GeneratorView[] + labels?: LabelDefs.Label[] + record: l.LexMap + creator: ActorDefs.ProfileViewBasic + indexedAt: l.DatetimeString + joinedWeekCount?: number + listItemsSample?: ListItemView[] + joinedAllTimeCount?: number +} + +export type { StarterPackView } + +const starterPackView = /*#__PURE__*/ l.typedObject( + $nsid, + 'starterPackView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + list: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref((() => listViewBasic) as any), + ), + feeds: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => FeedDefs.generatorView) as any, + ), + { maxLength: 3 }, + ), + ), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + record: /*#__PURE__*/ l.lexMap(), + creator: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewBasic) as any, + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + joinedWeekCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + listItemsSample: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => listItemView) as any), + { maxLength: 12 }, + ), + ), + joinedAllTimeCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + }), +) + +export { starterPackView } + +type StarterPackViewBasic = { + $type?: 'app.bsky.graph.defs#starterPackViewBasic' + cid: l.CidString + uri: l.AtUriString + labels?: LabelDefs.Label[] + record: l.LexMap + creator: ActorDefs.ProfileViewBasic + indexedAt: l.DatetimeString + listItemCount?: number + joinedWeekCount?: number + joinedAllTimeCount?: number +} + +export type { StarterPackViewBasic } + +const starterPackViewBasic = /*#__PURE__*/ l.typedObject( + $nsid, + 'starterPackViewBasic', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + record: /*#__PURE__*/ l.lexMap(), + creator: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileViewBasic) as any, + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + listItemCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + joinedWeekCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + joinedAllTimeCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + }), +) + +export { starterPackViewBasic } diff --git a/src/lexicons/app/bsky/graph/defs.ts b/src/lexicons/app/bsky/graph/defs.ts new file mode 100644 index 0000000000..1e9dcf01c1 --- /dev/null +++ b/src/lexicons/app/bsky/graph/defs.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './defs.defs.js' diff --git a/src/lexicons/app/bsky/labeler.ts b/src/lexicons/app/bsky/labeler.ts new file mode 100644 index 0000000000..a358fbc6c6 --- /dev/null +++ b/src/lexicons/app/bsky/labeler.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './labeler/defs.js' diff --git a/src/lexicons/app/bsky/labeler/defs.defs.ts b/src/lexicons/app/bsky/labeler/defs.defs.ts new file mode 100644 index 0000000000..ea4edc1d62 --- /dev/null +++ b/src/lexicons/app/bsky/labeler/defs.defs.ts @@ -0,0 +1,186 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' +import * as LabelDefs from './..\\..\\..\\com\\atproto\\label\\defs.defs.js' +import * as ActorDefs from './..\\actor\\defs.defs.js' +import * as ModerationDefs from './..\\..\\..\\com\\atproto\\moderation\\defs.defs.js' + +const $nsid = 'app.bsky.labeler.defs' + +export { $nsid } + +type LabelerView = { + $type?: 'app.bsky.labeler.defs#labelerView' + cid: l.CidString + uri: l.AtUriString + labels?: LabelDefs.Label[] + viewer?: LabelerViewerState + creator: ActorDefs.ProfileView + indexedAt: l.DatetimeString + likeCount?: number +} + +export type { LabelerView } + +const labelerView = /*#__PURE__*/ l.typedObject( + $nsid, + 'labelerView', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => labelerViewerState) as any, + ), + ), + creator: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileView) as any, + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + likeCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + }), +) + +export { labelerView } + +type LabelerPolicies = { + $type?: 'app.bsky.labeler.defs#labelerPolicies' + + /** + * The label values which this labeler publishes. May include global or custom labels. + */ + labelValues: LabelDefs.LabelValue[] + + /** + * Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. + */ + labelValueDefinitions?: LabelDefs.LabelValueDefinition[] +} + +export type { LabelerPolicies } + +const labelerPolicies = /*#__PURE__*/ l.typedObject( + $nsid, + 'labelerPolicies', + /*#__PURE__*/ l.object({ + labelValues: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => LabelDefs.labelValue) as any, + ), + ), + labelValueDefinitions: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => LabelDefs.labelValueDefinition) as any, + ), + ), + ), + }), +) + +export { labelerPolicies } + +type LabelerViewerState = { + $type?: 'app.bsky.labeler.defs#labelerViewerState' + like?: l.AtUriString +} + +export type { LabelerViewerState } + +const labelerViewerState = /*#__PURE__*/ l.typedObject( + $nsid, + 'labelerViewerState', + /*#__PURE__*/ l.object({ + like: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.string({ format: 'at-uri' }), + ), + }), +) + +export { labelerViewerState } + +type LabelerViewDetailed = { + $type?: 'app.bsky.labeler.defs#labelerViewDetailed' + cid: l.CidString + uri: l.AtUriString + labels?: LabelDefs.Label[] + viewer?: LabelerViewerState + creator: ActorDefs.ProfileView + policies: LabelerPolicies + indexedAt: l.DatetimeString + likeCount?: number + + /** + * The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. + */ + reasonTypes?: ModerationDefs.ReasonType[] + + /** + * The set of subject types (account, record, etc) this service accepts reports on. + */ + subjectTypes?: ModerationDefs.SubjectType[] + + /** + * Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. + */ + subjectCollections?: l.NsidString[] +} + +export type { LabelerViewDetailed } + +const labelerViewDetailed = /*#__PURE__*/ l.typedObject( + $nsid, + 'labelerViewDetailed', + /*#__PURE__*/ l.object({ + cid: /*#__PURE__*/ l.string({ format: 'cid' }), + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + labels: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => LabelDefs.label) as any), + ), + ), + viewer: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.ref( + (() => labelerViewerState) as any, + ), + ), + creator: /*#__PURE__*/ l.ref( + (() => ActorDefs.profileView) as any, + ), + policies: /*#__PURE__*/ l.ref( + (() => labelerPolicies) as any, + ), + indexedAt: /*#__PURE__*/ l.string({ format: 'datetime' }), + likeCount: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.integer({ minimum: 0 }), + ), + reasonTypes: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => ModerationDefs.reasonType) as any, + ), + ), + ), + subjectTypes: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref( + (() => ModerationDefs.subjectType) as any, + ), + ), + ), + subjectCollections: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'nsid' })), + ), + }), +) + +export { labelerViewDetailed } diff --git a/src/lexicons/app/bsky/labeler/defs.ts b/src/lexicons/app/bsky/labeler/defs.ts new file mode 100644 index 0000000000..1e9dcf01c1 --- /dev/null +++ b/src/lexicons/app/bsky/labeler/defs.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './defs.defs.js' diff --git a/src/lexicons/app/bsky/notification.ts b/src/lexicons/app/bsky/notification.ts new file mode 100644 index 0000000000..e944040ed5 --- /dev/null +++ b/src/lexicons/app/bsky/notification.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './notification/defs.js' diff --git a/src/lexicons/app/bsky/notification/defs.defs.ts b/src/lexicons/app/bsky/notification/defs.defs.ts new file mode 100644 index 0000000000..13ad619c94 --- /dev/null +++ b/src/lexicons/app/bsky/notification/defs.defs.ts @@ -0,0 +1,182 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.notification.defs' + +export { $nsid } + +type Preference = { + $type?: 'app.bsky.notification.defs#preference' + list: boolean + push: boolean +} + +export type { Preference } + +const preference = /*#__PURE__*/ l.typedObject( + $nsid, + 'preference', + /*#__PURE__*/ l.object({ + list: /*#__PURE__*/ l.boolean(), + push: /*#__PURE__*/ l.boolean(), + }), +) + +export { preference } + +type Preferences = { + $type?: 'app.bsky.notification.defs#preferences' + chat: ChatPreference + like: FilterablePreference + quote: FilterablePreference + reply: FilterablePreference + follow: FilterablePreference + repost: FilterablePreference + mention: FilterablePreference + verified: Preference + unverified: Preference + likeViaRepost: FilterablePreference + subscribedPost: Preference + repostViaRepost: FilterablePreference + starterpackJoined: Preference +} + +export type { Preferences } + +const preferences = /*#__PURE__*/ l.typedObject( + $nsid, + 'preferences', + /*#__PURE__*/ l.object({ + chat: /*#__PURE__*/ l.ref((() => chatPreference) as any), + like: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + quote: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + reply: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + follow: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + repost: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + mention: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + verified: /*#__PURE__*/ l.ref((() => preference) as any), + unverified: /*#__PURE__*/ l.ref((() => preference) as any), + likeViaRepost: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + subscribedPost: /*#__PURE__*/ l.ref((() => preference) as any), + repostViaRepost: /*#__PURE__*/ l.ref( + (() => filterablePreference) as any, + ), + starterpackJoined: /*#__PURE__*/ l.ref( + (() => preference) as any, + ), + }), +) + +export { preferences } + +type RecordDeleted = { $type?: 'app.bsky.notification.defs#recordDeleted' } + +export type { RecordDeleted } + +const recordDeleted = /*#__PURE__*/ l.typedObject( + $nsid, + 'recordDeleted', + /*#__PURE__*/ l.object({}), +) + +export { recordDeleted } + +type ChatPreference = { + $type?: 'app.bsky.notification.defs#chatPreference' + push: boolean + include: 'all' | 'accepted' | l.UnknownString +} + +export type { ChatPreference } + +const chatPreference = /*#__PURE__*/ l.typedObject( + $nsid, + 'chatPreference', + /*#__PURE__*/ l.object({ + push: /*#__PURE__*/ l.boolean(), + include: /*#__PURE__*/ l.string<{ knownValues: ['all', 'accepted'] }>(), + }), +) + +export { chatPreference } + +type ActivitySubscription = { + $type?: 'app.bsky.notification.defs#activitySubscription' + post: boolean + reply: boolean +} + +export type { ActivitySubscription } + +const activitySubscription = /*#__PURE__*/ l.typedObject( + $nsid, + 'activitySubscription', + /*#__PURE__*/ l.object({ + post: /*#__PURE__*/ l.boolean(), + reply: /*#__PURE__*/ l.boolean(), + }), +) + +export { activitySubscription } + +type FilterablePreference = { + $type?: 'app.bsky.notification.defs#filterablePreference' + list: boolean + push: boolean + include: 'all' | 'follows' | l.UnknownString +} + +export type { FilterablePreference } + +const filterablePreference = /*#__PURE__*/ l.typedObject( + $nsid, + 'filterablePreference', + /*#__PURE__*/ l.object({ + list: /*#__PURE__*/ l.boolean(), + push: /*#__PURE__*/ l.boolean(), + include: /*#__PURE__*/ l.string<{ knownValues: ['all', 'follows'] }>(), + }), +) + +export { filterablePreference } + +/** Object used to store activity subscription data in stash. */ +type SubjectActivitySubscription = { + $type?: 'app.bsky.notification.defs#subjectActivitySubscription' + subject: l.DidString + activitySubscription: ActivitySubscription +} + +export type { SubjectActivitySubscription } + +/** Object used to store activity subscription data in stash. */ +const subjectActivitySubscription = + /*#__PURE__*/ l.typedObject( + $nsid, + 'subjectActivitySubscription', + /*#__PURE__*/ l.object({ + subject: /*#__PURE__*/ l.string({ format: 'did' }), + activitySubscription: /*#__PURE__*/ l.ref( + (() => activitySubscription) as any, + ), + }), + ) + +export { subjectActivitySubscription } diff --git a/src/lexicons/app/bsky/notification/defs.ts b/src/lexicons/app/bsky/notification/defs.ts new file mode 100644 index 0000000000..1e9dcf01c1 --- /dev/null +++ b/src/lexicons/app/bsky/notification/defs.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './defs.defs.js' diff --git a/src/lexicons/app/bsky/richtext.ts b/src/lexicons/app/bsky/richtext.ts new file mode 100644 index 0000000000..ce3591a99f --- /dev/null +++ b/src/lexicons/app/bsky/richtext.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as facet from './richtext/facet.js' diff --git a/src/lexicons/app/bsky/richtext/facet.defs.ts b/src/lexicons/app/bsky/richtext/facet.defs.ts new file mode 100644 index 0000000000..4ed1ffeae3 --- /dev/null +++ b/src/lexicons/app/bsky/richtext/facet.defs.ts @@ -0,0 +1,122 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'app.bsky.richtext.facet' + +export { $nsid } + +/** 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'). */ +type Tag = { $type?: 'app.bsky.richtext.facet#tag'; tag: string } + +export type { Tag } + +/** 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'). */ +const tag = /*#__PURE__*/ l.typedObject( + $nsid, + 'tag', + /*#__PURE__*/ l.object({ + tag: /*#__PURE__*/ l.string({ maxLength: 640, maxGraphemes: 64 }), + }), +) + +export { tag } + +/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ +type Link = { $type?: 'app.bsky.richtext.facet#link'; uri: l.UriString } + +export type { Link } + +/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */ +const link = /*#__PURE__*/ l.typedObject( + $nsid, + 'link', + /*#__PURE__*/ l.object({ uri: /*#__PURE__*/ l.string({ format: 'uri' }) }), +) + +export { link } + +/** Annotation of a sub-string within rich text. */ +type Main = { + $type?: 'app.bsky.richtext.facet' + index: ByteSlice + features: ( + | l.$Typed + | l.$Typed + | l.$Typed + | l.Unknown$TypedObject + )[] +} + +export type { Main } + +/** Annotation of a sub-string within rich text. */ +const main = /*#__PURE__*/ l.typedObject
( + $nsid, + 'main', + /*#__PURE__*/ l.object({ + index: /*#__PURE__*/ l.ref((() => byteSlice) as any), + features: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.typedUnion( + [ + /*#__PURE__*/ l.typedRef((() => mention) as any), + /*#__PURE__*/ l.typedRef((() => link) as any), + /*#__PURE__*/ l.typedRef((() => tag) as any), + ], + false, + ), + ), + }), +) + +export { main } + +export const $type = $nsid +export const $isTypeOf = /*#__PURE__*/ main.isTypeOf.bind(main) +export const $build = /*#__PURE__*/ main.build.bind(main) +export const $assert = /*#__PURE__*/ main.assert.bind(main) +export const $check = /*#__PURE__*/ main.check.bind(main) +export const $cast = /*#__PURE__*/ main.cast.bind(main) +export const $ifMatches = /*#__PURE__*/ main.ifMatches.bind(main) +export const $matches = /*#__PURE__*/ main.matches.bind(main) +export const $parse = /*#__PURE__*/ main.parse.bind(main) +export const $safeParse = /*#__PURE__*/ main.safeParse.bind(main) +export const $validate = /*#__PURE__*/ main.validate.bind(main) +export const $safeValidate = /*#__PURE__*/ main.safeValidate.bind(main) + +/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ +type Mention = { $type?: 'app.bsky.richtext.facet#mention'; did: l.DidString } + +export type { Mention } + +/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */ +const mention = /*#__PURE__*/ l.typedObject( + $nsid, + 'mention', + /*#__PURE__*/ l.object({ did: /*#__PURE__*/ l.string({ format: 'did' }) }), +) + +export { mention } + +/** 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. */ +type ByteSlice = { + $type?: 'app.bsky.richtext.facet#byteSlice' + byteEnd: number + byteStart: number +} + +export type { ByteSlice } + +/** 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. */ +const byteSlice = /*#__PURE__*/ l.typedObject( + $nsid, + 'byteSlice', + /*#__PURE__*/ l.object({ + byteEnd: /*#__PURE__*/ l.integer({ minimum: 0 }), + byteStart: /*#__PURE__*/ l.integer({ minimum: 0 }), + }), +) + +export { byteSlice } diff --git a/src/lexicons/app/bsky/richtext/facet.ts b/src/lexicons/app/bsky/richtext/facet.ts new file mode 100644 index 0000000000..f0282a7359 --- /dev/null +++ b/src/lexicons/app/bsky/richtext/facet.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './facet.defs.js' +export { main as default } from './facet.defs.js' diff --git a/src/lexicons/blue.ts b/src/lexicons/blue.ts new file mode 100644 index 0000000000..51a3748407 --- /dev/null +++ b/src/lexicons/blue.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as microcosm from './blue/microcosm.js' diff --git a/src/lexicons/blue/microcosm.ts b/src/lexicons/blue/microcosm.ts new file mode 100644 index 0000000000..99aa4f05a8 --- /dev/null +++ b/src/lexicons/blue/microcosm.ts @@ -0,0 +1,7 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as identity from './microcosm/identity.js' +export * as links from './microcosm/links.js' +export * as repo from './microcosm/repo.js' diff --git a/src/lexicons/blue/microcosm/identity.ts b/src/lexicons/blue/microcosm/identity.ts new file mode 100644 index 0000000000..2a7458e1f2 --- /dev/null +++ b/src/lexicons/blue/microcosm/identity.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as resolveMiniDoc from './identity/resolveMiniDoc.js' diff --git a/src/lexicons/blue/microcosm/identity/resolveMiniDoc.defs.ts b/src/lexicons/blue/microcosm/identity/resolveMiniDoc.defs.ts new file mode 100644 index 0000000000..356b1a6c75 --- /dev/null +++ b/src/lexicons/blue/microcosm/identity/resolveMiniDoc.defs.ts @@ -0,0 +1,35 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'blue.microcosm.identity.resolveMiniDoc' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + identifier: /*#__PURE__*/ l.string({ format: 'at-identifier' }), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + handle: /*#__PURE__*/ l.string({ format: 'handle' }), + pds: /*#__PURE__*/ l.string({ format: 'uri' }), + signing_key: /*#__PURE__*/ l.string(), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Slingshot: like com.atproto.identity.resolveIdentity but instead of the full didDoc it returns an atproto-relevant subset */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/blue/microcosm/identity/resolveMiniDoc.ts b/src/lexicons/blue/microcosm/identity/resolveMiniDoc.ts new file mode 100644 index 0000000000..f9a5d57ef4 --- /dev/null +++ b/src/lexicons/blue/microcosm/identity/resolveMiniDoc.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './resolveMiniDoc.defs.js' +export { main as default } from './resolveMiniDoc.defs.js' diff --git a/src/lexicons/blue/microcosm/links.ts b/src/lexicons/blue/microcosm/links.ts new file mode 100644 index 0000000000..3f88135b16 --- /dev/null +++ b/src/lexicons/blue/microcosm/links.ts @@ -0,0 +1,7 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as getBacklinks from './links/getBacklinks.js' +export * as getBacklinksCount from './links/getBacklinksCount.js' +export * as getManyToManyCounts from './links/getManyToManyCounts.js' diff --git a/src/lexicons/blue/microcosm/links/getBacklinks.defs.ts b/src/lexicons/blue/microcosm/links/getBacklinks.defs.ts new file mode 100644 index 0000000000..22c84ec2f6 --- /dev/null +++ b/src/lexicons/blue/microcosm/links/getBacklinks.defs.ts @@ -0,0 +1,81 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'blue.microcosm.links.getBacklinks' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + subject: /*#__PURE__*/ l.string({ format: 'uri' }), + source: /*#__PURE__*/ l.string(), + did: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'did' })), + ), + limit: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault( + /*#__PURE__*/ l.integer({ minimum: 1, maximum: 100 }), + 16, + ), + ), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + total: /*#__PURE__*/ l.integer(), + records: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => linkRecord) as any), + ), + cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Constellation: list records linking to any record, identity, or uri */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid + +/** a record linking to the subject */ +type LinkRecord = { + $type?: 'blue.microcosm.links.getBacklinks#linkRecord' + + /** + * the DID of the linking record's repository + */ + did: l.DidString + + /** + * the collection of the linking record + */ + collection: l.NsidString + + /** + * the record key of the linking record + */ + rkey: l.RecordKeyString +} + +export type { LinkRecord } + +/** a record linking to the subject */ +const linkRecord = /*#__PURE__*/ l.typedObject( + $nsid, + 'linkRecord', + /*#__PURE__*/ l.object({ + did: /*#__PURE__*/ l.string({ format: 'did' }), + collection: /*#__PURE__*/ l.string({ format: 'nsid' }), + rkey: /*#__PURE__*/ l.string({ format: 'record-key' }), + }), +) + +export { linkRecord } diff --git a/src/lexicons/blue/microcosm/links/getBacklinks.ts b/src/lexicons/blue/microcosm/links/getBacklinks.ts new file mode 100644 index 0000000000..a03fc3be6f --- /dev/null +++ b/src/lexicons/blue/microcosm/links/getBacklinks.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getBacklinks.defs.js' +export { main as default } from './getBacklinks.defs.js' diff --git a/src/lexicons/blue/microcosm/links/getBacklinksCount.defs.ts b/src/lexicons/blue/microcosm/links/getBacklinksCount.defs.ts new file mode 100644 index 0000000000..248b170be5 --- /dev/null +++ b/src/lexicons/blue/microcosm/links/getBacklinksCount.defs.ts @@ -0,0 +1,33 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'blue.microcosm.links.getBacklinksCount' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + subject: /*#__PURE__*/ l.string({ format: 'at-uri' }), + source: /*#__PURE__*/ l.string(), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + total: /*#__PURE__*/ l.integer(), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Constellation: count records that link to another record */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/blue/microcosm/links/getBacklinksCount.ts b/src/lexicons/blue/microcosm/links/getBacklinksCount.ts new file mode 100644 index 0000000000..fe4ed870ce --- /dev/null +++ b/src/lexicons/blue/microcosm/links/getBacklinksCount.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getBacklinksCount.defs.js' +export { main as default } from './getBacklinksCount.defs.js' diff --git a/src/lexicons/blue/microcosm/links/getManyToManyCounts.defs.ts b/src/lexicons/blue/microcosm/links/getManyToManyCounts.defs.ts new file mode 100644 index 0000000000..d1adb92b40 --- /dev/null +++ b/src/lexicons/blue/microcosm/links/getManyToManyCounts.defs.ts @@ -0,0 +1,84 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'blue.microcosm.links.getManyToManyCounts' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + subject: /*#__PURE__*/ l.string({ format: 'uri' }), + source: /*#__PURE__*/ l.string(), + pathToOther: /*#__PURE__*/ l.string(), + did: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string({ format: 'did' })), + ), + otherSubject: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.array(/*#__PURE__*/ l.string()), + ), + limit: /*#__PURE__*/ l.optional( + /*#__PURE__*/ l.withDefault( + /*#__PURE__*/ l.integer({ minimum: 1, maximum: 100 }), + 16, + ), + ), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + counts_by_other_subject: /*#__PURE__*/ l.array( + /*#__PURE__*/ l.ref((() => countBySubject) as any), + ), + cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Constellation: count many-to-many relationships with secondary link paths */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid + +/** count of links to a secondary subject */ +type CountBySubject = { + $type?: 'blue.microcosm.links.getManyToManyCounts#countBySubject' + + /** + * the secondary subject being counted + */ + subject: string + + /** + * total number of links to this subject + */ + total: number + + /** + * number of distinct DIDs linking to this subject + */ + distinct: number +} + +export type { CountBySubject } + +/** count of links to a secondary subject */ +const countBySubject = /*#__PURE__*/ l.typedObject( + $nsid, + 'countBySubject', + /*#__PURE__*/ l.object({ + subject: /*#__PURE__*/ l.string(), + total: /*#__PURE__*/ l.integer(), + distinct: /*#__PURE__*/ l.integer(), + }), +) + +export { countBySubject } diff --git a/src/lexicons/blue/microcosm/links/getManyToManyCounts.ts b/src/lexicons/blue/microcosm/links/getManyToManyCounts.ts new file mode 100644 index 0000000000..163c38ca38 --- /dev/null +++ b/src/lexicons/blue/microcosm/links/getManyToManyCounts.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getManyToManyCounts.defs.js' +export { main as default } from './getManyToManyCounts.defs.js' diff --git a/src/lexicons/blue/microcosm/repo.ts b/src/lexicons/blue/microcosm/repo.ts new file mode 100644 index 0000000000..fb1b046c56 --- /dev/null +++ b/src/lexicons/blue/microcosm/repo.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as getRecordByUri from './repo/getRecordByUri.js' diff --git a/src/lexicons/blue/microcosm/repo/getRecordByUri.defs.ts b/src/lexicons/blue/microcosm/repo/getRecordByUri.defs.ts new file mode 100644 index 0000000000..fcc979a13d --- /dev/null +++ b/src/lexicons/blue/microcosm/repo/getRecordByUri.defs.ts @@ -0,0 +1,35 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'blue.microcosm.repo.getRecordByUri' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + at_uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + uri: /*#__PURE__*/ l.string({ format: 'at-uri' }), + cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })), + value: /*#__PURE__*/ l.lexMap(), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Slingshot: ergonomic complement to com.atproto.repo.getRecord which accepts an at-uri instead of individual repo/collection/rkey params */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/blue/microcosm/repo/getRecordByUri.ts b/src/lexicons/blue/microcosm/repo/getRecordByUri.ts new file mode 100644 index 0000000000..c90a96cc2c --- /dev/null +++ b/src/lexicons/blue/microcosm/repo/getRecordByUri.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './getRecordByUri.defs.js' +export { main as default } from './getRecordByUri.defs.js' diff --git a/src/lexicons/com.ts b/src/lexicons/com.ts new file mode 100644 index 0000000000..6b6c956bdc --- /dev/null +++ b/src/lexicons/com.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as atproto from './com/atproto.js' diff --git a/src/lexicons/com/atproto.ts b/src/lexicons/com/atproto.ts new file mode 100644 index 0000000000..3d1e3c4342 --- /dev/null +++ b/src/lexicons/com/atproto.ts @@ -0,0 +1,9 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as sync from './atproto/sync.js' +export * as identity from './atproto/identity.js' +export * as label from './atproto/label.js' +export * as moderation from './atproto/moderation.js' +export * as repo from './atproto/repo.js' diff --git a/src/lexicons/com/atproto/identity.ts b/src/lexicons/com/atproto/identity.ts new file mode 100644 index 0000000000..2ec477efa6 --- /dev/null +++ b/src/lexicons/com/atproto/identity.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as resolveHandle from './identity/resolveHandle.js' diff --git a/src/lexicons/com/atproto/identity/resolveHandle.defs.ts b/src/lexicons/com/atproto/identity/resolveHandle.defs.ts new file mode 100644 index 0000000000..ced378a70b --- /dev/null +++ b/src/lexicons/com/atproto/identity/resolveHandle.defs.ts @@ -0,0 +1,32 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'com.atproto.identity.resolveHandle' + +export { $nsid } + +export const $params = /*#__PURE__*/ l.params({ + handle: /*#__PURE__*/ l.string({ format: 'handle' }), +}) + +export type $Params = l.InferOutput + +export const $output = /*#__PURE__*/ l.jsonPayload({ + did: /*#__PURE__*/ l.string({ format: 'did' }), +}) + +export type $Output = l.InferPayload +export type $OutputBody = l.InferPayloadBody< + typeof $output, + B +> + +/** Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the DID document. */ +const main = /*#__PURE__*/ l.query($nsid, $params, $output, ['HandleNotFound']) + +export { main } + +export const $lxm = $nsid diff --git a/src/lexicons/com/atproto/identity/resolveHandle.ts b/src/lexicons/com/atproto/identity/resolveHandle.ts new file mode 100644 index 0000000000..dfb2d22dde --- /dev/null +++ b/src/lexicons/com/atproto/identity/resolveHandle.ts @@ -0,0 +1,6 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * from './resolveHandle.defs.js' +export { main as default } from './resolveHandle.defs.js' diff --git a/src/lexicons/com/atproto/label.ts b/src/lexicons/com/atproto/label.ts new file mode 100644 index 0000000000..b5ec286b0a --- /dev/null +++ b/src/lexicons/com/atproto/label.ts @@ -0,0 +1,5 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +export * as defs from './label/defs.js' diff --git a/src/lexicons/com/atproto/label/defs.defs.ts b/src/lexicons/com/atproto/label/defs.defs.ts new file mode 100644 index 0000000000..508cc8a052 --- /dev/null +++ b/src/lexicons/com/atproto/label/defs.defs.ts @@ -0,0 +1,260 @@ +/* + * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT. + */ + +import { l } from '@atproto/lex' + +const $nsid = 'com.atproto.label.defs' + +export { $nsid } + +/** Metadata tag on an atproto resource (eg, repo or record). */ +type Label = { + $type?: 'com.atproto.label.defs#label' + + /** + * Optionally, CID specifying the specific version of 'uri' resource this label applies to. + */ + cid?: l.CidString + + /** + * Timestamp when this label was created. + */ + cts: l.DatetimeString + + /** + * Timestamp at which this label expires (no longer applies). + */ + exp?: l.DatetimeString + + /** + * If true, this is a negation label, overwriting a previous label. + */ + neg?: boolean + + /** + * Signature of dag-cbor encoded label. + */ + sig?: Uint8Array + + /** + * DID of the actor who created this label. + */ + src: l.DidString + + /** + * AT URI of the record, repository (account), or other resource that this label applies to. + */ + uri: l.UriString + + /** + * The short string name of the value or type of this label. + */ + val: string + + /** + * The AT Protocol version of the label object. + */ + ver?: number +} + +export type { Label } + +/** Metadata tag on an atproto resource (eg, repo or record). */ +const label = /*#__PURE__*/ l.typedObject