@pipedream/zoom 0.3.6 → 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/README.md +21 -64
- package/actions/add-meeting-registrant/add-meeting-registrant.mjs +157 -108
- package/actions/add-webinar-registrant/add-webinar-registrant.mjs +157 -108
- package/actions/create-meeting/create-meeting.mjs +1 -1
- package/actions/create-user/create-user.mjs +1 -1
- package/actions/delete-user/delete-user.mjs +1 -1
- package/actions/get-meeting-details/get-meeting-details.mjs +1 -1
- package/actions/get-webinar-details/get-webinar-details.mjs +36 -22
- package/actions/list-channels/list-channels.mjs +1 -1
- package/actions/list-past-meeting-participants/list-past-meeting-participants.mjs +25 -23
- package/actions/list-past-webinar-qa/list-past-webinar-qa.mjs +1 -1
- package/actions/list-user-call-logs/list-user-call-logs.mjs +31 -0
- package/actions/list-webinar-participants-report/list-webinar-participants-report.mjs +68 -0
- package/actions/send-chat-message/send-chat-message.mjs +1 -1
- package/actions/update-meeting/update-meeting.mjs +1 -1
- package/actions/update-webinar/update-webinar.mjs +1 -1
- package/actions/view-user/view-user.mjs +1 -1
- package/common/constants.mjs +9 -0
- package/common/utils.mjs +20 -0
- package/package.json +3 -3
- package/sources/common/common.mjs +2 -2
- package/sources/common/constants.mjs +106 -104
- package/sources/custom-event/custom-event.mjs +13 -10
- package/sources/meeting-created/meeting-created.mjs +16 -10
- package/sources/meeting-deleted/meeting-deleted.mjs +13 -8
- package/sources/meeting-ended/meeting-ended.mjs +20 -12
- package/sources/meeting-started/meeting-started.mjs +17 -11
- package/sources/meeting-updated/meeting-updated.mjs +16 -10
- package/sources/phone-event/phone-event.mjs +12 -10
- package/sources/recording-completed/recording-completed.mjs +28 -19
- package/sources/webinar-created/webinar-created.mjs +16 -10
- package/sources/webinar-deleted/webinar-deleted.mjs +14 -9
- package/sources/webinar-ended/webinar-ended.mjs +19 -13
- package/sources/webinar-started/webinar-started.mjs +16 -10
- package/sources/webinar-updated/webinar-updated.mjs +16 -10
- package/zoom.app.mjs +277 -42
|
@@ -1,143 +1,192 @@
|
|
|
1
|
-
|
|
2
|
-
import { axios } from "@pipedream/platform";
|
|
1
|
+
import app from "../../zoom.app.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
key: "zoom-add-webinar-registrant",
|
|
6
5
|
name: "Add Webinar Registrant",
|
|
7
|
-
description: "Registers a participant for a webinar.",
|
|
8
|
-
version: "0.
|
|
6
|
+
description: "Registers a participant for a webinar. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrantcreate).",
|
|
7
|
+
version: "0.3.1",
|
|
9
8
|
type: "action",
|
|
10
9
|
props: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
app,
|
|
11
|
+
webinarId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
app,
|
|
14
|
+
"webinarId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
occurrenceIds: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
app,
|
|
20
|
+
"occurrenceIds",
|
|
21
|
+
],
|
|
23
22
|
},
|
|
24
23
|
email: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
propDefinition: [
|
|
25
|
+
app,
|
|
26
|
+
"email",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
firstName: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
app,
|
|
32
|
+
"firstName",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
lastName: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
app,
|
|
38
|
+
"lastName",
|
|
39
|
+
],
|
|
35
40
|
},
|
|
36
41
|
address: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
propDefinition: [
|
|
43
|
+
app,
|
|
44
|
+
"address",
|
|
45
|
+
],
|
|
40
46
|
},
|
|
41
47
|
city: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
propDefinition: [
|
|
49
|
+
app,
|
|
50
|
+
"city",
|
|
51
|
+
],
|
|
45
52
|
},
|
|
46
53
|
country: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
propDefinition: [
|
|
55
|
+
app,
|
|
56
|
+
"country",
|
|
57
|
+
],
|
|
50
58
|
},
|
|
51
59
|
zip: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
propDefinition: [
|
|
61
|
+
app,
|
|
62
|
+
"zip",
|
|
63
|
+
],
|
|
55
64
|
},
|
|
56
65
|
state: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
propDefinition: [
|
|
67
|
+
app,
|
|
68
|
+
"state",
|
|
69
|
+
],
|
|
60
70
|
},
|
|
61
71
|
phone: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
propDefinition: [
|
|
73
|
+
app,
|
|
74
|
+
"phone",
|
|
75
|
+
],
|
|
65
76
|
},
|
|
66
77
|
industry: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
propDefinition: [
|
|
79
|
+
app,
|
|
80
|
+
"industry",
|
|
81
|
+
],
|
|
70
82
|
},
|
|
71
83
|
org: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
propDefinition: [
|
|
85
|
+
app,
|
|
86
|
+
"org",
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
jobTitle: {
|
|
90
|
+
propDefinition: [
|
|
91
|
+
app,
|
|
92
|
+
"jobTitle",
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
purchasingTimeFrame: {
|
|
96
|
+
propDefinition: [
|
|
97
|
+
app,
|
|
98
|
+
"purchasingTimeFrame",
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
roleInPurchaseProcess: {
|
|
102
|
+
propDefinition: [
|
|
103
|
+
app,
|
|
104
|
+
"roleInPurchaseProcess",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
noOfEmployees: {
|
|
108
|
+
propDefinition: [
|
|
109
|
+
app,
|
|
110
|
+
"noOfEmployees",
|
|
111
|
+
],
|
|
95
112
|
},
|
|
96
113
|
comments: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
114
|
+
propDefinition: [
|
|
115
|
+
app,
|
|
116
|
+
"comments",
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
customQuestions: {
|
|
120
|
+
propDefinition: [
|
|
121
|
+
app,
|
|
122
|
+
"customQuestions",
|
|
123
|
+
],
|
|
100
124
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
125
|
+
},
|
|
126
|
+
methods: {
|
|
127
|
+
addWebinarRegistrant({
|
|
128
|
+
webinarId, ...args
|
|
129
|
+
} = {}) {
|
|
130
|
+
return this.app.create({
|
|
131
|
+
path: `/webinars/${webinarId}/registrants`,
|
|
132
|
+
...args,
|
|
133
|
+
});
|
|
105
134
|
},
|
|
106
135
|
},
|
|
107
|
-
async run({
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
136
|
+
async run({ $: step }) {
|
|
137
|
+
const {
|
|
138
|
+
webinarId,
|
|
139
|
+
occurrenceIds,
|
|
140
|
+
email,
|
|
141
|
+
firstName,
|
|
142
|
+
lastName,
|
|
143
|
+
address,
|
|
144
|
+
city,
|
|
145
|
+
country,
|
|
146
|
+
zip,
|
|
147
|
+
state,
|
|
148
|
+
phone,
|
|
149
|
+
industry,
|
|
150
|
+
org,
|
|
151
|
+
jobTitle,
|
|
152
|
+
purchasingTimeFrame,
|
|
153
|
+
roleInPurchaseProcess,
|
|
154
|
+
noOfEmployees,
|
|
155
|
+
comments,
|
|
156
|
+
customQuestions,
|
|
157
|
+
} = this;
|
|
158
|
+
|
|
159
|
+
const response = await this.addWebinarRegistrant({
|
|
160
|
+
step,
|
|
161
|
+
webinarId,
|
|
112
162
|
params: {
|
|
113
|
-
occurrence_ids:
|
|
163
|
+
occurrence_ids: occurrenceIds,
|
|
114
164
|
},
|
|
115
165
|
data: {
|
|
116
|
-
email
|
|
117
|
-
first_name:
|
|
118
|
-
last_name:
|
|
119
|
-
address
|
|
120
|
-
city
|
|
121
|
-
country
|
|
122
|
-
zip
|
|
123
|
-
state
|
|
124
|
-
phone
|
|
125
|
-
industry
|
|
126
|
-
org
|
|
127
|
-
job_title:
|
|
128
|
-
purchasing_time_frame:
|
|
129
|
-
role_in_purchase_process:
|
|
130
|
-
no_of_employees:
|
|
131
|
-
comments
|
|
132
|
-
custom_questions: typeof
|
|
133
|
-
?
|
|
134
|
-
: JSON.parse(
|
|
135
|
-
},
|
|
136
|
-
headers: {
|
|
137
|
-
"Authorization": `Bearer ${this.zoom.$auth.oauth_access_token}`,
|
|
138
|
-
"Content-Type": "application/json",
|
|
166
|
+
email,
|
|
167
|
+
first_name: firstName,
|
|
168
|
+
last_name: lastName,
|
|
169
|
+
address,
|
|
170
|
+
city,
|
|
171
|
+
country,
|
|
172
|
+
zip,
|
|
173
|
+
state,
|
|
174
|
+
phone,
|
|
175
|
+
industry,
|
|
176
|
+
org,
|
|
177
|
+
job_title: jobTitle,
|
|
178
|
+
purchasing_time_frame: purchasingTimeFrame,
|
|
179
|
+
role_in_purchase_process: roleInPurchaseProcess,
|
|
180
|
+
no_of_employees: noOfEmployees,
|
|
181
|
+
comments,
|
|
182
|
+
custom_questions: typeof(customQuestions) === "undefined"
|
|
183
|
+
? customQuestions
|
|
184
|
+
: JSON.parse(customQuestions),
|
|
139
185
|
},
|
|
140
|
-
};
|
|
141
|
-
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
step.export("$summary", `Successfully added registrant to webinar with ID \`${response.id}\``);
|
|
189
|
+
|
|
190
|
+
return response;
|
|
142
191
|
},
|
|
143
192
|
};
|
|
@@ -1,38 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import { axios } from "@pipedream/platform";
|
|
1
|
+
import app from "../../zoom.app.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
key: "zoom-get-webinar-details",
|
|
6
5
|
name: "Get Webinar Details",
|
|
7
|
-
description: "Gets details of a scheduled webinar.",
|
|
8
|
-
version: "0.
|
|
6
|
+
description: "Gets details of a scheduled webinar. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/webinar).",
|
|
7
|
+
version: "0.3.1",
|
|
9
8
|
type: "action",
|
|
10
9
|
props: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
app,
|
|
11
|
+
webinarId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
app,
|
|
14
|
+
"webinarId",
|
|
15
|
+
],
|
|
14
16
|
},
|
|
15
|
-
|
|
16
|
-
type: "integer",
|
|
17
|
-
description: "The webinar ID.",
|
|
18
|
-
},
|
|
19
|
-
occurrence_id: {
|
|
17
|
+
occurrenceId: {
|
|
20
18
|
type: "string",
|
|
19
|
+
label: "Occurrence ID",
|
|
21
20
|
description: "Unique Identifier that identifies an occurrence of a recurring webinar. Recurring webinars can have a maximum of 50 occurrences.",
|
|
22
21
|
optional: true,
|
|
23
22
|
},
|
|
24
23
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
methods: {
|
|
25
|
+
getWebinarDetails({
|
|
26
|
+
webinarId, ...args
|
|
27
|
+
} = {}) {
|
|
28
|
+
return this.app._makeRequest({
|
|
29
|
+
path: `/webinars/${webinarId}`,
|
|
30
|
+
...args,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
async run({ $: step }) {
|
|
35
|
+
const {
|
|
36
|
+
webinarId,
|
|
37
|
+
occurrenceId,
|
|
38
|
+
} = this;
|
|
39
|
+
|
|
40
|
+
const response = await this.getWebinarDetails({
|
|
41
|
+
step,
|
|
42
|
+
webinarId,
|
|
29
43
|
params: {
|
|
30
|
-
occurrence_id:
|
|
44
|
+
occurrence_id: occurrenceId,
|
|
31
45
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
step.export("$summary", `Successfully retrieved webinar details with ID \`${response.id}\``);
|
|
49
|
+
|
|
50
|
+
return response;
|
|
37
51
|
},
|
|
38
52
|
};
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import { axios } from "@pipedream/platform";
|
|
1
|
+
import app from "../../zoom.app.mjs";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
key: "zoom-list-past-meeting-participants",
|
|
6
5
|
name: "List Past Meeting Participants",
|
|
7
|
-
description: "Retrieve information on participants from a past meeting.",
|
|
8
|
-
version: "0.
|
|
6
|
+
description: "Retrieve information on participants from a past meeting. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/pastMeetingParticipants).",
|
|
7
|
+
version: "0.2.1",
|
|
9
8
|
type: "action",
|
|
10
9
|
props: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
app,
|
|
11
|
+
meetingId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
app,
|
|
14
|
+
"meetingId",
|
|
15
|
+
],
|
|
14
16
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
listPastMeetingParticipants({
|
|
20
|
+
meetingId, ...args
|
|
21
|
+
} = {}) {
|
|
22
|
+
return this.app._makeRequest({
|
|
23
|
+
path: `/past_meetings/${meetingId}/participants`,
|
|
24
|
+
...args,
|
|
25
|
+
});
|
|
17
26
|
},
|
|
18
27
|
},
|
|
19
|
-
async run({
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
};
|
|
28
|
+
async run({ $: step }) {
|
|
29
|
+
const { participants } = await this.listPastMeetingParticipants({
|
|
30
|
+
step,
|
|
31
|
+
meetingId: this.meetingId,
|
|
32
|
+
});
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
step.export("$summary", `Successfully retrieved ${participants.length} past meeting participants`);
|
|
28
35
|
|
|
29
|
-
return
|
|
30
|
-
const _element = JSON.stringify(element);
|
|
31
|
-
return index === results.participants.findIndex((obj) => {
|
|
32
|
-
return JSON.stringify(obj) === _element;
|
|
33
|
-
});
|
|
34
|
-
});
|
|
36
|
+
return participants;
|
|
35
37
|
},
|
|
36
38
|
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "zoom-list-past-webinar-qa",
|
|
6
6
|
name: "List Past Webinar Q&A",
|
|
7
7
|
description: "The feature for Webinars allows attendees to ask questions during the Webinar and for the panelists, co-hosts and host to answer their questions. Use this API to list Q&A of a specific Webinar.",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.2",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
zoom: {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import zoom from "../../zoom.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: "List User's Call Logs",
|
|
5
|
+
description: "Gets a user's Zoom phone call logs. [See the documentation](https://developers.zoom.us/docs/zoom-phone/apis/#operation/phoneUserCallLogs)",
|
|
6
|
+
key: "zoom-list-user-call-logs",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
zoom,
|
|
11
|
+
userId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
zoom,
|
|
14
|
+
"userId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
async run ({ $ }) {
|
|
19
|
+
const data = await this.zoom.getResourcesStream({
|
|
20
|
+
resourceFn: this.zoom.listCallLogs,
|
|
21
|
+
resourceFnArgs: {
|
|
22
|
+
userId: this.userId,
|
|
23
|
+
},
|
|
24
|
+
resourceName: "call_logs",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
$.export("$summary", `Successfully fetched ${data.length} call log(s)`);
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import utils from "../../common/utils.mjs";
|
|
2
|
+
import app from "../../zoom.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "zoom-list-webinar-participants-report",
|
|
6
|
+
name: "List Webinar Participants Report",
|
|
7
|
+
description: "Retrieves detailed report on each webinar attendee. You can get webinar participant reports for the last 6 months. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/reportWebinarParticipants).",
|
|
8
|
+
version: "0.0.2",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
app,
|
|
12
|
+
webinarId: {
|
|
13
|
+
propDefinition: [
|
|
14
|
+
app,
|
|
15
|
+
"webinarId",
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
nextPageToken: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
app,
|
|
21
|
+
"nextPageToken",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
max: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
app,
|
|
27
|
+
"max",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
async listWebinarParticipantsReport({
|
|
33
|
+
webinarId, ...args
|
|
34
|
+
} = {}) {
|
|
35
|
+
return this.app._makeRequest({
|
|
36
|
+
path: `/report/webinars/${webinarId}/participants`,
|
|
37
|
+
...args,
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async run({ $: step }) {
|
|
42
|
+
const {
|
|
43
|
+
webinarId,
|
|
44
|
+
nextPageToken,
|
|
45
|
+
max,
|
|
46
|
+
} = this;
|
|
47
|
+
|
|
48
|
+
const stream = await this.app.getResourcesStream({
|
|
49
|
+
resourceFn: this.listWebinarParticipantsReport,
|
|
50
|
+
resourceFnArgs: {
|
|
51
|
+
step,
|
|
52
|
+
webinarId,
|
|
53
|
+
params: {
|
|
54
|
+
page_size: 300,
|
|
55
|
+
next_page_token: nextPageToken,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
resourceName: "participants",
|
|
59
|
+
max,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const participants = await utils.streamIterator(stream);
|
|
63
|
+
|
|
64
|
+
step.export("$summary", `Successfully retrieved ${utils.summaryEnd(participants.length, "participant")}.`);
|
|
65
|
+
|
|
66
|
+
return participants;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "zoom-send-chat-message",
|
|
6
6
|
name: "Send Chat Message",
|
|
7
7
|
description: "Send chat messages on Zoom to either an individual user who is in your contact list or to a of which you are a member.",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.2",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
zoom: {
|
package/common/utils.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
async function streamIterator(stream) {
|
|
2
|
+
const resources = [];
|
|
3
|
+
for await (const resource of stream) {
|
|
4
|
+
resources.push(resource);
|
|
5
|
+
}
|
|
6
|
+
return resources;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function summaryEnd(count, singular, plural) {
|
|
10
|
+
if (!plural) {
|
|
11
|
+
plural = singular + "s";
|
|
12
|
+
}
|
|
13
|
+
const noun = count === 1 && singular || plural;
|
|
14
|
+
return `${count} ${noun}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
streamIterator,
|
|
19
|
+
summaryEnd,
|
|
20
|
+
};
|