ugcinc 3.31.2 → 3.32.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/automations.d.ts +38 -0
- package/dist/automations.js +44 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/automations.d.ts
CHANGED
|
@@ -126,6 +126,44 @@ export declare class AutomationsClient extends BaseClient {
|
|
|
126
126
|
stop(params: {
|
|
127
127
|
runId: string;
|
|
128
128
|
}): Promise<ApiResponse<null>>;
|
|
129
|
+
/**
|
|
130
|
+
* Get the recurrence status for an automation template
|
|
131
|
+
* Returns whether the template has a recurrence node, if it's published, and schedule info
|
|
132
|
+
*/
|
|
133
|
+
getRecurrenceStatus(params: {
|
|
134
|
+
templateId: string;
|
|
135
|
+
}): Promise<ApiResponse<{
|
|
136
|
+
hasRecurrence: boolean;
|
|
137
|
+
isPublished: boolean;
|
|
138
|
+
nextRunAt: string | null;
|
|
139
|
+
lastRunAt: string | null;
|
|
140
|
+
}>>;
|
|
141
|
+
/**
|
|
142
|
+
* Publish an automation - enables recurrence and starts the scheduler workflow
|
|
143
|
+
* The automation will run automatically based on its recurrence configuration
|
|
144
|
+
*/
|
|
145
|
+
publish(params: {
|
|
146
|
+
templateId: string;
|
|
147
|
+
}): Promise<ApiResponse<{
|
|
148
|
+
schedulerRunId: string;
|
|
149
|
+
}>>;
|
|
150
|
+
/**
|
|
151
|
+
* Unpublish an automation - disables recurrence and stops the scheduler workflow
|
|
152
|
+
* No more scheduled runs will occur until the automation is published again
|
|
153
|
+
*/
|
|
154
|
+
unpublish(params: {
|
|
155
|
+
templateId: string;
|
|
156
|
+
}): Promise<ApiResponse<null>>;
|
|
157
|
+
/**
|
|
158
|
+
* Run an automation once immediately
|
|
159
|
+
* If the automation is published, this also updates the schedule (restarts the scheduler)
|
|
160
|
+
* This is used for the "Run Once" button on recurrence automations
|
|
161
|
+
*/
|
|
162
|
+
runOnce(params: {
|
|
163
|
+
templateId: string;
|
|
164
|
+
}): Promise<ApiResponse<{
|
|
165
|
+
runIds: string[];
|
|
166
|
+
}>>;
|
|
129
167
|
}
|
|
130
168
|
/**
|
|
131
169
|
* Get all available automation nodes
|
package/dist/automations.js
CHANGED
|
@@ -142,6 +142,50 @@ class AutomationsClient extends base_1.BaseClient {
|
|
|
142
142
|
body: JSON.stringify(params),
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
+
// ===========================================================================
|
|
146
|
+
// Recurrence Scheduling
|
|
147
|
+
// ===========================================================================
|
|
148
|
+
/**
|
|
149
|
+
* Get the recurrence status for an automation template
|
|
150
|
+
* Returns whether the template has a recurrence node, if it's published, and schedule info
|
|
151
|
+
*/
|
|
152
|
+
async getRecurrenceStatus(params) {
|
|
153
|
+
return this.request('/automations/recurrence-status', {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
body: JSON.stringify(params),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Publish an automation - enables recurrence and starts the scheduler workflow
|
|
160
|
+
* The automation will run automatically based on its recurrence configuration
|
|
161
|
+
*/
|
|
162
|
+
async publish(params) {
|
|
163
|
+
return this.request('/automations/publish', {
|
|
164
|
+
method: 'POST',
|
|
165
|
+
body: JSON.stringify(params),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Unpublish an automation - disables recurrence and stops the scheduler workflow
|
|
170
|
+
* No more scheduled runs will occur until the automation is published again
|
|
171
|
+
*/
|
|
172
|
+
async unpublish(params) {
|
|
173
|
+
return this.request('/automations/unpublish', {
|
|
174
|
+
method: 'POST',
|
|
175
|
+
body: JSON.stringify(params),
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Run an automation once immediately
|
|
180
|
+
* If the automation is published, this also updates the schedule (restarts the scheduler)
|
|
181
|
+
* This is used for the "Run Once" button on recurrence automations
|
|
182
|
+
*/
|
|
183
|
+
async runOnce(params) {
|
|
184
|
+
return this.request('/automations/run-once', {
|
|
185
|
+
method: 'POST',
|
|
186
|
+
body: JSON.stringify(params),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
145
189
|
}
|
|
146
190
|
exports.AutomationsClient = AutomationsClient;
|
|
147
191
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -1385,6 +1385,9 @@ export interface AutomationTemplate {
|
|
|
1385
1385
|
output_schema: Record<string, {
|
|
1386
1386
|
type: string;
|
|
1387
1387
|
}> | null;
|
|
1388
|
+
recurrence_enabled: boolean;
|
|
1389
|
+
next_run_at: string | null;
|
|
1390
|
+
last_run_at: string | null;
|
|
1388
1391
|
created_at: string;
|
|
1389
1392
|
updated_at: string;
|
|
1390
1393
|
}
|