@openpeepshq/client 0.2.0 → 0.3.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.
@@ -45,6 +45,10 @@ type Finders = {
45
45
  recordingId: string;
46
46
  }>;
47
47
  unseenCounts: OpenpeepsNoPayloadEndpoint<UnseenPostCounts>;
48
+ exportRsvps: (args: {
49
+ id: string;
50
+ occurrence?: string;
51
+ }) => Promise<string>;
48
52
  };
49
53
  type EventFeeds = {
50
54
  events: {
@@ -15,6 +15,16 @@ const finders = (rawClient) => ({
15
15
  publishRecordingReply: allpeepNoPayloadEndpoint(rawClient, '/posts/:id/recordings/:recordingId/reply', 'post'),
16
16
  deleteRecording: allpeepNoPayloadEndpoint(rawClient, '/posts/:id/recordings/:recordingId', 'delete'),
17
17
  unseenCounts: allpeepNoPayloadEndpoint(rawClient, '/posts/unseen/counts'),
18
+ exportRsvps: async ({ id, occurrence }) => {
19
+ const query = occurrence
20
+ ? `?occurrence=${encodeURIComponent(occurrence)}`
21
+ : '';
22
+ const response = await rawClient.get(`/posts/${id}/rsvp/export${query}`);
23
+ if (!response.ok) {
24
+ throw { ...(await response.json()), status: response.status };
25
+ }
26
+ return response.text();
27
+ },
18
28
  });
19
29
  const eventFeeds = (rawClient) => ({
20
30
  events: {