@openpeepshq/common 0.5.12 → 0.6.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/dist/lib/capabilitiesHelpers.d.ts +7 -7
- package/dist/lib/eventIcs.js +58 -15
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/videoEmbed.d.ts +12 -0
- package/dist/lib/videoEmbed.js +105 -0
- package/dist/types/api.d.ts +9 -4
- package/dist/types/auth.d.ts +6 -0
- package/dist/types/config.d.ts +3 -0
- package/dist/types/config.js +6 -0
- package/dist/types/db.d.ts +77 -0
- package/dist/types/internal.d.ts +464 -0
- package/dist/types/models.d.ts +8 -0
- package/dist/types/models.js +1 -0
- package/package.json +7 -5
- package/src/lib/eventIcs.ts +71 -15
- package/src/lib/index.ts +1 -0
- package/src/lib/videoEmbed.ts +116 -0
- package/src/types/config.ts +6 -0
- package/src/types/models.ts +1 -0
|
@@ -48,7 +48,7 @@ export declare const checkGroupCapabilities: (authData: AuthorizationData, neede
|
|
|
48
48
|
missingCapabilities: string[];
|
|
49
49
|
missingScope: {
|
|
50
50
|
resource: {
|
|
51
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
51
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
52
52
|
id?: string | undefined;
|
|
53
53
|
};
|
|
54
54
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -59,7 +59,7 @@ export declare const checkPostCapabilities: (authData: AuthorizationData, needed
|
|
|
59
59
|
missingCapabilities: string[];
|
|
60
60
|
missingScope: {
|
|
61
61
|
resource: {
|
|
62
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
62
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
63
63
|
id?: string | undefined;
|
|
64
64
|
};
|
|
65
65
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -70,7 +70,7 @@ export declare const checkProfileCapabilities: (authData: AuthorizationData, nee
|
|
|
70
70
|
missingCapabilities: string[];
|
|
71
71
|
missingScope: {
|
|
72
72
|
resource: {
|
|
73
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
73
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
74
74
|
id?: string | undefined;
|
|
75
75
|
};
|
|
76
76
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -81,7 +81,7 @@ export declare const checkReportCapabilities: (authData: AuthorizationData, need
|
|
|
81
81
|
missingCapabilities: string[];
|
|
82
82
|
missingScope: {
|
|
83
83
|
resource: {
|
|
84
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
84
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
85
85
|
id?: string | undefined;
|
|
86
86
|
};
|
|
87
87
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -92,7 +92,7 @@ export declare const checkAccessTokenCapabilities: (authData: AuthorizationData,
|
|
|
92
92
|
missingCapabilities: string[];
|
|
93
93
|
missingScope: {
|
|
94
94
|
resource: {
|
|
95
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
95
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
96
96
|
id?: string | undefined;
|
|
97
97
|
};
|
|
98
98
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -103,7 +103,7 @@ export declare const checkAccountCapabilities: (authData: AuthorizationData, nee
|
|
|
103
103
|
missingCapabilities: string[];
|
|
104
104
|
missingScope: {
|
|
105
105
|
resource: {
|
|
106
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
106
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
107
107
|
id?: string | undefined;
|
|
108
108
|
};
|
|
109
109
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -121,7 +121,7 @@ export declare const checkAccountCreateAuthorization: (authData: AuthorizationDa
|
|
|
121
121
|
missingCapabilities: string[];
|
|
122
122
|
missingScope: {
|
|
123
123
|
resource: {
|
|
124
|
-
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "analytics" | "render";
|
|
124
|
+
type: "self" | "*" | "db" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
|
|
125
125
|
id?: string | undefined;
|
|
126
126
|
};
|
|
127
127
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
package/dist/lib/eventIcs.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import ical, { ICalCalendarMethod, ICalEventRepeatingFreq, ICalWeekday, } from 'ical-generator';
|
|
2
|
+
import { TZDate } from '@date-fns/tz';
|
|
3
|
+
import { tzlib_get_ical_block } from 'timezones-ical-library';
|
|
2
4
|
import { effectiveEventTimes } from './eventRecurrence.js';
|
|
3
5
|
import { getJamUrl } from './jamHelpers.js';
|
|
6
|
+
import { isIanaTimeZone } from './timeZone.js';
|
|
4
7
|
const utcDateFromYmd = (yyyyMmDd) => {
|
|
5
8
|
const [y, m, d] = yyyyMmDd.split('-').map(Number);
|
|
6
9
|
return new Date(Date.UTC(y, m - 1, d));
|
|
@@ -10,6 +13,36 @@ const exclusiveEndAfterInclusiveDay = (yyyyMmDd) => {
|
|
|
10
13
|
dt.setUTCDate(dt.getUTCDate() + 1);
|
|
11
14
|
return dt;
|
|
12
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* The event's stored IANA zone when it is one; ical-generator writes any
|
|
18
|
+
* `timezone` string verbatim into `TZID=`, so non-IANA values fall back to
|
|
19
|
+
* UTC output here.
|
|
20
|
+
*/
|
|
21
|
+
const eventTimeZone = (event) => isIanaTimeZone(event.timeZone) ? event.timeZone : undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A zone-aware Date: ical-generator formats a TZDate's wall-clock components
|
|
24
|
+
* in the event's zone, so the host's local zone (and its DST gaps) never
|
|
25
|
+
* shifts the exported time.
|
|
26
|
+
*/
|
|
27
|
+
const instantInZone = (iso, timeZone) => timeZone ? new TZDate(iso, timeZone) : new Date(iso);
|
|
28
|
+
/** The default 1-hour end keeps the event's zone (or UTC). */
|
|
29
|
+
const defaultEnd = (start, timeZone) => timeZone
|
|
30
|
+
? new TZDate(start.getTime() + 60 * 60 * 1000, timeZone)
|
|
31
|
+
: new Date(start.getTime() + 60 * 60 * 1000);
|
|
32
|
+
/**
|
|
33
|
+
* RFC 5545 requires a VTIMEZONE for every TZID used. ical-generator only
|
|
34
|
+
* emits one via a calendar-level timezone, which in v10 also re-zones
|
|
35
|
+
* UNTIL and DTSTAMP (both of which must stay UTC), so the component is
|
|
36
|
+
* spliced in before the first VEVENT instead.
|
|
37
|
+
*/
|
|
38
|
+
const withVtimezone = (calendarText, timeZone) => {
|
|
39
|
+
const [block] = tzlib_get_ical_block(timeZone);
|
|
40
|
+
const normalized = block.replace(/\r?\n/g, '\r\n').trim() + '\r\n';
|
|
41
|
+
const veventIndex = calendarText.indexOf('BEGIN:VEVENT');
|
|
42
|
+
return (calendarText.slice(0, veventIndex) +
|
|
43
|
+
normalized +
|
|
44
|
+
calendarText.slice(veventIndex));
|
|
45
|
+
};
|
|
13
46
|
const originFromUrl = (url) => {
|
|
14
47
|
if (!url) {
|
|
15
48
|
return undefined;
|
|
@@ -49,13 +82,13 @@ const repeatingWeekday = {
|
|
|
49
82
|
SA: ICalWeekday.SA,
|
|
50
83
|
SU: ICalWeekday.SU,
|
|
51
84
|
};
|
|
52
|
-
const repeatingOptions = (event) => {
|
|
85
|
+
const repeatingOptions = (event, timeZone) => {
|
|
53
86
|
const recurrence = event.recurrence;
|
|
54
87
|
if (!recurrence)
|
|
55
88
|
return undefined;
|
|
56
89
|
const exclude = (event.exceptions ?? [])
|
|
57
90
|
.filter((exception) => exception.cancelled)
|
|
58
|
-
.map((exception) =>
|
|
91
|
+
.map((exception) => instantInZone(exception.recurrenceId, timeZone));
|
|
59
92
|
return {
|
|
60
93
|
freq: repeatingFreq[recurrence.freq],
|
|
61
94
|
interval: recurrence.interval ?? 1,
|
|
@@ -81,7 +114,10 @@ export const buildEventIcs = (post, options) => {
|
|
|
81
114
|
const summary = event.name?.trim() || 'Event';
|
|
82
115
|
const description = event.content?.trim();
|
|
83
116
|
const location = eventLocation(post, event, options?.postUrl);
|
|
84
|
-
|
|
117
|
+
// Timed events keep the event's own zone; all-day events use DATE values
|
|
118
|
+
// and carry no zone.
|
|
119
|
+
const timeZone = event.wholeDay ? undefined : eventTimeZone(event);
|
|
120
|
+
const repeating = repeatingOptions(event, timeZone);
|
|
85
121
|
if (event.wholeDay) {
|
|
86
122
|
const startYmd = event.start.slice(0, 10);
|
|
87
123
|
const lastInclusiveYmd = event.end?.slice(0, 10) ?? startYmd;
|
|
@@ -98,14 +134,15 @@ export const buildEventIcs = (post, options) => {
|
|
|
98
134
|
});
|
|
99
135
|
}
|
|
100
136
|
else {
|
|
101
|
-
const start =
|
|
137
|
+
const start = instantInZone(event.start, timeZone);
|
|
102
138
|
const end = event.end
|
|
103
|
-
?
|
|
104
|
-
:
|
|
139
|
+
? instantInZone(event.end, timeZone)
|
|
140
|
+
: defaultEnd(start, timeZone);
|
|
105
141
|
calendar.createEvent({
|
|
106
142
|
id: `openpeeps-event-${post.id}@openpeepshq`,
|
|
107
143
|
start,
|
|
108
144
|
end,
|
|
145
|
+
...(timeZone ? { timezone: timeZone } : {}),
|
|
109
146
|
summary,
|
|
110
147
|
...(description ? { description } : {}),
|
|
111
148
|
...(location ? { location } : {}),
|
|
@@ -116,22 +153,24 @@ export const buildEventIcs = (post, options) => {
|
|
|
116
153
|
for (const exception of event.exceptions ?? []) {
|
|
117
154
|
if (exception.cancelled || !exception.start)
|
|
118
155
|
continue;
|
|
119
|
-
const start =
|
|
156
|
+
const start = instantInZone(exception.start, timeZone);
|
|
120
157
|
const end = exception.end
|
|
121
|
-
?
|
|
122
|
-
:
|
|
158
|
+
? instantInZone(exception.end, timeZone)
|
|
159
|
+
: defaultEnd(start, timeZone);
|
|
123
160
|
calendar.createEvent({
|
|
124
161
|
id: `openpeeps-event-${post.id}-${exception.recurrenceId}@openpeepshq`,
|
|
125
162
|
start,
|
|
126
163
|
end,
|
|
164
|
+
...(timeZone ? { timezone: timeZone } : {}),
|
|
127
165
|
summary,
|
|
128
166
|
...(description ? { description } : {}),
|
|
129
167
|
...(location ? { location } : {}),
|
|
130
168
|
...(link ? { url: link } : {}),
|
|
131
|
-
recurrenceId:
|
|
169
|
+
recurrenceId: instantInZone(exception.recurrenceId, timeZone),
|
|
132
170
|
});
|
|
133
171
|
}
|
|
134
|
-
|
|
172
|
+
const calendarText = calendar.toString();
|
|
173
|
+
return ((timeZone ? withVtimezone(calendarText, timeZone) : calendarText) + '\r\n');
|
|
135
174
|
};
|
|
136
175
|
const addOccurrenceEvent = (calendar, post, event, recurrenceId, options) => {
|
|
137
176
|
const link = event.url ?? options?.postUrl;
|
|
@@ -140,6 +179,7 @@ const addOccurrenceEvent = (calendar, post, event, recurrenceId, options) => {
|
|
|
140
179
|
const location = eventLocation(post, event, options?.postUrl);
|
|
141
180
|
const times = effectiveEventTimes(event, recurrenceId);
|
|
142
181
|
const id = `openpeeps-event-${post.id}-${recurrenceId}@openpeepshq`;
|
|
182
|
+
const timeZone = event.wholeDay ? undefined : eventTimeZone(event);
|
|
143
183
|
if (event.wholeDay) {
|
|
144
184
|
const startYmd = times.start.slice(0, 10);
|
|
145
185
|
const lastInclusiveYmd = times.end?.slice(0, 10) ?? startYmd;
|
|
@@ -155,14 +195,15 @@ const addOccurrenceEvent = (calendar, post, event, recurrenceId, options) => {
|
|
|
155
195
|
});
|
|
156
196
|
return;
|
|
157
197
|
}
|
|
158
|
-
const start =
|
|
198
|
+
const start = instantInZone(times.start, timeZone);
|
|
159
199
|
const end = times.end
|
|
160
|
-
?
|
|
161
|
-
:
|
|
200
|
+
? instantInZone(times.end, timeZone)
|
|
201
|
+
: defaultEnd(start, timeZone);
|
|
162
202
|
calendar.createEvent({
|
|
163
203
|
id,
|
|
164
204
|
start,
|
|
165
205
|
end,
|
|
206
|
+
...(timeZone ? { timezone: timeZone } : {}),
|
|
166
207
|
summary,
|
|
167
208
|
...(description ? { description } : {}),
|
|
168
209
|
...(location ? { location } : {}),
|
|
@@ -187,7 +228,9 @@ export const buildRsvpIcs = (post, options) => {
|
|
|
187
228
|
for (const recurrenceId of occurrenceIds) {
|
|
188
229
|
addOccurrenceEvent(calendar, post, event, recurrenceId, options);
|
|
189
230
|
}
|
|
190
|
-
|
|
231
|
+
const timeZone = event.wholeDay ? undefined : eventTimeZone(event);
|
|
232
|
+
const calendarText = calendar.toString();
|
|
233
|
+
return ((timeZone ? withVtimezone(calendarText, timeZone) : calendarText) + '\r\n');
|
|
191
234
|
};
|
|
192
235
|
export const rsvpConfirmationContent = (post, options) => {
|
|
193
236
|
if (post.type !== 'event' || post.data?.type !== 'event') {
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VideoEmbed {
|
|
2
|
+
provider: 'youtube' | 'vimeo';
|
|
3
|
+
embedUrl: string;
|
|
4
|
+
/** Origin of `embedUrl`, for same-origin checks in WebView guards. */
|
|
5
|
+
origin: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Embed info for plain video URLs on supported providers (YouTube
|
|
9
|
+
* watch/share/shorts/embed, Vimeo). Lets the client render a playable
|
|
10
|
+
* player instead of a link card.
|
|
11
|
+
*/
|
|
12
|
+
export declare const videoEmbedForUrl: (url: string) => VideoEmbed | undefined;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const YOUTUBE_ID_RE = /^[A-Za-z0-9_-]{6,15}$/;
|
|
2
|
+
const VIMEO_ID_RE = /^\d{6,}$/;
|
|
3
|
+
const YOUTUBE_ORIGIN = 'https://www.youtube-nocookie.com';
|
|
4
|
+
const VIMEO_ORIGIN = 'https://player.vimeo.com';
|
|
5
|
+
/**
|
|
6
|
+
* Maps a YouTube `t=`/`start=` timestamp to seconds. Accepts `42`, `42s`,
|
|
7
|
+
* `1:30`, `1m30s`, and `1h2m3s` forms.
|
|
8
|
+
*/
|
|
9
|
+
const parseYouTubeStart = (raw) => {
|
|
10
|
+
const trimmed = raw.trim();
|
|
11
|
+
if (trimmed === '')
|
|
12
|
+
return undefined;
|
|
13
|
+
if (/^\d+$/.test(trimmed))
|
|
14
|
+
return Number(trimmed);
|
|
15
|
+
const compact = trimmed.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);
|
|
16
|
+
if (compact) {
|
|
17
|
+
const [, hours, minutes, seconds] = compact;
|
|
18
|
+
if (!hours && !minutes && !seconds)
|
|
19
|
+
return undefined;
|
|
20
|
+
return (Number(hours ?? 0) * 3600 +
|
|
21
|
+
Number(minutes ?? 0) * 60 +
|
|
22
|
+
Number(seconds ?? 0));
|
|
23
|
+
}
|
|
24
|
+
const parts = trimmed.split(':');
|
|
25
|
+
if (parts.length > 3 || parts.some((part) => !/^\d+$/.test(part))) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return parts.reduce((total, part) => total * 60 + Number(part), 0);
|
|
29
|
+
};
|
|
30
|
+
const youtubeEmbed = (id, parsed) => {
|
|
31
|
+
const rawStart = parsed.searchParams.get('t') ?? parsed.searchParams.get('start');
|
|
32
|
+
const start = rawStart ? parseYouTubeStart(rawStart) : undefined;
|
|
33
|
+
return {
|
|
34
|
+
provider: 'youtube',
|
|
35
|
+
embedUrl: `${YOUTUBE_ORIGIN}/embed/${id}` +
|
|
36
|
+
(start !== undefined && start > 0 ? `?start=${start}` : ''),
|
|
37
|
+
origin: YOUTUBE_ORIGIN,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Embed info for plain video URLs on supported providers (YouTube
|
|
42
|
+
* watch/share/shorts/embed, Vimeo). Lets the client render a playable
|
|
43
|
+
* player instead of a link card.
|
|
44
|
+
*/
|
|
45
|
+
export const videoEmbedForUrl = (url) => {
|
|
46
|
+
let parsed;
|
|
47
|
+
try {
|
|
48
|
+
parsed = new URL(url);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const host = parsed.hostname.replace(/^(www|m)\./, '');
|
|
54
|
+
if (host === 'youtu.be') {
|
|
55
|
+
const id = parsed.pathname.split('/')[1] ?? '';
|
|
56
|
+
return YOUTUBE_ID_RE.test(id) ? youtubeEmbed(id, parsed) : undefined;
|
|
57
|
+
}
|
|
58
|
+
if (host === 'youtube.com') {
|
|
59
|
+
const segments = parsed.pathname.split('/').filter(Boolean);
|
|
60
|
+
let id;
|
|
61
|
+
if (segments[0] === 'watch') {
|
|
62
|
+
id = parsed.searchParams.get('v') ?? undefined;
|
|
63
|
+
}
|
|
64
|
+
else if (segments[0] === 'shorts' || segments[0] === 'embed') {
|
|
65
|
+
id = segments[1];
|
|
66
|
+
}
|
|
67
|
+
return id && YOUTUBE_ID_RE.test(id) ? youtubeEmbed(id, parsed) : undefined;
|
|
68
|
+
}
|
|
69
|
+
if (host === 'vimeo.com' || host === 'player.vimeo.com') {
|
|
70
|
+
const segments = parsed.pathname.split('/').filter(Boolean);
|
|
71
|
+
let id;
|
|
72
|
+
let hash;
|
|
73
|
+
if (host === 'player.vimeo.com') {
|
|
74
|
+
if (segments[0] === 'video') {
|
|
75
|
+
id = segments[1];
|
|
76
|
+
hash = parsed.searchParams.get('h') ?? undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (segments.length === 1) {
|
|
80
|
+
id = segments[0];
|
|
81
|
+
}
|
|
82
|
+
else if (segments.length === 2 && VIMEO_ID_RE.test(segments[0])) {
|
|
83
|
+
// `vimeo.com/<id>/<hash>` — unlisted videos carry the privacy hash
|
|
84
|
+
// in the path.
|
|
85
|
+
id = segments[0];
|
|
86
|
+
hash = segments[1];
|
|
87
|
+
}
|
|
88
|
+
else if (segments.length === 3 && segments[0] === 'channels') {
|
|
89
|
+
id = segments[2];
|
|
90
|
+
}
|
|
91
|
+
else if (segments.length === 4 &&
|
|
92
|
+
segments[0] === 'groups' &&
|
|
93
|
+
segments[2] === 'videos') {
|
|
94
|
+
id = segments[3];
|
|
95
|
+
}
|
|
96
|
+
if (!id || !VIMEO_ID_RE.test(id))
|
|
97
|
+
return undefined;
|
|
98
|
+
return {
|
|
99
|
+
provider: 'vimeo',
|
|
100
|
+
embedUrl: `${VIMEO_ORIGIN}/video/${id}?dnt=1` + (hash ? `&h=${hash}` : ''),
|
|
101
|
+
origin: VIMEO_ORIGIN,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
};
|
package/dist/types/api.d.ts
CHANGED
|
@@ -265,6 +265,7 @@ export declare const publicAccessTokenSchema: z.ZodObject<{
|
|
|
265
265
|
groups: "groups";
|
|
266
266
|
reports: "reports";
|
|
267
267
|
webhooks: "webhooks";
|
|
268
|
+
conversations: "conversations";
|
|
268
269
|
analytics: "analytics";
|
|
269
270
|
render: "render";
|
|
270
271
|
}>;
|
|
@@ -38309,6 +38310,7 @@ export declare const serverInfoSchema: z.ZodObject<{
|
|
|
38309
38310
|
contactEmail: z.ZodOptional<z.ZodString>;
|
|
38310
38311
|
privacyPolicy: z.ZodOptional<z.ZodString>;
|
|
38311
38312
|
termsAndConditions: z.ZodOptional<z.ZodString>;
|
|
38313
|
+
bugReportUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>>;
|
|
38312
38314
|
}, z.core.$strip>;
|
|
38313
38315
|
content: z.ZodObject<{
|
|
38314
38316
|
aboutPage: z.ZodOptional<z.ZodString>;
|
|
@@ -38709,6 +38711,7 @@ export declare const guestPassRequestSchema: z.ZodObject<{
|
|
|
38709
38711
|
groups: "groups";
|
|
38710
38712
|
reports: "reports";
|
|
38711
38713
|
webhooks: "webhooks";
|
|
38714
|
+
conversations: "conversations";
|
|
38712
38715
|
analytics: "analytics";
|
|
38713
38716
|
render: "render";
|
|
38714
38717
|
}>;
|
|
@@ -39049,6 +39052,7 @@ export declare const updateProfileRequestSchema: z.ZodObject<{
|
|
|
39049
39052
|
groups: "groups";
|
|
39050
39053
|
reports: "reports";
|
|
39051
39054
|
webhooks: "webhooks";
|
|
39055
|
+
conversations: "conversations";
|
|
39052
39056
|
analytics: "analytics";
|
|
39053
39057
|
render: "render";
|
|
39054
39058
|
}>;
|
|
@@ -39059,16 +39063,16 @@ export declare const updateProfileRequestSchema: z.ZodObject<{
|
|
|
39059
39063
|
export type UpdateProfileRequest = z.infer<typeof updateProfileRequestSchema>;
|
|
39060
39064
|
export declare const updateAccountPasswordRequestSchema: z.ZodObject<{
|
|
39061
39065
|
email: z.ZodOptional<z.ZodString>;
|
|
39062
|
-
newPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString
|
|
39066
|
+
newPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
39063
39067
|
oldPassword: z.ZodString;
|
|
39064
|
-
confirmPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString
|
|
39068
|
+
confirmPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
39065
39069
|
}, z.core.$strip>;
|
|
39066
39070
|
export type UpdateAccountPasswordRequest = z.infer<typeof updateAccountPasswordRequestSchema>;
|
|
39067
39071
|
export declare const updateAccountPasswordFormSchema: z.ZodObject<{
|
|
39068
39072
|
email: z.ZodOptional<z.ZodString>;
|
|
39069
|
-
newPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString
|
|
39073
|
+
newPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
39070
39074
|
oldPassword: z.ZodString;
|
|
39071
|
-
confirmPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString
|
|
39075
|
+
confirmPassword: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
39072
39076
|
}, z.core.$strip>;
|
|
39073
39077
|
export declare const updateAccountEmailRequestSchema: z.ZodObject<{
|
|
39074
39078
|
newEmail: z.ZodEmail;
|
|
@@ -73050,6 +73054,7 @@ export declare const accessTokenCreationDataSchema: z.ZodObject<{
|
|
|
73050
73054
|
groups: "groups";
|
|
73051
73055
|
reports: "reports";
|
|
73052
73056
|
webhooks: "webhooks";
|
|
73057
|
+
conversations: "conversations";
|
|
73053
73058
|
analytics: "analytics";
|
|
73054
73059
|
render: "render";
|
|
73055
73060
|
}>;
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const authorizationSchema: z.ZodObject<{
|
|
|
23
23
|
groups: "groups";
|
|
24
24
|
reports: "reports";
|
|
25
25
|
webhooks: "webhooks";
|
|
26
|
+
conversations: "conversations";
|
|
26
27
|
analytics: "analytics";
|
|
27
28
|
render: "render";
|
|
28
29
|
}>;
|
|
@@ -79,6 +80,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
79
80
|
groups: "groups";
|
|
80
81
|
reports: "reports";
|
|
81
82
|
webhooks: "webhooks";
|
|
83
|
+
conversations: "conversations";
|
|
82
84
|
analytics: "analytics";
|
|
83
85
|
render: "render";
|
|
84
86
|
}>;
|
|
@@ -148,6 +150,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
148
150
|
groups: "groups";
|
|
149
151
|
reports: "reports";
|
|
150
152
|
webhooks: "webhooks";
|
|
153
|
+
conversations: "conversations";
|
|
151
154
|
analytics: "analytics";
|
|
152
155
|
render: "render";
|
|
153
156
|
}>;
|
|
@@ -207,6 +210,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
207
210
|
groups: "groups";
|
|
208
211
|
reports: "reports";
|
|
209
212
|
webhooks: "webhooks";
|
|
213
|
+
conversations: "conversations";
|
|
210
214
|
analytics: "analytics";
|
|
211
215
|
render: "render";
|
|
212
216
|
}>;
|
|
@@ -334,6 +338,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
334
338
|
groups: "groups";
|
|
335
339
|
reports: "reports";
|
|
336
340
|
webhooks: "webhooks";
|
|
341
|
+
conversations: "conversations";
|
|
337
342
|
analytics: "analytics";
|
|
338
343
|
render: "render";
|
|
339
344
|
}>;
|
|
@@ -366,6 +371,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
366
371
|
groups: "groups";
|
|
367
372
|
reports: "reports";
|
|
368
373
|
webhooks: "webhooks";
|
|
374
|
+
conversations: "conversations";
|
|
369
375
|
analytics: "analytics";
|
|
370
376
|
render: "render";
|
|
371
377
|
}>;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -687,6 +687,7 @@ export declare const communityConfigSchemaFactory: (_sanitize?: boolean) => z.Zo
|
|
|
687
687
|
contactEmail: z.ZodOptional<z.ZodString>;
|
|
688
688
|
privacyPolicy: z.ZodOptional<z.ZodString>;
|
|
689
689
|
termsAndConditions: z.ZodOptional<z.ZodString>;
|
|
690
|
+
bugReportUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>>;
|
|
690
691
|
}, z.core.$strip>;
|
|
691
692
|
content: z.ZodObject<{
|
|
692
693
|
aboutPage: z.ZodOptional<z.ZodString>;
|
|
@@ -768,6 +769,7 @@ export declare const communityConfigSchema: z.ZodObject<{
|
|
|
768
769
|
contactEmail: z.ZodOptional<z.ZodString>;
|
|
769
770
|
privacyPolicy: z.ZodOptional<z.ZodString>;
|
|
770
771
|
termsAndConditions: z.ZodOptional<z.ZodString>;
|
|
772
|
+
bugReportUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>>;
|
|
771
773
|
}, z.core.$strip>;
|
|
772
774
|
content: z.ZodObject<{
|
|
773
775
|
aboutPage: z.ZodOptional<z.ZodString>;
|
|
@@ -849,6 +851,7 @@ export declare const communityConfigSanitizedSchema: z.ZodObject<{
|
|
|
849
851
|
contactEmail: z.ZodOptional<z.ZodString>;
|
|
850
852
|
privacyPolicy: z.ZodOptional<z.ZodString>;
|
|
851
853
|
termsAndConditions: z.ZodOptional<z.ZodString>;
|
|
854
|
+
bugReportUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodURL]>>;
|
|
852
855
|
}, z.core.$strip>;
|
|
853
856
|
content: z.ZodObject<{
|
|
854
857
|
aboutPage: z.ZodOptional<z.ZodString>;
|
package/dist/types/config.js
CHANGED
|
@@ -326,6 +326,12 @@ export const communityConfigSchemaFactory = (_sanitize) => z.object({
|
|
|
326
326
|
contactEmail: z.string().email().optional(),
|
|
327
327
|
privacyPolicy: z.string().optional(),
|
|
328
328
|
termsAndConditions: z.string().optional(),
|
|
329
|
+
/** External bug report form; a "Report a bug" link is shown when set.
|
|
330
|
+
* `''` is the cleared value — pruneEmptyConfigStrings drops it on save.
|
|
331
|
+
* Only http(s) URLs are accepted; the render side re-checks as well. */
|
|
332
|
+
bugReportUrl: z
|
|
333
|
+
.union([z.literal(''), z.url({ protocol: /^https?$/ })])
|
|
334
|
+
.optional(),
|
|
329
335
|
}),
|
|
330
336
|
content: z.object({
|
|
331
337
|
aboutPage: z.string().optional(),
|