@undefineds.co/xpod 0.3.3 → 0.3.5

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.
@@ -0,0 +1,87 @@
1
+ import type { AuthContext } from '../auth/AuthContext';
2
+ export interface MatrixStoreContext {
3
+ userId: string;
4
+ auth?: AuthContext;
5
+ }
6
+ export interface MatrixRoomRecord {
7
+ roomId: string;
8
+ name?: string;
9
+ topic?: string;
10
+ creator: string;
11
+ createdAt: number;
12
+ }
13
+ export interface MatrixEventRecord {
14
+ eventId: string;
15
+ roomId: string;
16
+ type: string;
17
+ sender: string;
18
+ senderWebId?: string;
19
+ originServerTs: number;
20
+ content: Record<string, unknown>;
21
+ stateKey?: string;
22
+ unsigned?: Record<string, unknown>;
23
+ }
24
+ export interface MatrixCreateRoomRequest {
25
+ visibility?: 'private' | 'public';
26
+ room_alias_name?: string;
27
+ name?: string;
28
+ topic?: string;
29
+ invite?: string[];
30
+ creation_content?: Record<string, unknown>;
31
+ initial_state?: Array<{
32
+ type: string;
33
+ state_key?: string;
34
+ content?: Record<string, unknown>;
35
+ }>;
36
+ preset?: string;
37
+ is_direct?: boolean;
38
+ }
39
+ export interface MatrixSendEventRequest {
40
+ body?: string;
41
+ msgtype?: string;
42
+ [key: string]: unknown;
43
+ }
44
+ export interface MatrixSyncResponse {
45
+ next_batch: string;
46
+ rooms: {
47
+ join: Record<string, {
48
+ state: {
49
+ events: MatrixClientEvent[];
50
+ };
51
+ timeline: {
52
+ events: MatrixClientEvent[];
53
+ limited: boolean;
54
+ prev_batch?: string;
55
+ };
56
+ }>;
57
+ };
58
+ }
59
+ export interface MatrixClientEvent {
60
+ event_id: string;
61
+ room_id: string;
62
+ type: string;
63
+ sender: string;
64
+ origin_server_ts: number;
65
+ content: Record<string, unknown>;
66
+ state_key?: string;
67
+ unsigned?: Record<string, unknown>;
68
+ }
69
+ export interface MatrixStore {
70
+ createRoom(input: MatrixCreateRoomRequest, context: MatrixStoreContext): Promise<MatrixRoomRecord>;
71
+ sendEvent(roomId: string, eventType: string, txnId: string, content: MatrixSendEventRequest, context: MatrixStoreContext): Promise<MatrixEventRecord>;
72
+ sync(context: MatrixStoreContext, options?: {
73
+ since?: string;
74
+ limit?: number;
75
+ }): Promise<MatrixSyncResponse>;
76
+ listMessages(roomId: string, context: MatrixStoreContext, options?: {
77
+ limit?: number;
78
+ dir?: 'b' | 'f';
79
+ from?: string;
80
+ }): Promise<{
81
+ chunk: MatrixClientEvent[];
82
+ start?: string;
83
+ end: string;
84
+ }>;
85
+ getEvent(roomId: string, eventId: string, context: MatrixStoreContext): Promise<MatrixClientEvent>;
86
+ getState(roomId: string, eventType: string, stateKey: string, context: MatrixStoreContext): Promise<Record<string, unknown>>;
87
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/matrix/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AuthContext } from '../auth/AuthContext';\n\nexport interface MatrixStoreContext {\n userId: string;\n auth?: AuthContext;\n}\n\nexport interface MatrixRoomRecord {\n roomId: string;\n name?: string;\n topic?: string;\n creator: string;\n createdAt: number;\n}\n\nexport interface MatrixEventRecord {\n eventId: string;\n roomId: string;\n type: string;\n sender: string;\n senderWebId?: string;\n originServerTs: number;\n content: Record<string, unknown>;\n stateKey?: string;\n unsigned?: Record<string, unknown>;\n}\n\nexport interface MatrixCreateRoomRequest {\n visibility?: 'private' | 'public';\n room_alias_name?: string;\n name?: string;\n topic?: string;\n invite?: string[];\n creation_content?: Record<string, unknown>;\n initial_state?: Array<{\n type: string;\n state_key?: string;\n content?: Record<string, unknown>;\n }>;\n preset?: string;\n is_direct?: boolean;\n}\n\nexport interface MatrixSendEventRequest {\n body?: string;\n msgtype?: string;\n [key: string]: unknown;\n}\n\nexport interface MatrixSyncResponse {\n next_batch: string;\n rooms: {\n join: Record<string, {\n state: { events: MatrixClientEvent[] };\n timeline: {\n events: MatrixClientEvent[];\n limited: boolean;\n prev_batch?: string;\n };\n }>;\n };\n}\n\nexport interface MatrixClientEvent {\n event_id: string;\n room_id: string;\n type: string;\n sender: string;\n origin_server_ts: number;\n content: Record<string, unknown>;\n state_key?: string;\n unsigned?: Record<string, unknown>;\n}\n\nexport interface MatrixStore {\n createRoom(input: MatrixCreateRoomRequest, context: MatrixStoreContext): Promise<MatrixRoomRecord>;\n sendEvent(\n roomId: string,\n eventType: string,\n txnId: string,\n content: MatrixSendEventRequest,\n context: MatrixStoreContext,\n ): Promise<MatrixEventRecord>;\n sync(context: MatrixStoreContext, options?: { since?: string; limit?: number }): Promise<MatrixSyncResponse>;\n listMessages(\n roomId: string,\n context: MatrixStoreContext,\n options?: { limit?: number; dir?: 'b' | 'f'; from?: string },\n ): Promise<{ chunk: MatrixClientEvent[]; start?: string; end: string }>;\n getEvent(roomId: string, eventId: string, context: MatrixStoreContext): Promise<MatrixClientEvent>;\n getState(\n roomId: string,\n eventType: string,\n stateKey: string,\n context: MatrixStoreContext,\n ): Promise<Record<string, unknown>>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undefineds.co/xpod",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Xpod is an extended Community Solid Server, offering rich-feature, production-level Solid Pod and identity management.",
5
5
  "repository": "https://github.com/undefinedsco/xpod",
6
6
  "author": "developer@undefineds.co",
@@ -162,7 +162,7 @@
162
162
  "@mariozechner/pi-coding-agent": "^0.55.1",
163
163
  "@solid/community-server": "8.0.0-alpha.1",
164
164
  "@undefineds.co/drizzle-solid": "0.3.13",
165
- "@undefineds.co/models": "0.2.28",
165
+ "@undefineds.co/models": "0.2.34",
166
166
  "abstract-level": "^1.0.4",
167
167
  "acme-client": "^5.1.3",
168
168
  "ai": "^6.0.6",