@recursiv/sdk 0.7.18 → 0.7.19
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/index.d.ts +1 -1
- package/dist/resources/protocols.d.ts +74 -0
- package/dist/resources/protocols.js +27 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -189,7 +189,7 @@ export type { UploadMediaInput, UploadUrlInput, UploadUrlResult } from './resour
|
|
|
189
189
|
export { WalletResource } from './resources/wallet.js';
|
|
190
190
|
export { ProtocolsResource } from './resources/protocols.js';
|
|
191
191
|
export { PROTOCOL_ADAPTER_MATURITIES, PROTOCOL_CAPABILITY_OPERATIONS, PROTOCOL_CAPABILITY_STATUSES, } from './resources/protocols.js';
|
|
192
|
-
export type { HostedProtocolConnections, HostedProtocol, HostedProtocolIdentity, HostedNostrChallenge, HostedNostrIdentityProof, HostedPostPreview, ConnectHostedIdentityInput, PreviewHostedPostInput, PublishHostedPostInput, ListProtocolCandidatesParams, ProtocolAdapterMaturity, ProtocolAdapterMetadata, ProtocolCandidateListResponse, ProtocolCandidatePageMeta, ProtocolCapabilityOperation, ProtocolCapabilityStatus, ProtocolCollectionStatus, ProtocolQuarantinedCandidate, ProtocolRefreshResult, ProtocolSettings, ProtocolSettingsUpdateResult, UpdateSettingsInput as UpdateProtocolSettingsInput, } from './resources/protocols.js';
|
|
192
|
+
export type { SocialProfile, SocialSubscription, SocialProfilePage, SocialPost, SocialAuthorFeed, SearchPublicProfilesParams, HostedProtocolConnections, HostedProtocol, HostedProtocolIdentity, HostedNostrChallenge, HostedNostrIdentityProof, HostedPostPreview, ConnectHostedIdentityInput, PreviewHostedPostInput, PublishHostedPostInput, ListProtocolCandidatesParams, ProtocolAdapterMaturity, ProtocolAdapterMetadata, ProtocolCandidateListResponse, ProtocolCandidatePageMeta, ProtocolCapabilityOperation, ProtocolCapabilityStatus, ProtocolCollectionStatus, ProtocolQuarantinedCandidate, ProtocolRefreshResult, ProtocolSettings, ProtocolSettingsUpdateResult, UpdateSettingsInput as UpdateProtocolSettingsInput, } from './resources/protocols.js';
|
|
193
193
|
export { InboxResource } from './resources/inbox.js';
|
|
194
194
|
export { NetworkResource } from './resources/network.js';
|
|
195
195
|
export { SimulatorResource } from './resources/simulator.js';
|
|
@@ -192,9 +192,83 @@ export interface PublishHostedPostInput extends PreviewHostedPostInput {
|
|
|
192
192
|
/** Explicitly publish the previewed text publicly in this app. */
|
|
193
193
|
publishPublicly: true;
|
|
194
194
|
}
|
|
195
|
+
/** Public source identity, independent of any local Minds user or handle. */
|
|
196
|
+
export interface SocialProfile {
|
|
197
|
+
protocol: string;
|
|
198
|
+
nativeId: string;
|
|
199
|
+
handle: string;
|
|
200
|
+
displayName: string;
|
|
201
|
+
description: string;
|
|
202
|
+
profileUrl: string;
|
|
203
|
+
avatarUrl: string | null;
|
|
204
|
+
followersCount: number | null;
|
|
205
|
+
followingCount: number | null;
|
|
206
|
+
postsCount: number | null;
|
|
207
|
+
subscription: SocialSubscription | null;
|
|
208
|
+
}
|
|
209
|
+
export interface SocialSubscription {
|
|
210
|
+
id: string;
|
|
211
|
+
protocol: string;
|
|
212
|
+
nativeId: string;
|
|
213
|
+
/** Private reading subscription in this app; not a native-network follow. */
|
|
214
|
+
kind: 'minds_feed';
|
|
215
|
+
createdAt: string;
|
|
216
|
+
}
|
|
217
|
+
export interface SearchPublicProfilesParams {
|
|
218
|
+
protocol: string;
|
|
219
|
+
query: string;
|
|
220
|
+
limit?: number;
|
|
221
|
+
cursor?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface SocialProfilePage {
|
|
224
|
+
items: SocialProfile[];
|
|
225
|
+
cursor: string | null;
|
|
226
|
+
}
|
|
227
|
+
/** Public source data read on demand; never a canonical Minds post ID. */
|
|
228
|
+
export interface SocialPost {
|
|
229
|
+
protocol: string;
|
|
230
|
+
nativeId: string;
|
|
231
|
+
sourceUrl: string;
|
|
232
|
+
author: Omit<SocialProfile, 'subscription'>;
|
|
233
|
+
text: string;
|
|
234
|
+
createdAt: string;
|
|
235
|
+
replyCount: number;
|
|
236
|
+
likeCount: number;
|
|
237
|
+
repostCount: number;
|
|
238
|
+
media: Array<{
|
|
239
|
+
type: 'image';
|
|
240
|
+
url: string;
|
|
241
|
+
alt: string;
|
|
242
|
+
}>;
|
|
243
|
+
hasAdditionalContent: boolean;
|
|
244
|
+
}
|
|
245
|
+
export interface SocialAuthorFeed {
|
|
246
|
+
items: SocialPost[];
|
|
247
|
+
cursor: string | null;
|
|
248
|
+
coverage: 'original_posts';
|
|
249
|
+
}
|
|
195
250
|
export declare class ProtocolsResource {
|
|
196
251
|
private client;
|
|
197
252
|
constructor(client: HttpClient);
|
|
253
|
+
/** Query the live public network. It does not import users or posts. */
|
|
254
|
+
searchPublicProfiles(params: SearchPublicProfilesParams): Promise<SingleResponse<SocialProfilePage>>;
|
|
255
|
+
getPublicProfile(protocol: string, actor: string): Promise<SingleResponse<SocialProfile>>;
|
|
256
|
+
getPublicAuthorFeed(params: {
|
|
257
|
+
protocol: string;
|
|
258
|
+
actor: string;
|
|
259
|
+
limit?: number;
|
|
260
|
+
cursor?: string;
|
|
261
|
+
}): Promise<SingleResponse<SocialAuthorFeed>>;
|
|
262
|
+
listSubscriptions(): Promise<SingleResponse<SocialSubscription[]>>;
|
|
263
|
+
/** Save a private reading subscription after resolving the immutable native ID. */
|
|
264
|
+
subscribeToProfile(input: {
|
|
265
|
+
protocol: string;
|
|
266
|
+
nativeId: string;
|
|
267
|
+
kind: 'minds_feed';
|
|
268
|
+
}): Promise<SingleResponse<SocialSubscription>>;
|
|
269
|
+
unsubscribeFromProfile(id: string): Promise<SingleResponse<{
|
|
270
|
+
deleted: true;
|
|
271
|
+
}>>;
|
|
198
272
|
/** List adapters with truthful capability, maturity, and limitation metadata. */
|
|
199
273
|
list(): Promise<SingleResponse<ProtocolAdapterMetadata[]>>;
|
|
200
274
|
/** Configured addresses for the current app. Does not attest runtime or account readiness. */
|
|
@@ -39,6 +39,33 @@ export class ProtocolsResource {
|
|
|
39
39
|
constructor(client) {
|
|
40
40
|
this.client = client;
|
|
41
41
|
}
|
|
42
|
+
/** Query the live public network. It does not import users or posts. */
|
|
43
|
+
searchPublicProfiles(params) {
|
|
44
|
+
return this.client.get('/protocols/social/profiles', {
|
|
45
|
+
protocol: params.protocol, query: params.query, limit: params.limit, cursor: params.cursor,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
getPublicProfile(protocol, actor) {
|
|
49
|
+
return this.client.get('/protocols/social/profile', { protocol, actor });
|
|
50
|
+
}
|
|
51
|
+
getPublicAuthorFeed(params) {
|
|
52
|
+
return this.client.get('/protocols/social/author-feed', {
|
|
53
|
+
protocol: params.protocol, actor: params.actor, limit: params.limit, cursor: params.cursor,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
listSubscriptions() {
|
|
57
|
+
return this.client.get('/protocols/social/subscriptions');
|
|
58
|
+
}
|
|
59
|
+
/** Save a private reading subscription after resolving the immutable native ID. */
|
|
60
|
+
subscribeToProfile(input) {
|
|
61
|
+
return this.client.post('/protocols/social/subscriptions', input);
|
|
62
|
+
}
|
|
63
|
+
unsubscribeFromProfile(id) {
|
|
64
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id)) {
|
|
65
|
+
throw new ValidationError({ type: 'validation_error', code: 'invalid_subscription_id', message: 'A valid subscription ID is required' });
|
|
66
|
+
}
|
|
67
|
+
return this.client.delete(`/protocols/social/subscriptions/${encodeURIComponent(id)}`);
|
|
68
|
+
}
|
|
42
69
|
/** List adapters with truthful capability, maturity, and limitation metadata. */
|
|
43
70
|
list() {
|
|
44
71
|
return this.client.get('/protocols');
|