@singi-labs/sifa-sdk 0.18.21 → 0.19.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.
Files changed (43) hide show
  1. package/dist/atproto/index.cjs +8 -0
  2. package/dist/atproto/index.cjs.map +1 -1
  3. package/dist/atproto/index.d.cts +10 -1
  4. package/dist/atproto/index.d.ts +10 -1
  5. package/dist/atproto/index.js +7 -1
  6. package/dist/atproto/index.js.map +1 -1
  7. package/dist/badge/index.cjs.map +1 -1
  8. package/dist/badge/index.js.map +1 -1
  9. package/dist/{feed-BMm9Pkew.d.cts → follow-profile-D1l6pulB.d.cts} +1 -190
  10. package/dist/{feed-BMm9Pkew.d.ts → follow-profile-D1l6pulB.d.ts} +1 -190
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.d.cts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +1 -1
  15. package/dist/{network-map-Dupds9nG.d.cts → network-map-C8VCE7HI.d.cts} +2 -2
  16. package/dist/{network-map-Cwef6yhK.d.ts → network-map-DNE9jp_r.d.ts} +2 -2
  17. package/dist/{org-DgC4pecF.d.cts → org-8RWC0qSH.d.cts} +198 -191
  18. package/dist/{org-DC_71Ojb.d.ts → org-BwK-97S0.d.ts} +198 -191
  19. package/dist/{profile-investment-Bvulg_jG.d.cts → profile-investment-D-nKT3ZK.d.cts} +190 -1
  20. package/dist/{profile-investment-Bvulg_jG.d.ts → profile-investment-D-nKT3ZK.d.ts} +190 -1
  21. package/dist/query/fetchers/index.cjs +9 -9
  22. package/dist/query/fetchers/index.cjs.map +1 -1
  23. package/dist/query/fetchers/index.d.cts +4 -4
  24. package/dist/query/fetchers/index.d.ts +4 -4
  25. package/dist/query/fetchers/index.js +9 -9
  26. package/dist/query/fetchers/index.js.map +1 -1
  27. package/dist/query/hooks/index.cjs +11 -17
  28. package/dist/query/hooks/index.cjs.map +1 -1
  29. package/dist/query/hooks/index.d.cts +4 -4
  30. package/dist/query/hooks/index.d.ts +4 -4
  31. package/dist/query/hooks/index.js +11 -17
  32. package/dist/query/hooks/index.js.map +1 -1
  33. package/dist/query/index.cjs +12 -18
  34. package/dist/query/index.cjs.map +1 -1
  35. package/dist/query/index.d.cts +6 -6
  36. package/dist/query/index.d.ts +6 -6
  37. package/dist/query/index.js +12 -18
  38. package/dist/query/index.js.map +1 -1
  39. package/dist/schemas/index.d.cts +2 -2
  40. package/dist/schemas/index.d.ts +2 -2
  41. package/dist/{use-org-notification-emails-ZmOjvMh0.d.cts → use-org-notification-emails-CeDxRlis.d.cts} +7 -40
  42. package/dist/{use-org-notification-emails-CHU0JhlL.d.ts → use-org-notification-emails-LIoQtBgD.d.ts} +7 -40
  43. package/package.json +1 -1
@@ -216,6 +216,195 @@ declare function makeGraphFollowRecordSchema(followerDid: string): z.ZodObject<{
216
216
  note: z.ZodOptional<z.ZodString>;
217
217
  }, z.core.$strip>;
218
218
 
