@natsuneko-laboratory/catalyst-sdk 0.1.0 → 0.1.1
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +50 -11
- package/dist/index.mjs +50 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -242,6 +242,7 @@ declare class CatalystClient {
|
|
|
242
242
|
favorite(id: string): Promise<void>;
|
|
243
243
|
unfavorite(id: string): Promise<void>;
|
|
244
244
|
reactions(id: string): Promise<CatalystReactions>;
|
|
245
|
+
albumsInStatus(id: string): Promise<CatalystAlbum[]>;
|
|
245
246
|
react(id: string, symbol: string): Promise<void>;
|
|
246
247
|
unreact(id: string, symbol: string): Promise<void>;
|
|
247
248
|
contestTimeline(slug: string, opts?: {
|
|
@@ -458,6 +459,7 @@ declare const CatalystEndpoint: {
|
|
|
458
459
|
readonly favorite: (id: string) => Endpoint;
|
|
459
460
|
readonly unfavorite: (id: string) => Endpoint;
|
|
460
461
|
readonly reactions: (id: string) => Endpoint;
|
|
462
|
+
readonly albumsInStatus: (id: string) => Endpoint;
|
|
461
463
|
readonly react: (id: string, symbol: string) => Endpoint;
|
|
462
464
|
readonly unreact: (id: string, symbol: string) => Endpoint;
|
|
463
465
|
readonly contestTimeline: (slug: string, opts?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -242,6 +242,7 @@ declare class CatalystClient {
|
|
|
242
242
|
favorite(id: string): Promise<void>;
|
|
243
243
|
unfavorite(id: string): Promise<void>;
|
|
244
244
|
reactions(id: string): Promise<CatalystReactions>;
|
|
245
|
+
albumsInStatus(id: string): Promise<CatalystAlbum[]>;
|
|
245
246
|
react(id: string, symbol: string): Promise<void>;
|
|
246
247
|
unreact(id: string, symbol: string): Promise<void>;
|
|
247
248
|
contestTimeline(slug: string, opts?: {
|
|
@@ -458,6 +459,7 @@ declare const CatalystEndpoint: {
|
|
|
458
459
|
readonly favorite: (id: string) => Endpoint;
|
|
459
460
|
readonly unfavorite: (id: string) => Endpoint;
|
|
460
461
|
readonly reactions: (id: string) => Endpoint;
|
|
462
|
+
readonly albumsInStatus: (id: string) => Endpoint;
|
|
461
463
|
readonly react: (id: string, symbol: string) => Endpoint;
|
|
462
464
|
readonly unreact: (id: string, symbol: string) => Endpoint;
|
|
463
465
|
readonly contestTimeline: (slug: string, opts?: {
|
package/dist/index.js
CHANGED
|
@@ -169,13 +169,25 @@ var CatalystEndpoint = {
|
|
|
169
169
|
};
|
|
170
170
|
},
|
|
171
171
|
editAlbum(id, data) {
|
|
172
|
-
return {
|
|
172
|
+
return {
|
|
173
|
+
path: `/catalyst/v1/album/by/id/${id}`,
|
|
174
|
+
method: "PATCH",
|
|
175
|
+
body: data
|
|
176
|
+
};
|
|
173
177
|
},
|
|
174
178
|
insertToAlbum(id, data) {
|
|
175
|
-
return {
|
|
179
|
+
return {
|
|
180
|
+
path: `/catalyst/v1/album/by/id/${id}`,
|
|
181
|
+
method: "PUT",
|
|
182
|
+
body: data
|
|
183
|
+
};
|
|
176
184
|
},
|
|
177
185
|
removeFromAlbum(id, data) {
|
|
178
|
-
return {
|
|
186
|
+
return {
|
|
187
|
+
path: `/catalyst/v1/album/by/id/${id}`,
|
|
188
|
+
method: "PUT",
|
|
189
|
+
body: data
|
|
190
|
+
};
|
|
179
191
|
},
|
|
180
192
|
deleteAlbum(id) {
|
|
181
193
|
return { path: `/catalyst/v1/album/by/id/${id}`, method: "DELETE" };
|
|
@@ -217,13 +229,21 @@ var CatalystEndpoint = {
|
|
|
217
229
|
};
|
|
218
230
|
},
|
|
219
231
|
editSmartAlbum(id, data) {
|
|
220
|
-
return {
|
|
232
|
+
return {
|
|
233
|
+
path: `/catalyst/v1/smart-album/by/id/${id}`,
|
|
234
|
+
method: "PATCH",
|
|
235
|
+
body: data
|
|
236
|
+
};
|
|
221
237
|
},
|
|
222
238
|
deleteSmartAlbum(id) {
|
|
223
239
|
return { path: `/catalyst/v1/smart-album/by/id/${id}`, method: "DELETE" };
|
|
224
240
|
},
|
|
225
241
|
searchSmartAlbum(q) {
|
|
226
|
-
return {
|
|
242
|
+
return {
|
|
243
|
+
path: "/catalyst/v1/smart-album/search",
|
|
244
|
+
method: "GET",
|
|
245
|
+
queryParameters: { q }
|
|
246
|
+
};
|
|
227
247
|
},
|
|
228
248
|
createStatus(data) {
|
|
229
249
|
return { path: "/catalyst/v1/status", method: "POST", body: data };
|
|
@@ -249,11 +269,20 @@ var CatalystEndpoint = {
|
|
|
249
269
|
reactions(id) {
|
|
250
270
|
return { path: `/catalyst/v1/status/${id}/reactions`, method: "GET" };
|
|
251
271
|
},
|
|
272
|
+
albumsInStatus(id) {
|
|
273
|
+
return { path: `/catalyst/v1/status/${id}/albums`, method: "GET" };
|
|
274
|
+
},
|
|
252
275
|
react(id, symbol) {
|
|
253
|
-
return {
|
|
276
|
+
return {
|
|
277
|
+
path: `/catalyst/v1/status/${id}/reactions/${symbol}`,
|
|
278
|
+
method: "POST"
|
|
279
|
+
};
|
|
254
280
|
},
|
|
255
281
|
unreact(id, symbol) {
|
|
256
|
-
return {
|
|
282
|
+
return {
|
|
283
|
+
path: `/catalyst/v1/status/${id}/reactions/${symbol}`,
|
|
284
|
+
method: "DELETE"
|
|
285
|
+
};
|
|
257
286
|
},
|
|
258
287
|
contestTimeline(slug, opts = {}) {
|
|
259
288
|
return {
|
|
@@ -305,7 +334,8 @@ var CatalystEndpoint = {
|
|
|
305
334
|
userTimeline(username, opts = {}) {
|
|
306
335
|
const params = {};
|
|
307
336
|
if (opts.trimUser != null) params["trim_user"] = String(opts.trimUser);
|
|
308
|
-
if (opts.excludeSensitive != null)
|
|
337
|
+
if (opts.excludeSensitive != null)
|
|
338
|
+
params["exclude_sensitive"] = String(opts.excludeSensitive);
|
|
309
339
|
if (opts.since != null) params["since"] = opts.since;
|
|
310
340
|
if (opts.until != null) params["until"] = opts.until;
|
|
311
341
|
return {
|
|
@@ -351,10 +381,14 @@ var CatalystClient = class {
|
|
|
351
381
|
return this.http.requestVoid(CatalystEndpoint.deleteAlbum(id));
|
|
352
382
|
}
|
|
353
383
|
listAlbums(username, includeSmartAlbums = true) {
|
|
354
|
-
return this.http.request(
|
|
384
|
+
return this.http.request(
|
|
385
|
+
CatalystEndpoint.listAlbums(username, includeSmartAlbums)
|
|
386
|
+
);
|
|
355
387
|
}
|
|
356
388
|
searchAlbums(q, includeSmartAlbums = true) {
|
|
357
|
-
return this.http.request(
|
|
389
|
+
return this.http.request(
|
|
390
|
+
CatalystEndpoint.searchAlbum(q, includeSmartAlbums)
|
|
391
|
+
);
|
|
358
392
|
}
|
|
359
393
|
// Reactions
|
|
360
394
|
customReactions() {
|
|
@@ -411,6 +445,9 @@ var CatalystClient = class {
|
|
|
411
445
|
reactions(id) {
|
|
412
446
|
return this.http.request(CatalystEndpoint.reactions(id));
|
|
413
447
|
}
|
|
448
|
+
albumsInStatus(id) {
|
|
449
|
+
return this.http.request(CatalystEndpoint.albumsInStatus(id));
|
|
450
|
+
}
|
|
414
451
|
react(id, symbol) {
|
|
415
452
|
return this.http.requestVoid(CatalystEndpoint.react(id, symbol));
|
|
416
453
|
}
|
|
@@ -440,7 +477,9 @@ var CatalystClient = class {
|
|
|
440
477
|
return this.http.request(CatalystEndpoint.userTimeline(username, opts));
|
|
441
478
|
}
|
|
442
479
|
userGalleryTimeline(username, opts = {}) {
|
|
443
|
-
return this.http.request(
|
|
480
|
+
return this.http.request(
|
|
481
|
+
CatalystEndpoint.userGalleryTimeline(username, opts)
|
|
482
|
+
);
|
|
444
483
|
}
|
|
445
484
|
trend() {
|
|
446
485
|
return this.http.request(CatalystEndpoint.trend());
|
package/dist/index.mjs
CHANGED
|
@@ -120,13 +120,25 @@ var CatalystEndpoint = {
|
|
|
120
120
|
};
|
|
121
121
|
},
|
|
122
122
|
editAlbum(id, data) {
|
|
123
|
-
return {
|
|
123
|
+
return {
|
|
124
|
+
path: `/catalyst/v1/album/by/id/${id}`,
|
|
125
|
+
method: "PATCH",
|
|
126
|
+
body: data
|
|
127
|
+
};
|
|
124
128
|
},
|
|
125
129
|
insertToAlbum(id, data) {
|
|
126
|
-
return {
|
|
130
|
+
return {
|
|
131
|
+
path: `/catalyst/v1/album/by/id/${id}`,
|
|
132
|
+
method: "PUT",
|
|
133
|
+
body: data
|
|
134
|
+
};
|
|
127
135
|
},
|
|
128
136
|
removeFromAlbum(id, data) {
|
|
129
|
-
return {
|
|
137
|
+
return {
|
|
138
|
+
path: `/catalyst/v1/album/by/id/${id}`,
|
|
139
|
+
method: "PUT",
|
|
140
|
+
body: data
|
|
141
|
+
};
|
|
130
142
|
},
|
|
131
143
|
deleteAlbum(id) {
|
|
132
144
|
return { path: `/catalyst/v1/album/by/id/${id}`, method: "DELETE" };
|
|
@@ -168,13 +180,21 @@ var CatalystEndpoint = {
|
|
|
168
180
|
};
|
|
169
181
|
},
|
|
170
182
|
editSmartAlbum(id, data) {
|
|
171
|
-
return {
|
|
183
|
+
return {
|
|
184
|
+
path: `/catalyst/v1/smart-album/by/id/${id}`,
|
|
185
|
+
method: "PATCH",
|
|
186
|
+
body: data
|
|
187
|
+
};
|
|
172
188
|
},
|
|
173
189
|
deleteSmartAlbum(id) {
|
|
174
190
|
return { path: `/catalyst/v1/smart-album/by/id/${id}`, method: "DELETE" };
|
|
175
191
|
},
|
|
176
192
|
searchSmartAlbum(q) {
|
|
177
|
-
return {
|
|
193
|
+
return {
|
|
194
|
+
path: "/catalyst/v1/smart-album/search",
|
|
195
|
+
method: "GET",
|
|
196
|
+
queryParameters: { q }
|
|
197
|
+
};
|
|
178
198
|
},
|
|
179
199
|
createStatus(data) {
|
|
180
200
|
return { path: "/catalyst/v1/status", method: "POST", body: data };
|
|
@@ -200,11 +220,20 @@ var CatalystEndpoint = {
|
|
|
200
220
|
reactions(id) {
|
|
201
221
|
return { path: `/catalyst/v1/status/${id}/reactions`, method: "GET" };
|
|
202
222
|
},
|
|
223
|
+
albumsInStatus(id) {
|
|
224
|
+
return { path: `/catalyst/v1/status/${id}/albums`, method: "GET" };
|
|
225
|
+
},
|
|
203
226
|
react(id, symbol) {
|
|
204
|
-
return {
|
|
227
|
+
return {
|
|
228
|
+
path: `/catalyst/v1/status/${id}/reactions/${symbol}`,
|
|
229
|
+
method: "POST"
|
|
230
|
+
};
|
|
205
231
|
},
|
|
206
232
|
unreact(id, symbol) {
|
|
207
|
-
return {
|
|
233
|
+
return {
|
|
234
|
+
path: `/catalyst/v1/status/${id}/reactions/${symbol}`,
|
|
235
|
+
method: "DELETE"
|
|
236
|
+
};
|
|
208
237
|
},
|
|
209
238
|
contestTimeline(slug, opts = {}) {
|
|
210
239
|
return {
|
|
@@ -256,7 +285,8 @@ var CatalystEndpoint = {
|
|
|
256
285
|
userTimeline(username, opts = {}) {
|
|
257
286
|
const params = {};
|
|
258
287
|
if (opts.trimUser != null) params["trim_user"] = String(opts.trimUser);
|
|
259
|
-
if (opts.excludeSensitive != null)
|
|
288
|
+
if (opts.excludeSensitive != null)
|
|
289
|
+
params["exclude_sensitive"] = String(opts.excludeSensitive);
|
|
260
290
|
if (opts.since != null) params["since"] = opts.since;
|
|
261
291
|
if (opts.until != null) params["until"] = opts.until;
|
|
262
292
|
return {
|
|
@@ -302,10 +332,14 @@ var CatalystClient = class {
|
|
|
302
332
|
return this.http.requestVoid(CatalystEndpoint.deleteAlbum(id));
|
|
303
333
|
}
|
|
304
334
|
listAlbums(username, includeSmartAlbums = true) {
|
|
305
|
-
return this.http.request(
|
|
335
|
+
return this.http.request(
|
|
336
|
+
CatalystEndpoint.listAlbums(username, includeSmartAlbums)
|
|
337
|
+
);
|
|
306
338
|
}
|
|
307
339
|
searchAlbums(q, includeSmartAlbums = true) {
|
|
308
|
-
return this.http.request(
|
|
340
|
+
return this.http.request(
|
|
341
|
+
CatalystEndpoint.searchAlbum(q, includeSmartAlbums)
|
|
342
|
+
);
|
|
309
343
|
}
|
|
310
344
|
// Reactions
|
|
311
345
|
customReactions() {
|
|
@@ -362,6 +396,9 @@ var CatalystClient = class {
|
|
|
362
396
|
reactions(id) {
|
|
363
397
|
return this.http.request(CatalystEndpoint.reactions(id));
|
|
364
398
|
}
|
|
399
|
+
albumsInStatus(id) {
|
|
400
|
+
return this.http.request(CatalystEndpoint.albumsInStatus(id));
|
|
401
|
+
}
|
|
365
402
|
react(id, symbol) {
|
|
366
403
|
return this.http.requestVoid(CatalystEndpoint.react(id, symbol));
|
|
367
404
|
}
|
|
@@ -391,7 +428,9 @@ var CatalystClient = class {
|
|
|
391
428
|
return this.http.request(CatalystEndpoint.userTimeline(username, opts));
|
|
392
429
|
}
|
|
393
430
|
userGalleryTimeline(username, opts = {}) {
|
|
394
|
-
return this.http.request(
|
|
431
|
+
return this.http.request(
|
|
432
|
+
CatalystEndpoint.userGalleryTimeline(username, opts)
|
|
433
|
+
);
|
|
395
434
|
}
|
|
396
435
|
trend() {
|
|
397
436
|
return this.http.request(CatalystEndpoint.trend());
|