@recursiv/sdk 0.7.48 → 0.7.49

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 CHANGED
@@ -144,7 +144,7 @@ export { UsersResource } from './resources/users.js';
144
144
  export { CommunitiesResource } from './resources/communities.js';
145
145
  export { ChatResource } from './resources/chat.js';
146
146
  export { E2eeResource } from './resources/e2ee.js';
147
- export type { E2eeDevice, E2eeEnvelope, E2eeEvent, E2eeKeyPackageStatus } from './resources/e2ee.js';
147
+ export type { E2eeDevice, E2eeEnvelope, E2eeEvent, E2eeKeyPackageStatus, E2eeObjectDownload, E2eeObjectUpload } from './resources/e2ee.js';
148
148
  export { ProjectsResource } from './resources/projects.js';
149
149
  export { AgentsResource, SUPPORTED_MODELS } from './resources/agents.js';
150
150
  export { EvidenceResource } from './resources/evidence.js';
@@ -8,6 +8,10 @@ export declare class CommunitiesResource {
8
8
  /** Get a community by ID */
9
9
  get(id: string): Promise<SingleResponse<CommunityDetail>>;
10
10
  /** List members of a community */
11
+ /** Groups related to this one, ranked by shared members; the caller's own groups are left out. */
12
+ related(id: string, params?: {
13
+ limit?: number;
14
+ }): Promise<PaginatedResponse<Community>>;
11
15
  members(id: string, params?: PaginationParams): Promise<PaginatedResponse<CommunityMember>>;
12
16
  /** Create a new community */
13
17
  create(input: CreateCommunityInput): Promise<SingleResponse<CreatedCommunity>>;
@@ -12,6 +12,10 @@ export class CommunitiesResource {
12
12
  return this.client.get(`/communities/${id}`);
13
13
  }
14
14
  /** List members of a community */
15
+ /** Groups related to this one, ranked by shared members; the caller's own groups are left out. */
16
+ related(id, params) {
17
+ return this.client.get(`/communities/${encodeURIComponent(id)}/related`, params);
18
+ }
15
19
  members(id, params) {
16
20
  return this.client.get(`/communities/${id}/members`, params);
17
21
  }
@@ -43,6 +43,19 @@ export interface E2eeKeyPackageStatus {
43
43
  * Requires the `e2eeV2` network feature flag and a key acting as the account
44
44
  * owner (agent-scoped keys are refused). The realm is the network id.
45
45
  */
46
+ /** A reserved encrypted attachment object: PUT exactly `length` bytes of ciphertext to `uploadUrl`, then complete it. */
47
+ export interface E2eeObjectUpload {
48
+ reference: string;
49
+ uploadUrl: string;
50
+ uploadExpiresAt: string;
51
+ length: number;
52
+ }
53
+ /** A short-lived URL for a confirmed encrypted attachment object. */
54
+ export interface E2eeObjectDownload {
55
+ reference: string;
56
+ downloadUrl: string;
57
+ length: number;
58
+ }
46
59
  export declare class E2eeResource {
47
60
  private client;
48
61
  constructor(client: HttpClient);
@@ -109,4 +122,31 @@ export declare class E2eeResource {
109
122
  }): Promise<SingleResponse<{
110
123
  ackedSeq: number;
111
124
  }>>;
125
+ /**
126
+ * Reserve an encrypted attachment object in an encrypted conversation.
127
+ * `length` is the ciphertext size (recursiv-attachment-v1); the key never
128
+ * leaves the client, it travels inside the MLS message.
129
+ */
130
+ createObject(conversationId: string, input: {
131
+ device_id: string;
132
+ length: number;
133
+ }): Promise<SingleResponse<E2eeObjectUpload>>;
134
+ /** Confirm an upload; it counts only if the stored size equals the reserved length. */
135
+ completeObject(objectId: string, input: {
136
+ device_id: string;
137
+ }): Promise<SingleResponse<{
138
+ reference: string;
139
+ length: number;
140
+ }>>;
141
+ /** A short-lived download URL for a confirmed object in a conversation you can read. */
142
+ objectDownload(objectId: string, params: {
143
+ device_id: string;
144
+ }): Promise<SingleResponse<E2eeObjectDownload>>;
145
+ /** Remove an object you uploaded. Copies recipients already downloaded stay theirs. */
146
+ deleteObject(objectId: string, params: {
147
+ device_id: string;
148
+ }): Promise<SingleResponse<{
149
+ reference: string;
150
+ deleted: boolean;
151
+ }>>;
112
152
  }
@@ -1,9 +1,3 @@
1
- /**
2
- * E2EE v2 ciphertext transport. The server relays envelopes and public
3
- * credentials only; encryption happens in the shared core on each device.
4
- * Requires the `e2eeV2` network feature flag and a key acting as the account
5
- * owner (agent-scoped keys are refused). The realm is the network id.
6
- */
7
1
  export class E2eeResource {
8
2
  client;
9
3
  constructor(client) {
@@ -44,4 +38,24 @@ export class E2eeResource {
44
38
  acknowledge(conversationId, input) {
45
39
  return this.client.post(`/e2ee/conversations/${encodeURIComponent(conversationId)}/ack`, input);
46
40
  }
41
+ /**
42
+ * Reserve an encrypted attachment object in an encrypted conversation.
43
+ * `length` is the ciphertext size (recursiv-attachment-v1); the key never
44
+ * leaves the client, it travels inside the MLS message.
45
+ */
46
+ createObject(conversationId, input) {
47
+ return this.client.post(`/e2ee/conversations/${encodeURIComponent(conversationId)}/objects`, input);
48
+ }
49
+ /** Confirm an upload; it counts only if the stored size equals the reserved length. */
50
+ completeObject(objectId, input) {
51
+ return this.client.post(`/e2ee/objects/${encodeURIComponent(objectId)}/complete`, input);
52
+ }
53
+ /** A short-lived download URL for a confirmed object in a conversation you can read. */
54
+ objectDownload(objectId, params) {
55
+ return this.client.get(`/e2ee/objects/${encodeURIComponent(objectId)}`, params);
56
+ }
57
+ /** Remove an object you uploaded. Copies recipients already downloaded stay theirs. */
58
+ deleteObject(objectId, params) {
59
+ return this.client.delete(`/e2ee/objects/${encodeURIComponent(objectId)}?device_id=${encodeURIComponent(params.device_id)}`);
60
+ }
47
61
  }
@@ -12,6 +12,11 @@ export declare class PostsResource {
12
12
  }>>>;
13
13
  /** List posts the authenticated caller has upvoted. */
14
14
  liked(params?: Pick<ListPostsParams, 'limit' | 'offset' | 'cursor'>): Promise<PaginatedResponse<Post>>;
15
+ /** Posts similar to this one (embedding neighbours), in the app's scope. */
16
+ similar(id: string, params?: {
17
+ limit?: number;
18
+ organization_id?: string;
19
+ }): Promise<PaginatedResponse<Post>>;
15
20
  /** Get a single post with replies */
16
21
  get(id: string): Promise<SingleResponse<PostDetail>>;
17
22
  /** Create a new post */
@@ -15,6 +15,10 @@ export class PostsResource {
15
15
  liked(params) {
16
16
  return this.list({ ...params, liked: true });
17
17
  }
18
+ /** Posts similar to this one (embedding neighbours), in the app's scope. */
19
+ similar(id, params) {
20
+ return this.client.get(`/posts/${encodeURIComponent(id)}/similar`, params);
21
+ }
18
22
  /** Get a single post with replies */
19
23
  get(id) {
20
24
  return this.client.get(`/posts/${id}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursiv/sdk",
3
- "version": "0.7.48",
3
+ "version": "0.7.49",
4
4
  "description": "TypeScript SDK for the Recursiv API",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",