219
+ /**
220
+ * Feed item from `GET /api/following/feed`. Discriminated on `source`:
221
+ *
222
+ * - `sifa`: a Sifa-native event (e.g. profile update, endorsement).
223
+ * - `atmosphere`: a curated creation event from another ATproto app
224
+ * (Barazo post, etc.). Payload is the hydrated `app.bsky.embed.*#view`
225
+ * shape, NOT the raw record (per memory `sifa-hydrated-view-embed-types`).
226
+ *
227
+ * Both variants share `actor`, `indexedAt`, and `id` (the materialized
228
+ * `feed_events.id` row identifier, used in the cursor).
229
+ */
230
+ declare const FeedActorSchema: z.ZodObject<{
231
+ did: z.ZodString;
232
+ handle: z.ZodString;
233
+ displayName: z.ZodOptional<z.ZodString>;
234
+ avatarUrl: z.ZodOptional<z.ZodString>;
235
+ }, z.core.$strip>;
236
+ type FeedActor = z.infer<typeof FeedActorSchema>;
237
+ /**
238
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
239
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
240
+ * Stream are two distinct surfaces with different data paths (Barazo API
241
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
242
+ * types are no longer consumed. Scheduled for removal in next major bump.
243
+ */
244
+ declare const SifaFeedItemSchema: z.ZodObject<{
245
+ id: z.ZodString;
246
+ actor: z.ZodObject<{
247
+ did: z.ZodString;
248
+ handle: z.ZodString;
249
+ displayName: z.ZodOptional<z.ZodString>;
250
+ avatarUrl: z.ZodOptional<z.ZodString>;
251
+ }, z.core.$strip>;
252
+ indexedAt: z.ZodString;
253
+ eventType: z.ZodString;
254
+ source: z.ZodLiteral<"sifa">;
255
+ appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
256
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
257
+ }, z.core.$strip>;
258
+ /**
259
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
260
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
261
+ * Stream are two distinct surfaces with different data paths (Barazo API
262
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
263
+ * types are no longer consumed. Scheduled for removal in next major bump.
264
+ */
265
+ type SifaFeedItem = z.infer<typeof SifaFeedItemSchema>;
266
+ /**
267
+ * ATmosphere feed item. `payload` is intentionally permissive: it carries
268
+ * a hydrated `app.bsky.embed.*#view` shape that varies by source app. The
269
+ * AppView resolves the hydration; clients render via the existing
270
+ * embed-view union (mirrors `sifa-web/src/components/stream/`).
271
+ *
272
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
273
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
274
+ * Stream are two distinct surfaces with different data paths (Barazo API
275
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
276
+ * types are no longer consumed. Scheduled for removal in next major bump.
277
+ */
278
+ declare const AtmosphereFeedItemSchema: z.ZodObject<{
279
+ id: z.ZodString;
280
+ actor: z.ZodObject<{
281
+ did: z.ZodString;
282
+ handle: z.ZodString;
283
+ displayName: z.ZodOptional<z.ZodString>;
284
+ avatarUrl: z.ZodOptional<z.ZodString>;
285
+ }, z.core.$strip>;
286
+ indexedAt: z.ZodString;
287
+ eventType: z.ZodString;
288
+ source: z.ZodLiteral<"atmosphere">;
289
+ appId: z.ZodString;
290
+ uri: z.ZodOptional<z.ZodString>;
291
+ cid: z.ZodOptional<z.ZodString>;
292
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
293
+ }, z.core.$strip>;
294
+ /**
295
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
296
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
297
+ * Stream are two distinct surfaces with different data paths (Barazo API
298
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
299
+ * types are no longer consumed. Scheduled for removal in next major bump.
300
+ */
301
+ type AtmosphereFeedItem = z.infer<typeof AtmosphereFeedItemSchema>;
302
+ /**
303
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
304
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
305
+ * Stream are two distinct surfaces with different data paths (Barazo API
306
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
307
+ * types are no longer consumed. Scheduled for removal in next major bump.
308
+ */
309
+ declare const FollowFeedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
310
+ id: z.ZodString;
311
+ actor: z.ZodObject<{
312
+ did: z.ZodString;
313
+ handle: z.ZodString;
314
+ displayName: z.ZodOptional<z.ZodString>;
315
+ avatarUrl: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>;
317
+ indexedAt: z.ZodString;
318
+ eventType: z.ZodString;
319
+ source: z.ZodLiteral<"sifa">;
320
+ appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
321
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
322
+ }, z.core.$strip>, z.ZodObject<{
323
+ id: z.ZodString;
324
+ actor: z.ZodObject<{
325
+ did: z.ZodString;
326
+ handle: z.ZodString;
327
+ displayName: z.ZodOptional<z.ZodString>;
328
+ avatarUrl: z.ZodOptional<z.ZodString>;
329
+ }, z.core.$strip>;
330
+ indexedAt: z.ZodString;
331
+ eventType: z.ZodString;
332
+ source: z.ZodLiteral<"atmosphere">;
333
+ appId: z.ZodString;
334
+ uri: z.ZodOptional<z.ZodString>;
335
+ cid: z.ZodOptional<z.ZodString>;
336
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
337
+ }, z.core.$strip>], "source">;
338
+ /**
339
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
340
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
341
+ * Stream are two distinct surfaces with different data paths (Barazo API
342
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
343
+ * types are no longer consumed. Scheduled for removal in next major bump.
344
+ */
345
+ type FollowFeedItem = z.infer<typeof FollowFeedItemSchema>;
346
+ /**
347
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
348
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
349
+ * Stream are two distinct surfaces with different data paths (Barazo API
350
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
351
+ * types are no longer consumed. Scheduled for removal in next major bump.
352
+ */
353
+ declare const FollowFeedPageSchema: z.ZodObject<{
354
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
355
+ id: z.ZodString;
356
+ actor: z.ZodObject<{
357
+ did: z.ZodString;
358
+ handle: z.ZodString;
359
+ displayName: z.ZodOptional<z.ZodString>;
360
+ avatarUrl: z.ZodOptional<z.ZodString>;
361
+ }, z.core.$strip>;
362
+ indexedAt: z.ZodString;
363
+ eventType: z.ZodString;
364
+ source: z.ZodLiteral<"sifa">;
365
+ appId: z.ZodOptional<z.ZodLiteral<"sifa">>;
366
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
367
+ }, z.core.$strip>, z.ZodObject<{
368
+ id: z.ZodString;
369
+ actor: z.ZodObject<{
370
+ did: z.ZodString;
371
+ handle: z.ZodString;
372
+ displayName: z.ZodOptional<z.ZodString>;
373
+ avatarUrl: z.ZodOptional<z.ZodString>;
374
+ }, z.core.$strip>;
375
+ indexedAt: z.ZodString;
376
+ eventType: z.ZodString;
377
+ source: z.ZodLiteral<"atmosphere">;
378
+ appId: z.ZodString;
379
+ uri: z.ZodOptional<z.ZodString>;
380
+ cid: z.ZodOptional<z.ZodString>;
381
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
382
+ }, z.core.$strip>], "source">>;
383
+ cursor: z.ZodNullable<z.ZodString>;
384
+ }, z.core.$strip>;
385
+ /**
386
+ * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).
387
+ * Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere
388
+ * Stream are two distinct surfaces with different data paths (Barazo API
389
+ * for Timeline, live PDS reads + Valkey for Stream). These collapsed feed
390
+ * types are no longer consumed. Scheduled for removal in next major bump.
391
+ */
392
+ type FollowFeedPage = z.infer<typeof FollowFeedPageSchema>;
393
+ /**
394
+ * Composite feed cursor `(indexedAt DESC, source, id)`. Encoded as a
395
+ * URL-safe base64 string so it survives `URLSearchParams` round-trips
396
+ * without further encoding. Decoupling encode/decode from the API call
397
+ * lets consumers persist cursors (e.g. for "jump-back-here" UX) and
398
+ * lets us unit-test the format.
399
+ */
400
+ interface FeedCursor {
401
+ indexedAt: string;
402
+ source: 'sifa' | 'atmosphere';
403
+ id: string;
404
+ }
405
+ declare function encodeFeedCursor(cursor: FeedCursor): string;
406
+ declare function decodeFeedCursor(encoded: string): FeedCursor;
407
+
219
408
  /** Zod schema for `id.sifa.profile.certification` records. */
