@singi-labs/sifa-sdk 0.11.2 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adult-content-CC8eR44a.d.cts → adult-content-Bwr392Yu.d.cts} +46 -1
- package/dist/{adult-content-CC8eR44a.d.ts → adult-content-Bwr392Yu.d.ts} +46 -1
- package/dist/index.cjs +117 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -4
- package/dist/index.d.ts +44 -4
- package/dist/index.js +103 -2
- package/dist/index.js.map +1 -1
- package/dist/{keys-CbkMoJVL.d.ts → keys-BfRke4RH.d.ts} +1 -1
- package/dist/{keys-CmdNZbla.d.cts → keys-opBDjxEP.d.cts} +1 -1
- package/dist/publishing/index.cjs +4 -0
- package/dist/publishing/index.cjs.map +1 -1
- package/dist/publishing/index.js +4 -0
- package/dist/publishing/index.js.map +1 -1
- package/dist/query/fetchers/index.d.cts +3 -3
- package/dist/query/fetchers/index.d.ts +3 -3
- package/dist/query/hooks/index.d.cts +3 -3
- package/dist/query/hooks/index.d.ts +3 -3
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/schemas/index.cjs +49 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +86 -1
- package/dist/schemas/index.d.ts +86 -1
- package/dist/schemas/index.js +45 -1
- package/dist/schemas/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as ExternalAccount, S as SkillSuggestion, a as ActivityLabel } from './adult-content-
|
|
1
|
+
import { E as ExternalAccount, S as SkillSuggestion, a as ActivityLabel } from './adult-content-Bwr392Yu.js';
|
|
2
2
|
import { F as FollowFeedPage, a as FollowProfileItem, b as FeatureAllowlistEntry, c as FeatureFlag } from './feed-DHTy7fUN.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as ExternalAccount, S as SkillSuggestion, a as ActivityLabel } from './adult-content-
|
|
1
|
+
import { E as ExternalAccount, S as SkillSuggestion, a as ActivityLabel } from './adult-content-Bwr392Yu.cjs';
|
|
2
2
|
import { F as FollowFeedPage, a as FollowProfileItem, b as FeatureAllowlistEntry, c as FeatureFlag } from './feed-DHTy7fUN.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -24,6 +24,10 @@ var strongRefSchema = zod.z.object({
|
|
|
24
24
|
uri: atUriSchema,
|
|
25
25
|
cid: cidSchema
|
|
26
26
|
});
|
|
27
|
+
zod.z.object({
|
|
28
|
+
uri: atUriSchema,
|
|
29
|
+
cid: cidSchema.optional()
|
|
30
|
+
});
|
|
27
31
|
var selfLabelsSchema = zod.z.object({
|
|
28
32
|
$type: zod.z.literal("com.atproto.label.defs#selfLabels").optional(),
|
|
29
33
|
values: zod.z.array(zod.z.object({ val: zod.z.string() }))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/shared.ts","../../src/publishing/schemas.ts","../../src/publishing/registry.ts","../../src/publishing/types.ts"],"names":["z"],"mappings":";;;;;AASO,SAAS,aAAa,GAAA,EAAa;AACxC,EAAA,OAAO,CAAC,KAAA,KAA2B;AACjC,IAAA,MAAM,SAAA,GAAY,IAAI,IAAA,CAAK,SAAA,CAAU,QAAW,EAAE,WAAA,EAAa,YAAY,CAAA;AAC3E,IAAA,IAAI,KAAA,GAAQ,CAAA;AACZ,IAAA,KAAA,MAAW,CAAA,IAAK,SAAA,CAAU,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxC,MAAA,KAAA,EAAA;AACA,MAAA,IAAI,KAAA,GAAQ,KAAK,OAAO,KAAA;AAAA,IAC1B;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AACF;AAGO,IAAM,YAAYA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,kCAAkC,aAAa,CAAA;AAGlF,IAAM,cAAA,GAAiBA,MA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C7E;AAMO,SAAS,oBAAoB,GAAA,EAAkD;AACpF,EAAA,OAAO,oBAAA,CAAqB,WAAA,CAAY,GAAG,CAAC,CAAA;AAC9C;;;AC9BO,IAAM,8BAAA,GAAiC;AACvC,IAAM,2BAAA,GAA8B;AACpC,IAAM,+BAAA,GAAkC;AACxC,IAAM,4BAAA,GAA+B;AAQrC,IAAM,8BAAA,GAAiC;AAE9C,IAAM,cAAA,uBAAqB,GAAA,CAAY;AAAA,EACrC,8BAAA;AAAA,EACA,2BAAA;AAAA,EACA,+BAAA;AAAA,EACA;AACF,CAAC,CAAA;AAOM,SAAS,oBAAoB,GAAA,EAAsB;AACxD,EAAA,IAAI,CAAC,GAAA,CAAI,UAAA,CAAW,OAAO,GAAG,OAAO,KAAA;AACrC,EAAA,MAAM,WAAW,GAAA,CAAI,KAAA,CAAM,QAAQ,MAAM,CAAA,CAAE,MAAM,GAAG,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,SAAS,CAAC,CAAA;AAC7B,EAAA,OAAO,UAAA,KAAe,MAAA,IAAa,cAAA,CAAe,GAAA,CAAI,UAAU,CAAA;AAClE;AAOO,SAAS,6BAA6B,IAAA,EAA8C;AACzF,EAAA,IAAI,CAAC,MAAM,OAAO,KAAA;AAClB,EAAA,OAAO,KAAK,IAAA,CAAK,CAAC,MAAM,mBAAA,CAAoB,CAAA,CAAE,GAAG,CAAC,CAAA;AACpD","file":"index.cjs","sourcesContent":["import { z } from 'zod';\n\n/**\n * Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`\n * constraint. JS strings are sequences of UTF-16 code units, but lexicon\n * `maxGraphemes` counts user-perceived characters (grapheme clusters), so\n * emoji sequences, regional indicators, ZWJ joins, and combining marks all\n * count as one unit each. We use `Intl.Segmenter` to enforce this correctly.\n */\nexport function maxGraphemes(max: number) {\n return (value: string): boolean => {\n const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const _ of segmenter.segment(value)) {\n count++;\n if (count > max) return false;\n }\n return true;\n };\n}\n\n/** Decentralized identifier, AT Protocol `format: did`. */\nexport const didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, 'Invalid DID');\n\n/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */\nexport const datetimeSchema = z.string().datetime({ offset: true });\n\n/** Generic AT-URI, AT Protocol `format: at-uri`. */\nexport const atUriSchema = z.string().regex(/^at:\\/\\/[^\\s]+$/, 'Invalid AT-URI');\n\n/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */\nexport const cidSchema = z\n .string()\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, 'Invalid CID');\n\n/** BCP 47 language tag, AT Protocol `format: language`. */\nexport const languageTagSchema = z\n .string()\n .regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, 'Invalid BCP 47 language tag');\n\n/** Generic URI, AT Protocol `format: uri`. */\nexport const uriSchema = z.string().url();\n\n/**\n * StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both\n * AT-URI (identity) and CID (version).\n */\nexport const strongRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema,\n});\n\n/**\n * Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled\n * permissively because clients rarely construct this directly; the AppView\n * handles label validation.\n */\nexport const selfLabelsSchema = z.object({\n $type: z.literal('com.atproto.label.defs#selfLabels').optional(),\n values: z.array(z.object({ val: z.string() })),\n});\n","import { z } from 'zod';\n\nimport {\n atUriSchema,\n datetimeSchema,\n didSchema,\n maxGraphemes,\n selfLabelsSchema,\n strongRefSchema,\n uriSchema,\n} from '../schemas/shared.js';\n\n/**\n * Zod schemas mirroring the canonical Standard.site lexicons that Sifa\n * consumes when rendering publication embeds.\n *\n * Canonical lexicons live at:\n * DID: did:plc:re3ebnp5v7ffagz6rb6xfei4\n * PDS: https://auriporia.us-west.host.bsky.network\n * Collection: com.atproto.lexicon.schema\n *\n * Sifa does NOT own these lexicons; we vendor the validation shapes so\n * clients can parse augmented embeds and (in Phase 4) write subscription\n * records to viewers' PDSes. Re-check against the canonical PDS on each\n * SDK release to detect schema drift.\n */\n\nconst rgbColorSchema = z.object({\n r: z.number().int().min(0).max(255),\n g: z.number().int().min(0).max(255),\n b: z.number().int().min(0).max(255),\n});\n\nexport type RgbColor = z.infer<typeof rgbColorSchema>;\n\n/** site.standard.theme.basic */\nexport const BasicThemeSchema = z.object({\n background: rgbColorSchema,\n foreground: rgbColorSchema,\n accent: rgbColorSchema,\n accentForeground: rgbColorSchema,\n});\n\nexport type BasicTheme = z.infer<typeof BasicThemeSchema>;\n\nconst blobRefSchema = z\n .object({\n $type: z.string().optional(),\n ref: z.unknown(),\n mimeType: z.string().optional(),\n size: z.number().optional(),\n })\n .passthrough();\n\n/** site.standard.publication */\nexport const StandardSitePublicationRecordSchema = z\n .object({\n url: uriSchema,\n name: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n icon: blobRefSchema.optional(),\n basicTheme: BasicThemeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n preferences: z\n .object({\n showInDiscover: z.boolean().optional(),\n })\n .partial()\n .optional(),\n })\n .passthrough();\n\nexport type StandardSitePublicationRecord = z.infer<typeof StandardSitePublicationRecordSchema>;\n\nconst contributorSchema = z\n .object({\n did: didSchema,\n role: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n displayName: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n })\n .passthrough();\n\n/** site.standard.document */\nexport const StandardSiteDocumentRecordSchema = z\n .object({\n site: z.string().min(1),\n title: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n path: z.string().optional(),\n publishedAt: datetimeSchema,\n updatedAt: datetimeSchema.optional(),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n textContent: z.string().optional(),\n tags: z.array(z.string().refine(maxGraphemes(128)).max(1280)).optional(),\n coverImage: blobRefSchema.optional(),\n contributors: z.array(contributorSchema).optional(),\n bskyPostRef: strongRefSchema.optional(),\n labels: selfLabelsSchema.optional(),\n })\n .passthrough();\n\nexport type StandardSiteDocumentRecord = z.infer<typeof StandardSiteDocumentRecordSchema>;\n\n/**\n * site.standard.graph.subscription\n *\n * Authored by a viewer to declare a subscription to a publication. Used\n * by Phase 4 inline-subscribe path. Record key is a TID; the AT-URI\n * shape is `at://<viewer-did>/site.standard.graph.subscription/<rkey>`.\n */\nexport const StandardSiteSubscriptionRecordSchema = z.object({\n publication: atUriSchema,\n createdAt: datetimeSchema.optional(),\n});\n\nexport type StandardSiteSubscriptionRecord = z.infer<typeof StandardSiteSubscriptionRecordSchema>;\n\n/**\n * site.standard.graph.recommend\n *\n * Document-level \"like\" record. Same scope as subscription via the\n * site.standard.authSocial OAuth permission-set, so Phase 4 unlocks\n * inline likes alongside inline subscribes.\n */\nexport const StandardSiteRecommendRecordSchema = z.object({\n document: atUriSchema,\n createdAt: datetimeSchema,\n});\n\nexport type StandardSiteRecommendRecord = z.infer<typeof StandardSiteRecommendRecordSchema>;\n","/**\n * Publisher allowlist for the Standard.site rich embed.\n *\n * Mirrors `bluesky-social/social-app`\n * `src/components/Post/Embed/StandardSiteEmbed/publishers.ts`. The only\n * gate this provides is which publishers get the highlighted\n * \"Subscribe on {Publisher}\" CTA with a publisher icon vs the plain\n * \"View publication\" fallback — any Standard.site embed renders\n * regardless of allowlist membership.\n *\n * Sync policy: review additions against the upstream bsky list weekly;\n * Singi Labs reviews before merge.\n */\n\nexport interface Publisher {\n /** Lowercase host. Subdomains are matched via `hostMatches`. */\n host: string;\n /** Human-facing publisher name shown in CTA copy. */\n name: string;\n /**\n * Stable identifier used by clients to look up brand icons. The SDK\n * does not ship icon assets — sifa-web maintains them keyed by this\n * id so React Native vs web rendering can diverge.\n */\n iconKey: 'leaflet' | 'pckt' | 'offprint';\n}\n\nexport const STANDARD_SITE_PUBLISHERS: readonly Publisher[] = Object.freeze([\n { host: 'leaflet.pub', name: 'Leaflet', iconKey: 'leaflet' },\n { host: 'pckt.blog', name: 'pckt', iconKey: 'pckt' },\n { host: 'offprint.app', name: 'Offprint', iconKey: 'offprint' },\n]);\n\n/**\n * Returns true when `host` exactly matches `target` or is a subdomain of\n * it. Hosts are expected to be lowercase already.\n */\nexport function hostMatches(host: string, target: string): boolean {\n return host === target || host.endsWith('.' + target);\n}\n\nfunction hostFromUri(uri: string | undefined | null): string | null {\n if (!uri) return null;\n try {\n return new URL(uri).host.toLowerCase();\n } catch {\n return null;\n }\n}\n\n/**\n * Match a publisher by host. Returns the publisher when `host` is on the\n * allowlist (exact or subdomain match), null otherwise. Host should be\n * lowercase.\n */\nexport function matchPublisherByHost(host: string | null | undefined): Publisher | null {\n if (!host) return null;\n const lower = host.toLowerCase();\n return STANDARD_SITE_PUBLISHERS.find((p) => hostMatches(lower, p.host)) ?? null;\n}\n\n/**\n * Match a publisher by URI. Convenience wrapper around\n * `matchPublisherByHost` for callers that have a publication URL handy.\n */\nexport function matchPublisherByUri(uri: string | undefined | null): Publisher | null {\n return matchPublisherByHost(hostFromUri(uri));\n}\n","import type { BasicTheme } from './schemas.js';\n\n/**\n * Publication metadata embedded in the augmented activity view by\n * sifa-api when an external link card matches an indexed publication.\n *\n * `uri` is the publication's AT-URI (e.g.\n * `at://did:plc:abc/site.standard.publication/xyz`). `theme` carries\n * the publication's own colors when supplied — clients should apply a\n * WCAG min-contrast fallback before honoring them.\n *\n * `icon` is left as `unknown` here because its representation depends\n * on the surface: blob ref on the wire, CDN URL after resolution.\n */\nexport interface PublicationSource {\n uri: string;\n title: string;\n icon?: unknown;\n theme?: BasicTheme;\n}\n\n/**\n * Shape attached to activity items whose external link card URL matches\n * a Standard.site record. Mirrors the relevant fields of bsky's\n * `StandardSiteEmbed` view so a sifa-web renderer can be near-1:1.\n *\n * `associatedRefs` carries AT-URIs the client may use in Phase 4 to\n * query subscription state for the viewer.\n */\nexport interface StandardSiteEmbedView {\n uri: string;\n source: PublicationSource;\n associatedRefs: { uri: string }[];\n createdAt?: string;\n readingTime?: number;\n}\n\nexport const STANDARD_SITE_PUBLICATION_NSID = 'site.standard.publication' as const;\nexport const STANDARD_SITE_DOCUMENT_NSID = 'site.standard.document' as const;\nexport const STANDARD_SITE_SUBSCRIPTION_NSID = 'site.standard.graph.subscription' as const;\nexport const STANDARD_SITE_RECOMMEND_NSID = 'site.standard.graph.recommend' as const;\n\n/**\n * Pre-defined OAuth permission-set the consumer apps request to write\n * subscription + recommend records on behalf of the viewer. The actual\n * permission-set is published under\n * `at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.authSocial`.\n */\nexport const STANDARD_SITE_AUTH_SOCIAL_NSID = 'site.standard.authSocial' as const;\n\nconst COLLECTION_SET = new Set<string>([\n STANDARD_SITE_PUBLICATION_NSID,\n STANDARD_SITE_DOCUMENT_NSID,\n STANDARD_SITE_SUBSCRIPTION_NSID,\n STANDARD_SITE_RECOMMEND_NSID,\n]);\n\n/**\n * True when the AT-URI's collection segment is a Standard.site\n * collection. Useful for detecting Standard.site embed augmentation on\n * arbitrary activity items.\n */\nexport function isStandardSiteAtUri(uri: string): boolean {\n if (!uri.startsWith('at://')) return false;\n const segments = uri.slice('at://'.length).split('/');\n const collection = segments[1];\n return collection !== undefined && COLLECTION_SET.has(collection);\n}\n\n/**\n * True when any `associatedRefs[].uri` is a Standard.site collection\n * AT-URI. The bsky client uses the same check to gate the\n * `StandardSiteEmbed` renderer.\n */\nexport function hasStandardSiteAssociatedRef(refs: { uri: string }[] | undefined): boolean {\n if (!refs) return false;\n return refs.some((r) => isStandardSiteAtUri(r.uri));\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/shared.ts","../../src/publishing/schemas.ts","../../src/publishing/registry.ts","../../src/publishing/types.ts"],"names":["z"],"mappings":";;;;;AASO,SAAS,aAAa,GAAA,EAAa;AACxC,EAAA,OAAO,CAAC,KAAA,KAA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,GAAA,CAAI,UAAU,CAAA;AAClE;AAOO,SAAS,6BAA6B,IAAA,EAA8C;AACzF,EAAA,IAAI,CAAC,MAAM,OAAO,KAAA;AAClB,EAAA,OAAO,KAAK,IAAA,CAAK,CAAC,MAAM,mBAAA,CAAoB,CAAA,CAAE,GAAG,CAAC,CAAA;AACpD","file":"index.cjs","sourcesContent":["import { z } from 'zod';\n\n/**\n * Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`\n * constraint. JS strings are sequences of UTF-16 code units, but lexicon\n * `maxGraphemes` counts user-perceived characters (grapheme clusters), so\n * emoji sequences, regional indicators, ZWJ joins, and combining marks all\n * count as one unit each. We use `Intl.Segmenter` to enforce this correctly.\n */\nexport function maxGraphemes(max: number) {\n return (value: string): boolean => {\n const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const _ of segmenter.segment(value)) {\n count++;\n if (count > max) return false;\n }\n return true;\n };\n}\n\n/** Decentralized identifier, AT Protocol `format: did`. */\nexport const didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, 'Invalid DID');\n\n/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */\nexport const datetimeSchema = z.string().datetime({ offset: true });\n\n/** Generic AT-URI, AT Protocol `format: at-uri`. */\nexport const atUriSchema = z.string().regex(/^at:\\/\\/[^\\s]+$/, 'Invalid AT-URI');\n\n/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */\nexport const cidSchema = z\n .string()\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, 'Invalid CID');\n\n/** BCP 47 language tag, AT Protocol `format: language`. */\nexport const languageTagSchema = z\n .string()\n .regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, 'Invalid BCP 47 language tag');\n\n/** Generic URI, AT Protocol `format: uri`. */\nexport const uriSchema = z.string().url();\n\n/**\n * StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both\n * AT-URI (identity) and CID (version).\n */\nexport const strongRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema,\n});\n\n/**\n * Reference to a record by AT-URI, with an optional CID. Mirrors\n * `id.sifa.defs#externalRecordRef`. Unlike a strongRef the CID is optional:\n * consumers resolve the AT-URI live so the reference tracks edits to the\n * target, and the CID is a best-effort integrity hint only.\n */\nexport const externalRecordRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema.optional(),\n});\n\n/**\n * Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled\n * permissively because clients rarely construct this directly; the AppView\n * handles label validation.\n */\nexport const selfLabelsSchema = z.object({\n $type: z.literal('com.atproto.label.defs#selfLabels').optional(),\n values: z.array(z.object({ val: z.string() })),\n});\n","import { z } from 'zod';\n\nimport {\n atUriSchema,\n datetimeSchema,\n didSchema,\n maxGraphemes,\n selfLabelsSchema,\n strongRefSchema,\n uriSchema,\n} from '../schemas/shared.js';\n\n/**\n * Zod schemas mirroring the canonical Standard.site lexicons that Sifa\n * consumes when rendering publication embeds.\n *\n * Canonical lexicons live at:\n * DID: did:plc:re3ebnp5v7ffagz6rb6xfei4\n * PDS: https://auriporia.us-west.host.bsky.network\n * Collection: com.atproto.lexicon.schema\n *\n * Sifa does NOT own these lexicons; we vendor the validation shapes so\n * clients can parse augmented embeds and (in Phase 4) write subscription\n * records to viewers' PDSes. Re-check against the canonical PDS on each\n * SDK release to detect schema drift.\n */\n\nconst rgbColorSchema = z.object({\n r: z.number().int().min(0).max(255),\n g: z.number().int().min(0).max(255),\n b: z.number().int().min(0).max(255),\n});\n\nexport type RgbColor = z.infer<typeof rgbColorSchema>;\n\n/** site.standard.theme.basic */\nexport const BasicThemeSchema = z.object({\n background: rgbColorSchema,\n foreground: rgbColorSchema,\n accent: rgbColorSchema,\n accentForeground: rgbColorSchema,\n});\n\nexport type BasicTheme = z.infer<typeof BasicThemeSchema>;\n\nconst blobRefSchema = z\n .object({\n $type: z.string().optional(),\n ref: z.unknown(),\n mimeType: z.string().optional(),\n size: z.number().optional(),\n })\n .passthrough();\n\n/** site.standard.publication */\nexport const StandardSitePublicationRecordSchema = z\n .object({\n url: uriSchema,\n name: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n icon: blobRefSchema.optional(),\n basicTheme: BasicThemeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n preferences: z\n .object({\n showInDiscover: z.boolean().optional(),\n })\n .partial()\n .optional(),\n })\n .passthrough();\n\nexport type StandardSitePublicationRecord = z.infer<typeof StandardSitePublicationRecordSchema>;\n\nconst contributorSchema = z\n .object({\n did: didSchema,\n role: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n displayName: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n })\n .passthrough();\n\n/** site.standard.document */\nexport const StandardSiteDocumentRecordSchema = z\n .object({\n site: z.string().min(1),\n title: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n path: z.string().optional(),\n publishedAt: datetimeSchema,\n updatedAt: datetimeSchema.optional(),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n textContent: z.string().optional(),\n tags: z.array(z.string().refine(maxGraphemes(128)).max(1280)).optional(),\n coverImage: blobRefSchema.optional(),\n contributors: z.array(contributorSchema).optional(),\n bskyPostRef: strongRefSchema.optional(),\n labels: selfLabelsSchema.optional(),\n })\n .passthrough();\n\nexport type StandardSiteDocumentRecord = z.infer<typeof StandardSiteDocumentRecordSchema>;\n\n/**\n * site.standard.graph.subscription\n *\n * Authored by a viewer to declare a subscription to a publication. Used\n * by Phase 4 inline-subscribe path. Record key is a TID; the AT-URI\n * shape is `at://<viewer-did>/site.standard.graph.subscription/<rkey>`.\n */\nexport const StandardSiteSubscriptionRecordSchema = z.object({\n publication: atUriSchema,\n createdAt: datetimeSchema.optional(),\n});\n\nexport type StandardSiteSubscriptionRecord = z.infer<typeof StandardSiteSubscriptionRecordSchema>;\n\n/**\n * site.standard.graph.recommend\n *\n * Document-level \"like\" record. Same scope as subscription via the\n * site.standard.authSocial OAuth permission-set, so Phase 4 unlocks\n * inline likes alongside inline subscribes.\n */\nexport const StandardSiteRecommendRecordSchema = z.object({\n document: atUriSchema,\n createdAt: datetimeSchema,\n});\n\nexport type StandardSiteRecommendRecord = z.infer<typeof StandardSiteRecommendRecordSchema>;\n","/**\n * Publisher allowlist for the Standard.site rich embed.\n *\n * Mirrors `bluesky-social/social-app`\n * `src/components/Post/Embed/StandardSiteEmbed/publishers.ts`. The only\n * gate this provides is which publishers get the highlighted\n * \"Subscribe on {Publisher}\" CTA with a publisher icon vs the plain\n * \"View publication\" fallback — any Standard.site embed renders\n * regardless of allowlist membership.\n *\n * Sync policy: review additions against the upstream bsky list weekly;\n * Singi Labs reviews before merge.\n */\n\nexport interface Publisher {\n /** Lowercase host. Subdomains are matched via `hostMatches`. */\n host: string;\n /** Human-facing publisher name shown in CTA copy. */\n name: string;\n /**\n * Stable identifier used by clients to look up brand icons. The SDK\n * does not ship icon assets — sifa-web maintains them keyed by this\n * id so React Native vs web rendering can diverge.\n */\n iconKey: 'leaflet' | 'pckt' | 'offprint';\n}\n\nexport const STANDARD_SITE_PUBLISHERS: readonly Publisher[] = Object.freeze([\n { host: 'leaflet.pub', name: 'Leaflet', iconKey: 'leaflet' },\n { host: 'pckt.blog', name: 'pckt', iconKey: 'pckt' },\n { host: 'offprint.app', name: 'Offprint', iconKey: 'offprint' },\n]);\n\n/**\n * Returns true when `host` exactly matches `target` or is a subdomain of\n * it. Hosts are expected to be lowercase already.\n */\nexport function hostMatches(host: string, target: string): boolean {\n return host === target || host.endsWith('.' + target);\n}\n\nfunction hostFromUri(uri: string | undefined | null): string | null {\n if (!uri) return null;\n try {\n return new URL(uri).host.toLowerCase();\n } catch {\n return null;\n }\n}\n\n/**\n * Match a publisher by host. Returns the publisher when `host` is on the\n * allowlist (exact or subdomain match), null otherwise. Host should be\n * lowercase.\n */\nexport function matchPublisherByHost(host: string | null | undefined): Publisher | null {\n if (!host) return null;\n const lower = host.toLowerCase();\n return STANDARD_SITE_PUBLISHERS.find((p) => hostMatches(lower, p.host)) ?? null;\n}\n\n/**\n * Match a publisher by URI. Convenience wrapper around\n * `matchPublisherByHost` for callers that have a publication URL handy.\n */\nexport function matchPublisherByUri(uri: string | undefined | null): Publisher | null {\n return matchPublisherByHost(hostFromUri(uri));\n}\n","import type { BasicTheme } from './schemas.js';\n\n/**\n * Publication metadata embedded in the augmented activity view by\n * sifa-api when an external link card matches an indexed publication.\n *\n * `uri` is the publication's AT-URI (e.g.\n * `at://did:plc:abc/site.standard.publication/xyz`). `theme` carries\n * the publication's own colors when supplied — clients should apply a\n * WCAG min-contrast fallback before honoring them.\n *\n * `icon` is left as `unknown` here because its representation depends\n * on the surface: blob ref on the wire, CDN URL after resolution.\n */\nexport interface PublicationSource {\n uri: string;\n title: string;\n icon?: unknown;\n theme?: BasicTheme;\n}\n\n/**\n * Shape attached to activity items whose external link card URL matches\n * a Standard.site record. Mirrors the relevant fields of bsky's\n * `StandardSiteEmbed` view so a sifa-web renderer can be near-1:1.\n *\n * `associatedRefs` carries AT-URIs the client may use in Phase 4 to\n * query subscription state for the viewer.\n */\nexport interface StandardSiteEmbedView {\n uri: string;\n source: PublicationSource;\n associatedRefs: { uri: string }[];\n createdAt?: string;\n readingTime?: number;\n}\n\nexport const STANDARD_SITE_PUBLICATION_NSID = 'site.standard.publication' as const;\nexport const STANDARD_SITE_DOCUMENT_NSID = 'site.standard.document' as const;\nexport const STANDARD_SITE_SUBSCRIPTION_NSID = 'site.standard.graph.subscription' as const;\nexport const STANDARD_SITE_RECOMMEND_NSID = 'site.standard.graph.recommend' as const;\n\n/**\n * Pre-defined OAuth permission-set the consumer apps request to write\n * subscription + recommend records on behalf of the viewer. The actual\n * permission-set is published under\n * `at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.authSocial`.\n */\nexport const STANDARD_SITE_AUTH_SOCIAL_NSID = 'site.standard.authSocial' as const;\n\nconst COLLECTION_SET = new Set<string>([\n STANDARD_SITE_PUBLICATION_NSID,\n STANDARD_SITE_DOCUMENT_NSID,\n STANDARD_SITE_SUBSCRIPTION_NSID,\n STANDARD_SITE_RECOMMEND_NSID,\n]);\n\n/**\n * True when the AT-URI's collection segment is a Standard.site\n * collection. Useful for detecting Standard.site embed augmentation on\n * arbitrary activity items.\n */\nexport function isStandardSiteAtUri(uri: string): boolean {\n if (!uri.startsWith('at://')) return false;\n const segments = uri.slice('at://'.length).split('/');\n const collection = segments[1];\n return collection !== undefined && COLLECTION_SET.has(collection);\n}\n\n/**\n * True when any `associatedRefs[].uri` is a Standard.site collection\n * AT-URI. The bsky client uses the same check to gate the\n * `StandardSiteEmbed` renderer.\n */\nexport function hasStandardSiteAssociatedRef(refs: { uri: string }[] | undefined): boolean {\n if (!refs) return false;\n return refs.some((r) => isStandardSiteAtUri(r.uri));\n}\n"]}
|
package/dist/publishing/index.js
CHANGED
|
@@ -22,6 +22,10 @@ var strongRefSchema = z.object({
|
|
|
22
22
|
uri: atUriSchema,
|
|
23
23
|
cid: cidSchema
|
|
24
24
|
});
|
|
25
|
+
z.object({
|
|
26
|
+
uri: atUriSchema,
|
|
27
|
+
cid: cidSchema.optional()
|
|
28
|
+
});
|
|
25
29
|
var selfLabelsSchema = z.object({
|
|
26
30
|
$type: z.literal("com.atproto.label.defs#selfLabels").optional(),
|
|
27
31
|
values: z.array(z.object({ val: z.string() }))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/shared.ts","../../src/publishing/schemas.ts","../../src/publishing/registry.ts","../../src/publishing/types.ts"],"names":["z"],"mappings":";;;AASO,SAAS,aAAa,GAAA,EAAa;AACxC,EAAA,OAAO,CAAC,KAAA,KAA2B;AACjC,IAAA,MAAM,SAAA,GAAY,IAAI,IAAA,CAAK,SAAA,CAAU,QAAW,EAAE,WAAA,EAAa,YAAY,CAAA;AAC3E,IA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} from 'zod';\n\n/**\n * Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`\n * constraint. JS strings are sequences of UTF-16 code units, but lexicon\n * `maxGraphemes` counts user-perceived characters (grapheme clusters), so\n * emoji sequences, regional indicators, ZWJ joins, and combining marks all\n * count as one unit each. We use `Intl.Segmenter` to enforce this correctly.\n */\nexport function maxGraphemes(max: number) {\n return (value: string): boolean => {\n const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const _ of segmenter.segment(value)) {\n count++;\n if (count > max) return false;\n }\n return true;\n };\n}\n\n/** Decentralized identifier, AT Protocol `format: did`. */\nexport const didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, 'Invalid DID');\n\n/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */\nexport const datetimeSchema = z.string().datetime({ offset: true });\n\n/** Generic AT-URI, AT Protocol `format: at-uri`. */\nexport const atUriSchema = z.string().regex(/^at:\\/\\/[^\\s]+$/, 'Invalid AT-URI');\n\n/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */\nexport const cidSchema = z\n .string()\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, 'Invalid CID');\n\n/** BCP 47 language tag, AT Protocol `format: language`. */\nexport const languageTagSchema = z\n .string()\n .regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, 'Invalid BCP 47 language tag');\n\n/** Generic URI, AT Protocol `format: uri`. */\nexport const uriSchema = z.string().url();\n\n/**\n * StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both\n * AT-URI (identity) and CID (version).\n */\nexport const strongRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema,\n});\n\n/**\n * Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled\n * permissively because clients rarely construct this directly; the AppView\n * handles label validation.\n */\nexport const selfLabelsSchema = z.object({\n $type: z.literal('com.atproto.label.defs#selfLabels').optional(),\n values: z.array(z.object({ val: z.string() })),\n});\n","import { z } from 'zod';\n\nimport {\n atUriSchema,\n datetimeSchema,\n didSchema,\n maxGraphemes,\n selfLabelsSchema,\n strongRefSchema,\n uriSchema,\n} from '../schemas/shared.js';\n\n/**\n * Zod schemas mirroring the canonical Standard.site lexicons that Sifa\n * consumes when rendering publication embeds.\n *\n * Canonical lexicons live at:\n * DID: did:plc:re3ebnp5v7ffagz6rb6xfei4\n * PDS: https://auriporia.us-west.host.bsky.network\n * Collection: com.atproto.lexicon.schema\n *\n * Sifa does NOT own these lexicons; we vendor the validation shapes so\n * clients can parse augmented embeds and (in Phase 4) write subscription\n * records to viewers' PDSes. Re-check against the canonical PDS on each\n * SDK release to detect schema drift.\n */\n\nconst rgbColorSchema = z.object({\n r: z.number().int().min(0).max(255),\n g: z.number().int().min(0).max(255),\n b: z.number().int().min(0).max(255),\n});\n\nexport type RgbColor = z.infer<typeof rgbColorSchema>;\n\n/** site.standard.theme.basic */\nexport const BasicThemeSchema = z.object({\n background: rgbColorSchema,\n foreground: rgbColorSchema,\n accent: rgbColorSchema,\n accentForeground: rgbColorSchema,\n});\n\nexport type BasicTheme = z.infer<typeof BasicThemeSchema>;\n\nconst blobRefSchema = z\n .object({\n $type: z.string().optional(),\n ref: z.unknown(),\n mimeType: z.string().optional(),\n size: z.number().optional(),\n })\n .passthrough();\n\n/** site.standard.publication */\nexport const StandardSitePublicationRecordSchema = z\n .object({\n url: uriSchema,\n name: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n icon: blobRefSchema.optional(),\n basicTheme: BasicThemeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n preferences: z\n .object({\n showInDiscover: z.boolean().optional(),\n })\n .partial()\n .optional(),\n })\n .passthrough();\n\nexport type StandardSitePublicationRecord = z.infer<typeof StandardSitePublicationRecordSchema>;\n\nconst contributorSchema = z\n .object({\n did: didSchema,\n role: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n displayName: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n })\n .passthrough();\n\n/** site.standard.document */\nexport const StandardSiteDocumentRecordSchema = z\n .object({\n site: z.string().min(1),\n title: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n path: z.string().optional(),\n publishedAt: datetimeSchema,\n updatedAt: datetimeSchema.optional(),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n textContent: z.string().optional(),\n tags: z.array(z.string().refine(maxGraphemes(128)).max(1280)).optional(),\n coverImage: blobRefSchema.optional(),\n contributors: z.array(contributorSchema).optional(),\n bskyPostRef: strongRefSchema.optional(),\n labels: selfLabelsSchema.optional(),\n })\n .passthrough();\n\nexport type StandardSiteDocumentRecord = z.infer<typeof StandardSiteDocumentRecordSchema>;\n\n/**\n * site.standard.graph.subscription\n *\n * Authored by a viewer to declare a subscription to a publication. Used\n * by Phase 4 inline-subscribe path. Record key is a TID; the AT-URI\n * shape is `at://<viewer-did>/site.standard.graph.subscription/<rkey>`.\n */\nexport const StandardSiteSubscriptionRecordSchema = z.object({\n publication: atUriSchema,\n createdAt: datetimeSchema.optional(),\n});\n\nexport type StandardSiteSubscriptionRecord = z.infer<typeof StandardSiteSubscriptionRecordSchema>;\n\n/**\n * site.standard.graph.recommend\n *\n * Document-level \"like\" record. Same scope as subscription via the\n * site.standard.authSocial OAuth permission-set, so Phase 4 unlocks\n * inline likes alongside inline subscribes.\n */\nexport const StandardSiteRecommendRecordSchema = z.object({\n document: atUriSchema,\n createdAt: datetimeSchema,\n});\n\nexport type StandardSiteRecommendRecord = z.infer<typeof StandardSiteRecommendRecordSchema>;\n","/**\n * Publisher allowlist for the Standard.site rich embed.\n *\n * Mirrors `bluesky-social/social-app`\n * `src/components/Post/Embed/StandardSiteEmbed/publishers.ts`. The only\n * gate this provides is which publishers get the highlighted\n * \"Subscribe on {Publisher}\" CTA with a publisher icon vs the plain\n * \"View publication\" fallback — any Standard.site embed renders\n * regardless of allowlist membership.\n *\n * Sync policy: review additions against the upstream bsky list weekly;\n * Singi Labs reviews before merge.\n */\n\nexport interface Publisher {\n /** Lowercase host. Subdomains are matched via `hostMatches`. */\n host: string;\n /** Human-facing publisher name shown in CTA copy. */\n name: string;\n /**\n * Stable identifier used by clients to look up brand icons. The SDK\n * does not ship icon assets — sifa-web maintains them keyed by this\n * id so React Native vs web rendering can diverge.\n */\n iconKey: 'leaflet' | 'pckt' | 'offprint';\n}\n\nexport const STANDARD_SITE_PUBLISHERS: readonly Publisher[] = Object.freeze([\n { host: 'leaflet.pub', name: 'Leaflet', iconKey: 'leaflet' },\n { host: 'pckt.blog', name: 'pckt', iconKey: 'pckt' },\n { host: 'offprint.app', name: 'Offprint', iconKey: 'offprint' },\n]);\n\n/**\n * Returns true when `host` exactly matches `target` or is a subdomain of\n * it. Hosts are expected to be lowercase already.\n */\nexport function hostMatches(host: string, target: string): boolean {\n return host === target || host.endsWith('.' + target);\n}\n\nfunction hostFromUri(uri: string | undefined | null): string | null {\n if (!uri) return null;\n try {\n return new URL(uri).host.toLowerCase();\n } catch {\n return null;\n }\n}\n\n/**\n * Match a publisher by host. Returns the publisher when `host` is on the\n * allowlist (exact or subdomain match), null otherwise. Host should be\n * lowercase.\n */\nexport function matchPublisherByHost(host: string | null | undefined): Publisher | null {\n if (!host) return null;\n const lower = host.toLowerCase();\n return STANDARD_SITE_PUBLISHERS.find((p) => hostMatches(lower, p.host)) ?? null;\n}\n\n/**\n * Match a publisher by URI. Convenience wrapper around\n * `matchPublisherByHost` for callers that have a publication URL handy.\n */\nexport function matchPublisherByUri(uri: string | undefined | null): Publisher | null {\n return matchPublisherByHost(hostFromUri(uri));\n}\n","import type { BasicTheme } from './schemas.js';\n\n/**\n * Publication metadata embedded in the augmented activity view by\n * sifa-api when an external link card matches an indexed publication.\n *\n * `uri` is the publication's AT-URI (e.g.\n * `at://did:plc:abc/site.standard.publication/xyz`). `theme` carries\n * the publication's own colors when supplied — clients should apply a\n * WCAG min-contrast fallback before honoring them.\n *\n * `icon` is left as `unknown` here because its representation depends\n * on the surface: blob ref on the wire, CDN URL after resolution.\n */\nexport interface PublicationSource {\n uri: string;\n title: string;\n icon?: unknown;\n theme?: BasicTheme;\n}\n\n/**\n * Shape attached to activity items whose external link card URL matches\n * a Standard.site record. Mirrors the relevant fields of bsky's\n * `StandardSiteEmbed` view so a sifa-web renderer can be near-1:1.\n *\n * `associatedRefs` carries AT-URIs the client may use in Phase 4 to\n * query subscription state for the viewer.\n */\nexport interface StandardSiteEmbedView {\n uri: string;\n source: PublicationSource;\n associatedRefs: { uri: string }[];\n createdAt?: string;\n readingTime?: number;\n}\n\nexport const STANDARD_SITE_PUBLICATION_NSID = 'site.standard.publication' as const;\nexport const STANDARD_SITE_DOCUMENT_NSID = 'site.standard.document' as const;\nexport const STANDARD_SITE_SUBSCRIPTION_NSID = 'site.standard.graph.subscription' as const;\nexport const STANDARD_SITE_RECOMMEND_NSID = 'site.standard.graph.recommend' as const;\n\n/**\n * Pre-defined OAuth permission-set the consumer apps request to write\n * subscription + recommend records on behalf of the viewer. The actual\n * permission-set is published under\n * `at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.authSocial`.\n */\nexport const STANDARD_SITE_AUTH_SOCIAL_NSID = 'site.standard.authSocial' as const;\n\nconst COLLECTION_SET = new Set<string>([\n STANDARD_SITE_PUBLICATION_NSID,\n STANDARD_SITE_DOCUMENT_NSID,\n STANDARD_SITE_SUBSCRIPTION_NSID,\n STANDARD_SITE_RECOMMEND_NSID,\n]);\n\n/**\n * True when the AT-URI's collection segment is a Standard.site\n * collection. Useful for detecting Standard.site embed augmentation on\n * arbitrary activity items.\n */\nexport function isStandardSiteAtUri(uri: string): boolean {\n if (!uri.startsWith('at://')) return false;\n const segments = uri.slice('at://'.length).split('/');\n const collection = segments[1];\n return collection !== undefined && COLLECTION_SET.has(collection);\n}\n\n/**\n * True when any `associatedRefs[].uri` is a Standard.site collection\n * AT-URI. The bsky client uses the same check to gate the\n * `StandardSiteEmbed` renderer.\n */\nexport function hasStandardSiteAssociatedRef(refs: { uri: string }[] | undefined): boolean {\n if (!refs) return false;\n return refs.some((r) => isStandardSiteAtUri(r.uri));\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/shared.ts","../../src/publishing/schemas.ts","../../src/publishing/registry.ts","../../src/publishing/types.ts"],"names":["z"],"mappings":";;;AASO,SAAS,aAAa,GAAA,EAAa;AACxC,EAAA,OAAO,CAAC,KAAA,KAA2B;AACjC,IAAA,MAAM,SAAA,GAAY,IAAI,IAAA,CAAK,SAAA,CAAU,QAAW,EAAE,WAAA,EAAa,YAAY,CAAA;AAC3E,IAAA,IAAI,KAAA,GAAQ,CAAA;AACZ,IAAA,KAAA,MAAW,CAAA,IAAK,SAAA,CAAU,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxC,MAAA,KAAA,EAAA;AACA,MAAA,IAAI,KAAA,GAAQ,KAAK,OAAO,KAAA;AAAA,IAC1B;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AACF;AAGO,IAAM,YAAY,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,kCAAkC,aAAa,CAAA;AAGlF,IAAM,cAAA,GAAiB,EAAE,MAAA,EAAO,CAAE,SAAS,EAAE,MAAA,EAAQ,MAAM,CAAA;AAG3D,IAAM,cAAc,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,CAAM,mBAAmB,gBAAgB,CAAA;AAGxE,IAAM,YAAY,CAAA,CACtB,MAAA,EAAO,CACP,KAAA,CAAM,mDAAmD,aAAa,CAAA;AAGxC,CAAA,CAC9B,MAAA,EAAO,CACP,KAAA,CAAM,uCAAuC,6BAA6B;AAGtE,IAAM,SAAA,GAAY,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI;AAMjC,IAAM,eAAA,GAAkB,EAAE,MAAA,CAAO;AAAA,EACtC,GAAA,EAAK,WAAA;AAAA,EACL,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;AACF,CAAC,CAAA;AAOM,SAAS,oBAAoB,GAAA,EAAsB;AACxD,EAAA,IAAI,CAAC,GAAA,CAAI,UAAA,CAAW,OAAO,GAAG,OAAO,KAAA;AACrC,EAAA,MAAM,WAAW,GAAA,CAAI,KAAA,CAAM,QAAQ,MAAM,CAAA,CAAE,MAAM,GAAG,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,SAAS,CAAC,CAAA;AAC7B,EAAA,OAAO,UAAA,KAAe,MAAA,IAAa,cAAA,CAAe,GAAA,CAAI,UAAU,CAAA;AAClE;AAOO,SAAS,6BAA6B,IAAA,EAA8C;AACzF,EAAA,IAAI,CAAC,MAAM,OAAO,KAAA;AAClB,EAAA,OAAO,KAAK,IAAA,CAAK,CAAC,MAAM,mBAAA,CAAoB,CAAA,CAAE,GAAG,CAAC,CAAA;AACpD","file":"index.js","sourcesContent":["import { z } from 'zod';\n\n/**\n * Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`\n * constraint. JS strings are sequences of UTF-16 code units, but lexicon\n * `maxGraphemes` counts user-perceived characters (grapheme clusters), so\n * emoji sequences, regional indicators, ZWJ joins, and combining marks all\n * count as one unit each. We use `Intl.Segmenter` to enforce this correctly.\n */\nexport function maxGraphemes(max: number) {\n return (value: string): boolean => {\n const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const _ of segmenter.segment(value)) {\n count++;\n if (count > max) return false;\n }\n return true;\n };\n}\n\n/** Decentralized identifier, AT Protocol `format: did`. */\nexport const didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, 'Invalid DID');\n\n/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */\nexport const datetimeSchema = z.string().datetime({ offset: true });\n\n/** Generic AT-URI, AT Protocol `format: at-uri`. */\nexport const atUriSchema = z.string().regex(/^at:\\/\\/[^\\s]+$/, 'Invalid AT-URI');\n\n/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */\nexport const cidSchema = z\n .string()\n .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, 'Invalid CID');\n\n/** BCP 47 language tag, AT Protocol `format: language`. */\nexport const languageTagSchema = z\n .string()\n .regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, 'Invalid BCP 47 language tag');\n\n/** Generic URI, AT Protocol `format: uri`. */\nexport const uriSchema = z.string().url();\n\n/**\n * StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both\n * AT-URI (identity) and CID (version).\n */\nexport const strongRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema,\n});\n\n/**\n * Reference to a record by AT-URI, with an optional CID. Mirrors\n * `id.sifa.defs#externalRecordRef`. Unlike a strongRef the CID is optional:\n * consumers resolve the AT-URI live so the reference tracks edits to the\n * target, and the CID is a best-effort integrity hint only.\n */\nexport const externalRecordRefSchema = z.object({\n uri: atUriSchema,\n cid: cidSchema.optional(),\n});\n\n/**\n * Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled\n * permissively because clients rarely construct this directly; the AppView\n * handles label validation.\n */\nexport const selfLabelsSchema = z.object({\n $type: z.literal('com.atproto.label.defs#selfLabels').optional(),\n values: z.array(z.object({ val: z.string() })),\n});\n","import { z } from 'zod';\n\nimport {\n atUriSchema,\n datetimeSchema,\n didSchema,\n maxGraphemes,\n selfLabelsSchema,\n strongRefSchema,\n uriSchema,\n} from '../schemas/shared.js';\n\n/**\n * Zod schemas mirroring the canonical Standard.site lexicons that Sifa\n * consumes when rendering publication embeds.\n *\n * Canonical lexicons live at:\n * DID: did:plc:re3ebnp5v7ffagz6rb6xfei4\n * PDS: https://auriporia.us-west.host.bsky.network\n * Collection: com.atproto.lexicon.schema\n *\n * Sifa does NOT own these lexicons; we vendor the validation shapes so\n * clients can parse augmented embeds and (in Phase 4) write subscription\n * records to viewers' PDSes. Re-check against the canonical PDS on each\n * SDK release to detect schema drift.\n */\n\nconst rgbColorSchema = z.object({\n r: z.number().int().min(0).max(255),\n g: z.number().int().min(0).max(255),\n b: z.number().int().min(0).max(255),\n});\n\nexport type RgbColor = z.infer<typeof rgbColorSchema>;\n\n/** site.standard.theme.basic */\nexport const BasicThemeSchema = z.object({\n background: rgbColorSchema,\n foreground: rgbColorSchema,\n accent: rgbColorSchema,\n accentForeground: rgbColorSchema,\n});\n\nexport type BasicTheme = z.infer<typeof BasicThemeSchema>;\n\nconst blobRefSchema = z\n .object({\n $type: z.string().optional(),\n ref: z.unknown(),\n mimeType: z.string().optional(),\n size: z.number().optional(),\n })\n .passthrough();\n\n/** site.standard.publication */\nexport const StandardSitePublicationRecordSchema = z\n .object({\n url: uriSchema,\n name: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n icon: blobRefSchema.optional(),\n basicTheme: BasicThemeSchema.optional(),\n labels: selfLabelsSchema.optional(),\n preferences: z\n .object({\n showInDiscover: z.boolean().optional(),\n })\n .partial()\n .optional(),\n })\n .passthrough();\n\nexport type StandardSitePublicationRecord = z.infer<typeof StandardSitePublicationRecordSchema>;\n\nconst contributorSchema = z\n .object({\n did: didSchema,\n role: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n displayName: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n })\n .passthrough();\n\n/** site.standard.document */\nexport const StandardSiteDocumentRecordSchema = z\n .object({\n site: z.string().min(1),\n title: z.string().min(1).refine(maxGraphemes(500)).max(5000),\n path: z.string().optional(),\n publishedAt: datetimeSchema,\n updatedAt: datetimeSchema.optional(),\n description: z.string().refine(maxGraphemes(3000)).max(30000).optional(),\n textContent: z.string().optional(),\n tags: z.array(z.string().refine(maxGraphemes(128)).max(1280)).optional(),\n coverImage: blobRefSchema.optional(),\n contributors: z.array(contributorSchema).optional(),\n bskyPostRef: strongRefSchema.optional(),\n labels: selfLabelsSchema.optional(),\n })\n .passthrough();\n\nexport type StandardSiteDocumentRecord = z.infer<typeof StandardSiteDocumentRecordSchema>;\n\n/**\n * site.standard.graph.subscription\n *\n * Authored by a viewer to declare a subscription to a publication. Used\n * by Phase 4 inline-subscribe path. Record key is a TID; the AT-URI\n * shape is `at://<viewer-did>/site.standard.graph.subscription/<rkey>`.\n */\nexport const StandardSiteSubscriptionRecordSchema = z.object({\n publication: atUriSchema,\n createdAt: datetimeSchema.optional(),\n});\n\nexport type StandardSiteSubscriptionRecord = z.infer<typeof StandardSiteSubscriptionRecordSchema>;\n\n/**\n * site.standard.graph.recommend\n *\n * Document-level \"like\" record. Same scope as subscription via the\n * site.standard.authSocial OAuth permission-set, so Phase 4 unlocks\n * inline likes alongside inline subscribes.\n */\nexport const StandardSiteRecommendRecordSchema = z.object({\n document: atUriSchema,\n createdAt: datetimeSchema,\n});\n\nexport type StandardSiteRecommendRecord = z.infer<typeof StandardSiteRecommendRecordSchema>;\n","/**\n * Publisher allowlist for the Standard.site rich embed.\n *\n * Mirrors `bluesky-social/social-app`\n * `src/components/Post/Embed/StandardSiteEmbed/publishers.ts`. The only\n * gate this provides is which publishers get the highlighted\n * \"Subscribe on {Publisher}\" CTA with a publisher icon vs the plain\n * \"View publication\" fallback — any Standard.site embed renders\n * regardless of allowlist membership.\n *\n * Sync policy: review additions against the upstream bsky list weekly;\n * Singi Labs reviews before merge.\n */\n\nexport interface Publisher {\n /** Lowercase host. Subdomains are matched via `hostMatches`. */\n host: string;\n /** Human-facing publisher name shown in CTA copy. */\n name: string;\n /**\n * Stable identifier used by clients to look up brand icons. The SDK\n * does not ship icon assets — sifa-web maintains them keyed by this\n * id so React Native vs web rendering can diverge.\n */\n iconKey: 'leaflet' | 'pckt' | 'offprint';\n}\n\nexport const STANDARD_SITE_PUBLISHERS: readonly Publisher[] = Object.freeze([\n { host: 'leaflet.pub', name: 'Leaflet', iconKey: 'leaflet' },\n { host: 'pckt.blog', name: 'pckt', iconKey: 'pckt' },\n { host: 'offprint.app', name: 'Offprint', iconKey: 'offprint' },\n]);\n\n/**\n * Returns true when `host` exactly matches `target` or is a subdomain of\n * it. Hosts are expected to be lowercase already.\n */\nexport function hostMatches(host: string, target: string): boolean {\n return host === target || host.endsWith('.' + target);\n}\n\nfunction hostFromUri(uri: string | undefined | null): string | null {\n if (!uri) return null;\n try {\n return new URL(uri).host.toLowerCase();\n } catch {\n return null;\n }\n}\n\n/**\n * Match a publisher by host. Returns the publisher when `host` is on the\n * allowlist (exact or subdomain match), null otherwise. Host should be\n * lowercase.\n */\nexport function matchPublisherByHost(host: string | null | undefined): Publisher | null {\n if (!host) return null;\n const lower = host.toLowerCase();\n return STANDARD_SITE_PUBLISHERS.find((p) => hostMatches(lower, p.host)) ?? null;\n}\n\n/**\n * Match a publisher by URI. Convenience wrapper around\n * `matchPublisherByHost` for callers that have a publication URL handy.\n */\nexport function matchPublisherByUri(uri: string | undefined | null): Publisher | null {\n return matchPublisherByHost(hostFromUri(uri));\n}\n","import type { BasicTheme } from './schemas.js';\n\n/**\n * Publication metadata embedded in the augmented activity view by\n * sifa-api when an external link card matches an indexed publication.\n *\n * `uri` is the publication's AT-URI (e.g.\n * `at://did:plc:abc/site.standard.publication/xyz`). `theme` carries\n * the publication's own colors when supplied — clients should apply a\n * WCAG min-contrast fallback before honoring them.\n *\n * `icon` is left as `unknown` here because its representation depends\n * on the surface: blob ref on the wire, CDN URL after resolution.\n */\nexport interface PublicationSource {\n uri: string;\n title: string;\n icon?: unknown;\n theme?: BasicTheme;\n}\n\n/**\n * Shape attached to activity items whose external link card URL matches\n * a Standard.site record. Mirrors the relevant fields of bsky's\n * `StandardSiteEmbed` view so a sifa-web renderer can be near-1:1.\n *\n * `associatedRefs` carries AT-URIs the client may use in Phase 4 to\n * query subscription state for the viewer.\n */\nexport interface StandardSiteEmbedView {\n uri: string;\n source: PublicationSource;\n associatedRefs: { uri: string }[];\n createdAt?: string;\n readingTime?: number;\n}\n\nexport const STANDARD_SITE_PUBLICATION_NSID = 'site.standard.publication' as const;\nexport const STANDARD_SITE_DOCUMENT_NSID = 'site.standard.document' as const;\nexport const STANDARD_SITE_SUBSCRIPTION_NSID = 'site.standard.graph.subscription' as const;\nexport const STANDARD_SITE_RECOMMEND_NSID = 'site.standard.graph.recommend' as const;\n\n/**\n * Pre-defined OAuth permission-set the consumer apps request to write\n * subscription + recommend records on behalf of the viewer. The actual\n * permission-set is published under\n * `at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.authSocial`.\n */\nexport const STANDARD_SITE_AUTH_SOCIAL_NSID = 'site.standard.authSocial' as const;\n\nconst COLLECTION_SET = new Set<string>([\n STANDARD_SITE_PUBLICATION_NSID,\n STANDARD_SITE_DOCUMENT_NSID,\n STANDARD_SITE_SUBSCRIPTION_NSID,\n STANDARD_SITE_RECOMMEND_NSID,\n]);\n\n/**\n * True when the AT-URI's collection segment is a Standard.site\n * collection. Useful for detecting Standard.site embed augmentation on\n * arbitrary activity items.\n */\nexport function isStandardSiteAtUri(uri: string): boolean {\n if (!uri.startsWith('at://')) return false;\n const segments = uri.slice('at://'.length).split('/');\n const collection = segments[1];\n return collection !== undefined && COLLECTION_SET.has(collection);\n}\n\n/**\n * True when any `associatedRefs[].uri` is a Standard.site collection\n * AT-URI. The bsky client uses the same check to gate the\n * `StandardSiteEmbed` renderer.\n */\nexport function hasStandardSiteAssociatedRef(refs: { uri: string }[] | undefined): boolean {\n if (!refs) return false;\n return refs.some((r) => isStandardSiteAtUri(r.uri));\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from '../../keys-
|
|
2
|
-
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, s as sifaQueryKeys, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../../keys-
|
|
3
|
-
import { c as Profile,
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from '../../keys-opBDjxEP.cjs';
|
|
2
|
+
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, s as sifaQueryKeys, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../../keys-opBDjxEP.cjs';
|
|
3
|
+
import { c as Profile, s as ProfilePosition, z as SkillRef } from '../../adult-content-Bwr392Yu.cjs';
|
|
4
4
|
import '../../feed-DHTy7fUN.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from '../../keys-
|
|
2
|
-
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, s as sifaQueryKeys, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../../keys-
|
|
3
|
-
import { c as Profile,
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, j as CreateResult, W as WriteResult } from '../../keys-BfRke4RH.js';
|
|
2
|
+
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, s as sifaQueryKeys, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../../keys-BfRke4RH.js';
|
|
3
|
+
import { c as Profile, s as ProfilePosition, z as SkillRef } from '../../adult-content-Bwr392Yu.js';
|
|
4
4
|
import '../../feed-DHTy7fUN.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from '../../keys-
|
|
4
|
-
export { ad as SifaQueryKey } from '../../keys-
|
|
3
|
+
import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from '../../keys-opBDjxEP.cjs';
|
|
4
|
+
export { ad as SifaQueryKey } from '../../keys-opBDjxEP.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
|
7
|
-
import { c as Profile,
|
|
7
|
+
import { c as Profile, s as ProfilePosition, z as SkillRef, E as ExternalAccount, S as SkillSuggestion } from '../../adult-content-Bwr392Yu.cjs';
|
|
8
8
|
import { F as FollowFeedPage, c as FeatureFlag } from '../../feed-DHTy7fUN.cjs';
|
|
9
9
|
import 'zod';
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from '../../keys-
|
|
4
|
-
export { ad as SifaQueryKey } from '../../keys-
|
|
3
|
+
import { S as SifaApiConfig, s as sifaQueryKeys, W as WriteResult, a5 as RefreshPdsResult, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, j as CreateResult, U as ProfileLocationInput, k as ExternalAccountInput, i as CreateExternalAccountResult, am as VerifyExternalAccountResult, E as EndorsementInput, a4 as RefreshOrcidPublicationsResult, B as BulkHideProfileItemInput, P as HideProfileItemInput, ag as StatsResponse, g as AppRegistryEntry, M as HiddenApp, w as FilterOptions, ab as SearchFilters, ac as SearchResponse, af as SkillSearchResult, l as FeaturedProfile, ae as SimilarProfile, v as FetchSuggestionsOptions, ai as SuggestionsResponse, G as FollowUserResult, o as FetchFollowListOptions, x as FollowListPage, H as FollowingResponse, q as FetchFollowingFeedOptions, p as FetchFollowProfilePageOptions, z as FollowProfilePageResponse, F as FeatureAllowlistResponse, m as FetchActivityFeedOptions, b as ActivityFeedResponse, e as ActivityTeaserResponse, L as HeatmapResponse, a as AccountCheckResult, a3 as ReactionStatus, a2 as ReactionResult, a1 as ReactionError, aa as RoadmapVotesResponse, C as CastRoadmapVoteResult, D as DeleteAccountResult } from '../../keys-BfRke4RH.js';
|
|
4
|
+
export { ad as SifaQueryKey } from '../../keys-BfRke4RH.js';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { UseQueryOptions, UseMutationOptions, UseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
|
7
|
-
import { c as Profile,
|
|
7
|
+
import { c as Profile, s as ProfilePosition, z as SkillRef, E as ExternalAccount, S as SkillSuggestion } from '../../adult-content-Bwr392Yu.js';
|
|
8
8
|
import { F as FollowFeedPage, c as FeatureFlag } from '../../feed-DHTy7fUN.js';
|
|
9
9
|
import 'zod';
|
|
10
10
|
|
package/dist/query/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, W as WriteResult, s as sifaQueryKeys } from '../keys-
|
|
2
|
-
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, j as CreateResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../keys-
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, W as WriteResult, s as sifaQueryKeys } from '../keys-opBDjxEP.cjs';
|
|
2
|
+
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, j as CreateResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../keys-opBDjxEP.cjs';
|
|
3
3
|
export { AddFeatureAllowlistVariables, CreateReactionVariables, CreateRecordVariables, DeleteReactionVariables, DeleteRecordVariables, FollowVariables, PositionSkillLinkVariables, RemoveFeatureAllowlistVariables, SifaProvider, SifaProviderProps, UnfollowVariables, UpdateEducationVariables, UpdateExternalAccountVariables, UpdatePositionVariables, UpdateProfileLocationVariables, UpdateRecordVariables, UpdateSkillVariables, useActivityFeed, useActivityTeaser, useAddFeatureAllowlist, useAppAccountCheck, useAppsRegistry, useAtFundLink, useBlueskySuggestions, useBulkHideProfileItems, useBulkHideStandardPublications, useBulkUnhideProfileItems, useBulkUnhideStandardPublications, useCanonicalSkillSearch, useCastRoadmapVote, useCreateEducation, useCreateEndorsement, useCreateExternalAccount, useCreatePosition, useCreateProfileLocation, useCreateReaction, useCreateRecord, useCreateSkill, useDeleteAccount, useDeleteAvatarOverride, useDeleteEducation, useDeleteExternalAccount, useDeletePosition, useDeleteProfileLocation, useDeleteReaction, useDeleteRecord, useDeleteSkill, useEndorsementCount, useExternalAccounts, useFeatureAllowlist, useFeaturedProfile, useFollow, useFollowers, useFollowing, useFollowingFeed, useFollowingList, useHeatmapData, useHiddenApps, useHideKeytraceClaim, useHideOrcidPublication, useHideProfileItem, useHideSifaPublication, useHideStandardPublication, useLinkSkillToPosition, useMutuals, useMyRoadmapVotes, useNetworkStreamCount, useProfile, useReactionStatus, useRefreshOrcidPublications, useRefreshPds, useRemoveFeatureAllowlist, useResetProfile, useRetractRoadmapVote, useRevealMarqueDomain, useRoadmapVotes, useSearchFilters, useSearchProfiles, useSetExternalAccountPrimary, useSetPositionPrimary, useSifaConfig, useSimilarProfiles, useSkillSuggestions, useStats, useSuggestionCount, useSuggestions, useUnfollow, useUnhideKeytraceClaim, useUnhideOrcidPublication, useUnhideProfileItem, useUnhideSifaPublication, useUnhideStandardPublication, useUnlinkSkillFromPosition, useUnrevealMarqueDomain, useUnsetExternalAccountPrimary, useUnsetPositionPrimary, useUpdateEducation, useUpdateExternalAccount, useUpdatePosition, useUpdateProfileLocation, useUpdateProfileOverride, useUpdateProfileSelf, useUpdateRecord, useUpdateSkill, useUploadAvatar, useVerifyExternalAccount } from './hooks/index.cjs';
|
|
4
4
|
export { FetchNetworkStreamCountOptions, NetworkMapEdge, NetworkMapGenerationJob, NetworkMapGraphData, NetworkMapNode, NetworkMapPendingJob, NetworkMapResponse, checkNetworkMapJobStatus, createEducation, createPosition, createRecord, createSkill, deleteEducation, deletePosition, deleteRecord, deleteSkill, fetchAtFundLink, fetchEndorsementCount, fetchNetworkMap, fetchNetworkStreamCount, fetchProfile, hideKeytraceClaim, initiateNetworkMapGeneration, isNetworkMapResponse, linkSkillToPosition, revealMarqueDomain, setPositionPrimary, unhideKeytraceClaim, unlinkSkillFromPosition, unrevealMarqueDomain, unsetPositionPrimary, updateEducation, updatePosition, updateRecord, updateSkill } from './fetchers/index.cjs';
|
|
5
|
-
import { A as AdultContentLabel } from '../adult-content-
|
|
5
|
+
import { A as AdultContentLabel } from '../adult-content-Bwr392Yu.cjs';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
7
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
8
8
|
import '../feed-DHTy7fUN.cjs';
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as SifaApiConfig, A as ApiFetchOptions, W as WriteResult, s as sifaQueryKeys } from '../keys-
|
|
2
|
-
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, j as CreateResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../keys-
|
|
1
|
+
import { S as SifaApiConfig, A as ApiFetchOptions, W as WriteResult, s as sifaQueryKeys } from '../keys-BfRke4RH.js';
|
|
2
|
+
export { a as AccountCheckResult, b as ActivityFeedResponse, c as ActivityItem, d as ActivityItemLinkHealth, e as ActivityTeaserResponse, f as ApiError, g as AppRegistryEntry, B as BulkHideProfileItemInput, C as CastRoadmapVoteResult, h as CheckAppAccountOptions, i as CreateExternalAccountResult, j as CreateResult, D as DeleteAccountResult, E as EndorsementInput, k as ExternalAccountInput, F as FeatureAllowlistResponse, l as FeaturedProfile, m as FetchActivityFeedOptions, n as FetchActivityTeaserOptions, o as FetchFollowListOptions, p as FetchFollowProfilePageOptions, q as FetchFollowingFeedOptions, r as FetchHiddenAppsOptions, t as FetchMyRoadmapVotesOptions, u as FetchReactionStatusOptions, v as FetchSuggestionsOptions, w as FilterOptions, x as FollowListPage, y as FollowProfile, z as FollowProfilePageResponse, G as FollowUserResult, H as FollowingResponse, I as HIDDEN_ITEM_SOURCES, J as HIDDEN_ITEM_TYPES, K as HeatmapDay, L as HeatmapResponse, M as HiddenApp, N as HiddenItemSource, O as HiddenItemType, P as HideProfileItemInput, Q as ListFeatureAllowlistOptions, R as ProfileIndustryInput, T as ProfileLocationAddress, U as ProfileLocationInput, V as ProfileSearchResult, X as ProfileSelfLocation, Y as QUOTED_POSTS_BATCH_MAX, Z as QuotedPostAuthor, _ as QuotedPostImage, $ as QuotedPostResult, a0 as QuotedPostView, a1 as ReactionError, a2 as ReactionResult, a3 as ReactionStatus, a4 as RefreshOrcidPublicationsResult, a5 as RefreshPdsResult, a6 as ResolveQuotedPostsOptions, a7 as RoadmapVoteError, a8 as RoadmapVoteResult, a9 as RoadmapVoter, aa as RoadmapVotesResponse, ab as SearchFilters, ac as SearchResponse, ad as SifaQueryKey, ae as SimilarProfile, af as SkillSearchResult, ag as StatsResponse, ah as SuggestionProfile, ai as SuggestionsResponse, aj as UpdateProfileOverrideInput, ak as UpdateProfileSelfInput, al as UploadAvatarResult, am as VerifyExternalAccountResult, an as addFeatureAllowlist, ao as apiFetch, ap as apiFetchOrNull, aq as apiWrite, ar as apiWriteCreate, as as bulkHideProfileItems, at as bulkHideStandardPublications, au as bulkUnhideProfileItems, av as bulkUnhideStandardPublications, aw as castRoadmapVote, ax as checkAppAccount, ay as createEndorsement, az as createExternalAccount, aA as createProfileLocation, aB as createReaction, aC as deleteAccount, aD as deleteAvatarOverride, aE as deleteExternalAccount, aF as deleteProfileLocation, aG as deleteReaction, aH as fetchActivityFeed, aI as fetchActivityTeaser, aJ as fetchAppsRegistry, aK as fetchExternalAccounts, aL as fetchFeaturedProfile, aM as fetchFollowing, aN as fetchHeatmapData, aO as fetchHiddenApps, aP as fetchMyRoadmapVotes, aQ as fetchReactionStatus, aR as fetchRoadmapVotes, aS as fetchSearchFilters, aT as fetchSearchProfiles, aU as fetchSimilarProfiles, aV as fetchSkillSuggestions, aW as fetchStats, aX as fetchSuggestionCount, aY as fetchSuggestions, aZ as followUser, a_ as getBlueskySuggestions, a$ as getFollowers, b0 as getFollowing, b1 as getFollowingFeed, b2 as getMutuals, b3 as hideOrcidPublication, b4 as hideProfileItem, b5 as hideSifaPublication, b6 as hideStandardPublication, b7 as listFeatureAllowlist, b8 as refreshOrcidPublications, b9 as refreshPds, ba as removeFeatureAllowlist, bb as resetProfile, bc as resolveQuotedPosts, bd as retractRoadmapVote, be as searchSkills, bf as setExternalAccountPrimary, bg as unfollowUser, bh as unhideOrcidPublication, bi as unhideProfileItem, bj as unhideSifaPublication, bk as unhideStandardPublication, bl as unsetExternalAccountPrimary, bm as updateExternalAccount, bn as updateProfileLocation, bo as updateProfileOverride, bp as updateProfileSelf, bq as uploadAvatar, br as verifyExternalAccount } from '../keys-BfRke4RH.js';
|
|
3
3
|
export { AddFeatureAllowlistVariables, CreateReactionVariables, CreateRecordVariables, DeleteReactionVariables, DeleteRecordVariables, FollowVariables, PositionSkillLinkVariables, RemoveFeatureAllowlistVariables, SifaProvider, SifaProviderProps, UnfollowVariables, UpdateEducationVariables, UpdateExternalAccountVariables, UpdatePositionVariables, UpdateProfileLocationVariables, UpdateRecordVariables, UpdateSkillVariables, useActivityFeed, useActivityTeaser, useAddFeatureAllowlist, useAppAccountCheck, useAppsRegistry, useAtFundLink, useBlueskySuggestions, useBulkHideProfileItems, useBulkHideStandardPublications, useBulkUnhideProfileItems, useBulkUnhideStandardPublications, useCanonicalSkillSearch, useCastRoadmapVote, useCreateEducation, useCreateEndorsement, useCreateExternalAccount, useCreatePosition, useCreateProfileLocation, useCreateReaction, useCreateRecord, useCreateSkill, useDeleteAccount, useDeleteAvatarOverride, useDeleteEducation, useDeleteExternalAccount, useDeletePosition, useDeleteProfileLocation, useDeleteReaction, useDeleteRecord, useDeleteSkill, useEndorsementCount, useExternalAccounts, useFeatureAllowlist, useFeaturedProfile, useFollow, useFollowers, useFollowing, useFollowingFeed, useFollowingList, useHeatmapData, useHiddenApps, useHideKeytraceClaim, useHideOrcidPublication, useHideProfileItem, useHideSifaPublication, useHideStandardPublication, useLinkSkillToPosition, useMutuals, useMyRoadmapVotes, useNetworkStreamCount, useProfile, useReactionStatus, useRefreshOrcidPublications, useRefreshPds, useRemoveFeatureAllowlist, useResetProfile, useRetractRoadmapVote, useRevealMarqueDomain, useRoadmapVotes, useSearchFilters, useSearchProfiles, useSetExternalAccountPrimary, useSetPositionPrimary, useSifaConfig, useSimilarProfiles, useSkillSuggestions, useStats, useSuggestionCount, useSuggestions, useUnfollow, useUnhideKeytraceClaim, useUnhideOrcidPublication, useUnhideProfileItem, useUnhideSifaPublication, useUnhideStandardPublication, useUnlinkSkillFromPosition, useUnrevealMarqueDomain, useUnsetExternalAccountPrimary, useUnsetPositionPrimary, useUpdateEducation, useUpdateExternalAccount, useUpdatePosition, useUpdateProfileLocation, useUpdateProfileOverride, useUpdateProfileSelf, useUpdateRecord, useUpdateSkill, useUploadAvatar, useVerifyExternalAccount } from './hooks/index.js';
|
|
4
4
|
export { FetchNetworkStreamCountOptions, NetworkMapEdge, NetworkMapGenerationJob, NetworkMapGraphData, NetworkMapNode, NetworkMapPendingJob, NetworkMapResponse, checkNetworkMapJobStatus, createEducation, createPosition, createRecord, createSkill, deleteEducation, deletePosition, deleteRecord, deleteSkill, fetchAtFundLink, fetchEndorsementCount, fetchNetworkMap, fetchNetworkStreamCount, fetchProfile, hideKeytraceClaim, initiateNetworkMapGeneration, isNetworkMapResponse, linkSkillToPosition, revealMarqueDomain, setPositionPrimary, unhideKeytraceClaim, unlinkSkillFromPosition, unrevealMarqueDomain, unsetPositionPrimary, updateEducation, updatePosition, updateRecord, updateSkill } from './fetchers/index.js';
|
|
5
|
-
import { A as AdultContentLabel } from '../adult-content-
|
|
5
|
+
import { A as AdultContentLabel } from '../adult-content-Bwr392Yu.js';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
7
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
8
8
|
import '../feed-DHTy7fUN.js';
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -24,6 +24,10 @@ var strongRefSchema = zod.z.object({
|
|
|
24
24
|
uri: atUriSchema,
|
|
25
25
|
cid: cidSchema
|
|
26
26
|
});
|
|
27
|
+
var externalRecordRefSchema = zod.z.object({
|
|
28
|
+
uri: atUriSchema,
|
|
29
|
+
cid: cidSchema.optional()
|
|
30
|
+
});
|
|
27
31
|
var selfLabelsSchema = zod.z.object({
|
|
28
32
|
$type: zod.z.literal("com.atproto.label.defs#selfLabels").optional(),
|
|
29
33
|
values: zod.z.array(zod.z.object({ val: zod.z.string() }))
|
|
@@ -204,6 +208,46 @@ var ProfilePositionRecordSchema = zod.z.object({
|
|
|
204
208
|
labels: selfLabelsSchema.optional(),
|
|
205
209
|
createdAt: datetimeSchema
|
|
206
210
|
});
|
|
211
|
+
var PresentationDurationSchema = zod.z.object({
|
|
212
|
+
minMinutes: zod.z.number().int().min(1),
|
|
213
|
+
maxMinutes: zod.z.number().int().min(1).optional()
|
|
214
|
+
}).refine((d) => d.maxMinutes === void 0 || d.maxMinutes >= d.minMinutes, {
|
|
215
|
+
message: "maxMinutes must be greater than or equal to minMinutes",
|
|
216
|
+
path: ["maxMinutes"]
|
|
217
|
+
});
|
|
218
|
+
var PresentationLinkSchema = zod.z.object({
|
|
219
|
+
uri: uriSchema,
|
|
220
|
+
label: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
|
|
221
|
+
type: zod.z.string().optional()
|
|
222
|
+
});
|
|
223
|
+
var ProfilePresentationRecordSchema = zod.z.object({
|
|
224
|
+
title: zod.z.string().min(1).refine(maxGraphemes(300)).max(3e3),
|
|
225
|
+
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
226
|
+
duration: PresentationDurationSchema.optional(),
|
|
227
|
+
intendedAudiences: zod.z.array(zod.z.string().refine(maxGraphemes(100)).max(1e3)).max(20).optional(),
|
|
228
|
+
links: zod.z.array(PresentationLinkSchema).max(20).optional(),
|
|
229
|
+
// Optional reference to a long-form write-up (pub.leaflet.document or
|
|
230
|
+
// site.standard.document). Plain at-uri + optional cid so it tracks edits.
|
|
231
|
+
writeupRef: externalRecordRefSchema.optional(),
|
|
232
|
+
createdAt: datetimeSchema
|
|
233
|
+
});
|
|
234
|
+
var ProfilePresentationDeliveryRecordSchema = zod.z.object({
|
|
235
|
+
// Optional reference to the id.sifa.profile.presentation delivered here.
|
|
236
|
+
presentationRef: externalRecordRefSchema.optional(),
|
|
237
|
+
// Fallback title used when there is no presentationRef.
|
|
238
|
+
title: zod.z.string().refine(maxGraphemes(300)).max(3e3).optional(),
|
|
239
|
+
role: zod.z.string().refine(maxGraphemes(64)).max(640).optional(),
|
|
240
|
+
eventName: zod.z.string().refine(maxGraphemes(300)).max(3e3).optional(),
|
|
241
|
+
// Calendar date as YYYY-MM-DD (day only).
|
|
242
|
+
date: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "date must be YYYY-MM-DD").optional(),
|
|
243
|
+
location: zod.z.string().refine(maxGraphemes(256)).max(2560).optional(),
|
|
244
|
+
mode: zod.z.string().optional(),
|
|
245
|
+
status: zod.z.string().optional(),
|
|
246
|
+
links: zod.z.array(PresentationLinkSchema).max(20).optional(),
|
|
247
|
+
// Optional reference to a community.lexicon.calendar.event for this occasion.
|
|
248
|
+
eventRef: externalRecordRefSchema.optional(),
|
|
249
|
+
createdAt: datetimeSchema
|
|
250
|
+
});
|
|
207
251
|
var ProfileProjectRecordSchema = zod.z.object({
|
|
208
252
|
name: zod.z.string().min(1).refine(maxGraphemes(100)).max(1e3),
|
|
209
253
|
description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
|
|
@@ -268,6 +312,8 @@ exports.FollowFeedPageSchema = FollowFeedPageSchema;
|
|
|
268
312
|
exports.FollowProfilePageSchema = FollowProfilePageSchema;
|
|
269
313
|
exports.FollowProfileSchema = FollowProfileSchema;
|
|
270
314
|
exports.GraphFollowRecordSchema = GraphFollowRecordSchema;
|
|
315
|
+
exports.PresentationDurationSchema = PresentationDurationSchema;
|
|
316
|
+
exports.PresentationLinkSchema = PresentationLinkSchema;
|
|
271
317
|
exports.ProfileCertificationRecordSchema = ProfileCertificationRecordSchema;
|
|
272
318
|
exports.ProfileCourseRecordSchema = ProfileCourseRecordSchema;
|
|
273
319
|
exports.ProfileEducationRecordSchema = ProfileEducationRecordSchema;
|
|
@@ -275,6 +321,8 @@ exports.ProfileExternalAccountRecordSchema = ProfileExternalAccountRecordSchema;
|
|
|
275
321
|
exports.ProfileHonorRecordSchema = ProfileHonorRecordSchema;
|
|
276
322
|
exports.ProfileLanguageRecordSchema = ProfileLanguageRecordSchema;
|
|
277
323
|
exports.ProfilePositionRecordSchema = ProfilePositionRecordSchema;
|
|
324
|
+
exports.ProfilePresentationDeliveryRecordSchema = ProfilePresentationDeliveryRecordSchema;
|
|
325
|
+
exports.ProfilePresentationRecordSchema = ProfilePresentationRecordSchema;
|
|
278
326
|
exports.ProfileProjectRecordSchema = ProfileProjectRecordSchema;
|
|
279
327
|
exports.ProfilePublicationRecordSchema = ProfilePublicationRecordSchema;
|
|
280
328
|
exports.ProfileSelfRecordSchema = ProfileSelfRecordSchema;
|
|
@@ -288,6 +336,7 @@ exports.datetimeSchema = datetimeSchema;
|
|
|
288
336
|
exports.decodeFeedCursor = decodeFeedCursor;
|
|
289
337
|
exports.didSchema = didSchema;
|
|
290
338
|
exports.encodeFeedCursor = encodeFeedCursor;
|
|
339
|
+
exports.externalRecordRefSchema = externalRecordRefSchema;
|
|
291
340
|
exports.languageTagSchema = languageTagSchema;
|
|
292
341
|
exports.makeGraphFollowRecordSchema = makeGraphFollowRecordSchema;
|
|
293
342
|
exports.maxGraphemes = maxGraphemes;
|