@recursiv/sdk 0.7.49 → 0.7.51

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.
@@ -248,6 +248,8 @@ export interface HostedNostrIdentityProof {
248
248
  export type NativeNostrPrepareInput = {
249
249
  action: 'publish';
250
250
  content: string;
251
+ /** Your own post in this app (sdk.posts) that this note copies, so deleting it can offer this copy. */
252
+ crossPostOf?: string;
251
253
  } | {
252
254
  action: 'reply';
253
255
  content: string;
@@ -292,12 +294,27 @@ export interface SocialSourceRef {
292
294
  kind: 'actor' | 'post';
293
295
  nativeId: string;
294
296
  }
297
+ /**
298
+ * How a controlled source last looked when Minds observed it on its network: the latest public
299
+ * observation, not a copy saved with the control. Null when it was never observed or has aged out.
300
+ */
301
+ export interface SocialSourceControlDisplay {
302
+ handle: string | null;
303
+ displayName: string | null;
304
+ /** Null when the source, or a hidden post's author, is under an active app moderation action. */
305
+ avatarUrl: string | null;
306
+ /** A hidden post's text, at most 140 characters; null for accounts, deleted posts, and moderated posts or authors. */
307
+ excerpt: string | null;
308
+ observedAt: string;
309
+ }
295
310
  export interface SocialSourceControl {
296
311
  id: string;
297
312
  source: SocialSourceRef;
298
313
  control: 'block' | 'mute' | 'hide';
299
314
  scope: 'minds';
300
315
  createdAt: string;
316
+ /** Present on servers that label controls; null when the source has no recent observation. */
317
+ display?: SocialSourceControlDisplay | null;
301
318
  }
302
319
  export type SocialSourceControlChange = Omit<SocialSourceControl, 'id' | 'createdAt'> & {
303
320
  enabled: boolean;
@@ -377,6 +394,32 @@ export interface NativeFollowState extends NativeFollowReceipt {
377
394
  /** An earlier connection or another target profile has an unresolved attempt. Read again to reconcile; do not prepare a new write. */
378
395
  pendingActionBlocked: boolean;
379
396
  }
397
+ /** One connected account on the source's network, as the account lists describe it. */
398
+ export interface NativeFollowAccount {
399
+ id: string;
400
+ protocol: SocialSourceRef['protocol'];
401
+ nativeId: string;
402
+ handle: string;
403
+ serverUrl: string;
404
+ /** Includes `follow`/`unfollow` only when this account may follow here; otherwise offer a reconnect. */
405
+ capabilities: string[];
406
+ }
407
+ /** Every connected account's relationship with one source, from one read. */
408
+ export interface NativeFollowStates {
409
+ protocol: SocialSourceRef['protocol'];
410
+ nativeId: string;
411
+ /** False when native follows are off for this app; accounts are still listed, and no state is read. */
412
+ enabled: boolean;
413
+ accounts: Array<{
414
+ account: NativeFollowAccount;
415
+ /** Null when the account cannot follow, follows are off, or its read failed (see `error`). */
416
+ state: NativeFollowState | null;
417
+ error: {
418
+ code: string;
419
+ message: string;
420
+ } | null;
421
+ }>;
422
+ }
380
423
  export interface NativeFollowReview {
381
424
  id: string;
382
425
  clientMutationId: string;
@@ -624,6 +667,12 @@ export interface NativePostPrepareInput {
624
667
  protocol: 'bluesky';
625
668
  nativeId: string;
626
669
  };
670
+ /**
671
+ * Your own post in this app (sdk.posts, same app) that this publication copies. The server links
672
+ * them in the same write, so `nativePostHistory({ crossPostOf })` can list every copy when the post
673
+ * is deleted. Any other post answers not_found.
674
+ */
675
+ crossPostOf?: string;
627
676
  }
628
677
  export interface NativePostBatch {
629
678
  id: string;
@@ -643,14 +692,42 @@ export interface NativePostBatch {
643
692
  };
644
693
  }>;
645
694
  }
695
+ export interface NativeDelegatedPostHistoryItem {
696
+ id: string;
697
+ createdAt: string;
698
+ text: string;
699
+ textTruncated: boolean;
700
+ deliveries: Array<Omit<NativePostBatch['deliveries'][number], 'text' | 'wireText' | 'maxCharacters'>>;
701
+ /** The post in this app this publication copies, when it was prepared with crossPostOf. */
702
+ crossPostOf?: string;
703
+ }
704
+ /**
705
+ * An original Nostr note the member signed in this app. Reopen it with
706
+ * `getNativeNostrPost(identityId, eventId)` and delete it with the Nostr signing flow
707
+ * (`prepareNativeNostr(identityId, { action: 'delete', postId: eventId })`), not the
708
+ * delegated removal methods. `receipt.state` becomes 'deletion_requested' once a
709
+ * deletion request is confirmed on the relay.
710
+ */
711
+ export interface NativeNostrPostHistoryItem {
712
+ type: 'nostr';
713
+ id: string;
714
+ createdAt: string;
715
+ text: string;
716
+ textTruncated: boolean;
717
+ identityId: string;
718
+ pubkey: string;
719
+ relay: string;
720
+ eventId: string;
721
+ action: 'publish';
722
+ receipt: NativeNostrReceipt;
723
+ checkedAt: string | null;
724
+ lastReadBack: NativeNostrReceipt['readBack'];
725
+ /** The post in this app this note copies, when it was prepared with crossPostOf. */
726
+ crossPostOf?: string;
727
+ }
646
728
  export interface NativePostHistory {
647
- items: Array<{
648
- id: string;
649
- createdAt: string;
650
- text: string;
651
- textTruncated: boolean;
652
- deliveries: Array<Omit<NativePostBatch['deliveries'][number], 'text' | 'wireText' | 'maxCharacters'>>;
653
- }>;
729
+ /** Delegated Bluesky/ActivityPub posts and client-signed Nostr originals, newest first. */
730
+ items: Array<NativeDelegatedPostHistoryItem | NativeNostrPostHistoryItem>;
654
731
  cursor: string | null;
655
732
  }
656
733
  export interface NativeSocialCallbackInput {
@@ -712,6 +789,8 @@ export interface NativeNostrPrepared {
712
789
  relay: string;
713
790
  expiresAt: string;
714
791
  postId?: string;
792
+ /** The post in this app this note will be linked to on submit. */
793
+ crossPostOf?: string;
715
794
  parent?: {
716
795
  protocol: 'nostr';
717
796
  nativeId: string;
@@ -764,6 +843,21 @@ export interface NativeNostrReceipt {
764
843
  readBack: 'found' | 'absent' | 'unavailable';
765
844
  reason?: 'blocked' | 'rate_limited' | 'restricted' | 'invalid' | 'relay_error';
766
845
  }
846
+ /**
847
+ * Ask the app's own PDS to issue a Bluesky account. Only the label is sent: the
848
+ * app decides the domain (`alice` becomes `alice.pds.minds.com` on a test lane,
849
+ * `alice.minds.com` once handles move).
850
+ */
851
+ export interface CreateHostedIdentityInput {
852
+ protocol: 'atproto';
853
+ /** One lowercase label of 3 to 18 characters (the PDS's own bounds): letters, digits and inner hyphens. */
854
+ handle: string;
855
+ email: string;
856
+ }
857
+ /** The new identity, with the member's password: returned this once and stored nowhere. */
858
+ export interface CreatedHostedProtocolIdentity extends HostedProtocolIdentity {
859
+ password: string;
860
+ }
767
861
  export type ConnectHostedIdentityInput = {
768
862
  protocol: 'atproto';
769
863
  identifier: string; /** Prefer a native app password. Used once, never stored. */
@@ -940,6 +1034,16 @@ export interface SocialTrend {
940
1034
  /** A real image-bearing post from this topic, filtered by current source controls. */
941
1035
  preview?: SocialPost;
942
1036
  }
1037
+ /**
1038
+ * Present only on category pages of a feed the app's open-network source index serves (ActivityPub
1039
+ * and Nostr): the provider's posts come first, then posts the index judged into the category. The
1040
+ * page's `cursor` (it starts with `idx:`) carries both positions; pass it back unchanged like any other cursor.
1041
+ */
1042
+ export interface SocialTrendSourceIndex {
1043
+ /** Posts on this page that came from the index rather than the provider's ranking. */
1044
+ served: number;
1045
+ coverage: 'source_index';
1046
+ }
943
1047
  export type SocialTrends = SocialTrendProvenance & ({
944
1048
  kind: 'topics';
945
1049
  items: SocialTrend[];
@@ -948,6 +1052,10 @@ export type SocialTrends = SocialTrendProvenance & ({
948
1052
  kind: 'posts';
949
1053
  items: SocialPost[];
950
1054
  cursor: string | null;
1055
+ sourceIndex?: SocialTrendSourceIndex;
1056
+ safetyFilter?: {
1057
+ withheld: number;
1058
+ };
951
1059
  });
952
1060
  export interface SocialTrendFeed extends SocialTrendProvenance {
953
1061
  trend: SocialTrend;
@@ -1057,6 +1165,18 @@ export interface SocialRadarPosts {
1057
1165
  builtAt: string | null;
1058
1166
  items: SocialPost[];
1059
1167
  }
1168
+ /**
1169
+ * One radar story by id, with its social member posts.
1170
+ * `live`: on the current radar (`cluster` and `items` present). `aged_out`: on one of the last six
1171
+ * radars but not this one. `unknown`: not seen in that window (never existed, or aged out long ago).
1172
+ */
1173
+ export interface SocialRadarStory {
1174
+ id: string;
1175
+ builtAt: string | null;
1176
+ status: 'live' | 'aged_out' | 'unknown';
1177
+ cluster: SocialRadarCluster | null;
1178
+ items: SocialPost[];
1179
+ }
1060
1180
  /** Read options for callers that hold their own deadline, such as a discovery page. */
1061
1181
  export interface SocialReadOptions {
1062
1182
  retry?: boolean;
@@ -1123,6 +1243,18 @@ export declare class ProtocolsResource {
1123
1243
  post: string;
1124
1244
  readRef?: string;
1125
1245
  }): Promise<SingleResponse<SocialConversation>>;
1246
+ /** Public, app-moderated actor identity without member subscription/account state. */
1247
+ getSharedProfile(projectId: string, params: {
1248
+ protocol: string;
1249
+ actor: string;
1250
+ }): Promise<SingleResponse<Omit<SocialProfile, 'subscription'>>>;
1251
+ /** Bounded original public posts by one actor, with current app moderation. */
1252
+ getSharedAuthorFeed(projectId: string, params: {
1253
+ protocol: string;
1254
+ actor: string;
1255
+ limit?: number;
1256
+ cursor?: string;
1257
+ }): Promise<SingleResponse<SocialAuthorFeed>>;
1126
1258
  /** Public, app-moderated discovery without account authority. Enrichment uses cached judgments only. */
1127
1259
  getSharedTrends(projectId: string, params: {
1128
1260
  protocol: string;
@@ -1143,6 +1275,14 @@ export declare class ProtocolsResource {
1143
1275
  }): Promise<SingleResponse<SocialTrendFeed>>;
1144
1276
  /** Breaking and viral stories clustered across outlets, open networks and Minds, through the same public-only app boundary. */
1145
1277
  getSharedRadar(projectId: string, params?: SocialRadarParams): Promise<SingleResponse<SocialRadar>>;
1278
+ /** One radar story's social member posts without a key, so a signed-out story card can show the posts it counts. */
1279
+ getSharedRadarPosts(projectId: string, params: {
1280
+ cluster: string;
1281
+ }): Promise<SingleResponse<SocialRadarPosts>>;
1282
+ /** One radar story by id with its posts, without a key: a story page or shared link in one call. */
1283
+ getSharedRadarStory(projectId: string, params: {
1284
+ cluster: string;
1285
+ }): Promise<SingleResponse<SocialRadarStory>>;
1146
1286
  publicNetworks(): Promise<SingleResponse<SocialNetwork[]>>;
1147
1287
  /** Query the live public network. It does not import users or posts. */
1148
1288
  searchPublicPosts(params: SearchPublicPostsParams): Promise<SingleResponse<SocialPostSearch>>;
@@ -1198,6 +1338,10 @@ export declare class ProtocolsResource {
1198
1338
  getPublicRadarPosts(params: {
1199
1339
  cluster: string;
1200
1340
  }, options?: SocialReadOptions): Promise<SingleResponse<SocialRadarPosts>>;
1341
+ /** One radar story by id with its posts under the app's own key; `status` tells an aged-out story from an unknown one. */
1342
+ getPublicRadarStory(params: {
1343
+ cluster: string;
1344
+ }, options?: SocialReadOptions): Promise<SingleResponse<SocialRadarStory>>;
1201
1345
  /** Provider-ranked public accounts with explicit provenance; served from the app's index when a fresh snapshot exists. */
1202
1346
  getPublicPopularProfiles(params: {
1203
1347
  protocol: string;
@@ -1206,6 +1350,12 @@ export declare class ProtocolsResource {
1206
1350
  }): Promise<SingleResponse<SocialPopularProfiles>>;
1207
1351
  /** Read this connected account's current native following; never infer it from a public count. */
1208
1352
  nativeFollowState(input: NativeFollowSourceInput): Promise<SingleResponse<NativeFollowState>>;
1353
+ /**
1354
+ * The viewer's connected accounts on a source's network and each one's follow state, in one read,
1355
+ * so a profile's Follow control is ready after one round trip instead of listing accounts first.
1356
+ * Resume any `pendingActionId` with `nativeFollowStatus`; never start a duplicate action.
1357
+ */
1358
+ nativeFollowStates(input: Omit<NativeFollowSourceInput, 'accountId'>): Promise<SingleResponse<NativeFollowStates>>;
1209
1359
  /** Prepare a follow/unfollow for explicit approval. Preserve the mutation ID after a lost response. */
1210
1360
  prepareNativeFollow(input: NativeFollowPrepareInput): Promise<SingleResponse<NativeFollowReview>>;
1211
1361
  /** Submit one approved action. Only Nostr supplies a public signed event. Automatic retries are disabled. */
@@ -1251,10 +1401,17 @@ export declare class ProtocolsResource {
1251
1401
  }>>;
1252
1402
  /** Read the signed-in owner's saved publication review and durable receipts. */
1253
1403
  nativePostStatus(id: string): Promise<SingleResponse<NativePostBatch>>;
1254
- /** Page the current app user's standalone publication history. This never sends. */
1404
+ /**
1405
+ * Page the current app user's standalone publication history. This never sends.
1406
+ * Items are delegated Bluesky/ActivityPub posts and client-signed Nostr originals (`type: 'nostr'`,
1407
+ * no `deliveries`); the server lists the Nostr ones only for clients that ask, as this method does.
1408
+ * With `crossPostOf`, only the network copies of that post in this app: delete each with
1409
+ * prepareNativePostRemoval/removeNativePost, or the Nostr signing flow for a `type: 'nostr'` item.
1410
+ */
1255
1411
  nativePostHistory(params?: {
1256
1412
  limit?: number;
1257
1413
  cursor?: string;
1414
+ crossPostOf?: string;
1258
1415
  }): Promise<SingleResponse<NativePostHistory>>;
1259
1416
  /** Review the current own posts before approving removal. */
1260
1417
  prepareNativePostRemoval(id: string, input: {
@@ -1313,11 +1470,17 @@ export declare class ProtocolsResource {
1313
1470
  nativeSocialAccounts(): Promise<SingleResponse<{
1314
1471
  enabled: boolean;
1315
1472
  accounts: NativeSocialAccount[];
1473
+ /** Protocols this app can connect with `redirect: 'native'`. Empty when no native callback is configured. */
1474
+ nativeRedirects?: NativeSocialProtocol[];
1316
1475
  }>>;
1317
- /** Private source controls in this app, with bounded pagination. */
1476
+ /**
1477
+ * Private source controls in this app, with bounded pagination. Pass `control` to list only
1478
+ * blocks, mutes or hidden posts; each item may carry a `display` label for the settings list.
1479
+ */
1318
1480
  sourceControls(params?: {
1319
1481
  limit?: number;
1320
1482
  cursor?: string;
1483
+ control?: SocialSourceControl['control'];
1321
1484
  }): Promise<SingleResponse<{
1322
1485
  enabled: boolean;
1323
1486
  items: SocialSourceControl[];
@@ -1344,13 +1507,22 @@ export declare class ProtocolsResource {
1344
1507
  existing: boolean;
1345
1508
  scope: 'minds';
1346
1509
  }>>;
1347
- /** Open the returned authorization URL in the user's browser; never submit passwords or tokens. */
1510
+ /**
1511
+ * Open the returned authorization URL in the user's browser; never submit passwords or tokens.
1512
+ * In a native app pass `redirect: 'native'` (when `nativeSocialAccounts().nativeRedirects` lists the
1513
+ * protocol) and open an in-app auth session on `callbackUrl`, e.g. expo-web-browser's
1514
+ * `openAuthSessionAsync(authorizationUrl, callbackUrl)`; then pass the returned `state`, `code`,
1515
+ * `iss` or `error` query values to `finishNativeSocialConnection`.
1516
+ */
1348
1517
  startNativeSocialConnection(input: {
1349
1518
  protocol: NativeSocialProtocol;
1350
1519
  identifier: string;
1520
+ redirect?: 'web' | 'native';
1351
1521
  }): Promise<SingleResponse<{
1352
1522
  protocol: NativeSocialProtocol;
1353
1523
  authorizationUrl: string;
1524
+ /** Where the provider returns: the app's web callback, or its operator-configured native callback. */
1525
+ callbackUrl: string;
1354
1526
  }>>;
1355
1527
  /** Complete a single-use callback with the same signed-in app user. Remove its query from browser history; do not log codes. */
1356
1528
  finishNativeSocialConnection(input: NativeSocialCallbackInput): Promise<SingleResponse<NativeSocialAccount>>;
@@ -1402,6 +1574,21 @@ export declare class ProtocolsResource {
1402
1574
  /** Request a short-lived, single-use proof bound to this app, account and relay. */
1403
1575
  hostedNostrChallenge(): Promise<SingleResponse<HostedNostrChallenge>>;
1404
1576
  connectHostedIdentity(input: ConnectHostedIdentityInput): Promise<SingleResponse<HostedProtocolIdentity>>;
1577
+ /**
1578
+ * Create a Bluesky account for the signed-in member on the app's own PDS.
1579
+ *
1580
+ * The response carries the member's password exactly once; show it to them and
1581
+ * keep it nowhere. The server either finishes the account or removes it again,
1582
+ * so a failure leaves nothing half made. Never retried automatically: a replay
1583
+ * after a lost response could not return the password a second time.
1584
+ *
1585
+ * Failures to expect: `handle_unavailable` (409, taken or reserved; choose
1586
+ * another), `identity_conflict` (409, the member already has one),
1587
+ * `creation_in_progress` (409), and the operator-side 503s
1588
+ * `handle_dns_unavailable`, `handle_unresolvable`, `handle_unverified` and
1589
+ * `hosted_server_unavailable`, which succeed unchanged once the operator is done.
1590
+ */
1591
+ createHostedIdentity(input: CreateHostedIdentityInput): Promise<SingleResponse<CreatedHostedProtocolIdentity>>;
1405
1592
  disconnectHostedIdentity(id: string): Promise<SingleResponse<{
1406
1593
  disconnected: true;
1407
1594
  }>>;
@@ -80,6 +80,15 @@ export class ProtocolsResource {
80
80
  protocol: params.protocol, post: params.post, readRef: params.readRef,
81
81
  });
82
82
  }
83
+ /** Public, app-moderated actor identity without member subscription/account state. */
84
+ getSharedProfile(projectId, params) {
85
+ return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/profile`, { protocol: params.protocol, actor: params.actor });
86
+ }
87
+ /** Bounded original public posts by one actor, with current app moderation. */
88
+ getSharedAuthorFeed(projectId, params) {
89
+ return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/author-feed`, { protocol: params.protocol, actor: params.actor,
90
+ limit: params.limit, cursor: params.cursor });
91
+ }
83
92
  /** Public, app-moderated discovery without account authority. Enrichment uses cached judgments only. */
84
93
  getSharedTrends(projectId, params) {
85
94
  return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/trends`, { protocol: params.protocol, limit: params.limit, cursor: params.cursor,
@@ -94,6 +103,14 @@ export class ProtocolsResource {
94
103
  getSharedRadar(projectId, params = {}) {
95
104
  return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/radar`, radarQuery(params));
96
105
  }
106
+ /** One radar story's social member posts without a key, so a signed-out story card can show the posts it counts. */
107
+ getSharedRadarPosts(projectId, params) {
108
+ return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/radar/posts`, { cluster: params.cluster });
109
+ }
110
+ /** One radar story by id with its posts, without a key: a story page or shared link in one call. */
111
+ getSharedRadarStory(projectId, params) {
112
+ return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/radar/story`, { cluster: params.cluster });
113
+ }
97
114
  publicNetworks() {
98
115
  return this.client.get('/protocols/social/networks');
99
116
  }
@@ -152,6 +169,10 @@ export class ProtocolsResource {
152
169
  getPublicRadarPosts(params, options) {
153
170
  return this.client.get('/protocols/social/radar/posts', { cluster: params.cluster }, ...readOptions(options));
154
171
  }
172
+ /** One radar story by id with its posts under the app's own key; `status` tells an aged-out story from an unknown one. */
173
+ getPublicRadarStory(params, options) {
174
+ return this.client.get('/protocols/social/radar/story', { cluster: params.cluster }, ...readOptions(options));
175
+ }
155
176
  /** Provider-ranked public accounts with explicit provenance; served from the app's index when a fresh snapshot exists. */
156
177
  getPublicPopularProfiles(params) {
157
178
  return this.client.get('/protocols/social/popular-profiles', { protocol: params.protocol, limit: params.limit, cursor: params.cursor });
@@ -160,6 +181,14 @@ export class ProtocolsResource {
160
181
  nativeFollowState(input) {
161
182
  return this.client.get('/protocols/social/follows/state', { accountId: input.accountId, protocol: input.protocol, nativeId: input.nativeId });
162
183
  }
184
+ /**
185
+ * The viewer's connected accounts on a source's network and each one's follow state, in one read,
186
+ * so a profile's Follow control is ready after one round trip instead of listing accounts first.
187
+ * Resume any `pendingActionId` with `nativeFollowStatus`; never start a duplicate action.
188
+ */
189
+ nativeFollowStates(input) {
190
+ return this.client.get('/protocols/social/follows/states', { protocol: input.protocol, nativeId: input.nativeId });
191
+ }
163
192
  /** Prepare a follow/unfollow for explicit approval. Preserve the mutation ID after a lost response. */
164
193
  prepareNativeFollow(input) {
165
194
  return this.client.post('/protocols/social/follows/prepare', { clientMutationId: input.clientMutationId, accountId: input.accountId,
@@ -227,7 +256,8 @@ export class ProtocolsResource {
227
256
  return this.client.post('/protocols/social/posts/prepare', { clientMutationId: input.clientMutationId,
228
257
  text: input.text, accountIds: input.accountIds,
229
258
  ...(input.quote ? { quote: { protocol: input.quote.protocol, nativeId: input.quote.nativeId } } : {}),
230
- ...(input.media !== undefined ? { media: nativeMediaInput(input.media) } : {}) }, { retry: false });
259
+ ...(input.media !== undefined ? { media: nativeMediaInput(input.media) } : {}),
260
+ ...(input.crossPostOf !== undefined ? { crossPostOf: input.crossPostOf } : {}) }, { retry: false });
231
261
  }
232
262
  /** Explicitly approve selected deliveries; never auto-retry an uncertain write. */
233
263
  submitNativePost(id, input) {
@@ -239,9 +269,16 @@ export class ProtocolsResource {
239
269
  hostedIdentityPath(id);
240
270
  return this.client.get(`/protocols/social/posts/${encodeURIComponent(id)}`);
241
271
  }
242
- /** Page the current app user's standalone publication history. This never sends. */
272
+ /**
273
+ * Page the current app user's standalone publication history. This never sends.
274
+ * Items are delegated Bluesky/ActivityPub posts and client-signed Nostr originals (`type: 'nostr'`,
275
+ * no `deliveries`); the server lists the Nostr ones only for clients that ask, as this method does.
276
+ * With `crossPostOf`, only the network copies of that post in this app: delete each with
277
+ * prepareNativePostRemoval/removeNativePost, or the Nostr signing flow for a `type: 'nostr'` item.
278
+ */
243
279
  nativePostHistory(params = {}) {
244
- return this.client.get('/protocols/social/posts', { limit: params.limit, cursor: params.cursor });
280
+ return this.client.get('/protocols/social/posts', { limit: params.limit, cursor: params.cursor,
281
+ ...(params.crossPostOf !== undefined ? { crossPostOf: params.crossPostOf } : {}), include: 'nostr' });
245
282
  }
246
283
  /** Review the current own posts before approving removal. */
247
284
  prepareNativePostRemoval(id, input) {
@@ -291,9 +328,13 @@ export class ProtocolsResource {
291
328
  nativeSocialAccounts() {
292
329
  return this.client.get('/protocols/social/accounts');
293
330
  }
294
- /** Private source controls in this app, with bounded pagination. */
331
+ /**
332
+ * Private source controls in this app, with bounded pagination. Pass `control` to list only
333
+ * blocks, mutes or hidden posts; each item may carry a `display` label for the settings list.
334
+ */
295
335
  sourceControls(params = {}) {
296
- return this.client.get('/protocols/social/controls', { limit: params.limit, cursor: params.cursor });
336
+ return this.client.get('/protocols/social/controls', { limit: params.limit, cursor: params.cursor,
337
+ ...(params.control ? { control: params.control } : {}) });
297
338
  }
298
339
  /** Block/mute an actor or hide a post in Minds. This does not impersonate a native network block. */
299
340
  async setSourceControl(input) {
@@ -319,9 +360,17 @@ export class ProtocolsResource {
319
360
  return this.client.post('/protocols/social/reports', { source: { protocol: input.source.protocol, kind: input.source.kind, nativeId: input.source.nativeId },
320
361
  readRef: input.readRef, ...(input.accountId ? { accountId: input.accountId } : {}), reason: input.reason, details: input.details, scope: input.scope }, { retry: false });
321
362
  }
322
- /** Open the returned authorization URL in the user's browser; never submit passwords or tokens. */
363
+ /**
364
+ * Open the returned authorization URL in the user's browser; never submit passwords or tokens.
365
+ * In a native app pass `redirect: 'native'` (when `nativeSocialAccounts().nativeRedirects` lists the
366
+ * protocol) and open an in-app auth session on `callbackUrl`, e.g. expo-web-browser's
367
+ * `openAuthSessionAsync(authorizationUrl, callbackUrl)`; then pass the returned `state`, `code`,
368
+ * `iss` or `error` query values to `finishNativeSocialConnection`.
369
+ */
323
370
  startNativeSocialConnection(input) {
324
- return this.client.post('/protocols/social/oauth/start', { protocol: input.protocol, identifier: input.identifier }, { retry: false });
371
+ return this.client.post('/protocols/social/oauth/start', { protocol: input.protocol, identifier: input.identifier,
372
+ // Only the choice between operator-configured callbacks is sent; a callback URL never is.
373
+ ...(input.redirect === 'native' ? { redirect: 'native' } : {}) }, { retry: false });
325
374
  }
326
375
  /** Complete a single-use callback with the same signed-in app user. Remove its query from browser history; do not log codes. */
327
376
  finishNativeSocialConnection(input) {
@@ -353,7 +402,8 @@ export class ProtocolsResource {
353
402
  /** Prepare an exact event for review. A timeout never automatically creates another signing request. */
354
403
  prepareNativeNostr(id, input) {
355
404
  hostedIdentityPath(id);
356
- const body = input.action === 'publish' ? { action: input.action, content: input.content }
405
+ const body = input.action === 'publish' ? { action: input.action, content: input.content,
406
+ ...(input.crossPostOf !== undefined ? { crossPostOf: input.crossPostOf } : {}) }
357
407
  : input.action === 'reply' ? { action: input.action, content: input.content, parentId: input.parentId }
358
408
  : input.action === 'linked_post' ? { action: input.action, content: input.content,
359
409
  source: { protocol: input.source.protocol, nativeId: input.source.nativeId,
@@ -416,6 +466,24 @@ export class ProtocolsResource {
416
466
  connectHostedIdentity(input) {
417
467
  return this.client.post('/protocols/identities', input);
418
468
  }
469
+ /**
470
+ * Create a Bluesky account for the signed-in member on the app's own PDS.
471
+ *
472
+ * The response carries the member's password exactly once; show it to them and
473
+ * keep it nowhere. The server either finishes the account or removes it again,
474
+ * so a failure leaves nothing half made. Never retried automatically: a replay
475
+ * after a lost response could not return the password a second time.
476
+ *
477
+ * Failures to expect: `handle_unavailable` (409, taken or reserved; choose
478
+ * another), `identity_conflict` (409, the member already has one),
479
+ * `creation_in_progress` (409), and the operator-side 503s
480
+ * `handle_dns_unavailable`, `handle_unresolvable`, `handle_unverified` and
481
+ * `hosted_server_unavailable`, which succeed unchanged once the operator is done.
482
+ */
483
+ createHostedIdentity(input) {
484
+ const { protocol, handle, email } = input;
485
+ return this.client.post('/protocols/identities/create', { protocol, handle, email }, { retry: false });
486
+ }
419
487
  async disconnectHostedIdentity(id) {
420
488
  return this.client.delete(hostedIdentityPath(id));
421
489
  }
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { ChangePasswordInput, DeletionStatus, LoginHistoryEntry, PaginatedResponse, RequestEmailChangeInput, Session, SingleResponse, SuccessResponse, UpdateAppearanceInput, UpdateContentPreferencesInput, UpdateNotificationChannelsInput, UpdatePrivacyInput, UserPreferences } from '../types.js';
2
+ import type { ChangePasswordInput, ConfirmationCodePurpose, ConfirmationCodeSent, DeletionStatus, LoginHistoryEntry, PaginatedResponse, RequestEmailChangeInput, RevokeOtherSessionsInput, RevokeOtherSessionsResult, Session, SingleResponse, SuccessResponse, UpdateAppearanceInput, UpdateContentPreferencesInput, UpdateNotificationChannelsInput, UpdatePrivacyInput, UserPreferences } from '../types.js';
3
3
  export declare class SettingsResource {
4
4
  private client;
5
5
  constructor(client: HttpClient);
@@ -29,11 +29,33 @@ export declare class SettingsResource {
29
29
  listSessions(): Promise<SingleResponse<Session[]>>;
30
30
  /** Revoke a specific session */
31
31
  revokeSession(sessionId: string): Promise<SuccessResponse>;
32
- /** Revoke all sessions */
32
+ /**
33
+ * Revoke every session AND every API key of the account, including the key
34
+ * this client uses: after it resolves, this client is signed out too. For
35
+ * "sign out of all other devices", use `revokeOtherSessions`.
36
+ */
33
37
  revokeAllSessions(): Promise<SuccessResponse>;
38
+ /**
39
+ * Sign out of all other devices. Revokes every Better Auth session and the
40
+ * account's other API keys, and keeps this device: the calling key always
41
+ * survives, and so does the session named by `keep_session_token`. An
42
+ * app-bound key only revokes that app's keys.
43
+ */
44
+ revokeOtherSessions(input?: RevokeOtherSessionsInput): Promise<SingleResponse<RevokeOtherSessionsResult>>;
34
45
  /** Change password */
35
46
  changePassword(input: ChangePasswordInput): Promise<SuccessResponse>;
36
- /** Request email change */
47
+ /**
48
+ * Email a six-digit confirmation code to the account's current address.
49
+ * Only for accounts with no password (`profiles.me().has_password === false`);
50
+ * a password account answers `password_required`. Send the code as
51
+ * `email_code` to `requestEmailChange`, or as `emailCode` to the
52
+ * `auth.*TwoFactor` methods.
53
+ */
54
+ requestConfirmationCode(purpose: ConfirmationCodePurpose): Promise<SingleResponse<ConfirmationCodeSent>>;
55
+ /**
56
+ * Request email change. Confirm with `password`, or with `email_code` for an
57
+ * account that has no password.
58
+ */
37
59
  requestEmailChange(input: RequestEmailChangeInput): Promise<SingleResponse<{
38
60
  success: true;
39
61
  token?: string;
@@ -59,16 +59,42 @@ export class SettingsResource {
59
59
  revokeSession(sessionId) {
60
60
  return this.client.delete(`/settings/sessions/${sessionId}`);
61
61
  }
62
- /** Revoke all sessions */
62
+ /**
63
+ * Revoke every session AND every API key of the account, including the key
64
+ * this client uses: after it resolves, this client is signed out too. For
65
+ * "sign out of all other devices", use `revokeOtherSessions`.
66
+ */
63
67
  revokeAllSessions() {
64
68
  return this.client.delete('/settings/sessions');
65
69
  }
70
+ /**
71
+ * Sign out of all other devices. Revokes every Better Auth session and the
72
+ * account's other API keys, and keeps this device: the calling key always
73
+ * survives, and so does the session named by `keep_session_token`. An
74
+ * app-bound key only revokes that app's keys.
75
+ */
76
+ revokeOtherSessions(input = {}) {
77
+ return this.client.post('/settings/sessions/revoke-others', input);
78
+ }
66
79
  // ── Account Security ──
67
80
  /** Change password */
68
81
  changePassword(input) {
69
82
  return this.client.put('/settings/password', input);
70
83
  }
71
- /** Request email change */
84
+ /**
85
+ * Email a six-digit confirmation code to the account's current address.
86
+ * Only for accounts with no password (`profiles.me().has_password === false`);
87
+ * a password account answers `password_required`. Send the code as
88
+ * `email_code` to `requestEmailChange`, or as `emailCode` to the
89
+ * `auth.*TwoFactor` methods.
90
+ */
91
+ requestConfirmationCode(purpose) {
92
+ return this.client.post('/settings/confirmation-code', { purpose });
93
+ }
94
+ /**
95
+ * Request email change. Confirm with `password`, or with `email_code` for an
96
+ * account that has no password.
97
+ */
72
98
  requestEmailChange(input) {
73
99
  return this.client.post('/settings/email-change', input);
74
100
  }
@@ -27,6 +27,17 @@ export interface VideoPlaybackToken {
27
27
  token: string;
28
28
  expires: number;
29
29
  }
30
+ /** Whether the caller may publish video in this app, and how much storage is left. */
31
+ export interface VideoEntitlement {
32
+ allowed: boolean;
33
+ /** The caller's active app-subscription tier ('free' when none, canceled or past due). */
34
+ tier: string;
35
+ /** Why video is not allowed: a tier without video, or a used-up quota. */
36
+ reason?: 'tier' | 'quota';
37
+ quotaSeconds: number;
38
+ usedSeconds: number;
39
+ remainingSeconds: number;
40
+ }
30
41
  /**
31
42
  * Video primitive. Upload is gated by the caller's paid tier + storage quota
32
43
  * (so apps stay profitable); viewing is open with a signed playback URL.
@@ -34,6 +45,14 @@ export interface VideoPlaybackToken {
34
45
  export declare class VideoResource {
35
46
  private client;
36
47
  constructor(client: HttpClient);
48
+ /**
49
+ * The check `createUpload` runs, without starting an upload: lets a composer
50
+ * gate or explain video before the member picks a file. Needs an app-bound
51
+ * key with `uploads:write`.
52
+ */
53
+ entitlement(): Promise<{
54
+ data: VideoEntitlement;
55
+ }>;
37
56
  /** Begin an upload. Returns Bunny direct-upload creds + the playbackId to attach to a post. */
38
57
  createUpload(input?: {
39
58
  title?: string;
@@ -7,6 +7,14 @@ export class VideoResource {
7
7
  constructor(client) {
8
8
  this.client = client;
9
9
  }
10
+ /**
11
+ * The check `createUpload` runs, without starting an upload: lets a composer
12
+ * gate or explain video before the member picks a file. Needs an app-bound
13
+ * key with `uploads:write`.
14
+ */
15
+ entitlement() {
16
+ return this.client.get('/video/entitlement');
17
+ }
10
18
  /** Begin an upload. Returns Bunny direct-upload creds + the playbackId to attach to a post. */
11
19
  createUpload(input) {
12
20
  return this.client.post('/video/create-upload', input ?? {});