@openpeepshq/client 0.1.37 → 0.2.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/common/authenticated.js +2 -2
- package/dist/endpoints/accounts.d.ts +69 -0
- package/dist/endpoints/accounts.js +1 -0
- package/dist/endpoints/admin.d.ts +115 -17328
- package/dist/endpoints/admin.js +11 -2
- package/dist/endpoints/auth.d.ts +2 -1
- package/dist/endpoints/conversations.d.ts +35481 -5352
- package/dist/endpoints/conversations.js +2 -0
- package/dist/endpoints/groups.d.ts +15 -3
- package/dist/endpoints/jams.d.ts +7500 -716
- package/dist/endpoints/jams.js +12 -0
- package/dist/endpoints/plugins.d.ts +1 -1
- package/dist/endpoints/posts.d.ts +72 -76801
- package/dist/endpoints/posts.js +12 -2
- package/dist/endpoints/profiles.d.ts +27308 -3781
- package/dist/endpoints/profiles.js +8 -0
- package/dist/endpoints/search.d.ts +24551 -4361
- package/dist/endpoints/server.d.ts +19 -1
- package/dist/index.js +8 -11
- package/package.json +30 -9
- package/src/common/authenticated.ts +28 -0
- package/src/common/base.ts +11 -0
- package/src/endpoints/accounts.ts +52 -0
- package/src/endpoints/admin.ts +616 -0
- package/src/endpoints/analytics.ts +13 -0
- package/src/endpoints/auth.ts +43 -0
- package/src/endpoints/conversations.ts +28 -0
- package/src/endpoints/groups.ts +69 -0
- package/src/endpoints/helpers.ts +91 -0
- package/src/endpoints/i18n.ts +14 -0
- package/src/endpoints/jams.ts +126 -0
- package/src/endpoints/location.ts +10 -0
- package/src/endpoints/media.ts +56 -0
- package/src/endpoints/payments.ts +34 -0
- package/src/endpoints/plugins.ts +25 -0
- package/src/endpoints/posts.ts +377 -0
- package/src/endpoints/previewLink.ts +10 -0
- package/src/endpoints/profiles.ts +167 -0
- package/src/endpoints/reports.ts +32 -0
- package/src/endpoints/search.ts +34 -0
- package/src/endpoints/server.ts +38 -0
- package/src/endpoints/sso.ts +35 -0
- package/src/endpoints/streaming.ts +29 -0
- package/src/endpoints/types.ts +66 -0
- package/src/index.ts +88 -0
- package/src/types/index.ts +20 -0
- package/src/webhooks/index.ts +50 -0
|
@@ -7,13 +7,13 @@ export const authHeaders = (token) => {
|
|
|
7
7
|
}
|
|
8
8
|
: undefined;
|
|
9
9
|
};
|
|
10
|
-
export const authenticatedCoreApiClient = (token) =>
|
|
10
|
+
export const authenticatedCoreApiClient = (token) => fetchClient({ ...apiClientConfig, headers: authHeaders(token) ?? {} });
|
|
11
11
|
export const handleError = async (r) => {
|
|
12
12
|
if (r.ok) {
|
|
13
13
|
return r;
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
throw
|
|
16
|
+
throw { ...(await r.json()), status: r.status };
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
export const transformResponse = (r) => r.json();
|
|
@@ -22,6 +22,75 @@ export declare const accounts: (rawClient: FetchClient) => {
|
|
|
22
22
|
message?: string | undefined;
|
|
23
23
|
key?: string | undefined;
|
|
24
24
|
}, undefined, undefined>;
|
|
25
|
+
export: import("@openpeepshq/fetch-client").TypedNoPayloadEndpoint<{
|
|
26
|
+
account: {
|
|
27
|
+
id: string;
|
|
28
|
+
email: string;
|
|
29
|
+
emailValidated: boolean;
|
|
30
|
+
};
|
|
31
|
+
profiles: {
|
|
32
|
+
id: string;
|
|
33
|
+
type: "guest" | "local" | "federated";
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
handle: string;
|
|
37
|
+
memberships: {
|
|
38
|
+
group: {
|
|
39
|
+
handle: string;
|
|
40
|
+
capabilities: Record<string, {
|
|
41
|
+
add?: string[] | undefined;
|
|
42
|
+
remove?: string[] | undefined;
|
|
43
|
+
} | undefined>;
|
|
44
|
+
id: string;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
avatar?: string | null | undefined;
|
|
48
|
+
header?: string | null | undefined;
|
|
49
|
+
displayName?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
rules?: string | undefined;
|
|
52
|
+
pinnedPostId?: string | undefined;
|
|
53
|
+
discoverable?: boolean | undefined;
|
|
54
|
+
deletedAt?: string | null | undefined;
|
|
55
|
+
};
|
|
56
|
+
roles?: ("none" | "local" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
deletedAt?: string | null | undefined;
|
|
59
|
+
avatar?: string | null | undefined;
|
|
60
|
+
header?: string | null | undefined;
|
|
61
|
+
displayName?: string | undefined;
|
|
62
|
+
bio?: string | undefined;
|
|
63
|
+
location?: {
|
|
64
|
+
text: string;
|
|
65
|
+
coordinates?: {
|
|
66
|
+
lat: number;
|
|
67
|
+
lng: number;
|
|
68
|
+
alt?: number | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
locked?: boolean | undefined;
|
|
72
|
+
bot?: boolean | undefined;
|
|
73
|
+
discoverable?: boolean | undefined;
|
|
74
|
+
roles?: {
|
|
75
|
+
key: string;
|
|
76
|
+
displayName: string;
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
fields?: {
|
|
79
|
+
name: string;
|
|
80
|
+
value: string;
|
|
81
|
+
}[] | undefined;
|
|
82
|
+
profileStats?: {
|
|
83
|
+
followersCount: number;
|
|
84
|
+
followingCount: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
pinnedPostId?: string | undefined;
|
|
87
|
+
blockedByMe?: boolean | undefined;
|
|
88
|
+
}[];
|
|
89
|
+
}, {
|
|
90
|
+
success: boolean;
|
|
91
|
+
message?: string | undefined;
|
|
92
|
+
key?: string | undefined;
|
|
93
|
+
}, undefined, undefined>;
|
|
25
94
|
createPushSubscription: import("@openpeepshq/fetch-client").TypedPayloadEndpoint<{
|
|
26
95
|
type: "web";
|
|
27
96
|
endpoint: string;
|
|
@@ -3,6 +3,7 @@ export const accounts = (rawClient) => ({
|
|
|
3
3
|
current: {
|
|
4
4
|
update: allpeepPayloadEndpoint(rawClient, '/accounts/current', 'patch'),
|
|
5
5
|
read: allpeepNoPayloadEndpoint(rawClient, '/accounts/current'),
|
|
6
|
+
export: allpeepNoPayloadEndpoint(rawClient, '/accounts/current/export'),
|
|
6
7
|
createPushSubscription: allpeepPayloadEndpoint(rawClient, '/accounts/current/push-subscriptions'),
|
|
7
8
|
listPushSubscriptions: allpeepNoPayloadEndpoint(rawClient, '/accounts/current/push-subscriptions'),
|
|
8
9
|
testPushSubscription: allpeepPayloadEndpoint(rawClient, '/accounts/current/push-subscriptions/test'),
|