220
409
  declare const ProfileCertificationRecordSchema: z.ZodObject<{
221
410
  name: z.ZodString;
@@ -608,4 +797,4 @@ declare const ProfileInvestmentRecordSchema: z.ZodObject<{
608
797
  }, z.core.$loose>;
609
798
  type ProfileInvestmentRecord = z.infer<typeof ProfileInvestmentRecordSchema>;
610
799
 
611
- export { PublicationAuthorSchema as $, type ArtifactLink as A, type BlobRef as B, ProfileInvestmentRecordSchema as C, type ProfileInvolvementRecord as D, type EndorsementConfirmationRecord as E, ProfileInvolvementRecordSchema as F, type GraphFollowRecord as G, type ProfileLanguageRecord as H, InvestmentAmountSchema as I, ProfileLanguageRecordSchema as J, type ProfilePositionRecord as K, ProfilePositionRecordSchema as L, ProfilePresentationDeliveryRecordSchema as M, ProfilePresentationRecordSchema as N, type OrgProfileRecord as O, type PresentationDuration as P, type ProfileProjectRecord as Q, ProfileProjectRecordSchema as R, type ProfilePublicationRecord as S, ProfilePublicationRecordSchema as T, type ProfileSelfRecord as U, ProfileSelfRecordSchema as V, type ProfileSkillRecord as W, ProfileSkillRecordSchema as X, type ProfileVolunteeringRecord as Y, ProfileVolunteeringRecordSchema as Z, type PublicationAuthor as _, type ProfilePresentationDeliveryRecord as a, makeGraphFollowRecordSchema as a0, type ProfileInvestmentRecord as a1, type ProfilePresentationRecord as b, ArtifactLinkSchema as c, BlobRefSchema as d, EndorsementConfirmationRecordSchema as e, type EndorsementRecord as f, EndorsementRecordSchema as g, GraphFollowRecordSchema as h, type OrgEmploymentAttestationRecord as i, OrgEmploymentAttestationRecordSchema as j, OrgProfileRecordSchema as k, PROFILE_INVESTMENT_NSID as l, PROFILE_INVOLVEMENT_NSID as m, PresentationDurationSchema as n, type PresentationLink as o, PresentationLinkSchema as p, type ProfileCertificationRecord as q, ProfileCertificationRecordSchema as r, type ProfileCourseRecord as s, ProfileCourseRecordSchema as t, type ProfileEducationRecord as u, ProfileEducationRecordSchema as v, type ProfileExternalAccountRecord as w, ProfileExternalAccountRecordSchema as x, type ProfileHonorRecord as y, ProfileHonorRecordSchema as z };
800
+ export { type ProfilePublicationRecord as $, type ArtifactLink as A, type BlobRef as B, type ProfileCourseRecord as C, ProfileCourseRecordSchema as D, type EndorsementConfirmationRecord as E, type FeedActor as F, type GraphFollowRecord as G, type ProfileEducationRecord as H, InvestmentAmountSchema as I, ProfileEducationRecordSchema as J, type ProfileExternalAccountRecord as K, ProfileExternalAccountRecordSchema as L, type ProfileHonorRecord as M, ProfileHonorRecordSchema as N, type OrgProfileRecord as O, type PresentationDuration as P, ProfileInvestmentRecordSchema as Q, type ProfileInvolvementRecord as R, ProfileInvolvementRecordSchema as S, type ProfileLanguageRecord as T, ProfileLanguageRecordSchema as U, type ProfilePositionRecord as V, ProfilePositionRecordSchema as W, ProfilePresentationDeliveryRecordSchema as X, ProfilePresentationRecordSchema as Y, type ProfileProjectRecord as Z, ProfileProjectRecordSchema as _, type ProfilePresentationDeliveryRecord as a, ProfilePublicationRecordSchema as a0, type ProfileSelfRecord as a1, ProfileSelfRecordSchema as a2, type ProfileSkillRecord as a3, ProfileSkillRecordSchema as a4, type ProfileVolunteeringRecord as a5, ProfileVolunteeringRecordSchema as a6, type PublicationAuthor as a7, PublicationAuthorSchema as a8, type SifaFeedItem as a9, SifaFeedItemSchema as aa, decodeFeedCursor as ab, encodeFeedCursor as ac, makeGraphFollowRecordSchema as ad, type ProfileInvestmentRecord as ae, type ProfilePresentationRecord as b, ArtifactLinkSchema as c, type AtmosphereFeedItem as d, AtmosphereFeedItemSchema as e, BlobRefSchema as f, EndorsementConfirmationRecordSchema as g, type EndorsementRecord as h, EndorsementRecordSchema as i, FeedActorSchema as j, type FeedCursor as k, type FollowFeedItem as l, FollowFeedItemSchema as m, type FollowFeedPage as n, FollowFeedPageSchema as o, GraphFollowRecordSchema as p, type OrgEmploymentAttestationRecord as q, OrgEmploymentAttestationRecordSchema as r, OrgProfileRecordSchema as s, PROFILE_INVESTMENT_NSID as t, PROFILE_INVOLVEMENT_NSID as u, PresentationDurationSchema as v, type PresentationLink as w, PresentationLinkSchema as x, type ProfileCertificationRecord as y, ProfileCertificationRecordSchema as z };
@@ -1057,25 +1057,25 @@ async function getFollowing(config, handle, opts = {}) {
1057
1057
  return { follows: [], cursor: null };
1058
1058
  }
1059
1059
  }
