@stacksjs/chat 0.75.539 → 0.75.541

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.
@@ -1,3 +1,12 @@
1
+ export declare function channelPermissions(input: {
2
+ guildId: string
3
+ ownerId?: string | null
4
+ userId: string
5
+ memberRoles: string[]
6
+ roles: RoleLike[]
7
+ overwrites: OverwriteLike[]
8
+ }): bigint;
9
+ export declare function canRead(permissions: bigint): boolean;
1
10
  /**
2
11
  * Whether a member can see a channel, by Discord's own rules: the server's
3
12
  * @everyone role and the member's roles set the base, Administrator sees
@@ -5,3 +14,6 @@
5
14
  * then the member's roles together, then the member themselves.
6
15
  */
7
16
  export declare const VIEW_CHANNEL: bigint;
17
+ export declare const READ_MESSAGE_HISTORY: bigint;
18
+ export declare interface RoleLike { id: string, permissions: string | number }
19
+ export declare interface OverwriteLike { id: string, type: number | string, allow: string | number, deny: string | number }
@@ -9,6 +9,12 @@ export declare function unixMsToAppleDate(ms: number): number;
9
9
  * "\uFFFC": not empty, and invisible. Shown as text it is an empty bubble.
10
10
  */
11
11
  export declare function messageText(plain: string | null, attributedBody: Uint8Array | null): string | null;
12
+ /**
13
+ * `associated_message_guid` points at a part of a message, not the message:
14
+ * `p:0/<guid>` for the first part, `bp:<guid>` for a balloon. Reactions are
15
+ * shown on the message, so strip the part.
16
+ */
17
+ export declare function reactionTarget(raw: string | null): string | null;
12
18
  /**
13
19
  * Read-only access to the Messages app's database.
14
20
  *
@@ -84,3 +90,20 @@ export declare class MessagesAccessError extends Error {
84
90
  public readonly path: string;
85
91
  constructor(path: string, cause: unknown);
86
92
  }
93
+ export declare class MessagesDb {
94
+ private db;
95
+ private messageColumns;
96
+ private hasRecoverable;
97
+ public readonly path: string;
98
+ constructor(path?: string);
99
+ private hasChatProperties;
100
+ attachmentFile(guid: string): string | null;
101
+ close(): void;
102
+ latestRowId(): number;
103
+ private column;
104
+ chats(): ChatRow[];
105
+ private participantsByChat;
106
+ messages(chatGuids: string[], options?: MessageQuery): MessageRow[];
107
+ attachmentPath(guid: string): { path: string | null, mimeType: string | null, name: string } | null;
108
+ private attachmentsFor;
109
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/chat",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.539",
5
+ "version": "0.75.541",
6
6
  "description": "Easily interact with chat APIs.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -58,14 +58,14 @@
58
58
  "prepublishOnly": "bun run build"
59
59
  },
60
60
  "dependencies": {
61
- "@stacksjs/orm": "0.75.539",
62
- "@stacksjs/config": "0.75.539",
63
- "@stacksjs/logging": "0.75.539"
61
+ "@stacksjs/orm": "0.75.541",
62
+ "@stacksjs/config": "0.75.541",
63
+ "@stacksjs/logging": "0.75.541"
64
64
  },
65
65
  "devDependencies": {
66
- "@stacksjs/cli": "0.75.539",
67
- "@stacksjs/error-handling": "0.75.539",
68
- "@stacksjs/types": "0.75.539",
66
+ "@stacksjs/cli": "0.75.541",
67
+ "@stacksjs/error-handling": "0.75.541",
68
+ "@stacksjs/types": "0.75.541",
69
69
  "better-dx": "^0.2.24"
70
70
  }
71
71
  }