@openpeepshq/common 0.1.44 → 0.1.46
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/adminSections.d.ts +4 -0
- package/dist/lib/adminSections.js +5 -0
- package/dist/lib/capabilitiesHelpers.d.ts +9 -7
- package/dist/lib/capabilitiesHelpers.js +21 -13
- package/dist/lib/eventIcs.d.ts +17 -0
- package/dist/lib/eventIcs.js +138 -2
- package/dist/lib/eventRecurrence.d.ts +32 -0
- package/dist/lib/eventRecurrence.js +284 -0
- package/dist/lib/eventTime.d.ts +29 -0
- package/dist/lib/eventTime.js +143 -0
- package/dist/lib/federationHosts.d.ts +3 -0
- package/dist/lib/federationHosts.js +17 -0
- package/dist/lib/feedCursor.d.ts +14 -0
- package/dist/lib/feedCursor.js +22 -0
- package/dist/lib/feedFormat.d.ts +12 -0
- package/dist/lib/feedFormat.js +14 -0
- package/dist/lib/groupHelpers.d.ts +63 -41
- package/dist/lib/groupHelpers.js +155 -45
- package/dist/lib/groupTemplateHelpers.d.ts +16 -0
- package/dist/lib/groupTemplateHelpers.js +51 -0
- package/dist/lib/index.d.ts +11 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/jamHelpers.d.ts +38 -3
- package/dist/lib/jamHelpers.js +93 -8
- package/dist/lib/legacyThemeRoot.d.ts +3 -0
- package/dist/lib/legacyThemeRoot.js +10 -0
- package/dist/lib/markdownHelpers.d.ts +22 -0
- package/dist/lib/markdownHelpers.js +73 -3
- package/dist/lib/postHelpers.d.ts +164 -9
- package/dist/lib/postHelpers.js +353 -11
- package/dist/lib/profileHelpers.d.ts +11 -0
- package/dist/lib/profileHelpers.js +31 -0
- package/dist/lib/pushHelpers.d.ts +3 -1
- package/dist/lib/pushHelpers.js +13 -0
- package/dist/lib/reactions.d.ts +17 -0
- package/dist/lib/reactions.js +37 -0
- package/dist/lib/scopeHelpers.d.ts +31 -2
- package/dist/lib/scopeHelpers.js +37 -3
- package/dist/lib/ssoLoginUrl.d.ts +24 -0
- package/dist/lib/ssoLoginUrl.js +75 -0
- package/dist/lib/ssoProviders.d.ts +72 -0
- package/dist/lib/ssoProviders.js +370 -0
- package/dist/lib/text.d.ts +2 -0
- package/dist/lib/text.js +2 -0
- package/dist/lib/timeZone.d.ts +9 -0
- package/dist/lib/timeZone.js +44 -0
- package/dist/lib/tokenHelpers.d.ts +5 -0
- package/dist/lib/tokenHelpers.js +19 -0
- package/dist/types/analytics.d.ts +20 -0
- package/dist/types/analytics.js +4 -0
- package/dist/types/api.d.ts +42669 -10689
- package/dist/types/api.js +94 -16
- package/dist/types/auth.d.ts +22 -13
- package/dist/types/capabilities.d.ts +26 -5
- package/dist/types/capabilities.js +95 -1
- package/dist/types/config.d.ts +93 -6
- package/dist/types/config.js +56 -5
- package/dist/types/db.d.ts +1911 -248
- package/dist/types/db.js +17 -3
- package/dist/types/export.d.ts +120 -0
- package/dist/types/export.js +7 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/internal.d.ts +8313 -2675
- package/dist/types/internal.js +16 -1
- package/dist/types/models.d.ts +343 -16
- package/dist/types/models.js +98 -7
- package/dist/types/notifications.d.ts +1 -0
- package/dist/types/plugins.d.ts +43 -1
- package/dist/types/plugins.js +75 -1
- package/dist/types/roleDefaults.d.ts +31 -0
- package/dist/types/roleDefaults.js +110 -0
- package/dist/types/stats.d.ts +54359 -4718
- package/dist/types/stats.js +30 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/utils.js +1 -3
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interpret a datetime-local wall clock (`YYYY-MM-DDTHH:mm`) in `timeZone`
|
|
3
|
+
* and return a UTC ISO string.
|
|
4
|
+
*/
|
|
5
|
+
export declare const zonedDateTimeToUtcIso: (local: string, timeZone: string) => string | undefined;
|
|
6
|
+
/** Format a UTC ISO instant as a datetime-local string in `timeZone`. */
|
|
7
|
+
export declare const utcIsoToZonedDateTime: (iso: string, timeZone: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Keep the wall-clock time of `iso` (as seen in `fromTimeZone`) and express
|
|
10
|
+
* that same clock time in `toTimeZone`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const reinterpretIsoInTimeZone: (iso: string | undefined, fromTimeZone: string, toTimeZone: string) => string | undefined;
|
|
13
|
+
/** Build a Date whose local components match `iso` as seen in `timeZone`. */
|
|
14
|
+
export declare const utcIsoToWallClockDate: (iso: string, timeZone: string) => Date;
|
|
15
|
+
/** Treat `date`'s local components as wall time in `timeZone`. */
|
|
16
|
+
export declare const wallClockDateToUtcIso: (date: Date, timeZone: string) => string;
|
|
17
|
+
/** Intl `timeZone` option when `timeZone` is a valid IANA identifier. */
|
|
18
|
+
export declare const eventTimeZoneOptions: (timeZone?: string | null) => Pick<Intl.DateTimeFormatOptions, "timeZone">;
|
|
19
|
+
/** Clock time in the event timezone, always including a short zone name. */
|
|
20
|
+
export declare const formatEventClockTime: (iso: string, options?: {
|
|
21
|
+
timeZone?: string | null;
|
|
22
|
+
locale?: string;
|
|
23
|
+
}) => string;
|
|
24
|
+
export declare const formatEventWhen: (start: string, options?: {
|
|
25
|
+
end?: string | null;
|
|
26
|
+
timeZone?: string | null;
|
|
27
|
+
allDay?: boolean;
|
|
28
|
+
locale?: string;
|
|
29
|
+
}) => string;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { isIanaTimeZone } from './timeZone.js';
|
|
2
|
+
const DATETIME_LOCAL_RE = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
3
|
+
const partNumber = (parts, type) => { var _a; return Number((_a = parts.find((part) => part.type === type)) === null || _a === void 0 ? void 0 : _a.value); };
|
|
4
|
+
/** Milliseconds to add to UTC to get wall time in `timeZone` at `utcMs`. */
|
|
5
|
+
const tzOffsetMs = (utcMs, timeZone) => {
|
|
6
|
+
const parts = new Intl.DateTimeFormat('en-US', {
|
|
7
|
+
timeZone,
|
|
8
|
+
year: 'numeric',
|
|
9
|
+
month: '2-digit',
|
|
10
|
+
day: '2-digit',
|
|
11
|
+
hour: '2-digit',
|
|
12
|
+
minute: '2-digit',
|
|
13
|
+
second: '2-digit',
|
|
14
|
+
hourCycle: 'h23',
|
|
15
|
+
}).formatToParts(new Date(utcMs));
|
|
16
|
+
const hour = partNumber(parts, 'hour');
|
|
17
|
+
const asUtc = Date.UTC(partNumber(parts, 'year'), partNumber(parts, 'month') - 1, partNumber(parts, 'day'), hour === 24 ? 0 : hour, partNumber(parts, 'minute'), partNumber(parts, 'second'));
|
|
18
|
+
return asUtc - utcMs;
|
|
19
|
+
};
|
|
20
|
+
const pad2 = (value) => String(value).padStart(2, '0');
|
|
21
|
+
/**
|
|
22
|
+
* Interpret a datetime-local wall clock (`YYYY-MM-DDTHH:mm`) in `timeZone`
|
|
23
|
+
* and return a UTC ISO string.
|
|
24
|
+
*/
|
|
25
|
+
export const zonedDateTimeToUtcIso = (local, timeZone) => {
|
|
26
|
+
var _a;
|
|
27
|
+
if (!local)
|
|
28
|
+
return undefined;
|
|
29
|
+
const match = DATETIME_LOCAL_RE.exec(local);
|
|
30
|
+
if (!match) {
|
|
31
|
+
const parsed = new Date(local);
|
|
32
|
+
return Number.isNaN(parsed.getTime()) ? undefined : parsed.toISOString();
|
|
33
|
+
}
|
|
34
|
+
const utcGuess = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), Number(match[4]), Number(match[5]), Number((_a = match[6]) !== null && _a !== void 0 ? _a : 0));
|
|
35
|
+
try {
|
|
36
|
+
const offset = tzOffsetMs(utcGuess, timeZone);
|
|
37
|
+
const utcWithOffset = utcGuess - offset;
|
|
38
|
+
const offsetAtResult = tzOffsetMs(utcWithOffset, timeZone);
|
|
39
|
+
const utc = offsetAtResult === offset ? utcWithOffset : utcGuess - offsetAtResult;
|
|
40
|
+
return new Date(utc).toISOString();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return new Date(utcGuess).toISOString();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/** Format a UTC ISO instant as a datetime-local string in `timeZone`. */
|
|
47
|
+
export const utcIsoToZonedDateTime = (iso, timeZone) => {
|
|
48
|
+
const date = new Date(iso);
|
|
49
|
+
if (Number.isNaN(date.getTime()))
|
|
50
|
+
return '';
|
|
51
|
+
try {
|
|
52
|
+
const parts = new Intl.DateTimeFormat('en-US', {
|
|
53
|
+
timeZone,
|
|
54
|
+
year: 'numeric',
|
|
55
|
+
month: '2-digit',
|
|
56
|
+
day: '2-digit',
|
|
57
|
+
hour: '2-digit',
|
|
58
|
+
minute: '2-digit',
|
|
59
|
+
hourCycle: 'h23',
|
|
60
|
+
}).formatToParts(date);
|
|
61
|
+
const hour = partNumber(parts, 'hour');
|
|
62
|
+
const y = partNumber(parts, 'year');
|
|
63
|
+
const month = pad2(partNumber(parts, 'month'));
|
|
64
|
+
const day = pad2(partNumber(parts, 'day'));
|
|
65
|
+
const hh = pad2(hour === 24 ? 0 : hour);
|
|
66
|
+
const mm = pad2(partNumber(parts, 'minute'));
|
|
67
|
+
return `${y}-${month}-${day}T${hh}:${mm}`;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Keep the wall-clock time of `iso` (as seen in `fromTimeZone`) and express
|
|
75
|
+
* that same clock time in `toTimeZone`.
|
|
76
|
+
*/
|
|
77
|
+
export const reinterpretIsoInTimeZone = (iso, fromTimeZone, toTimeZone) => {
|
|
78
|
+
if (!iso)
|
|
79
|
+
return undefined;
|
|
80
|
+
if (fromTimeZone === toTimeZone)
|
|
81
|
+
return iso;
|
|
82
|
+
const wall = utcIsoToZonedDateTime(iso, fromTimeZone);
|
|
83
|
+
return wall ? zonedDateTimeToUtcIso(wall, toTimeZone) : iso;
|
|
84
|
+
};
|
|
85
|
+
/** Build a Date whose local components match `iso` as seen in `timeZone`. */
|
|
86
|
+
export const utcIsoToWallClockDate = (iso, timeZone) => {
|
|
87
|
+
const local = utcIsoToZonedDateTime(iso, timeZone);
|
|
88
|
+
if (!local)
|
|
89
|
+
return new Date(iso);
|
|
90
|
+
const [datePart, timePart] = local.split('T');
|
|
91
|
+
const [year, month, day] = datePart.split('-').map(Number);
|
|
92
|
+
const [hour, minute] = timePart.split(':').map(Number);
|
|
93
|
+
return new Date(year, month - 1, day, hour, minute);
|
|
94
|
+
};
|
|
95
|
+
/** Treat `date`'s local components as wall time in `timeZone`. */
|
|
96
|
+
export const wallClockDateToUtcIso = (date, timeZone) => {
|
|
97
|
+
var _a;
|
|
98
|
+
const local = `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}T${pad2(date.getHours())}:${pad2(date.getMinutes())}`;
|
|
99
|
+
return (_a = zonedDateTimeToUtcIso(local, timeZone)) !== null && _a !== void 0 ? _a : date.toISOString();
|
|
100
|
+
};
|
|
101
|
+
/** Intl `timeZone` option when `timeZone` is a valid IANA identifier. */
|
|
102
|
+
export const eventTimeZoneOptions = (timeZone) => {
|
|
103
|
+
const resolved = isIanaTimeZone(timeZone) ? timeZone : undefined;
|
|
104
|
+
return resolved ? { timeZone: resolved } : {};
|
|
105
|
+
};
|
|
106
|
+
/** Clock time in the event timezone, always including a short zone name. */
|
|
107
|
+
export const formatEventClockTime = (iso, options) => {
|
|
108
|
+
const timeZone = eventTimeZoneOptions(options === null || options === void 0 ? void 0 : options.timeZone).timeZone;
|
|
109
|
+
return new Date(iso).toLocaleTimeString(options === null || options === void 0 ? void 0 : options.locale, {
|
|
110
|
+
hour: '2-digit',
|
|
111
|
+
minute: '2-digit',
|
|
112
|
+
timeZoneName: 'short',
|
|
113
|
+
...(timeZone ? { timeZone } : {}),
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
export const formatEventWhen = (start, options) => {
|
|
117
|
+
const timeZone = (options === null || options === void 0 ? void 0 : options.timeZone) || undefined;
|
|
118
|
+
const dateOptions = {
|
|
119
|
+
weekday: 'long',
|
|
120
|
+
year: 'numeric',
|
|
121
|
+
month: 'long',
|
|
122
|
+
day: 'numeric',
|
|
123
|
+
...(timeZone ? { timeZone } : {}),
|
|
124
|
+
};
|
|
125
|
+
if (options === null || options === void 0 ? void 0 : options.allDay) {
|
|
126
|
+
const startLabel = new Date(start).toLocaleDateString(options.locale, dateOptions);
|
|
127
|
+
if (!options.end)
|
|
128
|
+
return startLabel;
|
|
129
|
+
const endLabel = new Date(options.end).toLocaleDateString(options.locale, dateOptions);
|
|
130
|
+
return `${startLabel} – ${endLabel}`;
|
|
131
|
+
}
|
|
132
|
+
const dateTimeOptions = {
|
|
133
|
+
...dateOptions,
|
|
134
|
+
hour: '2-digit',
|
|
135
|
+
minute: '2-digit',
|
|
136
|
+
...(timeZone ? { timeZoneName: 'short' } : {}),
|
|
137
|
+
};
|
|
138
|
+
const startLabel = new Date(start).toLocaleString(options === null || options === void 0 ? void 0 : options.locale, dateTimeOptions);
|
|
139
|
+
if (!(options === null || options === void 0 ? void 0 : options.end))
|
|
140
|
+
return startLabel;
|
|
141
|
+
const endLabel = new Date(options.end).toLocaleString(options.locale, dateTimeOptions);
|
|
142
|
+
return `${startLabel} – ${endLabel}`;
|
|
143
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Leftmost-label wildcard only: `*.example.com` matches `a.example.com`. */
|
|
2
|
+
export const hostMatchesAllowedPattern = (host, pattern) => {
|
|
3
|
+
const normalizedHost = host.trim().toLowerCase().replace(/\.$/, '');
|
|
4
|
+
const normalizedPattern = pattern.trim().toLowerCase().replace(/\.$/, '');
|
|
5
|
+
if (!normalizedHost || !normalizedPattern)
|
|
6
|
+
return false;
|
|
7
|
+
if (normalizedPattern === '*')
|
|
8
|
+
return false;
|
|
9
|
+
if (normalizedPattern.startsWith('*.')) {
|
|
10
|
+
const suffix = normalizedPattern.slice(2);
|
|
11
|
+
if (!suffix.includes('.'))
|
|
12
|
+
return false;
|
|
13
|
+
return normalizedHost === suffix || normalizedHost.endsWith(`.${suffix}`);
|
|
14
|
+
}
|
|
15
|
+
return normalizedHost === normalizedPattern;
|
|
16
|
+
};
|
|
17
|
+
export const hostIsAllowed = (host, allowedHosts) => allowedHosts.some((pattern) => hostMatchesAllowedPattern(host, pattern));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type FeedCursor = {
|
|
2
|
+
id: string;
|
|
3
|
+
lastActivityAt?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Timeline feeds page by `(lastActivityAt DESC, id DESC)`. Encode both in
|
|
7
|
+
* `start` so a later bump cannot skip or duplicate rows across pages.
|
|
8
|
+
* Id-sorted feeds (profile, bookmarks, hashtags) still work: they read `id`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const encodeFeedCursor: (post: {
|
|
11
|
+
id?: string;
|
|
12
|
+
lastActivityAt?: string | null;
|
|
13
|
+
}) => string | undefined;
|
|
14
|
+
export declare const parseFeedCursor: (start?: string) => FeedCursor | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeline feeds page by `(lastActivityAt DESC, id DESC)`. Encode both in
|
|
3
|
+
* `start` so a later bump cannot skip or duplicate rows across pages.
|
|
4
|
+
* Id-sorted feeds (profile, bookmarks, hashtags) still work: they read `id`.
|
|
5
|
+
*/
|
|
6
|
+
export const encodeFeedCursor = (post) => {
|
|
7
|
+
if (!post.id)
|
|
8
|
+
return undefined;
|
|
9
|
+
return post.lastActivityAt ? `${post.lastActivityAt}|${post.id}` : post.id;
|
|
10
|
+
};
|
|
11
|
+
export const parseFeedCursor = (start) => {
|
|
12
|
+
if (!start)
|
|
13
|
+
return undefined;
|
|
14
|
+
const sep = start.lastIndexOf('|');
|
|
15
|
+
if (sep <= 0)
|
|
16
|
+
return { id: start };
|
|
17
|
+
const lastActivityAt = start.slice(0, sep);
|
|
18
|
+
const id = start.slice(sep + 1);
|
|
19
|
+
if (!id)
|
|
20
|
+
return { id: start };
|
|
21
|
+
return { id, lastActivityAt };
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FEED_FORMAT_OPTIONS: readonly ["threaded", "linear"];
|
|
3
|
+
export declare const feedFormatSchema: z.ZodEnum<{
|
|
4
|
+
threaded: "threaded";
|
|
5
|
+
linear: "linear";
|
|
6
|
+
}>;
|
|
7
|
+
export type FeedFormat = z.infer<typeof feedFormatSchema>;
|
|
8
|
+
export declare const DEFAULT_FEED_FORMAT: FeedFormat;
|
|
9
|
+
export declare const isFeedFormat: (value: string | null | undefined) => value is FeedFormat;
|
|
10
|
+
export declare const parseFeedFormat: (value?: string | null) => FeedFormat;
|
|
11
|
+
/** Profile default, then community default, then threaded. */
|
|
12
|
+
export declare const resolveFeedFormat: (profileFormat?: string | null, communityFormat?: string | null) => FeedFormat;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const FEED_FORMAT_OPTIONS = ['threaded', 'linear'];
|
|
3
|
+
export const feedFormatSchema = z.enum(FEED_FORMAT_OPTIONS);
|
|
4
|
+
export const DEFAULT_FEED_FORMAT = 'threaded';
|
|
5
|
+
export const isFeedFormat = (value) => value === 'threaded' || value === 'linear';
|
|
6
|
+
export const parseFeedFormat = (value) => isFeedFormat(value) ? value : DEFAULT_FEED_FORMAT;
|
|
7
|
+
/** Profile default, then community default, then threaded. */
|
|
8
|
+
export const resolveFeedFormat = (profileFormat, communityFormat) => {
|
|
9
|
+
if (isFeedFormat(profileFormat))
|
|
10
|
+
return profileFormat;
|
|
11
|
+
if (isFeedFormat(communityFormat))
|
|
12
|
+
return communityFormat;
|
|
13
|
+
return DEFAULT_FEED_FORMAT;
|
|
14
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type { GroupData, GroupMember, GroupWithMeta, ProfileWithMeta } from '../types';
|
|
1
|
+
import type { GroupData, GroupMember, GroupRelationship, GroupWithMeta, ProfileWithMeta } from '../types';
|
|
2
|
+
import { defaultGroupRoles } from '../types/capabilities';
|
|
3
|
+
type CapabilitySet = {
|
|
4
|
+
add?: string[];
|
|
5
|
+
remove?: string[];
|
|
6
|
+
};
|
|
2
7
|
export declare const groupName: (group?: GroupData) => string;
|
|
3
8
|
export declare const matchesGroupQuery: (group: GroupData, query: string, queryOptions?: {
|
|
4
9
|
handle: boolean;
|
|
@@ -6,6 +11,32 @@ export declare const matchesGroupQuery: (group: GroupData, query: string, queryO
|
|
|
6
11
|
description: boolean;
|
|
7
12
|
}) => boolean | "" | undefined;
|
|
8
13
|
export declare const sortGroupMembers: (members: GroupMember[]) => GroupMember[];
|
|
14
|
+
type RoleList = readonly string[] | null | undefined;
|
|
15
|
+
export declare const groupMembershipHasRole: (roles: RoleList, role: string) => boolean;
|
|
16
|
+
export declare const actorIsGroupOwner: (profile: {
|
|
17
|
+
memberships?: {
|
|
18
|
+
group: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
roles?: RoleList;
|
|
22
|
+
}[];
|
|
23
|
+
}, groupId: string) => boolean;
|
|
24
|
+
export declare const countGroupOwners: (members: {
|
|
25
|
+
roles?: RoleList;
|
|
26
|
+
}[]) => number;
|
|
27
|
+
export type GroupRoleChangeBlock = 'last-owner' | 'owner-assignment';
|
|
28
|
+
export declare const groupRoleChangeBlocked: ({ actorIsOwner, currentRoles, nextRoles, ownerCount, }: {
|
|
29
|
+
actorIsOwner: boolean;
|
|
30
|
+
currentRoles?: RoleList;
|
|
31
|
+
nextRoles?: RoleList;
|
|
32
|
+
ownerCount: number;
|
|
33
|
+
}) => GroupRoleChangeBlock | undefined;
|
|
34
|
+
export declare const groupOwnerRemovalBlocked: ({ targetRoles, ownerCount, }: {
|
|
35
|
+
targetRoles?: RoleList;
|
|
36
|
+
ownerCount: number;
|
|
37
|
+
}) => boolean;
|
|
38
|
+
export declare const assignableGroupRoles: (actorIsOwner: boolean) => ("member" | "moderator" | "admin" | "owner")[];
|
|
39
|
+
export declare const groupRolesForAssignment: (role: (typeof defaultGroupRoles)[number]) => GroupRelationship[];
|
|
9
40
|
export declare const canChangeMemberRole: (profile: ProfileWithMeta, group: GroupWithMeta) => boolean;
|
|
10
41
|
export declare const canAddMember: (profile: ProfileWithMeta, group: GroupWithMeta) => boolean;
|
|
11
42
|
export declare const canRemoveMember: (profile: ProfileWithMeta, group: GroupWithMeta) => boolean;
|
|
@@ -26,12 +57,9 @@ export declare const groupCapabilityTemplates: {
|
|
|
26
57
|
add: string[];
|
|
27
58
|
remove: string[];
|
|
28
59
|
};
|
|
29
|
-
moderator:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
admin: {
|
|
33
|
-
add: string[];
|
|
34
|
-
};
|
|
60
|
+
moderator: CapabilitySet;
|
|
61
|
+
admin: CapabilitySet;
|
|
62
|
+
owner: CapabilitySet;
|
|
35
63
|
};
|
|
36
64
|
};
|
|
37
65
|
defaultGroupClosedCommunity: {
|
|
@@ -44,12 +72,9 @@ export declare const groupCapabilityTemplates: {
|
|
|
44
72
|
add: string[];
|
|
45
73
|
remove: string[];
|
|
46
74
|
};
|
|
47
|
-
moderator:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
admin: {
|
|
51
|
-
add: string[];
|
|
52
|
-
};
|
|
75
|
+
moderator: CapabilitySet;
|
|
76
|
+
admin: CapabilitySet;
|
|
77
|
+
owner: CapabilitySet;
|
|
53
78
|
};
|
|
54
79
|
};
|
|
55
80
|
publicGroup: {
|
|
@@ -61,12 +86,9 @@ export declare const groupCapabilityTemplates: {
|
|
|
61
86
|
member: {
|
|
62
87
|
add: string[];
|
|
63
88
|
};
|
|
64
|
-
moderator:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
admin: {
|
|
68
|
-
add: string[];
|
|
69
|
-
};
|
|
89
|
+
moderator: CapabilitySet;
|
|
90
|
+
admin: CapabilitySet;
|
|
91
|
+
owner: CapabilitySet;
|
|
70
92
|
};
|
|
71
93
|
};
|
|
72
94
|
localGroup: {
|
|
@@ -78,12 +100,9 @@ export declare const groupCapabilityTemplates: {
|
|
|
78
100
|
member: {
|
|
79
101
|
add: string[];
|
|
80
102
|
};
|
|
81
|
-
moderator:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
admin: {
|
|
85
|
-
add: string[];
|
|
86
|
-
};
|
|
103
|
+
moderator: CapabilitySet;
|
|
104
|
+
admin: CapabilitySet;
|
|
105
|
+
owner: CapabilitySet;
|
|
87
106
|
};
|
|
88
107
|
};
|
|
89
108
|
privateGroup: {
|
|
@@ -92,12 +111,9 @@ export declare const groupCapabilityTemplates: {
|
|
|
92
111
|
member: {
|
|
93
112
|
add: string[];
|
|
94
113
|
};
|
|
95
|
-
moderator:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
admin: {
|
|
99
|
-
add: string[];
|
|
100
|
-
};
|
|
114
|
+
moderator: CapabilitySet;
|
|
115
|
+
admin: CapabilitySet;
|
|
116
|
+
owner: CapabilitySet;
|
|
101
117
|
};
|
|
102
118
|
};
|
|
103
119
|
limitedPostingGroup: {
|
|
@@ -106,12 +122,20 @@ export declare const groupCapabilityTemplates: {
|
|
|
106
122
|
member: {
|
|
107
123
|
add: string[];
|
|
108
124
|
};
|
|
109
|
-
moderator:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
125
|
+
moderator: CapabilitySet;
|
|
126
|
+
admin: CapabilitySet;
|
|
127
|
+
owner: CapabilitySet;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
announcementGroup: {
|
|
131
|
+
name: string;
|
|
132
|
+
capabilities: {
|
|
133
|
+
member: {
|
|
113
134
|
add: string[];
|
|
114
135
|
};
|
|
136
|
+
moderator: CapabilitySet;
|
|
137
|
+
admin: CapabilitySet;
|
|
138
|
+
owner: CapabilitySet;
|
|
115
139
|
};
|
|
116
140
|
};
|
|
117
141
|
lockedGroup: {
|
|
@@ -123,12 +147,10 @@ export declare const groupCapabilityTemplates: {
|
|
|
123
147
|
member: {
|
|
124
148
|
add: string[];
|
|
125
149
|
};
|
|
126
|
-
moderator:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
admin: {
|
|
130
|
-
add: string[];
|
|
131
|
-
};
|
|
150
|
+
moderator: CapabilitySet;
|
|
151
|
+
admin: CapabilitySet;
|
|
152
|
+
owner: CapabilitySet;
|
|
132
153
|
};
|
|
133
154
|
};
|
|
134
155
|
};
|
|
156
|
+
export {};
|