korero-chat 0.1.0 → 0.1.1
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/README.md +3 -7
- package/dist/http.d.ts +1 -0
- package/dist/types.d.ts +7 -1
- package/package.json +1 -1
- package/src/http.ts +1 -1
- package/src/types.ts +2 -1
package/README.md
CHANGED
|
@@ -2,20 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Build clients and bots for the [Korero v1 protocol](../docs/protocol.md). The SDK runs in modern browsers with Web Crypto, Bun, and Node.js 22+. Each `KoreroClient` owns a connection to one server.
|
|
4
4
|
|
|
5
|
-
## Install
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
|
|
9
|
-
bun install --frozen-lockfile
|
|
10
|
-
npm pack
|
|
8
|
+
npm install korero-chat
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
In your project, install the generated package with `npm install /path/to/korero/sdk/korero-chat-sdk-0.1.0.tgz`.
|
|
14
|
-
|
|
15
11
|
## Listen and respond
|
|
16
12
|
|
|
17
13
|
```ts
|
|
18
|
-
import { Channel, KoreroClient, identityFromPrivateKey } from "
|
|
14
|
+
import { Channel, KoreroClient, identityFromPrivateKey } from "korero-chat";
|
|
19
15
|
|
|
20
16
|
const client = new KoreroClient("https://chat.example.org:8443");
|
|
21
17
|
const identity = identityFromPrivateKey(process.env.KORERO_PRIVATE_KEY!);
|
package/dist/http.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -117,7 +117,13 @@ export type MemberRequest = {
|
|
|
117
117
|
deafened: boolean;
|
|
118
118
|
};
|
|
119
119
|
} | {
|
|
120
|
-
kind: "moderation.
|
|
120
|
+
kind: "moderation.ban";
|
|
121
|
+
payload: {
|
|
122
|
+
accountId: string;
|
|
123
|
+
expiresInSeconds?: number;
|
|
124
|
+
};
|
|
125
|
+
} | {
|
|
126
|
+
kind: "moderation.kick" | "moderation.unban";
|
|
121
127
|
payload: {
|
|
122
128
|
accountId: string;
|
|
123
129
|
};
|
package/package.json
CHANGED
package/src/http.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface ChannelPermissionTable {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface AccountPage {
|
|
24
|
-
accounts: (Account & { editable: boolean; bannable: boolean; banned: boolean })[];
|
|
24
|
+
accounts: (Account & { editable: boolean; bannable: boolean; banned: boolean; bannedUntil?: number | null })[];
|
|
25
25
|
next: string | null;
|
|
26
26
|
roles: string[];
|
|
27
27
|
builtInRoles: (RoleDefinition & { editable: boolean; defaultPermissions: Permission[] })[];
|
package/src/types.ts
CHANGED
|
@@ -91,7 +91,8 @@ export type MemberRequest =
|
|
|
91
91
|
| { kind: "channel.move"; payload: { channelId: string } & ({ connectionId: string } | { connectionIds: string[] }) }
|
|
92
92
|
| { kind: "moderation.mute"; payload: { connectionId: string; muted: boolean } }
|
|
93
93
|
| { kind: "moderation.deafen"; payload: { connectionId: string; deafened: boolean } }
|
|
94
|
-
| { kind: "moderation.
|
|
94
|
+
| { kind: "moderation.ban"; payload: { accountId: string; expiresInSeconds?: number } }
|
|
95
|
+
| { kind: "moderation.kick" | "moderation.unban"; payload: { accountId: string } }
|
|
95
96
|
| { kind: "role.set"; payload: { accountId: string; role: string } };
|
|
96
97
|
|
|
97
98
|
export interface Message {
|