@openpeepshq/core 0.8.0 → 0.9.0
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/backups/extractWithNodeStreamZip.d.ts +15 -0
- package/dist/backups/extractWithNodeStreamZip.js +56 -0
- package/dist/backups/index.d.ts +10 -0
- package/dist/backups/index.js +14 -11
- package/dist/db/pg/filters/notifications.d.ts +8 -0
- package/dist/db/pg/filters/notifications.js +11 -1
- package/dist/db/pg/filters/types.d.ts +6 -0
- package/dist/db/pg/filters/types.js +6 -0
- package/dist/jams/mapping.d.ts +4 -4
- package/dist/notifications/finders.d.ts +2 -1
- package/dist/notifications/finders.js +14 -1
- package/dist/notifications/mutations.d.ts +7 -1
- package/dist/notifications/mutations.js +10 -1
- package/dist/posts/helpers/index.js +5 -7
- package/dist/posts/mutations.d.ts +1 -1
- package/dist/posts/mutations.js +3 -3
- package/dist/profileSettings/mapping.d.ts +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* node-stream-zip extraction, used on non-Linux platforms and as the fallback
|
|
3
|
+
* when the unzip CLI is unavailable.
|
|
4
|
+
*
|
|
5
|
+
* node-stream-zip's `validateName()` rejects `../`, absolute, drive-letter, and
|
|
6
|
+
* backslash entry names, and its extraction writes only regular files and
|
|
7
|
+
* directories (never symlinks), so zip-slip and symlink-escape attacks
|
|
8
|
+
* (GHSA-jmr9-qjv8-65gv / GHSA-7pqw-9j4j-h8q3) are neutralized at the root.
|
|
9
|
+
*
|
|
10
|
+
* @internal exposed for tests
|
|
11
|
+
*/
|
|
12
|
+
export declare const extractWithNodeStreamZip: (zipPath: string, tempDir: string) => {
|
|
13
|
+
promise: Promise<void>;
|
|
14
|
+
kill: () => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import StreamZip from 'node-stream-zip';
|
|
2
|
+
/**
|
|
3
|
+
* node-stream-zip extraction, used on non-Linux platforms and as the fallback
|
|
4
|
+
* when the unzip CLI is unavailable.
|
|
5
|
+
*
|
|
6
|
+
* node-stream-zip's `validateName()` rejects `../`, absolute, drive-letter, and
|
|
7
|
+
* backslash entry names, and its extraction writes only regular files and
|
|
8
|
+
* directories (never symlinks), so zip-slip and symlink-escape attacks
|
|
9
|
+
* (GHSA-jmr9-qjv8-65gv / GHSA-7pqw-9j4j-h8q3) are neutralized at the root.
|
|
10
|
+
*
|
|
11
|
+
* @internal exposed for tests
|
|
12
|
+
*/
|
|
13
|
+
export const extractWithNodeStreamZip = (zipPath, tempDir) => {
|
|
14
|
+
let zip;
|
|
15
|
+
// Flipped once the reader has finished opening (header read). node-stream-zip
|
|
16
|
+
// only tolerates `close()` while a read is in flight; closing it before that
|
|
17
|
+
// point is racy (it can resolve the read stream in a broken state and, in
|
|
18
|
+
// 1.16.0, even throw an uncaught fs error inside its err-handling path — a
|
|
19
|
+
// process crash).
|
|
20
|
+
let open = false;
|
|
21
|
+
let closed = false;
|
|
22
|
+
const promise = (async () => {
|
|
23
|
+
zip = new StreamZip.async({ file: zipPath });
|
|
24
|
+
void zip.entriesCount
|
|
25
|
+
.then(() => undefined)
|
|
26
|
+
.catch(() => undefined)
|
|
27
|
+
.then(() => {
|
|
28
|
+
open = true;
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
await zip.extract(null, tempDir);
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
await zip.close().catch(() => undefined);
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
37
|
+
return {
|
|
38
|
+
promise,
|
|
39
|
+
kill: () => {
|
|
40
|
+
/* Best-effort cancel: closing the reader aborts the in-flight read —
|
|
41
|
+
the extract promise rejects with an fs error (EBADF) and may leave a
|
|
42
|
+
partial file in tempDir. The restore path's error handling already
|
|
43
|
+
tolerates that (it logs and rethrows, with no tempDir cleanup —
|
|
44
|
+
pre-existing behavior). Only effective once the reader is open;
|
|
45
|
+
before that, kill() is a no-op and the extraction runs to completion
|
|
46
|
+
(nothing is in flight to abort yet). Kill-once: repeated calls are
|
|
47
|
+
ignored. */
|
|
48
|
+
if (closed)
|
|
49
|
+
return;
|
|
50
|
+
closed = true;
|
|
51
|
+
if (!open)
|
|
52
|
+
return;
|
|
53
|
+
void zip?.close().catch(() => undefined);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
};
|
package/dist/backups/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export { resolveBackupDatabaseType } from './metadata';
|
|
2
|
+
/**
|
|
3
|
+
* Chooses the unzip CLI on Linux and the node-stream-zip fallback everywhere
|
|
4
|
+
* else (and when the CLI is unavailable).
|
|
5
|
+
*
|
|
6
|
+
* @internal exposed for tests
|
|
7
|
+
*/
|
|
8
|
+
export declare const extractZipArchive: (zipPath: string, tempDir: string) => {
|
|
9
|
+
promise: Promise<void>;
|
|
10
|
+
kill: () => void;
|
|
11
|
+
};
|
|
2
12
|
export declare const createBackup: () => Promise<string | undefined>;
|
|
3
13
|
export declare const downloadBackup: (name: string) => Promise<string>;
|
|
4
14
|
export declare const listAllBackups: () => Promise<string[]>;
|
package/dist/backups/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { emptyDir } from 'fs-extra';
|
|
|
5
5
|
import { join, sep, isAbsolute } from 'node:path';
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
import archiver from 'archiver';
|
|
8
|
-
import
|
|
8
|
+
import { extractWithNodeStreamZip } from './extractWithNodeStreamZip.js';
|
|
9
9
|
import { collectionInfos } from '../db/index.js';
|
|
10
10
|
import { communityConfig, config, defaultConfig } from '../config/index.js';
|
|
11
11
|
import { exportAllPostgresCollections, importAllPostgresCollections, } from '../db/migration/importCollections.js';
|
|
@@ -57,15 +57,15 @@ const extractWithUnzipCli = (zipPath, tempDir) => {
|
|
|
57
57
|
},
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const extractZipArchive = (zipPath, tempDir) => {
|
|
60
|
+
/**
|
|
61
|
+
* Chooses the unzip CLI on Linux and the node-stream-zip fallback everywhere
|
|
62
|
+
* else (and when the CLI is unavailable).
|
|
63
|
+
*
|
|
64
|
+
* @internal exposed for tests
|
|
65
|
+
*/
|
|
66
|
+
export const extractZipArchive = (zipPath, tempDir) => {
|
|
67
67
|
if (process.platform !== 'linux') {
|
|
68
|
-
return
|
|
68
|
+
return extractWithNodeStreamZip(zipPath, tempDir);
|
|
69
69
|
}
|
|
70
70
|
const cli = extractWithUnzipCli(zipPath, tempDir);
|
|
71
71
|
let fallbackKill;
|
|
@@ -74,9 +74,12 @@ const extractZipArchive = (zipPath, tempDir) => {
|
|
|
74
74
|
if (!message.includes('unzip binary not found')) {
|
|
75
75
|
throw err;
|
|
76
76
|
}
|
|
77
|
-
log.warn('unzip CLI unavailable; falling back to
|
|
78
|
-
const fallback =
|
|
77
|
+
log.warn('unzip CLI unavailable; falling back to node-stream-zip');
|
|
78
|
+
const fallback = extractWithNodeStreamZip(zipPath, tempDir);
|
|
79
79
|
fallbackKill = fallback.kill;
|
|
80
|
+
// A kill that fires in the ENOENT→fallback window is dropped on purpose:
|
|
81
|
+
// the fallback's reader is not open yet, so a carried request would still
|
|
82
|
+
// hit the pre-open no-op rule and the extraction would complete anyway.
|
|
80
83
|
await fallback.promise;
|
|
81
84
|
});
|
|
82
85
|
return {
|
|
@@ -3,4 +3,12 @@ export declare const notificationFilters: {
|
|
|
3
3
|
forProfile: (profileId: string) => SqlFilter;
|
|
4
4
|
unseen: () => SqlFilter;
|
|
5
5
|
unread: () => SqlFilter;
|
|
6
|
+
/**
|
|
7
|
+
* `type` lives in the JSONB body (not a column), so this is a raw-SQL
|
|
8
|
+
* filter — the same `pgSql` escape hatch the feed's `excludeTypes` filter
|
|
9
|
+
* uses. Excludes notifications of the given types (e.g. the feed's hidden
|
|
10
|
+
* types, so "mark all as seen" only covers what is visible). Like
|
|
11
|
+
* `postFilters.notCreatorIn`, an empty list is a no-op filter.
|
|
12
|
+
*/
|
|
13
|
+
typesNotIn: (types: string[]) => SqlFilter | undefined;
|
|
6
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { eq, sql } from 'drizzle-orm';
|
|
1
|
+
import { eq, notInArray, sql } from 'drizzle-orm';
|
|
2
2
|
import { notifications } from '../schema/documents.js';
|
|
3
3
|
import { pgSql } from './types.js';
|
|
4
4
|
const seenExpr = sql `COALESCE((${notifications.body}->>'seen')::boolean, false)`;
|
|
@@ -7,4 +7,14 @@ export const notificationFilters = {
|
|
|
7
7
|
forProfile: (profileId) => pgSql(eq(notifications.profileId, profileId)),
|
|
8
8
|
unseen: () => pgSql(eq(seenExpr, false)),
|
|
9
9
|
unread: () => pgSql(eq(readExpr, false)),
|
|
10
|
+
/**
|
|
11
|
+
* `type` lives in the JSONB body (not a column), so this is a raw-SQL
|
|
12
|
+
* filter — the same `pgSql` escape hatch the feed's `excludeTypes` filter
|
|
13
|
+
* uses. Excludes notifications of the given types (e.g. the feed's hidden
|
|
14
|
+
* types, so "mark all as seen" only covers what is visible). Like
|
|
15
|
+
* `postFilters.notCreatorIn`, an empty list is a no-op filter.
|
|
16
|
+
*/
|
|
17
|
+
typesNotIn: (types) => types.length
|
|
18
|
+
? pgSql(notInArray(sql `${notifications.body} ->> 'type'`, types))
|
|
19
|
+
: undefined,
|
|
10
20
|
};
|
|
@@ -4,4 +4,10 @@ export type SqlFilter = {
|
|
|
4
4
|
where: SQL;
|
|
5
5
|
};
|
|
6
6
|
export declare const isSqlFilter: (filter: unknown) => filter is SqlFilter;
|
|
7
|
+
/**
|
|
8
|
+
* Raw-SQL filter escape hatch. Use only when the predicate cannot be
|
|
9
|
+
* expressed as a column filter — e.g. over a JSONB-resident field like
|
|
10
|
+
* `body ->> 'type'`. Pass a drizzle `SQL` fragment with values bound through
|
|
11
|
+
* the `sql` template tag (parameterized, never string-interpolated).
|
|
12
|
+
*/
|
|
7
13
|
export declare const pgSql: (where: SQL) => SqlFilter;
|
|
@@ -2,4 +2,10 @@ export const isSqlFilter = (filter) => typeof filter === 'object' &&
|
|
|
2
2
|
filter !== null &&
|
|
3
3
|
'kind' in filter &&
|
|
4
4
|
filter.kind === 'sql';
|
|
5
|
+
/**
|
|
6
|
+
* Raw-SQL filter escape hatch. Use only when the predicate cannot be
|
|
7
|
+
* expressed as a column filter — e.g. over a JSONB-resident field like
|
|
8
|
+
* `body ->> 'type'`. Pass a drizzle `SQL` fragment with values bound through
|
|
9
|
+
* the `sql` template tag (parameterized, never string-interpolated).
|
|
10
|
+
*/
|
|
5
11
|
export const pgSql = (where) => ({ kind: 'sql', where });
|
package/dist/jams/mapping.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const jamEventsMapping: import("../db/pg/map").Mapping<{
|
|
|
10
10
|
type: "message" | "join" | "close" | "reaction" | "start" | "leave" | "recordStart" | "recordStop" | "streamStart" | "streamStop";
|
|
11
11
|
profileId: string;
|
|
12
12
|
content?: string | undefined;
|
|
13
|
-
reaction?: "👍" | undefined;
|
|
13
|
+
reaction?: "👍" | "👎" | "❤️" | "😂" | "😮" | "😢" | "🎉" | undefined;
|
|
14
14
|
recurrenceId?: string | undefined;
|
|
15
15
|
}, JamEvent, JamEvent>;
|
|
16
16
|
export declare const jamSessionStartsMapping: import("../db/pg/map").Mapping<{
|
|
@@ -19,7 +19,7 @@ export declare const jamSessionStartsMapping: import("../db/pg/map").Mapping<{
|
|
|
19
19
|
type: "message" | "join" | "close" | "reaction" | "start" | "leave" | "recordStart" | "recordStop" | "streamStart" | "streamStop";
|
|
20
20
|
profileId: string;
|
|
21
21
|
content?: string | undefined;
|
|
22
|
-
reaction?: "👍" | undefined;
|
|
22
|
+
reaction?: "👍" | "👎" | "❤️" | "😂" | "😮" | "😢" | "🎉" | undefined;
|
|
23
23
|
recurrenceId?: string | undefined;
|
|
24
24
|
}, JamEvent, JamEvent>;
|
|
25
25
|
export declare const jamSessionClosesMapping: import("../db/pg/map").Mapping<{
|
|
@@ -28,7 +28,7 @@ export declare const jamSessionClosesMapping: import("../db/pg/map").Mapping<{
|
|
|
28
28
|
type: "message" | "join" | "close" | "reaction" | "start" | "leave" | "recordStart" | "recordStop" | "streamStart" | "streamStop";
|
|
29
29
|
profileId: string;
|
|
30
30
|
content?: string | undefined;
|
|
31
|
-
reaction?: "👍" | undefined;
|
|
31
|
+
reaction?: "👍" | "👎" | "❤️" | "😂" | "😮" | "😢" | "🎉" | undefined;
|
|
32
32
|
recurrenceId?: string | undefined;
|
|
33
33
|
}, JamEvent, JamEvent>;
|
|
34
34
|
export declare const jamParticipantsMapping: import("../db/pg/map").Mapping<{
|
|
@@ -37,7 +37,7 @@ export declare const jamParticipantsMapping: import("../db/pg/map").Mapping<{
|
|
|
37
37
|
type: "message" | "join" | "close" | "reaction" | "start" | "leave" | "recordStart" | "recordStop" | "streamStart" | "streamStop";
|
|
38
38
|
profileId: string;
|
|
39
39
|
content?: string | undefined;
|
|
40
|
-
reaction?: "👍" | undefined;
|
|
40
|
+
reaction?: "👍" | "👎" | "❤️" | "😂" | "😮" | "😢" | "🎉" | undefined;
|
|
41
41
|
recurrenceId?: string | undefined;
|
|
42
42
|
}, JamEvent, JamEvent>;
|
|
43
43
|
export declare const jamRecordingRelation: RelationWithMapping<PostWithMeta, JamRecording>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ExpandedNotification, NotificationStats, ProfileWithMeta } from '@openpeepshq/common/types';
|
|
2
2
|
export declare const findNotification: (profile: ProfileWithMeta, notificationId: string) => Promise<ExpandedNotification | undefined>;
|
|
3
|
-
export declare const listNotificationsByProfile: (profile: ProfileWithMeta, { start, limit }?: {
|
|
3
|
+
export declare const listNotificationsByProfile: (profile: ProfileWithMeta, { start, limit, excludeTypes, }?: {
|
|
4
4
|
start?: string;
|
|
5
5
|
limit?: number;
|
|
6
|
+
excludeTypes?: string[];
|
|
6
7
|
}) => Promise<ExpandedNotification[]>;
|
|
7
8
|
export declare const getNotificationStats: (profile: ProfileWithMeta) => Promise<NotificationStats>;
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { allpeepDb } from '../db/index.js';
|
|
2
2
|
import { addStart, filterAndTransform } from '../db/helpers.js';
|
|
3
|
+
import { notificationFilters } from '../db/pg/filters/index.js';
|
|
3
4
|
import { baseListNotifications, expandNotification, unreadNotifications, unseenNotifications, } from './helpers.js';
|
|
4
5
|
export const findNotification = (profile, notificationId) => allpeepDb()
|
|
5
6
|
.then(({ db }) => baseListNotifications(profile).find(db, notificationId))
|
|
6
7
|
.then((notification) => notification?.profileId === profile.id
|
|
7
8
|
? expandNotification(notification)
|
|
8
9
|
: undefined);
|
|
9
|
-
export const listNotificationsByProfile = (profile, { start, limit = 100 } = {
|
|
10
|
+
export const listNotificationsByProfile = (profile, { start, limit = 100, excludeTypes, } = {
|
|
11
|
+
limit: 100,
|
|
12
|
+
}) => allpeepDb().then(({ db }) => {
|
|
13
|
+
// Applying the exclusion to the mapping (not post-fetch) keeps
|
|
14
|
+
// `limit` = visible items per page, which the client relies on to know
|
|
15
|
+
// when the feed is exhausted. Same `typesNotIn` predicate "mark all as
|
|
16
|
+
// seen" (setAllSeen) applies.
|
|
17
|
+
const base = baseListNotifications(profile);
|
|
18
|
+
const filtered = base.filter(excludeTypes?.length
|
|
19
|
+
? notificationFilters.typesNotIn(excludeTypes)
|
|
20
|
+
: undefined);
|
|
21
|
+
return filterAndTransform(addStart(filtered, start), db, { transform: expandNotification, limit });
|
|
22
|
+
});
|
|
10
23
|
export const getNotificationStats = async (profile) => ({
|
|
11
24
|
unread: await unreadNotifications(profile),
|
|
12
25
|
unseen: await unseenNotifications(profile),
|
|
@@ -2,5 +2,11 @@ import { DbNotification, ExpandedNotification, NotificationData, ProfileWithMeta
|
|
|
2
2
|
export declare const updateNotification: (notification: ExpandedNotification | DbNotification, data: Partial<NotificationData>) => Promise<DbNotification>;
|
|
3
3
|
export declare const setNotificationRead: (notification: ExpandedNotification | DbNotification) => Promise<DbNotification>;
|
|
4
4
|
export declare const setNotificationSeen: (notification: ExpandedNotification | DbNotification) => Promise<DbNotification>;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Marks the profile's unseen notifications seen. When `excludeTypes` is
|
|
7
|
+
* given, notifications of those types are skipped: hidden types are only
|
|
8
|
+
* excluded from the feed view, so "mark all as seen" should not touch
|
|
9
|
+
* notifications the user is not seeing.
|
|
10
|
+
*/
|
|
11
|
+
export declare const setAllSeen: (profile: ProfileWithMeta, excludeTypes?: string[]) => Promise<Promise<DbNotification>[]>;
|
|
6
12
|
export declare const maybeCreateNotification: (profile: PublicProfile, data: Omit<NotificationData, "profileId">) => Promise<void>;
|
|
@@ -14,9 +14,18 @@ export const updateNotification = async (notification, data) => {
|
|
|
14
14
|
};
|
|
15
15
|
export const setNotificationRead = async (notification) => updateNotification(notification, { read: true });
|
|
16
16
|
export const setNotificationSeen = async (notification) => updateNotification(notification, { seen: true });
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Marks the profile's unseen notifications seen. When `excludeTypes` is
|
|
19
|
+
* given, notifications of those types are skipped: hidden types are only
|
|
20
|
+
* excluded from the feed view, so "mark all as seen" should not touch
|
|
21
|
+
* notifications the user is not seeing.
|
|
22
|
+
*/
|
|
23
|
+
export const setAllSeen = async (profile, excludeTypes) => allpeepDb()
|
|
18
24
|
.then(({ db }) => baseListNotifications(profile)
|
|
19
25
|
.filter(notificationFilters.unseen())
|
|
26
|
+
.filter(excludeTypes
|
|
27
|
+
? notificationFilters.typesNotIn(excludeTypes)
|
|
28
|
+
: undefined)
|
|
20
29
|
.all(db))
|
|
21
30
|
.then((notifications) => notifications.map((notification) => setNotificationSeen(notification)));
|
|
22
31
|
export const maybeCreateNotification = async (profile, data) => {
|
|
@@ -5,7 +5,7 @@ import { composeFilters, connectionFinder, connector, disconnector, filterAndTra
|
|
|
5
5
|
import { allpeepDb, collectionInfos } from '../../db/index.js';
|
|
6
6
|
import { capabilitiesConfig } from '../../config/index.js';
|
|
7
7
|
import { canReadPost } from './filters.js';
|
|
8
|
-
import {
|
|
8
|
+
import { currentReactionsFromEntries, isBlockedPair, isReactionHistoryEntry, isReactionType, matchMentionHandles, normalizePostDataFromDb, toHiddenPost, tombstoneProfileWithMetaIfDeleted, } from '@openpeepshq/common/lib';
|
|
9
9
|
import { EMBEDDED_REPOSTS_LIMIT } from '../mapping.js';
|
|
10
10
|
import { loadThreadPreviewReplies } from '../threadPreview.js';
|
|
11
11
|
export const isDirect = (post) => post.visibility === 'direct';
|
|
@@ -92,15 +92,13 @@ export const transformPost = async (post, currentProfile, options = {}) => {
|
|
|
92
92
|
? await Promise.all(post.entries.map(addProfileForEntry))
|
|
93
93
|
: [];
|
|
94
94
|
const entries = allEntries.filter((entry) => !isReactionHistoryEntry(entry.type));
|
|
95
|
+
// The public schema only accepts curated reactions, so drop anything else
|
|
96
|
+
// (legacy logs) before it can fail response validation.
|
|
95
97
|
const reactions = currentReactionsFromEntries(allEntries)
|
|
96
|
-
.filter((item) => item.reaction
|
|
98
|
+
.filter((item) => isReactionType(item.reaction))
|
|
97
99
|
// Privacy boundary: hide reactions from blocked pairs (either direction),
|
|
98
100
|
// mirroring how blocked creators are tombstoned via withBlockTombstone.
|
|
99
|
-
.filter((item) => !currentProfile || !isBlockedPair(currentProfile, item.profile.id))
|
|
100
|
-
.map((item) => ({
|
|
101
|
-
reaction: AP_LIKE_REACTION,
|
|
102
|
-
profile: item.profile,
|
|
103
|
-
}));
|
|
101
|
+
.filter((item) => !currentProfile || !isBlockedPair(currentProfile, item.profile.id));
|
|
104
102
|
const reposts = await leanRepostsFromWrappers(post.reposts);
|
|
105
103
|
const audience = post.audience
|
|
106
104
|
? (await Promise.all(post.audience.map((p) => loadPublicProfile(p.id)))).filter((profile) => !!profile)
|
|
@@ -8,7 +8,7 @@ export declare const createPost: (data: PostDataUnion, profile: Profile, postDat
|
|
|
8
8
|
}) => Promise<PostWithMeta>;
|
|
9
9
|
export declare const updatePost: (post: PostWithMeta, profile: Profile, data: PostDataUnion) => Promise<PostWithMeta>;
|
|
10
10
|
export declare const reactToPost: (post: PostWithMeta, profile: Profile, data: ReactionData) => Promise<void>;
|
|
11
|
-
export declare const retractReaction: (post: PostWithMeta, profile: Profile) => Promise<import("../db/pg/map").WithId<({
|
|
11
|
+
export declare const retractReaction: (post: PostWithMeta, profile: Profile, data: ReactionData) => Promise<import("../db/pg/map").WithId<({
|
|
12
12
|
type: "create";
|
|
13
13
|
data: {
|
|
14
14
|
type: "note";
|
package/dist/posts/mutations.js
CHANGED
|
@@ -13,7 +13,7 @@ import { profilesCache } from '../profiles/cache.js';
|
|
|
13
13
|
import { findOrCreateHashtag } from '../hashtags/index.js';
|
|
14
14
|
import { hub } from '../events/index.js';
|
|
15
15
|
import { listUnseenGroupPostIds } from './unseenCounts.js';
|
|
16
|
-
import {
|
|
16
|
+
import { canManageEventRsvps, capacityRsvpDecision, eventDataForDbUpdate, getEffectiveRsvp, instanceRsvpIdsForProfile, isOneToOneDm, normalizeEventDataForSave, overlaySeriesRsvpEntries, participantIds, passThroughUndefined, rsvpCancelNotice, rsvpTargetsPastEvent, sameRecurrenceId, } from '@openpeepshq/common/lib';
|
|
17
17
|
import { forbidden, notFound, unprocessableRequest } from '../errors/index.js';
|
|
18
18
|
import { areBlocked, hasBlockAmong } from '../profiles/blocks.js';
|
|
19
19
|
import { rebuildEventOccurrences, clearEventOccurrences, } from './eventOccurrences.js';
|
|
@@ -162,9 +162,9 @@ export const reactToPost = async (post, profile, data) => allpeepDb().then(({ db
|
|
|
162
162
|
type: 'reaction',
|
|
163
163
|
...data,
|
|
164
164
|
})));
|
|
165
|
-
export const retractReaction = async (post, profile) => allpeepDb().then(({ db }) => entryConnector(db, profile, post, {
|
|
165
|
+
export const retractReaction = async (post, profile, data) => allpeepDb().then(({ db }) => entryConnector(db, profile, post, {
|
|
166
166
|
type: 'unreaction',
|
|
167
|
-
data: { reaction:
|
|
167
|
+
data: { reaction: data.reaction },
|
|
168
168
|
}));
|
|
169
169
|
export const bookmarkPost = async (post, profile) => allpeepDb().then(({ db }) => bookmarkConnector(db, profile, post).then(() => hub.emit('bookmarkCreated', profile, post)));
|
|
170
170
|
export const unbookmarkPost = async (post, profile) => allpeepDb().then(({ db }) => bookmarkDisconnector(db, profile, post));
|
|
@@ -14,6 +14,7 @@ export declare const profileSettingsMapping: import("../db/pg/map").Mapping<{
|
|
|
14
14
|
push: boolean;
|
|
15
15
|
email: boolean;
|
|
16
16
|
}> | undefined;
|
|
17
|
+
hiddenNotificationTypes?: string[] | undefined;
|
|
17
18
|
groupNotificationLevels?: Record<string, "off" | "all" | "mostRelevant"> | undefined;
|
|
18
19
|
jamSettings?: {
|
|
19
20
|
backgroundObfuscation?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpeepshq/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"dependencies": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"apns2": "^12.2.0",
|
|
11
11
|
"archiver": "^7.0.1",
|
|
12
12
|
"bcrypt": "^5.1.1",
|
|
13
|
-
"bullmq": "^5.
|
|
13
|
+
"bullmq": "^5.81.5",
|
|
14
14
|
"cache-manager": "^7.2.4",
|
|
15
15
|
"cacheable": "^2.1.1",
|
|
16
16
|
"change-case": "^5.4.4",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"deepmerge-ts": "^8.0.2",
|
|
19
19
|
"dotenv": "^16.4.7",
|
|
20
20
|
"drizzle-orm": "^0.45.2",
|
|
21
|
-
"extract-zip": "^2.0.1",
|
|
22
21
|
"firebase-admin": "^13.10.0",
|
|
23
22
|
"fluent-ffmpeg": "^2.1.3",
|
|
24
23
|
"fs-extra": "^11.3.0",
|
|
@@ -26,6 +25,7 @@
|
|
|
26
25
|
"i18next-fs-backend": "^2.6.6",
|
|
27
26
|
"jose": "^5.9.6",
|
|
28
27
|
"livekit-server-sdk": "^2.15.4",
|
|
28
|
+
"node-stream-zip": "^1.16.0",
|
|
29
29
|
"nodemailer": "^10.0.0",
|
|
30
30
|
"pdfkit": "^0.19.1",
|
|
31
31
|
"pg": "^8.16.0",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"type-fest": "^4.31.0",
|
|
38
38
|
"uuidv7": "^1.0.2",
|
|
39
39
|
"web-push": "^3.6.7",
|
|
40
|
-
"@openpeepshq/common": "0.
|
|
40
|
+
"@openpeepshq/common": "0.11.0",
|
|
41
41
|
"@openpeepshq/fetch-client": "^0.2.1",
|
|
42
42
|
"@openpeepshq/geocoder": "^0.1.2",
|
|
43
|
-
"@openpeepshq/i18n": "^0.
|
|
43
|
+
"@openpeepshq/i18n": "^0.12.0"
|
|
44
44
|
},
|
|
45
45
|
"main": "dist/index.js",
|
|
46
46
|
"types": "dist/index.d.ts",
|