glitch-javascript-sdk 3.8.0 → 3.8.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/cjs/index.js +17 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +100 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +100 -0
- package/package.json +2 -2
- package/src/api/Scheduler.ts +122 -0
- package/src/routes/SchedulerRoute.ts +2 -0
|
@@ -1,5 +1,94 @@
|
|
|
1
1
|
import Response from "../util/Response";
|
|
2
2
|
import { AxiosPromise } from "axios";
|
|
3
|
+
export type DiscordMediaType = 'all' | 'image' | 'video' | 'gif';
|
|
4
|
+
export type DiscordMediaAuthorType = 'all' | 'user' | 'bot' | 'webhook';
|
|
5
|
+
export interface DiscordMediaSearchParams {
|
|
6
|
+
cursor?: string;
|
|
7
|
+
channel_id?: string;
|
|
8
|
+
search?: string;
|
|
9
|
+
search_scope?: 'content' | 'filename';
|
|
10
|
+
media_type?: DiscordMediaType;
|
|
11
|
+
author_type?: DiscordMediaAuthorType;
|
|
12
|
+
date_from?: string;
|
|
13
|
+
date_to?: string;
|
|
14
|
+
sort_order?: 'asc' | 'desc';
|
|
15
|
+
include_imported?: boolean;
|
|
16
|
+
include_unsupported?: boolean;
|
|
17
|
+
include_nsfw?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface DiscordMediaAttachment {
|
|
20
|
+
id: string;
|
|
21
|
+
filename: string;
|
|
22
|
+
title?: string | null;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
mime_type: string;
|
|
25
|
+
media_type: 'image' | 'video';
|
|
26
|
+
size: number;
|
|
27
|
+
url?: string | null;
|
|
28
|
+
proxy_url?: string | null;
|
|
29
|
+
width?: number | null;
|
|
30
|
+
height?: number | null;
|
|
31
|
+
duration_secs?: number | null;
|
|
32
|
+
supported: boolean;
|
|
33
|
+
unsupported_reason?: string | null;
|
|
34
|
+
already_imported: boolean;
|
|
35
|
+
imported_title_update_id?: string | null;
|
|
36
|
+
imported_media_id?: string | null;
|
|
37
|
+
duplicate_import: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface DiscordMediaMessage {
|
|
40
|
+
id: string;
|
|
41
|
+
channel_id: string;
|
|
42
|
+
content: string;
|
|
43
|
+
timestamp?: string | null;
|
|
44
|
+
edited_timestamp?: string | null;
|
|
45
|
+
jump_url: string;
|
|
46
|
+
author: {
|
|
47
|
+
id?: string | null;
|
|
48
|
+
username: string;
|
|
49
|
+
avatar?: string | null;
|
|
50
|
+
bot: boolean;
|
|
51
|
+
};
|
|
52
|
+
webhook_id?: string | null;
|
|
53
|
+
attachments: DiscordMediaAttachment[];
|
|
54
|
+
}
|
|
55
|
+
export interface DiscordMediaSearchResponse {
|
|
56
|
+
items: DiscordMediaMessage[];
|
|
57
|
+
total_results: number;
|
|
58
|
+
next_cursor?: string | null;
|
|
59
|
+
indexing: boolean;
|
|
60
|
+
retry_after?: number | null;
|
|
61
|
+
}
|
|
62
|
+
export interface DiscordMediaImportGroup {
|
|
63
|
+
channel_id: string;
|
|
64
|
+
message_id: string;
|
|
65
|
+
attachment_ids: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface DiscordMediaImportRequest {
|
|
68
|
+
groups: DiscordMediaImportGroup[];
|
|
69
|
+
}
|
|
70
|
+
export interface DiscordMediaImportAttachmentResult {
|
|
71
|
+
status: 'imported' | 'duplicate' | 'failed';
|
|
72
|
+
channel_id: string;
|
|
73
|
+
message_id: string;
|
|
74
|
+
attachment_id: string;
|
|
75
|
+
media_id?: string;
|
|
76
|
+
title_update_id?: string;
|
|
77
|
+
reason?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface DiscordMediaImportResponse {
|
|
80
|
+
imported_count: number;
|
|
81
|
+
duplicate_count: number;
|
|
82
|
+
failed_count: number;
|
|
83
|
+
updates: Array<{
|
|
84
|
+
id: string;
|
|
85
|
+
title?: string | null;
|
|
86
|
+
scheduled_status: 'pending';
|
|
87
|
+
schedule_for_social: false;
|
|
88
|
+
media_count: number;
|
|
89
|
+
}>;
|
|
90
|
+
attachments: DiscordMediaImportAttachmentResult[];
|
|
91
|
+
}
|
|
3
92
|
declare class Scheduler {
|
|
4
93
|
/**
|
|
5
94
|
* List promotion schedules.
|
|
@@ -310,6 +399,17 @@ declare class Scheduler {
|
|
|
310
399
|
* @returns promise
|
|
311
400
|
*/
|
|
312
401
|
static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
402
|
+
/**
|
|
403
|
+
* Search image and video attachments in the connected Discord server.
|
|
404
|
+
* This call only returns remote candidates; it does not copy files into the
|
|
405
|
+
* Library and does not create or schedule social posts.
|
|
406
|
+
*/
|
|
407
|
+
static searchDiscordMedia<T = DiscordMediaSearchResponse>(scheduler_id: string, params?: DiscordMediaSearchParams): AxiosPromise<Response<T>>;
|
|
408
|
+
/**
|
|
409
|
+
* Import explicitly selected Discord attachments as pending, unscheduled
|
|
410
|
+
* Library updates. Attachments selected from one message stay grouped.
|
|
411
|
+
*/
|
|
412
|
+
static importDiscordMedia<T = DiscordMediaImportResponse>(scheduler_id: string, data: DiscordMediaImportRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
313
413
|
/**
|
|
314
414
|
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
315
415
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -16257,6 +16257,8 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
16257
16257
|
getRedditSubredditFlairs: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/flairs', method: HTTP_METHODS.GET },
|
|
16258
16258
|
getRedditSubredditRules: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/rules', method: HTTP_METHODS.GET },
|
|
16259
16259
|
getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
|
|
16260
|
+
searchDiscordMedia: { url: '/schedulers/{scheduler_id}/discord/media', method: HTTP_METHODS.GET },
|
|
16261
|
+
importDiscordMedia: { url: '/schedulers/{scheduler_id}/discord/media/import', method: HTTP_METHODS.POST },
|
|
16260
16262
|
crossPromoteListRelationships: {
|
|
16261
16263
|
url: '/schedulers/{scheduler_id}/crosspromote/relationships',
|
|
16262
16264
|
method: HTTP_METHODS.GET
|
|
@@ -16753,6 +16755,21 @@ var Scheduler = /** @class */ (function () {
|
|
|
16753
16755
|
Scheduler.getDiscordChannels = function (scheduler_id, params) {
|
|
16754
16756
|
return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id: scheduler_id }, params);
|
|
16755
16757
|
};
|
|
16758
|
+
/**
|
|
16759
|
+
* Search image and video attachments in the connected Discord server.
|
|
16760
|
+
* This call only returns remote candidates; it does not copy files into the
|
|
16761
|
+
* Library and does not create or schedule social posts.
|
|
16762
|
+
*/
|
|
16763
|
+
Scheduler.searchDiscordMedia = function (scheduler_id, params) {
|
|
16764
|
+
return Requests.processRoute(SchedulerRoute.routes.searchDiscordMedia, {}, { scheduler_id: scheduler_id }, params);
|
|
16765
|
+
};
|
|
16766
|
+
/**
|
|
16767
|
+
* Import explicitly selected Discord attachments as pending, unscheduled
|
|
16768
|
+
* Library updates. Attachments selected from one message stay grouped.
|
|
16769
|
+
*/
|
|
16770
|
+
Scheduler.importDiscordMedia = function (scheduler_id, data, params) {
|
|
16771
|
+
return Requests.processRoute(SchedulerRoute.routes.importDiscordMedia, data, { scheduler_id: scheduler_id }, params);
|
|
16772
|
+
};
|
|
16756
16773
|
/**
|
|
16757
16774
|
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
16758
16775
|
*
|