1060
- async function getFollowingFeed(config, opts = {}) {
1060
+ var FOLLOWING_FEED_LXM = "id.sifa.feed.getFollowingFeed";
1061
+ async function fetchFollowingFeed(config, opts = {}) {
1061
1062
  const params = new URLSearchParams();
1062
- if (opts.cursor) params.set("cursor", opts.cursor);
1063
1063
  if (opts.limit) params.set("limit", String(opts.limit));
1064
- if (opts.categories && opts.categories.length > 0) {
1065
- params.set("categories", opts.categories.join(","));
1066
- }
1067
1064
  const qs = params.toString();
1068
1065
  const headers = { ...opts.headers ?? {} };
1069
1066
  if (opts.cookieHeader) headers.cookie = opts.cookieHeader;
1067
+ if (config.getAuthToken) {
1068
+ const token = await config.getAuthToken(FOLLOWING_FEED_LXM);
1069
+ if (token) headers.Authorization = `Bearer ${token}`;
1070
+ }
1070
1071
  try {
1071
- const res = await apiFetch(
1072
+ return await apiFetch(
1072
1073
  config,
1073
1074
  `/api/following/feed${qs ? `?${qs}` : ""}`,
1074
1075
  { credentials: "include", cache: "no-store", ...opts, headers }
1075
1076
  );
1076
- return { items: res.items ?? [], cursor: res.cursor ?? null };
1077
1077
  } catch {
1078
- return { items: [], cursor: null };
1078
+ return null;
1079
1079
  }
1080
1080
  }
1081
1081
 
@@ -2046,6 +2046,7 @@ exports.fetchEntitySearch = fetchEntitySearch;
2046
2046
  exports.fetchExternalAccounts = fetchExternalAccounts;
2047
2047
  exports.fetchFeaturedProfile = fetchFeaturedProfile;
2048
2048
  exports.fetchFollowing = fetchFollowing;
2049
+ exports.fetchFollowingFeed = fetchFollowingFeed;
2049
2050
  exports.fetchGetProfileView = fetchGetProfileView;
2050
2051
  exports.fetchGivenConfirmations = fetchGivenConfirmations;
2051
2052
  exports.fetchHeatmapData = fetchHeatmapData;
@@ -2083,7 +2084,6 @@ exports.getAdminReviewQueues = getAdminReviewQueues;
2083
2084
  exports.getBlueskySuggestions = getBlueskySuggestions;
2084
2085
  exports.getFollowers = getFollowers;
2085
2086
  exports.getFollowing = getFollowing;
2086
- exports.getFollowingFeed = getFollowingFeed;
2087
2087
  exports.getMutuals = getMutuals;
2088
2088
  exports.hideActivityItem = hideActivityItem;
2089
2089
  exports.hideKeytraceClaim = hideKeytraceClaim;