glitch-javascript-sdk 3.8.1 → 3.8.3
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 +25 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +78 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +78 -0
- package/package.json +1 -1
- package/src/api/Scheduler.ts +117 -0
- package/src/routes/SchedulerRoute.ts +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -7055,6 +7055,74 @@ interface DiscordMediaImportResponse {
|
|
|
7055
7055
|
}>;
|
|
7056
7056
|
attachments: DiscordMediaImportAttachmentResult[];
|
|
7057
7057
|
}
|
|
7058
|
+
interface DiscordUserCommandStatus {
|
|
7059
|
+
linked: boolean;
|
|
7060
|
+
linked_to_this_scheduler: boolean;
|
|
7061
|
+
discord_username?: string | null;
|
|
7062
|
+
destination_scheduler_id?: string | null;
|
|
7063
|
+
destination_scheduler_name?: string | null;
|
|
7064
|
+
installed_at?: string | null;
|
|
7065
|
+
pending_count: number;
|
|
7066
|
+
command_name: string;
|
|
7067
|
+
setup_path: string;
|
|
7068
|
+
configured: boolean;
|
|
7069
|
+
command_ready: boolean;
|
|
7070
|
+
credentials_configured: boolean;
|
|
7071
|
+
user_install_enabled: boolean;
|
|
7072
|
+
interactions_endpoint_configured: boolean;
|
|
7073
|
+
command_registered: boolean;
|
|
7074
|
+
command_id?: string | null;
|
|
7075
|
+
configuration_error?: string | null;
|
|
7076
|
+
checked_at?: string | null;
|
|
7077
|
+
}
|
|
7078
|
+
type DiscordMediaCaptureStatus = 'processing' | 'ready' | 'complete' | 'failed' | 'expired';
|
|
7079
|
+
type DiscordMediaCaptureAttachmentStatus = 'processing' | 'ready' | 'duplicate' | 'unsupported' | 'failed' | 'imported';
|
|
7080
|
+
interface DiscordMediaCaptureAttachment {
|
|
7081
|
+
id: string;
|
|
7082
|
+
discord_attachment_id: string;
|
|
7083
|
+
filename: string;
|
|
7084
|
+
mime_type?: string | null;
|
|
7085
|
+
media_type: 'image' | 'video';
|
|
7086
|
+
size: number;
|
|
7087
|
+
width?: number | null;
|
|
7088
|
+
height?: number | null;
|
|
7089
|
+
duration_secs?: number | null;
|
|
7090
|
+
description?: string | null;
|
|
7091
|
+
status: DiscordMediaCaptureAttachmentStatus;
|
|
7092
|
+
failure_reason?: string | null;
|
|
7093
|
+
preview_url?: string | null;
|
|
7094
|
+
media_id?: string | null;
|
|
7095
|
+
title_update_id?: string | null;
|
|
7096
|
+
}
|
|
7097
|
+
interface DiscordMediaCapture {
|
|
7098
|
+
id: string;
|
|
7099
|
+
status: DiscordMediaCaptureStatus;
|
|
7100
|
+
content?: string | null;
|
|
7101
|
+
author?: {
|
|
7102
|
+
id?: string | null;
|
|
7103
|
+
username: string;
|
|
7104
|
+
avatar?: string | null;
|
|
7105
|
+
bot: boolean;
|
|
7106
|
+
} | null;
|
|
7107
|
+
timestamp?: string | null;
|
|
7108
|
+
jump_url?: string | null;
|
|
7109
|
+
expires_at: string;
|
|
7110
|
+
failure_reason?: string | null;
|
|
7111
|
+
attachments: DiscordMediaCaptureAttachment[];
|
|
7112
|
+
}
|
|
7113
|
+
interface DiscordMediaCaptureListParams {
|
|
7114
|
+
cursor?: string;
|
|
7115
|
+
search?: string;
|
|
7116
|
+
limit?: number;
|
|
7117
|
+
}
|
|
7118
|
+
interface DiscordMediaCaptureListResponse {
|
|
7119
|
+
items: DiscordMediaCapture[];
|
|
7120
|
+
next_cursor?: string | null;
|
|
7121
|
+
}
|
|
7122
|
+
interface DiscordMediaCaptureImportRequest {
|
|
7123
|
+
capture_id: string;
|
|
7124
|
+
attachment_ids: string[];
|
|
7125
|
+
}
|
|
7058
7126
|
declare class Scheduler {
|
|
7059
7127
|
/**
|
|
7060
7128
|
* List promotion schedules.
|
|
@@ -7376,6 +7444,16 @@ declare class Scheduler {
|
|
|
7376
7444
|
* Library updates. Attachments selected from one message stay grouped.
|
|
7377
7445
|
*/
|
|
7378
7446
|
static importDiscordMedia<T = DiscordMediaImportResponse>(scheduler_id: string, data: DiscordMediaImportRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7447
|
+
/** Get the current user's personal Save to Glitch command setup state. */
|
|
7448
|
+
static getDiscordUserCommandStatus<T = DiscordUserCommandStatus>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7449
|
+
/** Disconnect the current user's personal command from this Library. */
|
|
7450
|
+
static disconnectDiscordUserCommand<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7451
|
+
/** List messages saved through the user-installed Discord command. */
|
|
7452
|
+
static listDiscordMediaCaptures<T = DiscordMediaCaptureListResponse>(scheduler_id: string, params?: DiscordMediaCaptureListParams): AxiosPromise<Response<T>>;
|
|
7453
|
+
/** Import selected staged attachments into pending Library content. */
|
|
7454
|
+
static importDiscordMediaCapture<T = DiscordMediaImportResponse>(scheduler_id: string, data: DiscordMediaCaptureImportRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7455
|
+
/** Dismiss one saved Discord message and delete its temporary staged files. */
|
|
7456
|
+
static dismissDiscordMediaCapture<T>(scheduler_id: string, capture_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7379
7457
|
/**
|
|
7380
7458
|
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
7381
7459
|
*
|
package/package.json
CHANGED
package/src/api/Scheduler.ts
CHANGED
|
@@ -101,6 +101,81 @@ export interface DiscordMediaImportResponse {
|
|
|
101
101
|
attachments: DiscordMediaImportAttachmentResult[];
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
export interface DiscordUserCommandStatus {
|
|
105
|
+
linked: boolean;
|
|
106
|
+
linked_to_this_scheduler: boolean;
|
|
107
|
+
discord_username?: string | null;
|
|
108
|
+
destination_scheduler_id?: string | null;
|
|
109
|
+
destination_scheduler_name?: string | null;
|
|
110
|
+
installed_at?: string | null;
|
|
111
|
+
pending_count: number;
|
|
112
|
+
command_name: string;
|
|
113
|
+
setup_path: string;
|
|
114
|
+
configured: boolean;
|
|
115
|
+
command_ready: boolean;
|
|
116
|
+
credentials_configured: boolean;
|
|
117
|
+
user_install_enabled: boolean;
|
|
118
|
+
interactions_endpoint_configured: boolean;
|
|
119
|
+
command_registered: boolean;
|
|
120
|
+
command_id?: string | null;
|
|
121
|
+
configuration_error?: string | null;
|
|
122
|
+
checked_at?: string | null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type DiscordMediaCaptureStatus = 'processing' | 'ready' | 'complete' | 'failed' | 'expired';
|
|
126
|
+
export type DiscordMediaCaptureAttachmentStatus = 'processing' | 'ready' | 'duplicate' | 'unsupported' | 'failed' | 'imported';
|
|
127
|
+
|
|
128
|
+
export interface DiscordMediaCaptureAttachment {
|
|
129
|
+
id: string;
|
|
130
|
+
discord_attachment_id: string;
|
|
131
|
+
filename: string;
|
|
132
|
+
mime_type?: string | null;
|
|
133
|
+
media_type: 'image' | 'video';
|
|
134
|
+
size: number;
|
|
135
|
+
width?: number | null;
|
|
136
|
+
height?: number | null;
|
|
137
|
+
duration_secs?: number | null;
|
|
138
|
+
description?: string | null;
|
|
139
|
+
status: DiscordMediaCaptureAttachmentStatus;
|
|
140
|
+
failure_reason?: string | null;
|
|
141
|
+
preview_url?: string | null;
|
|
142
|
+
media_id?: string | null;
|
|
143
|
+
title_update_id?: string | null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface DiscordMediaCapture {
|
|
147
|
+
id: string;
|
|
148
|
+
status: DiscordMediaCaptureStatus;
|
|
149
|
+
content?: string | null;
|
|
150
|
+
author?: {
|
|
151
|
+
id?: string | null;
|
|
152
|
+
username: string;
|
|
153
|
+
avatar?: string | null;
|
|
154
|
+
bot: boolean;
|
|
155
|
+
} | null;
|
|
156
|
+
timestamp?: string | null;
|
|
157
|
+
jump_url?: string | null;
|
|
158
|
+
expires_at: string;
|
|
159
|
+
failure_reason?: string | null;
|
|
160
|
+
attachments: DiscordMediaCaptureAttachment[];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface DiscordMediaCaptureListParams {
|
|
164
|
+
cursor?: string;
|
|
165
|
+
search?: string;
|
|
166
|
+
limit?: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface DiscordMediaCaptureListResponse {
|
|
170
|
+
items: DiscordMediaCapture[];
|
|
171
|
+
next_cursor?: string | null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface DiscordMediaCaptureImportRequest {
|
|
175
|
+
capture_id: string;
|
|
176
|
+
attachment_ids: string[];
|
|
177
|
+
}
|
|
178
|
+
|
|
104
179
|
class Scheduler {
|
|
105
180
|
/**
|
|
106
181
|
* List promotion schedules.
|
|
@@ -553,6 +628,48 @@ class Scheduler {
|
|
|
553
628
|
return Requests.processRoute(SchedulerRoute.routes.importDiscordMedia, data, { scheduler_id }, params);
|
|
554
629
|
}
|
|
555
630
|
|
|
631
|
+
/** Get the current user's personal Save to Glitch command setup state. */
|
|
632
|
+
public static getDiscordUserCommandStatus<T = DiscordUserCommandStatus>(
|
|
633
|
+
scheduler_id: string,
|
|
634
|
+
params?: Record<string, any>
|
|
635
|
+
): AxiosPromise<Response<T>> {
|
|
636
|
+
return Requests.processRoute(SchedulerRoute.routes.getDiscordUserCommandStatus, {}, { scheduler_id }, params);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/** Disconnect the current user's personal command from this Library. */
|
|
640
|
+
public static disconnectDiscordUserCommand<T>(
|
|
641
|
+
scheduler_id: string,
|
|
642
|
+
params?: Record<string, any>
|
|
643
|
+
): AxiosPromise<Response<T>> {
|
|
644
|
+
return Requests.processRoute(SchedulerRoute.routes.disconnectDiscordUserCommand, {}, { scheduler_id }, params);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/** List messages saved through the user-installed Discord command. */
|
|
648
|
+
public static listDiscordMediaCaptures<T = DiscordMediaCaptureListResponse>(
|
|
649
|
+
scheduler_id: string,
|
|
650
|
+
params?: DiscordMediaCaptureListParams
|
|
651
|
+
): AxiosPromise<Response<T>> {
|
|
652
|
+
return Requests.processRoute(SchedulerRoute.routes.listDiscordMediaCaptures, {}, { scheduler_id }, params);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** Import selected staged attachments into pending Library content. */
|
|
656
|
+
public static importDiscordMediaCapture<T = DiscordMediaImportResponse>(
|
|
657
|
+
scheduler_id: string,
|
|
658
|
+
data: DiscordMediaCaptureImportRequest,
|
|
659
|
+
params?: Record<string, any>
|
|
660
|
+
): AxiosPromise<Response<T>> {
|
|
661
|
+
return Requests.processRoute(SchedulerRoute.routes.importDiscordMediaCapture, data, { scheduler_id }, params);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** Dismiss one saved Discord message and delete its temporary staged files. */
|
|
665
|
+
public static dismissDiscordMediaCapture<T>(
|
|
666
|
+
scheduler_id: string,
|
|
667
|
+
capture_id: string,
|
|
668
|
+
params?: Record<string, any>
|
|
669
|
+
): AxiosPromise<Response<T>> {
|
|
670
|
+
return Requests.processRoute(SchedulerRoute.routes.dismissDiscordMediaCapture, {}, { scheduler_id, capture_id }, params);
|
|
671
|
+
}
|
|
672
|
+
|
|
556
673
|
/**
|
|
557
674
|
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
558
675
|
*
|
|
@@ -52,6 +52,11 @@ class SchedulerRoute {
|
|
|
52
52
|
getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
|
|
53
53
|
searchDiscordMedia: { url: '/schedulers/{scheduler_id}/discord/media', method: HTTP_METHODS.GET },
|
|
54
54
|
importDiscordMedia: { url: '/schedulers/{scheduler_id}/discord/media/import', method: HTTP_METHODS.POST },
|
|
55
|
+
getDiscordUserCommandStatus: { url: '/schedulers/{scheduler_id}/discord/user-command', method: HTTP_METHODS.GET },
|
|
56
|
+
disconnectDiscordUserCommand: { url: '/schedulers/{scheduler_id}/discord/user-command', method: HTTP_METHODS.DELETE },
|
|
57
|
+
listDiscordMediaCaptures: { url: '/schedulers/{scheduler_id}/discord/captures', method: HTTP_METHODS.GET },
|
|
58
|
+
importDiscordMediaCapture: { url: '/schedulers/{scheduler_id}/discord/captures/import', method: HTTP_METHODS.POST },
|
|
59
|
+
dismissDiscordMediaCapture: { url: '/schedulers/{scheduler_id}/discord/captures/{capture_id}', method: HTTP_METHODS.DELETE },
|
|
55
60
|
|
|
56
61
|
crossPromoteListRelationships: {
|
|
57
62
|
url: '/schedulers/{scheduler_id}/crosspromote/relationships',
|