@antiphony/shared 0.3.0 → 0.5.0
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/README.md +4 -4
- package/dist/cjs/api-codecs.cjs +149 -142
- package/dist/cjs/api-codecs.d.cts +157 -68
- package/dist/cjs/index.cjs +187 -192
- package/dist/cjs/index.d.cts +310 -7
- package/dist/cjs/nsid.cjs +6 -9
- package/dist/cjs/nsid.d.cts +7 -8
- package/dist/cjs/types/audio.cjs +133 -119
- package/dist/cjs/types/audio.d.cts +343 -199
- package/dist/cjs/types/blob.cjs +5 -9
- package/dist/cjs/types/blob.d.cts +21 -21
- package/dist/cjs/types/records.cjs +0 -45
- package/dist/cjs/types/records.d.cts +1 -103
- package/dist/esm/api-codecs.d.ts +187 -98
- package/dist/esm/api-codecs.js +4 -5
- package/dist/esm/chunk-D655OH2I.js +35 -0
- package/dist/esm/chunk-F5ZKFJL2.js +39 -0
- package/dist/esm/{chunk-6LROFBKK.js → chunk-SBYNIQRZ.js} +7 -9
- package/dist/esm/chunk-SMK4OZNU.js +17 -0
- package/dist/esm/chunk-TVOXIQKF.js +294 -0
- package/dist/esm/index.d.ts +310 -7
- package/dist/esm/index.js +5 -7
- package/dist/esm/nsid.d.ts +7 -8
- package/dist/esm/nsid.js +1 -1
- package/dist/esm/types/audio.d.ts +420 -276
- package/dist/esm/types/audio.js +3 -4
- package/dist/esm/types/blob.d.ts +21 -21
- package/dist/esm/types/blob.js +1 -1
- package/dist/esm/types/records.d.ts +1 -103
- package/dist/esm/types/records.js +1 -1
- package/package.json +94 -26
- package/dist/cjs/types/api.cjs +0 -166
- package/dist/cjs/types/api.d.cts +0 -242
- package/dist/cjs/types/views.cjs +0 -179
- package/dist/cjs/types/views.d.cts +0 -726
- package/dist/esm/chunk-5EHV73BA.js +0 -20
- package/dist/esm/chunk-F7IHVM34.js +0 -144
- package/dist/esm/chunk-FDM5FDN4.js +0 -46
- package/dist/esm/chunk-IHIBHQBJ.js +0 -78
- package/dist/esm/chunk-R6SBR3IG.js +0 -97
- package/dist/esm/chunk-Y6HNNRVD.js +0 -12
- package/dist/esm/types/api.d.ts +0 -242
- package/dist/esm/types/api.js +0 -4
- package/dist/esm/types/views.d.ts +0 -726
- package/dist/esm/types/views.js +0 -3
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
// types/blob.ts
|
|
4
|
-
var BlobRefSchema = z.object({
|
|
5
|
-
/** Discriminator for AT Protocol type system */
|
|
6
|
-
$type: z.literal("blob"),
|
|
7
|
-
/** Content Identifier (CID) or URL pointing to the blob */
|
|
8
|
-
ref: z.string(),
|
|
9
|
-
/** MIME type of the blob (e.g., 'audio/webm') */
|
|
10
|
-
mimeType: z.string(),
|
|
11
|
-
/** Size of the blob in bytes */
|
|
12
|
-
size: z.number()
|
|
13
|
-
});
|
|
14
|
-
function resolveAudioUrl(record) {
|
|
15
|
-
var _a;
|
|
16
|
-
if ((_a = record.audio) == null ? void 0 : _a.ref) return record.audio.ref;
|
|
17
|
-
return record.audioUrl;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { BlobRefSchema, resolveAudioUrl };
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { BlobRefSchema } from './chunk-5EHV73BA.js';
|
|
2
|
-
import { ProfileViewBasicSchema } from './chunk-R6SBR3IG.js';
|
|
3
|
-
import { FirestoreTimestampSchema } from './chunk-IHIBHQBJ.js';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
|
|
6
|
-
var StrongRefSchema = z.object({
|
|
7
|
-
uri: z.string().regex(/^at:\/\/.+/, "Must be an at:// URI"),
|
|
8
|
-
cid: z.string()
|
|
9
|
-
});
|
|
10
|
-
var ReplyRefSchema = z.object({
|
|
11
|
-
root: StrongRefSchema,
|
|
12
|
-
parent: StrongRefSchema
|
|
13
|
-
});
|
|
14
|
-
var AudioEmbedSchema = z.object({
|
|
15
|
-
$type: z.literal("dev.antiphony.embed.audio"),
|
|
16
|
-
/** The audio bytes as a content-addressed storage ref (CID/path). */
|
|
17
|
-
audio: BlobRefSchema,
|
|
18
|
-
/** Duration in MILLISECONDS (platform-wide unit; not seconds). */
|
|
19
|
-
durationMs: z.number().int().min(0).optional(),
|
|
20
|
-
/** User-authored short description (audio analogue of image alt). NOT the transcript. */
|
|
21
|
-
alt: z.string().max(1e4).optional(),
|
|
22
|
-
/** Pre-computed waveform peaks (normalized 0–100) for instant rendering. */
|
|
23
|
-
waveform: z.array(z.number().int().min(0).max(100)).max(1e3).optional()
|
|
24
|
-
});
|
|
25
|
-
var TranscriptSegmentSchema = z.object({
|
|
26
|
-
startMs: z.number().int().min(0),
|
|
27
|
-
endMs: z.number().int().min(0),
|
|
28
|
-
text: z.string()
|
|
29
|
-
}).refine((s) => s.endMs >= s.startMs, {
|
|
30
|
-
message: "endMs must be >= startMs",
|
|
31
|
-
path: ["endMs"]
|
|
32
|
-
});
|
|
33
|
-
var TimedTranscriptSchema = z.object({
|
|
34
|
-
segments: z.array(TranscriptSegmentSchema),
|
|
35
|
-
text: z.string().optional()
|
|
36
|
-
});
|
|
37
|
-
var AudioEmbedViewSchema = z.object({
|
|
38
|
-
$type: z.literal("dev.antiphony.embed.audio#view"),
|
|
39
|
-
url: z.string().url(),
|
|
40
|
-
durationMs: z.number().int().min(0).optional(),
|
|
41
|
-
// `alt`/`waveform` are copied from the stored embed; keep the same bounds
|
|
42
|
-
// so a view can never carry a larger payload than the record allows.
|
|
43
|
-
alt: z.string().max(1e4).optional(),
|
|
44
|
-
waveform: z.array(z.number().int().min(0).max(100)).max(1e3).optional(),
|
|
45
|
-
/** Lifted from the transcript enrichment record; absent until transcription completes. */
|
|
46
|
-
transcript: TimedTranscriptSchema.optional()
|
|
47
|
-
});
|
|
48
|
-
var AudioPostRecordSchema = z.object({
|
|
49
|
-
/** Storage id (rkey/doc id). */
|
|
50
|
-
id: z.string(),
|
|
51
|
-
// --- Tenancy + facets (storage-indexed; NOT in the lexicon) ---
|
|
52
|
-
/** Origin app that created this record — the multi-tenant isolation key. */
|
|
53
|
-
originAppId: z.string(),
|
|
54
|
-
/** Authoring user. A queryable facet, not the tenancy boundary. */
|
|
55
|
-
authorId: z.string(),
|
|
56
|
-
/** Optional AT Protocol identity of the author (facet). */
|
|
57
|
-
authorDid: z.string().optional(),
|
|
58
|
-
/** Optional org context (facet). */
|
|
59
|
-
orgId: z.string().nullable().optional(),
|
|
60
|
-
/** Denormalized from `reply` presence: `reply` set ⇒ 'reply', else 'prompt'. */
|
|
61
|
-
kind: z.enum(["prompt", "reply"]),
|
|
62
|
-
/**
|
|
63
|
-
* Branch participant pair (author ids) for reply gating — the parties to a
|
|
64
|
-
* reply's sub-thread: the creator (thread-root author) + the responder who
|
|
65
|
-
* opened the branch. Set on replies (deduped, 1–2 ids); absent on prompts
|
|
66
|
-
* (a prompt's repliers are the app's audience policy, not a fixed pair).
|
|
67
|
-
* Inherited down the branch so reply gating is an O(1) field check, never a
|
|
68
|
-
* thread walk. See `specs/antiphony-data-model.md` §6 "Reply gating".
|
|
69
|
-
*/
|
|
70
|
-
threadParticipants: z.array(z.string()).optional(),
|
|
71
|
-
// --- Lexicon fields (public contract) ---
|
|
72
|
-
/** User-authored text (bsky-semantic). May be empty for pure-audio posts. NEVER the transcript. */
|
|
73
|
-
text: z.string().max(3e3),
|
|
74
|
-
/** Optional headline; a prompt feature, not the discriminator. */
|
|
75
|
-
title: z.string().max(3e3).optional(),
|
|
76
|
-
/** Audio (or other) attachment. Audio posts carry an `AudioEmbed`. */
|
|
77
|
-
embed: AudioEmbedSchema.optional(),
|
|
78
|
-
/** Present iff this post is a reply (StrongRef root + parent). */
|
|
79
|
-
reply: ReplyRefSchema.optional(),
|
|
80
|
-
/** BCP-47 language tags for the text. */
|
|
81
|
-
langs: z.array(z.string()).max(3).optional(),
|
|
82
|
-
/** Author-applied self-label values (content warnings). Simplified from the
|
|
83
|
-
* lexicon's `com.atproto.label.defs#selfLabels` to the bare value strings. */
|
|
84
|
-
selfLabels: z.array(z.string()).optional(),
|
|
85
|
-
createdAt: FirestoreTimestampSchema
|
|
86
|
-
}).refine(
|
|
87
|
-
// `kind` is denormalized from `reply` presence at write time; enforce the
|
|
88
|
-
// invariant so an inconsistent record can't be written or read silently.
|
|
89
|
-
// A reply has `reply` and no `title`; a prompt has neither a `reply`.
|
|
90
|
-
(r) => r.kind === "reply" ? !!r.reply && r.title === void 0 : !r.reply,
|
|
91
|
-
{
|
|
92
|
-
message: "kind must match reply presence: 'reply' \u21D2 reply set & no title; 'prompt' \u21D2 no reply",
|
|
93
|
-
path: ["kind"]
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
var TranscriptEnrichmentRecordSchema = z.object({
|
|
97
|
-
id: z.string(),
|
|
98
|
-
/** The post whose audio this transcribes. */
|
|
99
|
-
subject: StrongRefSchema,
|
|
100
|
-
transcript: TimedTranscriptSchema,
|
|
101
|
-
/** BCP-47 language tag of the transcript. */
|
|
102
|
-
lang: z.string().optional(),
|
|
103
|
-
/** Model/provider provenance (the generator is a pluggable port). */
|
|
104
|
-
model: z.string().optional(),
|
|
105
|
-
createdAt: FirestoreTimestampSchema
|
|
106
|
-
});
|
|
107
|
-
var ActorProfileRecordSchema = z.object({
|
|
108
|
-
handle: z.string().min(3).max(20).optional(),
|
|
109
|
-
usageIntent: z.string().max(100).optional(),
|
|
110
|
-
rssFeed: z.string().url().optional()
|
|
111
|
-
});
|
|
112
|
-
var ViewerStateSchema = z.object({
|
|
113
|
-
/** True when the authenticated caller authored this post. */
|
|
114
|
-
isAuthor: z.boolean().default(false),
|
|
115
|
-
/**
|
|
116
|
-
* Whether the caller may reply to this post (reply gating, §6). A prompt is
|
|
117
|
-
* repliable by any authenticated viewer (the app's audience-policy default);
|
|
118
|
-
* a reply only by its branch participants (`{ creator, branch responder }`).
|
|
119
|
-
*/
|
|
120
|
-
canReply: z.boolean().default(false),
|
|
121
|
-
/** Why `canReply` is false, when it is (omitted when the caller can reply). */
|
|
122
|
-
replyDisabledReason: z.enum(["unauthenticated", "not_a_participant"]).optional()
|
|
123
|
-
});
|
|
124
|
-
var PostRecordPublicSchema = z.object({
|
|
125
|
-
text: z.string(),
|
|
126
|
-
title: z.string().optional(),
|
|
127
|
-
reply: ReplyRefSchema.optional(),
|
|
128
|
-
langs: z.array(z.string()).optional(),
|
|
129
|
-
selfLabels: z.array(z.string()).optional(),
|
|
130
|
-
createdAt: FirestoreTimestampSchema
|
|
131
|
-
});
|
|
132
|
-
var AudioPostViewSchema = z.object({
|
|
133
|
-
/** at:// URI (or internal ref) identifying the post. */
|
|
134
|
-
uri: z.string(),
|
|
135
|
-
cid: z.string().optional(),
|
|
136
|
-
kind: z.enum(["prompt", "reply"]),
|
|
137
|
-
author: ProfileViewBasicSchema,
|
|
138
|
-
record: PostRecordPublicSchema,
|
|
139
|
-
/** Hydrated audio embed (signed URL + lifted transcript). */
|
|
140
|
-
embed: AudioEmbedViewSchema.optional(),
|
|
141
|
-
viewer: ViewerStateSchema
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export { ActorProfileRecordSchema, AudioEmbedSchema, AudioEmbedViewSchema, AudioPostRecordSchema, AudioPostViewSchema, PostRecordPublicSchema, ReplyRefSchema, StrongRefSchema, TimedTranscriptSchema, TranscriptEnrichmentRecordSchema, TranscriptSegmentSchema, ViewerStateSchema };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ReplyRefSchema, AudioEmbedSchema } from './chunk-F7IHVM34.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
var CreateAudioPostRequestSchema = z.object({
|
|
5
|
-
/** User-authored text; may be empty for pure-audio posts. */
|
|
6
|
-
text: z.string().max(3e3).default(""),
|
|
7
|
-
/** Optional headline (prompt feature). */
|
|
8
|
-
title: z.string().max(3e3).optional(),
|
|
9
|
-
/** The uploaded audio attachment. */
|
|
10
|
-
embed: AudioEmbedSchema.optional(),
|
|
11
|
-
/** Present ⇒ this is a reply (StrongRef root + parent). */
|
|
12
|
-
reply: ReplyRefSchema.optional(),
|
|
13
|
-
/** BCP-47 language tags. */
|
|
14
|
-
langs: z.array(z.string()).max(3).optional(),
|
|
15
|
-
/** Author self-label values (content warnings). */
|
|
16
|
-
selfLabels: z.array(z.string()).optional()
|
|
17
|
-
}).refine((d) => !(d.reply && d.title), {
|
|
18
|
-
message: "Replies cannot have a title",
|
|
19
|
-
path: ["title"]
|
|
20
|
-
}).refine((d) => d.text.trim().length > 0 || !!d.embed, {
|
|
21
|
-
message: "Post must have text or an audio embed",
|
|
22
|
-
path: ["text"]
|
|
23
|
-
});
|
|
24
|
-
var UpdateProfileRequestSchema = z.object({
|
|
25
|
-
handle: z.string().min(3).max(20).regex(/^[a-zA-Z0-9_]+$/).optional(),
|
|
26
|
-
displayName: z.string().max(50).optional(),
|
|
27
|
-
bio: z.string().max(160).optional(),
|
|
28
|
-
avatarUrl: z.string().url().nullable().optional(),
|
|
29
|
-
usageIntent: z.string().max(200).nullable().optional(),
|
|
30
|
-
/**
|
|
31
|
-
* Personal website surfaced on the public profile. Accepts a URL, empty
|
|
32
|
-
* string, or null from the client; normalizes empty string → null so the
|
|
33
|
-
* value stored on `UserRecord` (which requires `.url() | null`) round-trips
|
|
34
|
-
* cleanly through `UserRecordSchema.parse` on subsequent reads.
|
|
35
|
-
*/
|
|
36
|
-
website: z.union([z.string().url(), z.literal(""), z.null()]).optional().transform((v) => v === "" ? null : v),
|
|
37
|
-
/** Up to 5 public links (label + URL) shown under the bio. */
|
|
38
|
-
links: z.array(z.object({
|
|
39
|
-
label: z.string().min(1).max(40),
|
|
40
|
-
url: z.string().url()
|
|
41
|
-
})).max(5).optional(),
|
|
42
|
-
/** When true, surfaces the linked Bluesky identity on the public profile. */
|
|
43
|
-
showBlueskyPublicly: z.boolean().optional()
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export { CreateAudioPostRequestSchema, UpdateProfileRequestSchema };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
// types/records.ts
|
|
4
|
-
function httpsUrl() {
|
|
5
|
-
return z.string().trim().url().refine((u) => /^https?:\/\//i.test(u), {
|
|
6
|
-
message: "URL must use the http or https scheme"
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
var FirestoreTimestampSchema = z.union([
|
|
10
|
-
z.custom((data) => {
|
|
11
|
-
return data && typeof data === "object" && (typeof data.toDate === "function" || "seconds" in data && "nanoseconds" in data);
|
|
12
|
-
}),
|
|
13
|
-
z.string(),
|
|
14
|
-
z.number(),
|
|
15
|
-
z.date()
|
|
16
|
-
]).transform((data, ctx) => {
|
|
17
|
-
let date;
|
|
18
|
-
if (data instanceof Date) {
|
|
19
|
-
date = data;
|
|
20
|
-
} else if (typeof data === "string") {
|
|
21
|
-
date = new Date(data);
|
|
22
|
-
} else if (typeof data === "number") {
|
|
23
|
-
date = new Date(data);
|
|
24
|
-
} else if (typeof data.toDate === "function") {
|
|
25
|
-
date = data.toDate();
|
|
26
|
-
} else {
|
|
27
|
-
const timestamp = data;
|
|
28
|
-
date = new Date(timestamp.seconds * 1e3 + timestamp.nanoseconds / 1e6);
|
|
29
|
-
}
|
|
30
|
-
if (Number.isNaN(date.getTime())) {
|
|
31
|
-
ctx.addIssue({
|
|
32
|
-
code: z.ZodIssueCode.custom,
|
|
33
|
-
message: "FirestoreTimestamp coerced to Invalid Date"
|
|
34
|
-
});
|
|
35
|
-
return z.NEVER;
|
|
36
|
-
}
|
|
37
|
-
return date;
|
|
38
|
-
});
|
|
39
|
-
var UserRecordSchema = z.object({
|
|
40
|
-
/** Unique Firebase UID */
|
|
41
|
-
id: z.string(),
|
|
42
|
-
/** Public handle (e.g. @brad). Optional for Lite Users. */
|
|
43
|
-
handle: z.string().min(3).max(20).regex(/^[a-zA-Z0-9_]+$/).nullable().optional(),
|
|
44
|
-
/** User stated intent (e.g. "Podcaster", "Listener") */
|
|
45
|
-
usageIntent: z.string().nullable().optional(),
|
|
46
|
-
/** Domain for federated handle support. */
|
|
47
|
-
domain: z.string().default("antiphony.dev"),
|
|
48
|
-
/**
|
|
49
|
-
* Display Name (e.g. "Brad Thorson"). Nullable: Firestore stores `null`
|
|
50
|
-
* when the user clears this field via the settings form, and the schema
|
|
51
|
-
* must match storage reality or `UserRecordSchema.parse` (in
|
|
52
|
-
* `getUserRecordByUid`) will throw.
|
|
53
|
-
*/
|
|
54
|
-
displayName: z.string().max(50).nullable().optional(),
|
|
55
|
-
/** Short bio/description — nullable for the same reason as displayName. */
|
|
56
|
-
bio: z.string().max(160).nullable().optional(),
|
|
57
|
-
/** URL to avatar image — nullable for the same reason as displayName. */
|
|
58
|
-
avatarUrl: z.string().url().nullable().optional(),
|
|
59
|
-
/** Optional personal website surfaced on the public profile. */
|
|
60
|
-
website: httpsUrl().nullable().optional(),
|
|
61
|
-
/** Up to 5 additional public links (label + URL) shown under the bio. */
|
|
62
|
-
links: z.array(z.object({
|
|
63
|
-
label: z.string().min(1).max(40),
|
|
64
|
-
url: httpsUrl()
|
|
65
|
-
})).max(5).optional(),
|
|
66
|
-
/** When true and a Bluesky identity is linked, surfaces it on the public profile. */
|
|
67
|
-
showBlueskyPublicly: z.boolean().optional(),
|
|
68
|
-
/** Server timestamp of creation */
|
|
69
|
-
createdAt: FirestoreTimestampSchema,
|
|
70
|
-
/** Individual account tier — free or creator_pro */
|
|
71
|
-
tier: z.enum(["free", "creator_pro"]).default("free"),
|
|
72
|
-
/** Account status. Deactivated accounts retain data but are excluded from lookups. */
|
|
73
|
-
status: z.enum(["active", "deactivated"]).default("active"),
|
|
74
|
-
/** Timestamp when the account was deactivated (soft deleted) */
|
|
75
|
-
deactivatedAt: FirestoreTimestampSchema.optional()
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
export { FirestoreTimestampSchema, UserRecordSchema, httpsUrl };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { FirestoreTimestampSchema } from './chunk-IHIBHQBJ.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
var ProfileViewBasicSchema = z.object({
|
|
5
|
-
id: z.string(),
|
|
6
|
-
handle: z.string().nullable().optional(),
|
|
7
|
-
// `displayName` and `bio` are `.nullable()` — Firestore stores `null` for
|
|
8
|
-
// empty values on these fields (see users-dependencies.ts), and Zod's
|
|
9
|
-
// `.optional()` alone rejects `null`. Consumers already use truthy
|
|
10
|
-
// checks / `??` / `||`, so widening the type to include `null` is safe.
|
|
11
|
-
displayName: z.string().nullable().optional(),
|
|
12
|
-
avatarUrl: z.string().nullable().optional(),
|
|
13
|
-
bio: z.string().nullable().optional(),
|
|
14
|
-
/** Personal website link surfaced on the public profile. */
|
|
15
|
-
website: z.string().nullable().optional(),
|
|
16
|
-
/** Public links (label + URL) shown under the bio. */
|
|
17
|
-
links: z.array(z.object({
|
|
18
|
-
label: z.string(),
|
|
19
|
-
url: z.string()
|
|
20
|
-
})).optional(),
|
|
21
|
-
/**
|
|
22
|
-
* AT Protocol identity, surfaced on the public profile only when the user
|
|
23
|
-
* opts in (`UserRecord.showBlueskyPublicly === true`). Projection happens
|
|
24
|
-
* in the user dependency layer; this schema simply allows the field.
|
|
25
|
-
*/
|
|
26
|
-
bluesky: z.object({
|
|
27
|
-
handle: z.string(),
|
|
28
|
-
did: z.string()
|
|
29
|
-
}).optional(),
|
|
30
|
-
stats: z.object({
|
|
31
|
-
followers: z.number().default(0),
|
|
32
|
-
following: z.number().default(0),
|
|
33
|
-
prompts: z.number().default(0)
|
|
34
|
-
}).optional(),
|
|
35
|
-
badges: z.array(z.string()).optional(),
|
|
36
|
-
isVerified: z.boolean().optional(),
|
|
37
|
-
createdAt: FirestoreTimestampSchema.optional()
|
|
38
|
-
});
|
|
39
|
-
function toProfileViewBasic(profile) {
|
|
40
|
-
const { id, handle, displayName, avatarUrl, bio, website, links, bluesky, showBlueskyPublicly, stats, badges, isVerified, createdAt } = profile;
|
|
41
|
-
return {
|
|
42
|
-
id,
|
|
43
|
-
handle,
|
|
44
|
-
displayName,
|
|
45
|
-
avatarUrl,
|
|
46
|
-
bio,
|
|
47
|
-
website,
|
|
48
|
-
links,
|
|
49
|
-
bluesky: showBlueskyPublicly ? bluesky : void 0,
|
|
50
|
-
stats,
|
|
51
|
-
badges,
|
|
52
|
-
isVerified,
|
|
53
|
-
createdAt
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
var ProfileViewDetailedSchema = ProfileViewBasicSchema.extend({
|
|
57
|
-
/** AT Protocol Identity link */
|
|
58
|
-
bluesky: z.object({
|
|
59
|
-
handle: z.string(),
|
|
60
|
-
did: z.string()
|
|
61
|
-
}).optional(),
|
|
62
|
-
usageIntent: z.string().nullable().optional()
|
|
63
|
-
});
|
|
64
|
-
var ProfileViewSelfSchema = ProfileViewDetailedSchema.extend({
|
|
65
|
-
phoneNumber: z.string().nullable().optional(),
|
|
66
|
-
email: z.string().optional(),
|
|
67
|
-
lastSeenAt: FirestoreTimestampSchema.optional(),
|
|
68
|
-
lastActiveAt: FirestoreTimestampSchema.optional(),
|
|
69
|
-
unreadReplyCount: z.number().default(0),
|
|
70
|
-
newReplierCount: z.number().default(0),
|
|
71
|
-
/**
|
|
72
|
-
* Account tier from UserRecord — surfaced on the self profile so the
|
|
73
|
-
* client can gate paid features. Optional for legacy docs without the
|
|
74
|
-
* field; consumers should treat missing as `'free'`.
|
|
75
|
-
*/
|
|
76
|
-
tier: z.enum(["free", "creator_pro"]).optional(),
|
|
77
|
-
/**
|
|
78
|
-
* Surfaces the linked Bluesky identity (handle + DID) on the public profile
|
|
79
|
-
* when true. Persisted on UserRecord; exposed in self/detailed views so the
|
|
80
|
-
* settings form can render the toggle's current state.
|
|
81
|
-
*/
|
|
82
|
-
showBlueskyPublicly: z.boolean().optional(),
|
|
83
|
-
settings: z.object({
|
|
84
|
-
notifications: z.boolean().optional(),
|
|
85
|
-
theme: z.string().optional()
|
|
86
|
-
}).optional()
|
|
87
|
-
});
|
|
88
|
-
var ProfileViewAdminSchema = ProfileViewSelfSchema.extend({
|
|
89
|
-
blockedUsers: z.array(z.string()).optional(),
|
|
90
|
-
followers: z.array(z.string()).optional(),
|
|
91
|
-
following: z.array(z.string()).optional(),
|
|
92
|
-
reportCount: z.number().optional(),
|
|
93
|
-
isBanned: z.boolean().optional()
|
|
94
|
-
});
|
|
95
|
-
var ProfileViewSchema = ProfileViewAdminSchema;
|
|
96
|
-
|
|
97
|
-
export { ProfileViewAdminSchema, ProfileViewBasicSchema, ProfileViewDetailedSchema, ProfileViewSchema, ProfileViewSelfSchema, toProfileViewBasic };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ProfileViewBasicSchema, ProfileViewSelfSchema } from './chunk-R6SBR3IG.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
var PublicProfileDtoSchema = ProfileViewBasicSchema.extend({
|
|
5
|
-
bluesky: z.object({
|
|
6
|
-
handle: z.string(),
|
|
7
|
-
did: z.string()
|
|
8
|
-
}).optional()
|
|
9
|
-
});
|
|
10
|
-
var ActorViewSchema = ProfileViewSelfSchema;
|
|
11
|
-
|
|
12
|
-
export { ActorViewSchema, PublicProfileDtoSchema };
|
package/dist/esm/types/api.d.ts
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Public Profile DTO — the public-facing profile shape.
|
|
5
|
-
* Equivalent to ProfileViewBasicSchema plus a few enrichment fields.
|
|
6
|
-
*/
|
|
7
|
-
declare const PublicProfileDtoSchema: z.ZodObject<{
|
|
8
|
-
id: z.ZodString;
|
|
9
|
-
handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
-
displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
-
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
-
bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
-
website: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
-
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
-
label: z.ZodString;
|
|
16
|
-
url: z.ZodString;
|
|
17
|
-
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
label: string;
|
|
19
|
-
url: string;
|
|
20
|
-
}, {
|
|
21
|
-
label: string;
|
|
22
|
-
url: string;
|
|
23
|
-
}>, "many">>;
|
|
24
|
-
stats: z.ZodOptional<z.ZodObject<{
|
|
25
|
-
followers: z.ZodDefault<z.ZodNumber>;
|
|
26
|
-
following: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
prompts: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
followers: number;
|
|
30
|
-
following: number;
|
|
31
|
-
prompts: number;
|
|
32
|
-
}, {
|
|
33
|
-
followers?: number | undefined;
|
|
34
|
-
following?: number | undefined;
|
|
35
|
-
prompts?: number | undefined;
|
|
36
|
-
}>>;
|
|
37
|
-
badges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
-
isVerified: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
-
createdAt: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>>;
|
|
40
|
-
} & {
|
|
41
|
-
bluesky: z.ZodOptional<z.ZodObject<{
|
|
42
|
-
handle: z.ZodString;
|
|
43
|
-
did: z.ZodString;
|
|
44
|
-
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
handle: string;
|
|
46
|
-
did: string;
|
|
47
|
-
}, {
|
|
48
|
-
handle: string;
|
|
49
|
-
did: string;
|
|
50
|
-
}>>;
|
|
51
|
-
}, "strip", z.ZodTypeAny, {
|
|
52
|
-
id: string;
|
|
53
|
-
handle?: string | null | undefined;
|
|
54
|
-
displayName?: string | null | undefined;
|
|
55
|
-
bio?: string | null | undefined;
|
|
56
|
-
avatarUrl?: string | null | undefined;
|
|
57
|
-
website?: string | null | undefined;
|
|
58
|
-
links?: {
|
|
59
|
-
label: string;
|
|
60
|
-
url: string;
|
|
61
|
-
}[] | undefined;
|
|
62
|
-
createdAt?: Date | undefined;
|
|
63
|
-
bluesky?: {
|
|
64
|
-
handle: string;
|
|
65
|
-
did: string;
|
|
66
|
-
} | undefined;
|
|
67
|
-
stats?: {
|
|
68
|
-
followers: number;
|
|
69
|
-
following: number;
|
|
70
|
-
prompts: number;
|
|
71
|
-
} | undefined;
|
|
72
|
-
badges?: string[] | undefined;
|
|
73
|
-
isVerified?: boolean | undefined;
|
|
74
|
-
}, {
|
|
75
|
-
id: string;
|
|
76
|
-
handle?: string | null | undefined;
|
|
77
|
-
displayName?: string | null | undefined;
|
|
78
|
-
bio?: string | null | undefined;
|
|
79
|
-
avatarUrl?: string | null | undefined;
|
|
80
|
-
website?: string | null | undefined;
|
|
81
|
-
links?: {
|
|
82
|
-
label: string;
|
|
83
|
-
url: string;
|
|
84
|
-
}[] | undefined;
|
|
85
|
-
createdAt?: unknown;
|
|
86
|
-
bluesky?: {
|
|
87
|
-
handle: string;
|
|
88
|
-
did: string;
|
|
89
|
-
} | undefined;
|
|
90
|
-
stats?: {
|
|
91
|
-
followers?: number | undefined;
|
|
92
|
-
following?: number | undefined;
|
|
93
|
-
prompts?: number | undefined;
|
|
94
|
-
} | undefined;
|
|
95
|
-
badges?: string[] | undefined;
|
|
96
|
-
isVerified?: boolean | undefined;
|
|
97
|
-
}>;
|
|
98
|
-
type PublicProfileDto = z.infer<typeof PublicProfileDtoSchema>;
|
|
99
|
-
/**
|
|
100
|
-
* Actor View — the full view returned to the authenticated user about themselves.
|
|
101
|
-
* Uses ProfileViewSelfSchema which includes private settings but not admin fields.
|
|
102
|
-
*/
|
|
103
|
-
declare const ActorViewSchema: z.ZodObject<{
|
|
104
|
-
id: z.ZodString;
|
|
105
|
-
handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
-
displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
-
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
-
bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
|
-
website: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
-
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
111
|
-
label: z.ZodString;
|
|
112
|
-
url: z.ZodString;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
label: string;
|
|
115
|
-
url: string;
|
|
116
|
-
}, {
|
|
117
|
-
label: string;
|
|
118
|
-
url: string;
|
|
119
|
-
}>, "many">>;
|
|
120
|
-
stats: z.ZodOptional<z.ZodObject<{
|
|
121
|
-
followers: z.ZodDefault<z.ZodNumber>;
|
|
122
|
-
following: z.ZodDefault<z.ZodNumber>;
|
|
123
|
-
prompts: z.ZodDefault<z.ZodNumber>;
|
|
124
|
-
}, "strip", z.ZodTypeAny, {
|
|
125
|
-
followers: number;
|
|
126
|
-
following: number;
|
|
127
|
-
prompts: number;
|
|
128
|
-
}, {
|
|
129
|
-
followers?: number | undefined;
|
|
130
|
-
following?: number | undefined;
|
|
131
|
-
prompts?: number | undefined;
|
|
132
|
-
}>>;
|
|
133
|
-
badges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
134
|
-
isVerified: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
-
createdAt: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>>;
|
|
136
|
-
} & {
|
|
137
|
-
bluesky: z.ZodOptional<z.ZodObject<{
|
|
138
|
-
handle: z.ZodString;
|
|
139
|
-
did: z.ZodString;
|
|
140
|
-
}, "strip", z.ZodTypeAny, {
|
|
141
|
-
handle: string;
|
|
142
|
-
did: string;
|
|
143
|
-
}, {
|
|
144
|
-
handle: string;
|
|
145
|
-
did: string;
|
|
146
|
-
}>>;
|
|
147
|
-
usageIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
148
|
-
} & {
|
|
149
|
-
phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
150
|
-
email: z.ZodOptional<z.ZodString>;
|
|
151
|
-
lastSeenAt: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>>;
|
|
152
|
-
lastActiveAt: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodString, z.ZodNumber, z.ZodDate]>, Date, unknown>>;
|
|
153
|
-
unreadReplyCount: z.ZodDefault<z.ZodNumber>;
|
|
154
|
-
newReplierCount: z.ZodDefault<z.ZodNumber>;
|
|
155
|
-
tier: z.ZodOptional<z.ZodEnum<["free", "creator_pro"]>>;
|
|
156
|
-
showBlueskyPublicly: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
-
settings: z.ZodOptional<z.ZodObject<{
|
|
158
|
-
notifications: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
-
theme: z.ZodOptional<z.ZodString>;
|
|
160
|
-
}, "strip", z.ZodTypeAny, {
|
|
161
|
-
notifications?: boolean | undefined;
|
|
162
|
-
theme?: string | undefined;
|
|
163
|
-
}, {
|
|
164
|
-
notifications?: boolean | undefined;
|
|
165
|
-
theme?: string | undefined;
|
|
166
|
-
}>>;
|
|
167
|
-
}, "strip", z.ZodTypeAny, {
|
|
168
|
-
id: string;
|
|
169
|
-
unreadReplyCount: number;
|
|
170
|
-
newReplierCount: number;
|
|
171
|
-
handle?: string | null | undefined;
|
|
172
|
-
displayName?: string | null | undefined;
|
|
173
|
-
bio?: string | null | undefined;
|
|
174
|
-
avatarUrl?: string | null | undefined;
|
|
175
|
-
usageIntent?: string | null | undefined;
|
|
176
|
-
website?: string | null | undefined;
|
|
177
|
-
links?: {
|
|
178
|
-
label: string;
|
|
179
|
-
url: string;
|
|
180
|
-
}[] | undefined;
|
|
181
|
-
showBlueskyPublicly?: boolean | undefined;
|
|
182
|
-
createdAt?: Date | undefined;
|
|
183
|
-
tier?: "free" | "creator_pro" | undefined;
|
|
184
|
-
bluesky?: {
|
|
185
|
-
handle: string;
|
|
186
|
-
did: string;
|
|
187
|
-
} | undefined;
|
|
188
|
-
stats?: {
|
|
189
|
-
followers: number;
|
|
190
|
-
following: number;
|
|
191
|
-
prompts: number;
|
|
192
|
-
} | undefined;
|
|
193
|
-
badges?: string[] | undefined;
|
|
194
|
-
isVerified?: boolean | undefined;
|
|
195
|
-
phoneNumber?: string | null | undefined;
|
|
196
|
-
email?: string | undefined;
|
|
197
|
-
lastSeenAt?: Date | undefined;
|
|
198
|
-
lastActiveAt?: Date | undefined;
|
|
199
|
-
settings?: {
|
|
200
|
-
notifications?: boolean | undefined;
|
|
201
|
-
theme?: string | undefined;
|
|
202
|
-
} | undefined;
|
|
203
|
-
}, {
|
|
204
|
-
id: string;
|
|
205
|
-
handle?: string | null | undefined;
|
|
206
|
-
displayName?: string | null | undefined;
|
|
207
|
-
bio?: string | null | undefined;
|
|
208
|
-
avatarUrl?: string | null | undefined;
|
|
209
|
-
usageIntent?: string | null | undefined;
|
|
210
|
-
website?: string | null | undefined;
|
|
211
|
-
links?: {
|
|
212
|
-
label: string;
|
|
213
|
-
url: string;
|
|
214
|
-
}[] | undefined;
|
|
215
|
-
showBlueskyPublicly?: boolean | undefined;
|
|
216
|
-
createdAt?: unknown;
|
|
217
|
-
tier?: "free" | "creator_pro" | undefined;
|
|
218
|
-
bluesky?: {
|
|
219
|
-
handle: string;
|
|
220
|
-
did: string;
|
|
221
|
-
} | undefined;
|
|
222
|
-
stats?: {
|
|
223
|
-
followers?: number | undefined;
|
|
224
|
-
following?: number | undefined;
|
|
225
|
-
prompts?: number | undefined;
|
|
226
|
-
} | undefined;
|
|
227
|
-
badges?: string[] | undefined;
|
|
228
|
-
isVerified?: boolean | undefined;
|
|
229
|
-
phoneNumber?: string | null | undefined;
|
|
230
|
-
email?: string | undefined;
|
|
231
|
-
lastSeenAt?: unknown;
|
|
232
|
-
lastActiveAt?: unknown;
|
|
233
|
-
unreadReplyCount?: number | undefined;
|
|
234
|
-
newReplierCount?: number | undefined;
|
|
235
|
-
settings?: {
|
|
236
|
-
notifications?: boolean | undefined;
|
|
237
|
-
theme?: string | undefined;
|
|
238
|
-
} | undefined;
|
|
239
|
-
}>;
|
|
240
|
-
type ActorView = z.infer<typeof ActorViewSchema>;
|
|
241
|
-
|
|
242
|
-
export { type ActorView, ActorViewSchema, type PublicProfileDto, PublicProfileDtoSchema };
|
package/dist/esm/types/api.js
DELETED