@openpeepshq/client 0.3.0 → 0.5.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/endpoints/auth.d.ts +1 -1
- package/dist/endpoints/jams.d.ts +1 -0
- package/dist/endpoints/posts.d.ts +8 -1
- package/dist/endpoints/posts.js +6 -0
- package/dist/endpoints/profiles.d.ts +12 -5
- package/dist/endpoints/server.d.ts +26 -16
- package/package.json +3 -6
- package/src/endpoints/posts.ts +34 -0
- package/src/endpoints/profiles.ts +8 -7
package/dist/endpoints/auth.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare const auth: (rawClient: FetchClient) => {
|
|
|
57
57
|
displayName: string;
|
|
58
58
|
email: string;
|
|
59
59
|
resource: {
|
|
60
|
-
type: "self" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "db" | "analytics" | "render" | "*";
|
|
60
|
+
type: "self" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "db" | "analytics" | "render" | "*";
|
|
61
61
|
id?: string | undefined;
|
|
62
62
|
};
|
|
63
63
|
}, {
|
package/dist/endpoints/jams.d.ts
CHANGED
|
@@ -10988,6 +10988,7 @@ export declare const jams: (rawClient: FetchClient, eventSource: ReturnType<type
|
|
|
10988
10988
|
state: import("@openpeepshq/fetch-client").TypedNoPayloadEndpoint<{
|
|
10989
10989
|
active: boolean;
|
|
10990
10990
|
participants: string[];
|
|
10991
|
+
observers?: number | undefined;
|
|
10991
10992
|
}, {
|
|
10992
10993
|
success: boolean;
|
|
10993
10994
|
message?: string | undefined;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { FetchClient } from '@openpeepshq/fetch-client';
|
|
2
|
-
import { type JamRecording, type RsvpRequest, type ChronologicalInfiniteQueryParams, type PostContext, type PostCreationData, type PostDataUnion, type PostType, type ReactionData, type SuccessResponse, type OffsetInfiniteQueryParams, type PublicPost, type UnseenPostCounts } from '@openpeepshq/common';
|
|
2
|
+
import { type JamRecording, type RsvpRequest, type ChronologicalInfiniteQueryParams, type PostContext, type PostCreationData, type PostDataUnion, type PostType, type ReactionData, type SuccessResponse, type OffsetInfiniteQueryParams, type PublicPost, type UnseenPostCounts, type EventRangeQueryParams } from '@openpeepshq/common';
|
|
3
3
|
import type { OpenpeepsNoPayloadEndpoint, OpenpeepsPayloadEndpoint } from '../types';
|
|
4
4
|
type PostsSeenRequest = {
|
|
5
5
|
postIds: string[];
|
|
6
6
|
};
|
|
7
7
|
type ChronologicalPosts = OpenpeepsNoPayloadEndpoint<PublicPost[], undefined, ChronologicalInfiniteQueryParams>;
|
|
8
8
|
type OffsetPosts = OpenpeepsNoPayloadEndpoint<PublicPost[], undefined, OffsetInfiniteQueryParams>;
|
|
9
|
+
type RangePosts = OpenpeepsNoPayloadEndpoint<PublicPost[], undefined, EventRangeQueryParams>;
|
|
10
|
+
type GroupRangePosts = OpenpeepsNoPayloadEndpoint<PublicPost[], {
|
|
11
|
+
groupId: string;
|
|
12
|
+
}, EventRangeQueryParams>;
|
|
9
13
|
type GroupOffsetPosts = OpenpeepsNoPayloadEndpoint<PublicPost[], {
|
|
10
14
|
groupId: string;
|
|
11
15
|
}, OffsetInfiniteQueryParams>;
|
|
@@ -56,13 +60,16 @@ type EventFeeds = {
|
|
|
56
60
|
upcoming: OffsetPosts;
|
|
57
61
|
current: OffsetPosts;
|
|
58
62
|
past: OffsetPosts;
|
|
63
|
+
range: RangePosts;
|
|
59
64
|
};
|
|
60
65
|
upcoming: OffsetPosts;
|
|
61
66
|
current: OffsetPosts;
|
|
62
67
|
past: OffsetPosts;
|
|
68
|
+
range: RangePosts;
|
|
63
69
|
group: {
|
|
64
70
|
upcoming: GroupOffsetPosts;
|
|
65
71
|
past: GroupOffsetPosts;
|
|
72
|
+
range: GroupRangePosts;
|
|
66
73
|
};
|
|
67
74
|
};
|
|
68
75
|
};
|
package/dist/endpoints/posts.js
CHANGED
|
@@ -32,13 +32,19 @@ const eventFeeds = (rawClient) => ({
|
|
|
32
32
|
upcoming: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/my/upcoming'),
|
|
33
33
|
current: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/my/current'),
|
|
34
34
|
past: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/my/past'),
|
|
35
|
+
/** Date-range feed for calendar views. */
|
|
36
|
+
range: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/my/range'),
|
|
35
37
|
},
|
|
36
38
|
upcoming: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/upcoming'),
|
|
37
39
|
current: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/current'),
|
|
38
40
|
past: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/past'),
|
|
41
|
+
/** Date-range feed for calendar views. */
|
|
42
|
+
range: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/range'),
|
|
39
43
|
group: {
|
|
40
44
|
upcoming: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/by-group/:groupId/upcoming'),
|
|
41
45
|
past: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/by-group/:groupId/past'),
|
|
46
|
+
/** Date-range feed for calendar views. */
|
|
47
|
+
range: allpeepNoPayloadEndpoint(rawClient, '/posts/feeds/events/by-group/:groupId/range'),
|
|
42
48
|
},
|
|
43
49
|
},
|
|
44
50
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FetchClient, noPayloadEventSource } from '@openpeepshq/fetch-client';
|
|
2
|
-
import type { AccessTokenWithMeta,
|
|
2
|
+
import type { AccessTokenWithMeta, NotificationFeedExcludeTypesQuery, ProfileWithMeta, ProfileSettings, PublicAccessToken, SessionPlatform, Hashtag } from '@openpeepshq/common';
|
|
3
3
|
export declare const profiles: (rawClient: FetchClient, eventSource: ReturnType<typeof noPayloadEventSource>) => {
|
|
4
4
|
current: {
|
|
5
5
|
read: import("@openpeepshq/fetch-client").TypedNoPayloadEndpoint<ProfileWithMeta, {
|
|
@@ -43,7 +43,7 @@ export declare const profiles: (rawClient: FetchClient, eventSource: ReturnType<
|
|
|
43
43
|
guestData?: {
|
|
44
44
|
email?: string | undefined;
|
|
45
45
|
resource?: {
|
|
46
|
-
type: "self" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "db" | "analytics" | "render" | "*";
|
|
46
|
+
type: "self" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "db" | "analytics" | "render" | "*";
|
|
47
47
|
id?: string | undefined;
|
|
48
48
|
} | undefined;
|
|
49
49
|
} | undefined;
|
|
@@ -11123,7 +11123,13 @@ export declare const profiles: (rawClient: FetchClient, eventSource: ReturnType<
|
|
|
11123
11123
|
success: boolean;
|
|
11124
11124
|
message?: string | undefined;
|
|
11125
11125
|
key?: string | undefined;
|
|
11126
|
-
}, undefined,
|
|
11126
|
+
}, undefined, {
|
|
11127
|
+
start?: string | undefined;
|
|
11128
|
+
limit?: number | undefined;
|
|
11129
|
+
format?: "threaded" | "linear" | undefined;
|
|
11130
|
+
groupId?: string | undefined;
|
|
11131
|
+
ungrouped?: "true" | undefined;
|
|
11132
|
+
} & NotificationFeedExcludeTypesQuery>;
|
|
11127
11133
|
notificationStats: import("@openpeepshq/fetch-client").TypedNoPayloadEndpoint<{
|
|
11128
11134
|
unread: number;
|
|
11129
11135
|
unseen: number;
|
|
@@ -22134,7 +22140,7 @@ export declare const profiles: (rawClient: FetchClient, eventSource: ReturnType<
|
|
|
22134
22140
|
success: boolean;
|
|
22135
22141
|
message?: string | undefined;
|
|
22136
22142
|
key?: string | undefined;
|
|
22137
|
-
}, undefined,
|
|
22143
|
+
}, undefined, NotificationFeedExcludeTypesQuery>;
|
|
22138
22144
|
readSettings: import("@openpeepshq/fetch-client").TypedNoPayloadEndpoint<ProfileSettings, {
|
|
22139
22145
|
success: boolean;
|
|
22140
22146
|
message?: string | undefined;
|
|
@@ -22155,6 +22161,7 @@ export declare const profiles: (rawClient: FetchClient, eventSource: ReturnType<
|
|
|
22155
22161
|
push: boolean;
|
|
22156
22162
|
email: boolean;
|
|
22157
22163
|
}> | undefined;
|
|
22164
|
+
hiddenNotificationTypes?: string[] | undefined;
|
|
22158
22165
|
groupNotificationLevels?: Record<string, "all" | "mostRelevant" | "off"> | undefined;
|
|
22159
22166
|
jamSettings?: {
|
|
22160
22167
|
backgroundObfuscation?: {
|
|
@@ -22195,7 +22202,7 @@ export declare const profiles: (rawClient: FetchClient, eventSource: ReturnType<
|
|
|
22195
22202
|
description?: string | undefined;
|
|
22196
22203
|
scopes?: {
|
|
22197
22204
|
resource: {
|
|
22198
|
-
type: "self" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "db" | "analytics" | "render" | "*";
|
|
22205
|
+
type: "self" | "jams" | "profiles" | "notifications" | "posts" | "groups" | "reports" | "webhooks" | "conversations" | "db" | "analytics" | "render" | "*";
|
|
22199
22206
|
id?: string | undefined;
|
|
22200
22207
|
};
|
|
22201
22208
|
scopeLevel?: "admin" | "write" | "read" | undefined;
|
|
@@ -55,6 +55,7 @@ export declare const server: (rawClient: FetchClient) => {
|
|
|
55
55
|
contactEmail?: string | undefined;
|
|
56
56
|
privacyPolicy?: string | undefined;
|
|
57
57
|
termsAndConditions?: string | undefined;
|
|
58
|
+
bugReportUrl?: string | undefined;
|
|
58
59
|
};
|
|
59
60
|
content: {
|
|
60
61
|
aboutPage?: string | undefined;
|
|
@@ -62,6 +63,7 @@ export declare const server: (rawClient: FetchClient) => {
|
|
|
62
63
|
codeOfConduct?: string | undefined;
|
|
63
64
|
welcomeEmail?: string | undefined;
|
|
64
65
|
pinnedPost?: string | undefined;
|
|
66
|
+
autoFollow?: string[] | undefined;
|
|
65
67
|
};
|
|
66
68
|
settings: {
|
|
67
69
|
openRegistrations: boolean;
|
|
@@ -133,22 +135,30 @@ export declare const server: (rawClient: FetchClient) => {
|
|
|
133
135
|
}, undefined, undefined>;
|
|
134
136
|
config: {
|
|
135
137
|
capabilities: import("@openpeepshq/fetch-client").TypedNoPayloadEndpoint<{
|
|
136
|
-
post:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
138
|
+
post: {
|
|
139
|
+
[x: string]: {
|
|
140
|
+
add: string[];
|
|
141
|
+
remove: string[];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
profile: {
|
|
145
|
+
[x: string]: {
|
|
146
|
+
add: string[];
|
|
147
|
+
remove: string[];
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
report: {
|
|
151
|
+
[x: string]: {
|
|
152
|
+
add: string[];
|
|
153
|
+
remove: string[];
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
accessToken: {
|
|
157
|
+
[x: string]: {
|
|
158
|
+
add: string[];
|
|
159
|
+
remove: string[];
|
|
160
|
+
};
|
|
161
|
+
};
|
|
152
162
|
}, {
|
|
153
163
|
success: boolean;
|
|
154
164
|
message?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpeepshq/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"
|
|
9
|
-
"@openpeepshq/common": "^0.5.0",
|
|
8
|
+
"@openpeepshq/common": "^0.10.0",
|
|
10
9
|
"@openpeepshq/fetch-client": "^0.2.1"
|
|
11
10
|
},
|
|
12
11
|
"main": "./dist/index.js",
|
|
@@ -39,11 +38,9 @@
|
|
|
39
38
|
],
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@types/node": "^22.14.1",
|
|
42
|
-
"@types/validator": "^13.11.9",
|
|
43
41
|
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
|
44
42
|
"@typescript-eslint/parser": "^8.72.0",
|
|
45
|
-
"
|
|
46
|
-
"eslint": "^10.1.0",
|
|
43
|
+
"eslint": "^10.14.0",
|
|
47
44
|
"i18next": "^24.2.3",
|
|
48
45
|
"livekit-client": "^2.19.2",
|
|
49
46
|
"prettier": "^3.4.2",
|
package/src/endpoints/posts.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type OffsetInfiniteQueryParams,
|
|
13
13
|
type PublicPost,
|
|
14
14
|
type UnseenPostCounts,
|
|
15
|
+
type EventRangeQueryParams,
|
|
15
16
|
} from '@openpeepshq/common';
|
|
16
17
|
import { allpeepNoPayloadEndpoint, allpeepPayloadEndpoint } from './helpers';
|
|
17
18
|
import type {
|
|
@@ -35,6 +36,18 @@ type OffsetPosts = OpenpeepsNoPayloadEndpoint<
|
|
|
35
36
|
OffsetInfiniteQueryParams
|
|
36
37
|
>;
|
|
37
38
|
|
|
39
|
+
type RangePosts = OpenpeepsNoPayloadEndpoint<
|
|
40
|
+
PublicPost[],
|
|
41
|
+
undefined,
|
|
42
|
+
EventRangeQueryParams
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
type GroupRangePosts = OpenpeepsNoPayloadEndpoint<
|
|
46
|
+
PublicPost[],
|
|
47
|
+
{ groupId: string },
|
|
48
|
+
EventRangeQueryParams
|
|
49
|
+
>;
|
|
50
|
+
|
|
38
51
|
type GroupOffsetPosts = OpenpeepsNoPayloadEndpoint<
|
|
39
52
|
PublicPost[],
|
|
40
53
|
{ groupId: string },
|
|
@@ -173,6 +186,12 @@ const eventFeeds = (rawClient: FetchClient): EventFeeds => ({
|
|
|
173
186
|
undefined,
|
|
174
187
|
OffsetInfiniteQueryParams
|
|
175
188
|
>(rawClient, '/posts/feeds/events/my/past'),
|
|
189
|
+
/** Date-range feed for calendar views. */
|
|
190
|
+
range: allpeepNoPayloadEndpoint<
|
|
191
|
+
PublicPost[],
|
|
192
|
+
undefined,
|
|
193
|
+
EventRangeQueryParams
|
|
194
|
+
>(rawClient, '/posts/feeds/events/my/range'),
|
|
176
195
|
},
|
|
177
196
|
upcoming: allpeepNoPayloadEndpoint<
|
|
178
197
|
PublicPost[],
|
|
@@ -189,6 +208,12 @@ const eventFeeds = (rawClient: FetchClient): EventFeeds => ({
|
|
|
189
208
|
undefined,
|
|
190
209
|
OffsetInfiniteQueryParams
|
|
191
210
|
>(rawClient, '/posts/feeds/events/past'),
|
|
211
|
+
/** Date-range feed for calendar views. */
|
|
212
|
+
range: allpeepNoPayloadEndpoint<
|
|
213
|
+
PublicPost[],
|
|
214
|
+
undefined,
|
|
215
|
+
EventRangeQueryParams
|
|
216
|
+
>(rawClient, '/posts/feeds/events/range'),
|
|
192
217
|
group: {
|
|
193
218
|
upcoming: allpeepNoPayloadEndpoint<
|
|
194
219
|
PublicPost[],
|
|
@@ -200,6 +225,12 @@ const eventFeeds = (rawClient: FetchClient): EventFeeds => ({
|
|
|
200
225
|
{ groupId: string },
|
|
201
226
|
OffsetInfiniteQueryParams
|
|
202
227
|
>(rawClient, '/posts/feeds/events/by-group/:groupId/past'),
|
|
228
|
+
/** Date-range feed for calendar views. */
|
|
229
|
+
range: allpeepNoPayloadEndpoint<
|
|
230
|
+
PublicPost[],
|
|
231
|
+
{ groupId: string },
|
|
232
|
+
EventRangeQueryParams
|
|
233
|
+
>(rawClient, '/posts/feeds/events/by-group/:groupId/range'),
|
|
203
234
|
},
|
|
204
235
|
},
|
|
205
236
|
});
|
|
@@ -210,13 +241,16 @@ type EventFeeds = {
|
|
|
210
241
|
upcoming: OffsetPosts;
|
|
211
242
|
current: OffsetPosts;
|
|
212
243
|
past: OffsetPosts;
|
|
244
|
+
range: RangePosts;
|
|
213
245
|
};
|
|
214
246
|
upcoming: OffsetPosts;
|
|
215
247
|
current: OffsetPosts;
|
|
216
248
|
past: OffsetPosts;
|
|
249
|
+
range: RangePosts;
|
|
217
250
|
group: {
|
|
218
251
|
upcoming: GroupOffsetPosts;
|
|
219
252
|
past: GroupOffsetPosts;
|
|
253
|
+
range: GroupRangePosts;
|
|
220
254
|
};
|
|
221
255
|
};
|
|
222
256
|
};
|
|
@@ -7,7 +7,8 @@ import type {
|
|
|
7
7
|
AccessTokenWithMeta,
|
|
8
8
|
FollowData,
|
|
9
9
|
GroupWithMeta,
|
|
10
|
-
|
|
10
|
+
NotificationFeedQueryParams,
|
|
11
|
+
NotificationFeedExcludeTypesQuery,
|
|
11
12
|
PublicPost,
|
|
12
13
|
NotificationStats,
|
|
13
14
|
ProfileData,
|
|
@@ -49,7 +50,7 @@ export const profiles = (
|
|
|
49
50
|
notifications: allpeepNoPayloadEndpoint<
|
|
50
51
|
PublicNotification[],
|
|
51
52
|
undefined,
|
|
52
|
-
|
|
53
|
+
NotificationFeedQueryParams
|
|
53
54
|
>(rawClient, '/profiles/current/notifications'),
|
|
54
55
|
notificationStats: allpeepNoPayloadEndpoint<NotificationStats>(
|
|
55
56
|
rawClient,
|
|
@@ -67,11 +68,11 @@ export const profiles = (
|
|
|
67
68
|
rawClient,
|
|
68
69
|
'/profiles/current/bookmarkedIds',
|
|
69
70
|
),
|
|
70
|
-
markAllNotificationsAsSeen: allpeepNoPayloadEndpoint<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
),
|
|
71
|
+
markAllNotificationsAsSeen: allpeepNoPayloadEndpoint<
|
|
72
|
+
SuccessResponse,
|
|
73
|
+
undefined,
|
|
74
|
+
NotificationFeedExcludeTypesQuery
|
|
75
|
+
>(rawClient, '/profiles/current/notifications/mark-all-seen', 'put'),
|
|
75
76
|
readSettings: allpeepNoPayloadEndpoint<ProfileSettings>(
|
|
76
77
|
rawClient,
|
|
77
78
|
'/profiles/current/settings',
|