@stage5/lumine 0.2.17 → 0.2.19

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/lib/api.js CHANGED
@@ -189,6 +189,74 @@ export async function loadContributionDiff({
189
189
  });
190
190
  }
191
191
 
192
+ export async function listBuildSuggestions({
193
+ options,
194
+ auth,
195
+ rootBuildId,
196
+ cursor,
197
+ suggestionId,
198
+ }) {
199
+ const query = new URLSearchParams();
200
+ if (Number(cursor || 0) > 0) query.set("cursor", String(cursor));
201
+ if (Number(suggestionId || 0) > 0) {
202
+ query.set("suggestionId", String(suggestionId));
203
+ }
204
+ const queryString = query.toString();
205
+ return await requestJson({
206
+ url: `${options.apiUrl}/build/${rootBuildId}/suggestions${queryString ? `?${queryString}` : ""}`,
207
+ authToken: auth.token,
208
+ timeoutMs: options.timeoutMs,
209
+ });
210
+ }
211
+
212
+ export async function notifyBuildOwnerOfContribution({
213
+ options,
214
+ auth,
215
+ rootBuildId,
216
+ contributionBuildId,
217
+ note,
218
+ }) {
219
+ return await requestJson({
220
+ method: "POST",
221
+ url: `${options.apiUrl}/build/${rootBuildId}/contributions/${contributionBuildId}/notify-owner`,
222
+ authToken: auth.token,
223
+ body: { note },
224
+ timeoutMs: options.timeoutMs,
225
+ });
226
+ }
227
+
228
+ export async function suggestBuildThumbnailToOwner({
229
+ options,
230
+ auth,
231
+ rootBuildId,
232
+ contributionBuildId,
233
+ }) {
234
+ return await requestJson({
235
+ method: "POST",
236
+ url: `${options.apiUrl}/build/${rootBuildId}/contributions/${contributionBuildId}/suggest-thumbnail`,
237
+ authToken: auth.token,
238
+ body: {},
239
+ timeoutMs: options.timeoutMs,
240
+ });
241
+ }
242
+
243
+ export async function adoptBuildThumbnailSuggestion({
244
+ options,
245
+ auth,
246
+ rootBuildId,
247
+ contributionBuildId,
248
+ suggestionMessageId,
249
+ thumbnailUrl,
250
+ }) {
251
+ return await requestJson({
252
+ method: "POST",
253
+ url: `${options.apiUrl}/build/${rootBuildId}/contributions/${contributionBuildId}/adopt-thumbnail`,
254
+ authToken: auth.token,
255
+ body: { suggestionMessageId, thumbnailUrl },
256
+ timeoutMs: options.timeoutMs,
257
+ });
258
+ }
259
+
192
260
  export async function mergeContributionIntoMain({
193
261
  options,
194
262
  auth,