runlater-js 0.7.0 → 0.9.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/dist/index.d.mts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -50,7 +50,7 @@ interface CronResponse {
|
|
|
50
50
|
name: string;
|
|
51
51
|
url: string;
|
|
52
52
|
method: string;
|
|
53
|
-
|
|
53
|
+
cron: string;
|
|
54
54
|
enabled: boolean;
|
|
55
55
|
next_run_at: string | null;
|
|
56
56
|
inserted_at: string;
|
|
@@ -64,8 +64,8 @@ interface Task {
|
|
|
64
64
|
headers: Record<string, string>;
|
|
65
65
|
body: string | null;
|
|
66
66
|
schedule_type: string;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
cron: string | null;
|
|
68
|
+
run_at: string | null;
|
|
69
69
|
enabled: boolean;
|
|
70
70
|
timeout_ms: number;
|
|
71
71
|
retry_attempts: number;
|
|
@@ -154,8 +154,8 @@ interface UpdateTaskOptions {
|
|
|
154
154
|
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
155
155
|
headers?: Record<string, string>;
|
|
156
156
|
body?: string;
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
cron?: string;
|
|
158
|
+
run_at?: string;
|
|
159
159
|
timeout_ms?: number;
|
|
160
160
|
retry_attempts?: number;
|
|
161
161
|
callback_url?: string;
|
|
@@ -225,6 +225,7 @@ interface Endpoint {
|
|
|
225
225
|
inbound_url: string;
|
|
226
226
|
forward_urls: string[];
|
|
227
227
|
enabled: boolean;
|
|
228
|
+
paused: boolean;
|
|
228
229
|
retry_attempts: number;
|
|
229
230
|
use_queue: boolean;
|
|
230
231
|
notify_on_failure: boolean | null;
|
|
@@ -417,6 +418,8 @@ declare class Endpoints {
|
|
|
417
418
|
delete(id: string): Promise<void>;
|
|
418
419
|
events(id: string, limit?: number): Promise<InboundEvent[]>;
|
|
419
420
|
replay(endpointId: string, eventId: string): Promise<void>;
|
|
421
|
+
pause(id: string): Promise<Endpoint>;
|
|
422
|
+
resume(id: string): Promise<Endpoint>;
|
|
420
423
|
}
|
|
421
424
|
|
|
422
425
|
export { type BatchOptions, type BatchResponse, type CancelQueueResponse, type CreateEndpointOptions, type CreateMonitorOptions, type CronOptions, type CronResponse, type DelayOptions, type Endpoint, type Execution, type InboundEvent, type ListOptions, type ListResponse, type Monitor, type Ping, type PingResponse, Runlater, RunlaterError, type RunlaterOptions, type ScheduleOptions, type SendOptions, type SyncOptions, type SyncResponse, type Task, type TaskResponse, type TriggerResponse, type UpdateEndpointOptions, type UpdateMonitorOptions, type UpdateTaskOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ interface CronResponse {
|
|
|
50
50
|
name: string;
|
|
51
51
|
url: string;
|
|
52
52
|
method: string;
|
|
53
|
-
|
|
53
|
+
cron: string;
|
|
54
54
|
enabled: boolean;
|
|
55
55
|
next_run_at: string | null;
|
|
56
56
|
inserted_at: string;
|
|
@@ -64,8 +64,8 @@ interface Task {
|
|
|
64
64
|
headers: Record<string, string>;
|
|
65
65
|
body: string | null;
|
|
66
66
|
schedule_type: string;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
cron: string | null;
|
|
68
|
+
run_at: string | null;
|
|
69
69
|
enabled: boolean;
|
|
70
70
|
timeout_ms: number;
|
|
71
71
|
retry_attempts: number;
|
|
@@ -154,8 +154,8 @@ interface UpdateTaskOptions {
|
|
|
154
154
|
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
155
155
|
headers?: Record<string, string>;
|
|
156
156
|
body?: string;
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
cron?: string;
|
|
158
|
+
run_at?: string;
|
|
159
159
|
timeout_ms?: number;
|
|
160
160
|
retry_attempts?: number;
|
|
161
161
|
callback_url?: string;
|
|
@@ -225,6 +225,7 @@ interface Endpoint {
|
|
|
225
225
|
inbound_url: string;
|
|
226
226
|
forward_urls: string[];
|
|
227
227
|
enabled: boolean;
|
|
228
|
+
paused: boolean;
|
|
228
229
|
retry_attempts: number;
|
|
229
230
|
use_queue: boolean;
|
|
230
231
|
notify_on_failure: boolean | null;
|
|
@@ -417,6 +418,8 @@ declare class Endpoints {
|
|
|
417
418
|
delete(id: string): Promise<void>;
|
|
418
419
|
events(id: string, limit?: number): Promise<InboundEvent[]>;
|
|
419
420
|
replay(endpointId: string, eventId: string): Promise<void>;
|
|
421
|
+
pause(id: string): Promise<Endpoint>;
|
|
422
|
+
resume(id: string): Promise<Endpoint>;
|
|
420
423
|
}
|
|
421
424
|
|
|
422
425
|
export { type BatchOptions, type BatchResponse, type CancelQueueResponse, type CreateEndpointOptions, type CreateMonitorOptions, type CronOptions, type CronResponse, type DelayOptions, type Endpoint, type Execution, type InboundEvent, type ListOptions, type ListResponse, type Monitor, type Ping, type PingResponse, Runlater, RunlaterError, type RunlaterOptions, type ScheduleOptions, type SendOptions, type SyncOptions, type SyncResponse, type Task, type TaskResponse, type TriggerResponse, type UpdateEndpointOptions, type UpdateMonitorOptions, type UpdateTaskOptions };
|
package/dist/index.js
CHANGED
|
@@ -168,8 +168,7 @@ var Runlater = class {
|
|
|
168
168
|
// name defaults to url if not in CronOptions
|
|
169
169
|
url: t.url,
|
|
170
170
|
method: t.method ?? "GET",
|
|
171
|
-
|
|
172
|
-
cron_expression: t.schedule,
|
|
171
|
+
cron: t.schedule,
|
|
173
172
|
headers: t.headers,
|
|
174
173
|
body: t.body != null ? JSON.stringify(t.body) : void 0,
|
|
175
174
|
timeout_ms: t.timeout,
|
|
@@ -429,6 +428,14 @@ var Endpoints = class {
|
|
|
429
428
|
async replay(endpointId, eventId) {
|
|
430
429
|
await this.client.request("POST", `/endpoints/${endpointId}/events/${eventId}/replay`);
|
|
431
430
|
}
|
|
431
|
+
async pause(id) {
|
|
432
|
+
const res = await this.client.request("POST", `/endpoints/${id}/pause`);
|
|
433
|
+
return res.data;
|
|
434
|
+
}
|
|
435
|
+
async resume(id) {
|
|
436
|
+
const res = await this.client.request("POST", `/endpoints/${id}/resume`);
|
|
437
|
+
return res.data;
|
|
438
|
+
}
|
|
432
439
|
};
|
|
433
440
|
function formatDelay(delay) {
|
|
434
441
|
if (typeof delay === "number") return `${delay}s`;
|
package/dist/index.mjs
CHANGED
|
@@ -141,8 +141,7 @@ var Runlater = class {
|
|
|
141
141
|
// name defaults to url if not in CronOptions
|
|
142
142
|
url: t.url,
|
|
143
143
|
method: t.method ?? "GET",
|
|
144
|
-
|
|
145
|
-
cron_expression: t.schedule,
|
|
144
|
+
cron: t.schedule,
|
|
146
145
|
headers: t.headers,
|
|
147
146
|
body: t.body != null ? JSON.stringify(t.body) : void 0,
|
|
148
147
|
timeout_ms: t.timeout,
|
|
@@ -402,6 +401,14 @@ var Endpoints = class {
|
|
|
402
401
|
async replay(endpointId, eventId) {
|
|
403
402
|
await this.client.request("POST", `/endpoints/${endpointId}/events/${eventId}/replay`);
|
|
404
403
|
}
|
|
404
|
+
async pause(id) {
|
|
405
|
+
const res = await this.client.request("POST", `/endpoints/${id}/pause`);
|
|
406
|
+
return res.data;
|
|
407
|
+
}
|
|
408
|
+
async resume(id) {
|
|
409
|
+
const res = await this.client.request("POST", `/endpoints/${id}/resume`);
|
|
410
|
+
return res.data;
|
|
411
|
+
}
|
|
405
412
|
};
|
|
406
413
|
function formatDelay(delay) {
|
|
407
414
|
if (typeof delay === "number") return `${delay}s`;
|