@singi-labs/sifa-sdk 0.9.18 → 0.9.20
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/feed-DHTy7fUN.d.cts +254 -0
- package/dist/feed-DHTy7fUN.d.ts +254 -0
- package/dist/{index-DCpMh2Ny.d.cts → index-DYUYJxOs.d.cts} +1 -1
- package/dist/{index-DCpMh2Ny.d.ts → index-DYUYJxOs.d.ts} +1 -1
- package/dist/index.cjs +114 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +103 -4
- package/dist/index.js.map +1 -1
- package/dist/keys-D-vNPzXx.d.ts +1085 -0
- package/dist/keys-DRD79nDE.d.cts +1085 -0
- package/dist/query/fetchers/index.cjs +155 -1
- package/dist/query/fetchers/index.cjs.map +1 -1
- package/dist/query/fetchers/index.d.cts +6 -933
- package/dist/query/fetchers/index.d.ts +6 -933
- package/dist/query/fetchers/index.js +146 -2
- package/dist/query/fetchers/index.js.map +1 -1
- package/dist/query/hooks/index.cjs +2268 -0
- package/dist/query/hooks/index.cjs.map +1 -0
- package/dist/query/hooks/index.d.cts +479 -0
- package/dist/query/hooks/index.d.ts +479 -0
- package/dist/query/hooks/index.js +2178 -0
- package/dist/query/hooks/index.js.map +1 -0
- package/dist/query/index.cjs +340 -1
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +9 -352
- package/dist/query/index.d.ts +9 -352
- package/dist/query/index.js +322 -3
- package/dist/query/index.js.map +1 -1
- package/dist/schemas/index.cjs +102 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +28 -2
- package/dist/schemas/index.d.ts +28 -2
- package/dist/schemas/index.js +91 -2
- package/dist/schemas/index.js.map +1 -1
- package/package.json +14 -4
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Profile row shared across `/api/following`, `/api/profile/:handleOrDid/mutuals`,
|
|
5
|
+
* and `/api/me/bluesky-suggestions`. Matches the existing `FollowProfile` TS
|
|
6
|
+
* interface byte-for-byte but adds runtime validation for the SDK's pagination
|
|
7
|
+
* helpers and the upcoming `sifa-app` consumer (where we can't trust the wire).
|
|
8
|
+
*
|
|
9
|
+
* Per `sifa-api#674` PR body: mutuals + bluesky-suggestions reuse this shape
|
|
10
|
+
* exactly, so a single Zod schema covers all three endpoints.
|
|
11
|
+
*/
|
|
12
|
+
declare const FollowProfileSchema: z.ZodObject<{
|
|
13
|
+
did: z.ZodString;
|
|
14
|
+
handle: z.ZodString;
|
|
15
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
17
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
18
|
+
source: z.ZodString;
|
|
19
|
+
claimed: z.ZodBoolean;
|
|
20
|
+
followedAt: z.ZodString;
|
|
21
|
+
blueskyVerified: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
blueskyVerifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type FollowProfileItem = z.infer<typeof FollowProfileSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* Cursor-paginated page of {@link FollowProfileSchema} rows. Used by mutuals
|
|
27
|
+
* + bluesky-suggestions. The legacy `/api/following` endpoint uses a different
|
|
28
|
+
* wrapper key (`follows` instead of `items`) and is intentionally NOT covered
|
|
29
|
+
* by this schema.
|
|
30
|
+
*/
|
|
31
|
+
declare const FollowProfilePageSchema: z.ZodObject<{
|
|
32
|
+
items: z.ZodArray<z.ZodObject<{
|
|
33
|
+
did: z.ZodString;
|
|
34
|
+
handle: z.ZodString;
|
|
35
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
36
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
37
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
38
|
+
source: z.ZodString;
|
|
39
|
+
claimed: z.ZodBoolean;
|
|
40
|
+
followedAt: z.ZodString;
|
|
41
|
+
blueskyVerified: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
blueskyVerifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
type FollowProfilePage = z.infer<typeof FollowProfilePageSchema>;
|
|
47
|
+
/**
|
|
48
|
+
* Per-flag allowlist row returned by `GET /api/admin/feature-allowlists/:flag`.
|
|
49
|
+
* Mirrors the `feature_allowlists` table; `note` is optional free-form text.
|
|
50
|
+
*/
|
|
51
|
+
declare const FeatureAllowlistEntrySchema: z.ZodObject<{
|
|
52
|
+
did: z.ZodString;
|
|
53
|
+
addedAt: z.ZodString;
|
|
54
|
+
note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
type FeatureAllowlistEntry = z.infer<typeof FeatureAllowlistEntrySchema>;
|
|
57
|
+
/**
|
|
58
|
+
* Known feature flags accepted by the admin allowlist endpoints. Mirrors the
|
|
59
|
+
* server-side `FEATURE_FLAGS` const in `sifa-api`. Kept as a `const` tuple so
|
|
60
|
+
* consumers can `as const`-narrow when building UIs.
|
|
61
|
+
*/
|
|
62
|
+
declare const FEATURE_FLAGS: readonly ["FEED_V5_ENABLED"];
|
|
63
|
+
type FeatureFlag = (typeof FEATURE_FLAGS)[number];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Feed item from `GET /api/following/feed`. Discriminated on `source`:
|
|
67
|
+
*
|
|
68
|
+
* - `sifa`: a Sifa-native event (e.g. profile update, endorsement).
|
|
69
|
+
* - `atmosphere`: a curated creation event from another ATproto app
|
|
70
|
+
* (Barazo post, etc.). Payload is the hydrated `app.bsky.embed.*#view`
|
|
71
|
+
* shape, NOT the raw record (per memory `sifa-hydrated-view-embed-types`).
|
|
72
|
+
*
|
|
73
|
+
* Both variants share `actor`, `indexedAt`, and `id` (the materialized
|
|
74
|
+
* `feed_events.id` row identifier, used in the cursor).
|
|
75
|
+
*/
|
|
76
|
+
declare const FeedActorSchema: z.ZodObject<{
|
|
77
|
+
did: z.ZodString;
|
|
78
|
+
handle: z.ZodString;
|
|
79
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
80
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
type FeedActor = z.infer<typeof FeedActorSchema>;
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
85
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
86
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
87
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
88
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
89
|
+
*/
|
|
90
|
+
declare const SifaFeedItemSchema: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
actor: z.ZodObject<{
|
|
93
|
+
did: z.ZodString;
|
|
94
|
+
handle: z.ZodString;
|
|
95
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
96
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
indexedAt: z.ZodString;
|
|
99
|
+
eventType: z.ZodString;
|
|
100
|
+
source: z.ZodLiteral<"sifa">;
|
|
101
|
+
appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
|
|
102
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
106
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
107
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
108
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
109
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
110
|
+
*/
|
|
111
|
+
type SifaFeedItem = z.infer<typeof SifaFeedItemSchema>;
|
|
112
|
+
/**
|
|
113
|
+
* ATmosphere feed item. `payload` is intentionally permissive: it carries
|
|
114
|
+
* a hydrated `app.bsky.embed.*#view` shape that varies by source app. The
|
|
115
|
+
* AppView resolves the hydration; clients render via the existing
|
|
116
|
+
* embed-view union (mirrors `sifa-web/src/components/stream/`).
|
|
117
|
+
*
|
|
118
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
119
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
120
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
121
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
122
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
123
|
+
*/
|
|
124
|
+
declare const AtmosphereFeedItemSchema: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
actor: z.ZodObject<{
|
|
127
|
+
did: z.ZodString;
|
|
128
|
+
handle: z.ZodString;
|
|
129
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
130
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
indexedAt: z.ZodString;
|
|
133
|
+
eventType: z.ZodString;
|
|
134
|
+
source: z.ZodLiteral<"atmosphere">;
|
|
135
|
+
appId: z.ZodString;
|
|
136
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
137
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
138
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
142
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
143
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
144
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
145
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
146
|
+
*/
|
|
147
|
+
type AtmosphereFeedItem = z.infer<typeof AtmosphereFeedItemSchema>;
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
150
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
151
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
152
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
153
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
154
|
+
*/
|
|
155
|
+
declare const FollowFeedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
actor: z.ZodObject<{
|
|
158
|
+
did: z.ZodString;
|
|
159
|
+
handle: z.ZodString;
|
|
160
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
161
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
indexedAt: z.ZodString;
|
|
164
|
+
eventType: z.ZodString;
|
|
165
|
+
source: z.ZodLiteral<"sifa">;
|
|
166
|
+
appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
|
|
167
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
actor: z.ZodObject<{
|
|
171
|
+
did: z.ZodString;
|
|
172
|
+
handle: z.ZodString;
|
|
173
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
174
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
indexedAt: z.ZodString;
|
|
177
|
+
eventType: z.ZodString;
|
|
178
|
+
source: z.ZodLiteral<"atmosphere">;
|
|
179
|
+
appId: z.ZodString;
|
|
180
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
181
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
182
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
183
|
+
}, z.core.$strip>], "source">;
|
|
184
|
+
/**
|
|
185
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
186
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
187
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
188
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
189
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
190
|
+
*/
|
|
191
|
+
type FollowFeedItem = z.infer<typeof FollowFeedItemSchema>;
|
|
192
|
+
/**
|
|
193
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
194
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
195
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
196
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
197
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
198
|
+
*/
|
|
199
|
+
declare const FollowFeedPageSchema: z.ZodObject<{
|
|
200
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
actor: z.ZodObject<{
|
|
203
|
+
did: z.ZodString;
|
|
204
|
+
handle: z.ZodString;
|
|
205
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
206
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
indexedAt: z.ZodString;
|
|
209
|
+
eventType: z.ZodString;
|
|
210
|
+
source: z.ZodLiteral<"sifa">;
|
|
211
|
+
appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
|
|
212
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
id: z.ZodString;
|
|
215
|
+
actor: z.ZodObject<{
|
|
216
|
+
did: z.ZodString;
|
|
217
|
+
handle: z.ZodString;
|
|
218
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
219
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
indexedAt: z.ZodString;
|
|
222
|
+
eventType: z.ZodString;
|
|
223
|
+
source: z.ZodLiteral<"atmosphere">;
|
|
224
|
+
appId: z.ZodString;
|
|
225
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
226
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
227
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
228
|
+
}, z.core.$strip>], "source">>;
|
|
229
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
/**
|
|
232
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
233
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
234
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
235
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
236
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
237
|
+
*/
|
|
238
|
+
type FollowFeedPage = z.infer<typeof FollowFeedPageSchema>;
|
|
239
|
+
/**
|
|
240
|
+
* Composite feed cursor `(indexedAt DESC, source, id)`. Encoded as a
|
|
241
|
+
* URL-safe base64 string so it survives `URLSearchParams` round-trips
|
|
242
|
+
* without further encoding. Decoupling encode/decode from the API call
|
|
243
|
+
* lets consumers persist cursors (e.g. for "jump-back-here" UX) and
|
|
244
|
+
* lets us unit-test the format.
|
|
245
|
+
*/
|
|
246
|
+
interface FeedCursor {
|
|
247
|
+
indexedAt: string;
|
|
248
|
+
source: 'sifa' | 'atmosphere';
|
|
249
|
+
id: string;
|
|
250
|
+
}
|
|
251
|
+
declare function encodeFeedCursor(cursor: FeedCursor): string;
|
|
252
|
+
declare function decodeFeedCursor(encoded: string): FeedCursor;
|
|
253
|
+
|
|
254
|
+
export { type AtmosphereFeedItem as A, type FollowFeedPage as F, type SifaFeedItem as S, type FollowProfileItem as a, type FeatureAllowlistEntry as b, type FeatureFlag as c, AtmosphereFeedItemSchema as d, FEATURE_FLAGS as e, FeatureAllowlistEntrySchema as f, type FeedActor as g, FeedActorSchema as h, type FeedCursor as i, type FollowFeedItem as j, FollowFeedItemSchema as k, FollowFeedPageSchema as l, type FollowProfilePage as m, FollowProfilePageSchema as n, FollowProfileSchema as o, SifaFeedItemSchema as p, decodeFeedCursor as q, encodeFeedCursor as r };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Profile row shared across `/api/following`, `/api/profile/:handleOrDid/mutuals`,
|
|
5
|
+
* and `/api/me/bluesky-suggestions`. Matches the existing `FollowProfile` TS
|
|
6
|
+
* interface byte-for-byte but adds runtime validation for the SDK's pagination
|
|
7
|
+
* helpers and the upcoming `sifa-app` consumer (where we can't trust the wire).
|
|
8
|
+
*
|
|
9
|
+
* Per `sifa-api#674` PR body: mutuals + bluesky-suggestions reuse this shape
|
|
10
|
+
* exactly, so a single Zod schema covers all three endpoints.
|
|
11
|
+
*/
|
|
12
|
+
declare const FollowProfileSchema: z.ZodObject<{
|
|
13
|
+
did: z.ZodString;
|
|
14
|
+
handle: z.ZodString;
|
|
15
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
17
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
18
|
+
source: z.ZodString;
|
|
19
|
+
claimed: z.ZodBoolean;
|
|
20
|
+
followedAt: z.ZodString;
|
|
21
|
+
blueskyVerified: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
blueskyVerifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type FollowProfileItem = z.infer<typeof FollowProfileSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* Cursor-paginated page of {@link FollowProfileSchema} rows. Used by mutuals
|
|
27
|
+
* + bluesky-suggestions. The legacy `/api/following` endpoint uses a different
|
|
28
|
+
* wrapper key (`follows` instead of `items`) and is intentionally NOT covered
|
|
29
|
+
* by this schema.
|
|
30
|
+
*/
|
|
31
|
+
declare const FollowProfilePageSchema: z.ZodObject<{
|
|
32
|
+
items: z.ZodArray<z.ZodObject<{
|
|
33
|
+
did: z.ZodString;
|
|
34
|
+
handle: z.ZodString;
|
|
35
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
36
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
37
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
38
|
+
source: z.ZodString;
|
|
39
|
+
claimed: z.ZodBoolean;
|
|
40
|
+
followedAt: z.ZodString;
|
|
41
|
+
blueskyVerified: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
blueskyVerifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
type FollowProfilePage = z.infer<typeof FollowProfilePageSchema>;
|
|
47
|
+
/**
|
|
48
|
+
* Per-flag allowlist row returned by `GET /api/admin/feature-allowlists/:flag`.
|
|
49
|
+
* Mirrors the `feature_allowlists` table; `note` is optional free-form text.
|
|
50
|
+
*/
|
|
51
|
+
declare const FeatureAllowlistEntrySchema: z.ZodObject<{
|
|
52
|
+
did: z.ZodString;
|
|
53
|
+
addedAt: z.ZodString;
|
|
54
|
+
note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
type FeatureAllowlistEntry = z.infer<typeof FeatureAllowlistEntrySchema>;
|
|
57
|
+
/**
|
|
58
|
+
* Known feature flags accepted by the admin allowlist endpoints. Mirrors the
|
|
59
|
+
* server-side `FEATURE_FLAGS` const in `sifa-api`. Kept as a `const` tuple so
|
|
60
|
+
* consumers can `as const`-narrow when building UIs.
|
|
61
|
+
*/
|
|
62
|
+
declare const FEATURE_FLAGS: readonly ["FEED_V5_ENABLED"];
|
|
63
|
+
type FeatureFlag = (typeof FEATURE_FLAGS)[number];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Feed item from `GET /api/following/feed`. Discriminated on `source`:
|
|
67
|
+
*
|
|
68
|
+
* - `sifa`: a Sifa-native event (e.g. profile update, endorsement).
|
|
69
|
+
* - `atmosphere`: a curated creation event from another ATproto app
|
|
70
|
+
* (Barazo post, etc.). Payload is the hydrated `app.bsky.embed.*#view`
|
|
71
|
+
* shape, NOT the raw record (per memory `sifa-hydrated-view-embed-types`).
|
|
72
|
+
*
|
|
73
|
+
* Both variants share `actor`, `indexedAt`, and `id` (the materialized
|
|
74
|
+
* `feed_events.id` row identifier, used in the cursor).
|
|
75
|
+
*/
|
|
76
|
+
declare const FeedActorSchema: z.ZodObject<{
|
|
77
|
+
did: z.ZodString;
|
|
78
|
+
handle: z.ZodString;
|
|
79
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
80
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
type FeedActor = z.infer<typeof FeedActorSchema>;
|
|
83
|
+
/**
|
|
84
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
85
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
86
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
87
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
88
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
89
|
+
*/
|
|
90
|
+
declare const SifaFeedItemSchema: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
actor: z.ZodObject<{
|
|
93
|
+
did: z.ZodString;
|
|
94
|
+
handle: z.ZodString;
|
|
95
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
96
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
indexedAt: z.ZodString;
|
|
99
|
+
eventType: z.ZodString;
|
|
100
|
+
source: z.ZodLiteral<"sifa">;
|
|
101
|
+
appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
|
|
102
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
106
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
107
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
108
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
109
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
110
|
+
*/
|
|
111
|
+
type SifaFeedItem = z.infer<typeof SifaFeedItemSchema>;
|
|
112
|
+
/**
|
|
113
|
+
* ATmosphere feed item. `payload` is intentionally permissive: it carries
|
|
114
|
+
* a hydrated `app.bsky.embed.*#view` shape that varies by source app. The
|
|
115
|
+
* AppView resolves the hydration; clients render via the existing
|
|
116
|
+
* embed-view union (mirrors `sifa-web/src/components/stream/`).
|
|
117
|
+
*
|
|
118
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
119
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
120
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
121
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
122
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
123
|
+
*/
|
|
124
|
+
declare const AtmosphereFeedItemSchema: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
actor: z.ZodObject<{
|
|
127
|
+
did: z.ZodString;
|
|
128
|
+
handle: z.ZodString;
|
|
129
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
130
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
indexedAt: z.ZodString;
|
|
133
|
+
eventType: z.ZodString;
|
|
134
|
+
source: z.ZodLiteral<"atmosphere">;
|
|
135
|
+
appId: z.ZodString;
|
|
136
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
137
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
138
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
142
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
143
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
144
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
145
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
146
|
+
*/
|
|
147
|
+
type AtmosphereFeedItem = z.infer<typeof AtmosphereFeedItemSchema>;
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
150
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
151
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
152
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
153
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
154
|
+
*/
|
|
155
|
+
declare const FollowFeedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
actor: z.ZodObject<{
|
|
158
|
+
did: z.ZodString;
|
|
159
|
+
handle: z.ZodString;
|
|
160
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
161
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
indexedAt: z.ZodString;
|
|
164
|
+
eventType: z.ZodString;
|
|
165
|
+
source: z.ZodLiteral<"sifa">;
|
|
166
|
+
appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
|
|
167
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
actor: z.ZodObject<{
|
|
171
|
+
did: z.ZodString;
|
|
172
|
+
handle: z.ZodString;
|
|
173
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
174
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
indexedAt: z.ZodString;
|
|
177
|
+
eventType: z.ZodString;
|
|
178
|
+
source: z.ZodLiteral<"atmosphere">;
|
|
179
|
+
appId: z.ZodString;
|
|
180
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
181
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
182
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
183
|
+
}, z.core.$strip>], "source">;
|
|
184
|
+
/**
|
|
185
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
186
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
187
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
188
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
189
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
190
|
+
*/
|
|
191
|
+
type FollowFeedItem = z.infer<typeof FollowFeedItemSchema>;
|
|
192
|
+
/**
|
|
193
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
194
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
195
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
196
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
197
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
198
|
+
*/
|
|
199
|
+
declare const FollowFeedPageSchema: z.ZodObject<{
|
|
200
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
actor: z.ZodObject<{
|
|
203
|
+
did: z.ZodString;
|
|
204
|
+
handle: z.ZodString;
|
|
205
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
206
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
indexedAt: z.ZodString;
|
|
209
|
+
eventType: z.ZodString;
|
|
210
|
+
source: z.ZodLiteral<"sifa">;
|
|
211
|
+
appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
|
|
212
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
id: z.ZodString;
|
|
215
|
+
actor: z.ZodObject<{
|
|
216
|
+
did: z.ZodString;
|
|
217
|
+
handle: z.ZodString;
|
|
218
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
219
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
indexedAt: z.ZodString;
|
|
222
|
+
eventType: z.ZodString;
|
|
223
|
+
source: z.ZodLiteral<"atmosphere">;
|
|
224
|
+
appId: z.ZodString;
|
|
225
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
226
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
227
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
228
|
+
}, z.core.$strip>], "source">>;
|
|
229
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
/**
|
|
232
|
+
* @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
|
|
233
|
+
* Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
|
|
234
|
+
* Stream are two distinct surfaces with different data paths (Barazo API
|
|
235
|
+
* for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
|
|
236
|
+
* types are no longer consumed. Scheduled for removal in next major bump.
|
|
237
|
+
*/
|
|
238
|
+
type FollowFeedPage = z.infer<typeof FollowFeedPageSchema>;
|
|
239
|
+
/**
|
|
240
|
+
* Composite feed cursor `(indexedAt DESC, source, id)`. Encoded as a
|
|
241
|
+
* URL-safe base64 string so it survives `URLSearchParams` round-trips
|
|
242
|
+
* without further encoding. Decoupling encode/decode from the API call
|
|
243
|
+
* lets consumers persist cursors (e.g. for "jump-back-here" UX) and
|
|
244
|
+
* lets us unit-test the format.
|
|
245
|
+
*/
|
|
246
|
+
interface FeedCursor {
|
|
247
|
+
indexedAt: string;
|
|
248
|
+
source: 'sifa' | 'atmosphere';
|
|
249
|
+
id: string;
|
|
250
|
+
}
|
|
251
|
+
declare function encodeFeedCursor(cursor: FeedCursor): string;
|
|
252
|
+
declare function decodeFeedCursor(encoded: string): FeedCursor;
|
|
253
|
+
|
|
254
|
+
export { type AtmosphereFeedItem as A, type FollowFeedPage as F, type SifaFeedItem as S, type FollowProfileItem as a, type FeatureAllowlistEntry as b, type FeatureFlag as c, AtmosphereFeedItemSchema as d, FEATURE_FLAGS as e, FeatureAllowlistEntrySchema as f, type FeedActor as g, FeedActorSchema as h, type FeedCursor as i, type FollowFeedItem as j, FollowFeedItemSchema as k, FollowFeedPageSchema as l, type FollowProfilePage as m, FollowProfilePageSchema as n, FollowProfileSchema as o, SifaFeedItemSchema as p, decodeFeedCursor as q, encodeFeedCursor as r };
|
|
@@ -318,4 +318,4 @@ interface Profile {
|
|
|
318
318
|
externalAccounts?: ExternalAccount[];
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
export type { ActiveApp as A,
|
|
321
|
+
export type { ActiveApp as A, ExternalAccount as E, FeedItem as F, LocationValue as L, ProfileSkill as P, SkillSuggestion as S, TrustStat as T, VerifiedAccount as V, PdsProviderInfo as a, Profile as b, Endorsement as c, EndorsementData as d, ExternalAccountKeytraceClaim as e, LanguageProficiency as f, ProfileCertification as g, ProfileCourse as h, ProfileEducation as i, ProfileHonor as j, ProfileIndustry as k, ProfileLanguage as l, ProfileLocation as m, ProfileOverrideSource as n, ProfilePosition as o, ProfileProject as p, ProfilePublication as q, ProfileVolunteering as r, PublicationContributor as s, SkillRef as t };
|
|
@@ -318,4 +318,4 @@ interface Profile {
|
|
|
318
318
|
externalAccounts?: ExternalAccount[];
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
export type { ActiveApp as A,
|
|
321
|
+
export type { ActiveApp as A, ExternalAccount as E, FeedItem as F, LocationValue as L, ProfileSkill as P, SkillSuggestion as S, TrustStat as T, VerifiedAccount as V, PdsProviderInfo as a, Profile as b, Endorsement as c, EndorsementData as d, ExternalAccountKeytraceClaim as e, LanguageProficiency as f, ProfileCertification as g, ProfileCourse as h, ProfileEducation as i, ProfileHonor as j, ProfileIndustry as k, ProfileLanguage as l, ProfileLocation as m, ProfileOverrideSource as n, ProfilePosition as o, ProfileProject as p, ProfilePublication as q, ProfileVolunteering as r, PublicationContributor as s, SkillRef as t };
|