@linkt/sdk 0.5.0 → 0.7.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/CHANGELOG.md +53 -0
- package/README.md +0 -29
- package/client.d.mts +23 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +23 -1
- package/client.d.ts.map +1 -1
- package/client.js +38 -4
- package/client.js.map +1 -1
- package/client.mjs +38 -4
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +1 -1
- package/resources/entity.d.mts +34 -19
- package/resources/entity.d.mts.map +1 -1
- package/resources/entity.d.ts +34 -19
- package/resources/entity.d.ts.map +1 -1
- package/resources/entity.js +15 -8
- package/resources/entity.js.map +1 -1
- package/resources/entity.mjs +15 -8
- package/resources/entity.mjs.map +1 -1
- package/resources/files.d.mts +4 -2
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +4 -2
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +3 -0
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +3 -0
- package/resources/files.mjs.map +1 -1
- package/resources/icp.d.mts +31 -0
- package/resources/icp.d.mts.map +1 -1
- package/resources/icp.d.ts +31 -0
- package/resources/icp.d.ts.map +1 -1
- package/resources/icp.js +3 -0
- package/resources/icp.js.map +1 -1
- package/resources/icp.mjs +3 -0
- package/resources/icp.mjs.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/run.d.mts +3 -0
- package/resources/run.d.mts.map +1 -1
- package/resources/run.d.ts +3 -0
- package/resources/run.d.ts.map +1 -1
- package/resources/run.js +3 -0
- package/resources/run.js.map +1 -1
- package/resources/run.mjs +3 -0
- package/resources/run.mjs.map +1 -1
- package/resources/schedule.d.mts +305 -0
- package/resources/schedule.d.mts.map +1 -0
- package/resources/schedule.d.ts +305 -0
- package/resources/schedule.d.ts.map +1 -0
- package/resources/schedule.js +84 -0
- package/resources/schedule.js.map +1 -0
- package/resources/schedule.mjs +80 -0
- package/resources/schedule.mjs.map +1 -0
- package/resources/sheet/schema.d.mts +3 -0
- package/resources/sheet/schema.d.mts.map +1 -1
- package/resources/sheet/schema.d.ts +3 -0
- package/resources/sheet/schema.d.ts.map +1 -1
- package/resources/sheet/schema.js +3 -0
- package/resources/sheet/schema.js.map +1 -1
- package/resources/sheet/schema.mjs +3 -0
- package/resources/sheet/schema.mjs.map +1 -1
- package/resources/sheet/sheet.d.mts +3 -0
- package/resources/sheet/sheet.d.mts.map +1 -1
- package/resources/sheet/sheet.d.ts +3 -0
- package/resources/sheet/sheet.d.ts.map +1 -1
- package/resources/sheet/sheet.js +3 -0
- package/resources/sheet/sheet.js.map +1 -1
- package/resources/sheet/sheet.mjs +3 -0
- package/resources/sheet/sheet.mjs.map +1 -1
- package/resources/signal.d.mts +4 -0
- package/resources/signal.d.mts.map +1 -1
- package/resources/signal.d.ts +4 -0
- package/resources/signal.d.ts.map +1 -1
- package/resources/signal.js +3 -0
- package/resources/signal.js.map +1 -1
- package/resources/signal.mjs +3 -0
- package/resources/signal.mjs.map +1 -1
- package/resources/task.d.mts +233 -5
- package/resources/task.d.mts.map +1 -1
- package/resources/task.d.ts +233 -5
- package/resources/task.d.ts.map +1 -1
- package/resources/task.js +3 -0
- package/resources/task.js.map +1 -1
- package/resources/task.mjs +3 -0
- package/resources/task.mjs.map +1 -1
- package/src/client.ts +63 -7
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/entity.ts +36 -19
- package/src/resources/files.ts +4 -2
- package/src/resources/icp.ts +36 -0
- package/src/resources/index.ts +10 -0
- package/src/resources/run.ts +3 -0
- package/src/resources/schedule.ts +375 -0
- package/src/resources/sheet/schema.ts +3 -0
- package/src/resources/sheet/sheet.ts +3 -0
- package/src/resources/signal.ts +5 -0
- package/src/resources/task.ts +258 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class Schedule extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new schedule.
|
|
7
|
+
*
|
|
8
|
+
* The cron expression must be a daily, weekly, or monthly pattern. For signal
|
|
9
|
+
* tasks, the cron frequency must match the task's monitoring_frequency.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const scheduleResponse = await client.schedule.create({
|
|
14
|
+
* cron_expression: 'cron_expression',
|
|
15
|
+
* icp_id: '5eb7cf5a86d9755df3a6c593',
|
|
16
|
+
* name: 'x',
|
|
17
|
+
* task_id: '5eb7cf5a86d9755df3a6c593',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: ScheduleCreateParams, options?: RequestOptions): APIPromise<ScheduleResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a specific schedule by ID.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const scheduleResponse = await client.schedule.retrieve(
|
|
28
|
+
* '5eb7cf5a86d9755df3a6c593',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieve(scheduleID: string, options?: RequestOptions): APIPromise<ScheduleResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a schedule.
|
|
35
|
+
*
|
|
36
|
+
* Only provided fields will be updated. The cron expression is validated for
|
|
37
|
+
* frequency restrictions.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const scheduleResponse = await client.schedule.update(
|
|
42
|
+
* '5eb7cf5a86d9755df3a6c593',
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
update(scheduleID: string, body: ScheduleUpdateParams, options?: RequestOptions): APIPromise<ScheduleResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* List schedules with pagination and optional filters.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const scheduleListResponse = await client.schedule.list();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
list(query?: ScheduleListParams | null | undefined, options?: RequestOptions): APIPromise<ScheduleListResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete a schedule.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await client.schedule.delete('5eb7cf5a86d9755df3a6c593');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
delete(scheduleID: string, options?: RequestOptions): APIPromise<void>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Request model for creating a new schedule.
|
|
68
|
+
*
|
|
69
|
+
* Attributes: name: Human-readable name for the schedule. task_id: ID of the task
|
|
70
|
+
* to execute. icp_id: ID of the ICP context for execution. cron_expression: 5-part
|
|
71
|
+
* cron expression (must be daily/weekly/monthly). description: Optional
|
|
72
|
+
* description. parameters: Optional execution parameters.
|
|
73
|
+
*/
|
|
74
|
+
export interface CreateScheduleRequest {
|
|
75
|
+
/**
|
|
76
|
+
* Cron expression (5 parts: minute hour day month day_of_week). Must be daily,
|
|
77
|
+
* weekly, or monthly.
|
|
78
|
+
*/
|
|
79
|
+
cron_expression: string;
|
|
80
|
+
/**
|
|
81
|
+
* ICP context for execution
|
|
82
|
+
*/
|
|
83
|
+
icp_id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Schedule name
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/**
|
|
89
|
+
* Task to execute
|
|
90
|
+
*/
|
|
91
|
+
task_id: string;
|
|
92
|
+
/**
|
|
93
|
+
* Schedule description
|
|
94
|
+
*/
|
|
95
|
+
description?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Execution parameters
|
|
98
|
+
*/
|
|
99
|
+
parameters?: {
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Response model for paginated schedule list.
|
|
105
|
+
*
|
|
106
|
+
* Attributes: schedules: List of schedules. total: Total number of schedules
|
|
107
|
+
* matching filters. page: Current page number (1-based). page_size: Number of
|
|
108
|
+
* items per page.
|
|
109
|
+
*/
|
|
110
|
+
export interface ScheduleListResponse {
|
|
111
|
+
/**
|
|
112
|
+
* Current page number (1-based)
|
|
113
|
+
*/
|
|
114
|
+
page: number;
|
|
115
|
+
/**
|
|
116
|
+
* Number of items per page
|
|
117
|
+
*/
|
|
118
|
+
page_size: number;
|
|
119
|
+
/**
|
|
120
|
+
* List of schedules
|
|
121
|
+
*/
|
|
122
|
+
schedules: Array<ScheduleResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Total number of schedules matching filters
|
|
125
|
+
*/
|
|
126
|
+
total: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Response model for schedule data.
|
|
130
|
+
*
|
|
131
|
+
* Attributes: id: Schedule ID. name: Schedule name. task_id: Task ID. icp_id: ICP
|
|
132
|
+
* ID. cron_expression: Cron expression. status: Schedule status. description:
|
|
133
|
+
* Optional description. parameters: Execution parameters. created_at: Creation
|
|
134
|
+
* timestamp. updated_at: Last update timestamp.
|
|
135
|
+
*/
|
|
136
|
+
export interface ScheduleResponse {
|
|
137
|
+
/**
|
|
138
|
+
* Schedule ID
|
|
139
|
+
*/
|
|
140
|
+
id: string;
|
|
141
|
+
/**
|
|
142
|
+
* Creation timestamp
|
|
143
|
+
*/
|
|
144
|
+
created_at: string;
|
|
145
|
+
/**
|
|
146
|
+
* Cron expression
|
|
147
|
+
*/
|
|
148
|
+
cron_expression: string;
|
|
149
|
+
/**
|
|
150
|
+
* ICP ID
|
|
151
|
+
*/
|
|
152
|
+
icp_id: string;
|
|
153
|
+
/**
|
|
154
|
+
* Schedule name
|
|
155
|
+
*/
|
|
156
|
+
name: string;
|
|
157
|
+
/**
|
|
158
|
+
* Schedule status
|
|
159
|
+
*/
|
|
160
|
+
status: string;
|
|
161
|
+
/**
|
|
162
|
+
* Task ID
|
|
163
|
+
*/
|
|
164
|
+
task_id: string;
|
|
165
|
+
/**
|
|
166
|
+
* Last update timestamp
|
|
167
|
+
*/
|
|
168
|
+
updated_at: string;
|
|
169
|
+
/**
|
|
170
|
+
* Description
|
|
171
|
+
*/
|
|
172
|
+
description?: string | null;
|
|
173
|
+
/**
|
|
174
|
+
* Execution parameters
|
|
175
|
+
*/
|
|
176
|
+
parameters?: {
|
|
177
|
+
[key: string]: unknown;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Request model for updating a schedule.
|
|
182
|
+
*
|
|
183
|
+
* At least one field must be provided.
|
|
184
|
+
*
|
|
185
|
+
* Attributes: name: Updated schedule name. description: Updated description.
|
|
186
|
+
* cron_expression: Updated cron expression (validated for frequency). parameters:
|
|
187
|
+
* Updated execution parameters. status: Updated schedule status.
|
|
188
|
+
*/
|
|
189
|
+
export interface UpdateScheduleRequest {
|
|
190
|
+
/**
|
|
191
|
+
* Updated cron expression
|
|
192
|
+
*/
|
|
193
|
+
cron_expression?: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* Updated description
|
|
196
|
+
*/
|
|
197
|
+
description?: string | null;
|
|
198
|
+
/**
|
|
199
|
+
* Updated schedule name
|
|
200
|
+
*/
|
|
201
|
+
name?: string | null;
|
|
202
|
+
/**
|
|
203
|
+
* Updated execution parameters
|
|
204
|
+
*/
|
|
205
|
+
parameters?: {
|
|
206
|
+
[key: string]: unknown;
|
|
207
|
+
} | null;
|
|
208
|
+
/**
|
|
209
|
+
* Schedule status values.
|
|
210
|
+
*
|
|
211
|
+
* ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
|
|
212
|
+
* be resumed DISABLED: Permanently disabled (requires manual intervention)
|
|
213
|
+
*/
|
|
214
|
+
status?: 'active' | 'paused' | 'disabled' | null;
|
|
215
|
+
}
|
|
216
|
+
export interface ScheduleCreateParams {
|
|
217
|
+
/**
|
|
218
|
+
* Cron expression (5 parts: minute hour day month day_of_week). Must be daily,
|
|
219
|
+
* weekly, or monthly.
|
|
220
|
+
*/
|
|
221
|
+
cron_expression: string;
|
|
222
|
+
/**
|
|
223
|
+
* ICP context for execution
|
|
224
|
+
*/
|
|
225
|
+
icp_id: string;
|
|
226
|
+
/**
|
|
227
|
+
* Schedule name
|
|
228
|
+
*/
|
|
229
|
+
name: string;
|
|
230
|
+
/**
|
|
231
|
+
* Task to execute
|
|
232
|
+
*/
|
|
233
|
+
task_id: string;
|
|
234
|
+
/**
|
|
235
|
+
* Schedule description
|
|
236
|
+
*/
|
|
237
|
+
description?: string | null;
|
|
238
|
+
/**
|
|
239
|
+
* Execution parameters
|
|
240
|
+
*/
|
|
241
|
+
parameters?: {
|
|
242
|
+
[key: string]: unknown;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export interface ScheduleUpdateParams {
|
|
246
|
+
/**
|
|
247
|
+
* Updated cron expression
|
|
248
|
+
*/
|
|
249
|
+
cron_expression?: string | null;
|
|
250
|
+
/**
|
|
251
|
+
* Updated description
|
|
252
|
+
*/
|
|
253
|
+
description?: string | null;
|
|
254
|
+
/**
|
|
255
|
+
* Updated schedule name
|
|
256
|
+
*/
|
|
257
|
+
name?: string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Updated execution parameters
|
|
260
|
+
*/
|
|
261
|
+
parameters?: {
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
} | null;
|
|
264
|
+
/**
|
|
265
|
+
* Schedule status values.
|
|
266
|
+
*
|
|
267
|
+
* ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
|
|
268
|
+
* be resumed DISABLED: Permanently disabled (requires manual intervention)
|
|
269
|
+
*/
|
|
270
|
+
status?: 'active' | 'paused' | 'disabled' | null;
|
|
271
|
+
}
|
|
272
|
+
export interface ScheduleListParams {
|
|
273
|
+
/**
|
|
274
|
+
* Filter by ICP
|
|
275
|
+
*/
|
|
276
|
+
icp_id?: string | null;
|
|
277
|
+
/**
|
|
278
|
+
* Sort order: -1 descending, 1 ascending
|
|
279
|
+
*/
|
|
280
|
+
order?: number | null;
|
|
281
|
+
/**
|
|
282
|
+
* Page number (1-based)
|
|
283
|
+
*/
|
|
284
|
+
page?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Items per page (max 100)
|
|
287
|
+
*/
|
|
288
|
+
page_size?: number;
|
|
289
|
+
/**
|
|
290
|
+
* Field to sort by (e.g., 'created_at')
|
|
291
|
+
*/
|
|
292
|
+
sort_by?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* Filter by status
|
|
295
|
+
*/
|
|
296
|
+
status?: 'active' | 'paused' | 'disabled' | null;
|
|
297
|
+
/**
|
|
298
|
+
* Filter by task
|
|
299
|
+
*/
|
|
300
|
+
task_id?: string | null;
|
|
301
|
+
}
|
|
302
|
+
export declare namespace Schedule {
|
|
303
|
+
export { type CreateScheduleRequest as CreateScheduleRequest, type ScheduleListResponse as ScheduleListResponse, type ScheduleResponse as ScheduleResponse, type UpdateScheduleRequest as UpdateScheduleRequest, type ScheduleCreateParams as ScheduleCreateParams, type ScheduleUpdateParams as ScheduleUpdateParams, type ScheduleListParams as ScheduleListParams, };
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=schedule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.mts","sourceRoot":"","sources":["../src/resources/schedule.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAI1F;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAIpF;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gBAAgB,CAAC;IAI/B;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAMvE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC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AAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Schedule extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new schedule.
|
|
7
|
+
*
|
|
8
|
+
* The cron expression must be a daily, weekly, or monthly pattern. For signal
|
|
9
|
+
* tasks, the cron frequency must match the task's monitoring_frequency.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const scheduleResponse = await client.schedule.create({
|
|
14
|
+
* cron_expression: 'cron_expression',
|
|
15
|
+
* icp_id: '5eb7cf5a86d9755df3a6c593',
|
|
16
|
+
* name: 'x',
|
|
17
|
+
* task_id: '5eb7cf5a86d9755df3a6c593',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: ScheduleCreateParams, options?: RequestOptions): APIPromise<ScheduleResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a specific schedule by ID.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const scheduleResponse = await client.schedule.retrieve(
|
|
28
|
+
* '5eb7cf5a86d9755df3a6c593',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieve(scheduleID: string, options?: RequestOptions): APIPromise<ScheduleResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a schedule.
|
|
35
|
+
*
|
|
36
|
+
* Only provided fields will be updated. The cron expression is validated for
|
|
37
|
+
* frequency restrictions.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const scheduleResponse = await client.schedule.update(
|
|
42
|
+
* '5eb7cf5a86d9755df3a6c593',
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
update(scheduleID: string, body: ScheduleUpdateParams, options?: RequestOptions): APIPromise<ScheduleResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* List schedules with pagination and optional filters.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const scheduleListResponse = await client.schedule.list();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
list(query?: ScheduleListParams | null | undefined, options?: RequestOptions): APIPromise<ScheduleListResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete a schedule.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await client.schedule.delete('5eb7cf5a86d9755df3a6c593');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
delete(scheduleID: string, options?: RequestOptions): APIPromise<void>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Request model for creating a new schedule.
|
|
68
|
+
*
|
|
69
|
+
* Attributes: name: Human-readable name for the schedule. task_id: ID of the task
|
|
70
|
+
* to execute. icp_id: ID of the ICP context for execution. cron_expression: 5-part
|
|
71
|
+
* cron expression (must be daily/weekly/monthly). description: Optional
|
|
72
|
+
* description. parameters: Optional execution parameters.
|
|
73
|
+
*/
|
|
74
|
+
export interface CreateScheduleRequest {
|
|
75
|
+
/**
|
|
76
|
+
* Cron expression (5 parts: minute hour day month day_of_week). Must be daily,
|
|
77
|
+
* weekly, or monthly.
|
|
78
|
+
*/
|
|
79
|
+
cron_expression: string;
|
|
80
|
+
/**
|
|
81
|
+
* ICP context for execution
|
|
82
|
+
*/
|
|
83
|
+
icp_id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Schedule name
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/**
|
|
89
|
+
* Task to execute
|
|
90
|
+
*/
|
|
91
|
+
task_id: string;
|
|
92
|
+
/**
|
|
93
|
+
* Schedule description
|
|
94
|
+
*/
|
|
95
|
+
description?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Execution parameters
|
|
98
|
+
*/
|
|
99
|
+
parameters?: {
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Response model for paginated schedule list.
|
|
105
|
+
*
|
|
106
|
+
* Attributes: schedules: List of schedules. total: Total number of schedules
|
|
107
|
+
* matching filters. page: Current page number (1-based). page_size: Number of
|
|
108
|
+
* items per page.
|
|
109
|
+
*/
|
|
110
|
+
export interface ScheduleListResponse {
|
|
111
|
+
/**
|
|
112
|
+
* Current page number (1-based)
|
|
113
|
+
*/
|
|
114
|
+
page: number;
|
|
115
|
+
/**
|
|
116
|
+
* Number of items per page
|
|
117
|
+
*/
|
|
118
|
+
page_size: number;
|
|
119
|
+
/**
|
|
120
|
+
* List of schedules
|
|
121
|
+
*/
|
|
122
|
+
schedules: Array<ScheduleResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Total number of schedules matching filters
|
|
125
|
+
*/
|
|
126
|
+
total: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Response model for schedule data.
|
|
130
|
+
*
|
|
131
|
+
* Attributes: id: Schedule ID. name: Schedule name. task_id: Task ID. icp_id: ICP
|
|
132
|
+
* ID. cron_expression: Cron expression. status: Schedule status. description:
|
|
133
|
+
* Optional description. parameters: Execution parameters. created_at: Creation
|
|
134
|
+
* timestamp. updated_at: Last update timestamp.
|
|
135
|
+
*/
|
|
136
|
+
export interface ScheduleResponse {
|
|
137
|
+
/**
|
|
138
|
+
* Schedule ID
|
|
139
|
+
*/
|
|
140
|
+
id: string;
|
|
141
|
+
/**
|
|
142
|
+
* Creation timestamp
|
|
143
|
+
*/
|
|
144
|
+
created_at: string;
|
|
145
|
+
/**
|
|
146
|
+
* Cron expression
|
|
147
|
+
*/
|
|
148
|
+
cron_expression: string;
|
|
149
|
+
/**
|
|
150
|
+
* ICP ID
|
|
151
|
+
*/
|
|
152
|
+
icp_id: string;
|
|
153
|
+
/**
|
|
154
|
+
* Schedule name
|
|
155
|
+
*/
|
|
156
|
+
name: string;
|
|
157
|
+
/**
|
|
158
|
+
* Schedule status
|
|
159
|
+
*/
|
|
160
|
+
status: string;
|
|
161
|
+
/**
|
|
162
|
+
* Task ID
|
|
163
|
+
*/
|
|
164
|
+
task_id: string;
|
|
165
|
+
/**
|
|
166
|
+
* Last update timestamp
|
|
167
|
+
*/
|
|
168
|
+
updated_at: string;
|
|
169
|
+
/**
|
|
170
|
+
* Description
|
|
171
|
+
*/
|
|
172
|
+
description?: string | null;
|
|
173
|
+
/**
|
|
174
|
+
* Execution parameters
|
|
175
|
+
*/
|
|
176
|
+
parameters?: {
|
|
177
|
+
[key: string]: unknown;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Request model for updating a schedule.
|
|
182
|
+
*
|
|
183
|
+
* At least one field must be provided.
|
|
184
|
+
*
|
|
185
|
+
* Attributes: name: Updated schedule name. description: Updated description.
|
|
186
|
+
* cron_expression: Updated cron expression (validated for frequency). parameters:
|
|
187
|
+
* Updated execution parameters. status: Updated schedule status.
|
|
188
|
+
*/
|
|
189
|
+
export interface UpdateScheduleRequest {
|
|
190
|
+
/**
|
|
191
|
+
* Updated cron expression
|
|
192
|
+
*/
|
|
193
|
+
cron_expression?: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* Updated description
|
|
196
|
+
*/
|
|
197
|
+
description?: string | null;
|
|
198
|
+
/**
|
|
199
|
+
* Updated schedule name
|
|
200
|
+
*/
|
|
201
|
+
name?: string | null;
|
|
202
|
+
/**
|
|
203
|
+
* Updated execution parameters
|
|
204
|
+
*/
|
|
205
|
+
parameters?: {
|
|
206
|
+
[key: string]: unknown;
|
|
207
|
+
} | null;
|
|
208
|
+
/**
|
|
209
|
+
* Schedule status values.
|
|
210
|
+
*
|
|
211
|
+
* ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
|
|
212
|
+
* be resumed DISABLED: Permanently disabled (requires manual intervention)
|
|
213
|
+
*/
|
|
214
|
+
status?: 'active' | 'paused' | 'disabled' | null;
|
|
215
|
+
}
|
|
216
|
+
export interface ScheduleCreateParams {
|
|
217
|
+
/**
|
|
218
|
+
* Cron expression (5 parts: minute hour day month day_of_week). Must be daily,
|
|
219
|
+
* weekly, or monthly.
|
|
220
|
+
*/
|
|
221
|
+
cron_expression: string;
|
|
222
|
+
/**
|
|
223
|
+
* ICP context for execution
|
|
224
|
+
*/
|
|
225
|
+
icp_id: string;
|
|
226
|
+
/**
|
|
227
|
+
* Schedule name
|
|
228
|
+
*/
|
|
229
|
+
name: string;
|
|
230
|
+
/**
|
|
231
|
+
* Task to execute
|
|
232
|
+
*/
|
|
233
|
+
task_id: string;
|
|
234
|
+
/**
|
|
235
|
+
* Schedule description
|
|
236
|
+
*/
|
|
237
|
+
description?: string | null;
|
|
238
|
+
/**
|
|
239
|
+
* Execution parameters
|
|
240
|
+
*/
|
|
241
|
+
parameters?: {
|
|
242
|
+
[key: string]: unknown;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export interface ScheduleUpdateParams {
|
|
246
|
+
/**
|
|
247
|
+
* Updated cron expression
|
|
248
|
+
*/
|
|
249
|
+
cron_expression?: string | null;
|
|
250
|
+
/**
|
|
251
|
+
* Updated description
|
|
252
|
+
*/
|
|
253
|
+
description?: string | null;
|
|
254
|
+
/**
|
|
255
|
+
* Updated schedule name
|
|
256
|
+
*/
|
|
257
|
+
name?: string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Updated execution parameters
|
|
260
|
+
*/
|
|
261
|
+
parameters?: {
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
} | null;
|
|
264
|
+
/**
|
|
265
|
+
* Schedule status values.
|
|
266
|
+
*
|
|
267
|
+
* ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
|
|
268
|
+
* be resumed DISABLED: Permanently disabled (requires manual intervention)
|
|
269
|
+
*/
|
|
270
|
+
status?: 'active' | 'paused' | 'disabled' | null;
|
|
271
|
+
}
|
|
272
|
+
export interface ScheduleListParams {
|
|
273
|
+
/**
|
|
274
|
+
* Filter by ICP
|
|
275
|
+
*/
|
|
276
|
+
icp_id?: string | null;
|
|
277
|
+
/**
|
|
278
|
+
* Sort order: -1 descending, 1 ascending
|
|
279
|
+
*/
|
|
280
|
+
order?: number | null;
|
|
281
|
+
/**
|
|
282
|
+
* Page number (1-based)
|
|
283
|
+
*/
|
|
284
|
+
page?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Items per page (max 100)
|
|
287
|
+
*/
|
|
288
|
+
page_size?: number;
|
|
289
|
+
/**
|
|
290
|
+
* Field to sort by (e.g., 'created_at')
|
|
291
|
+
*/
|
|
292
|
+
sort_by?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* Filter by status
|
|
295
|
+
*/
|
|
296
|
+
status?: 'active' | 'paused' | 'disabled' | null;
|
|
297
|
+
/**
|
|
298
|
+
* Filter by task
|
|
299
|
+
*/
|
|
300
|
+
task_id?: string | null;
|
|
301
|
+
}
|
|
302
|
+
export declare namespace Schedule {
|
|
303
|
+
export { type CreateScheduleRequest as CreateScheduleRequest, type ScheduleListResponse as ScheduleListResponse, type ScheduleResponse as ScheduleResponse, type UpdateScheduleRequest as UpdateScheduleRequest, type ScheduleCreateParams as ScheduleCreateParams, type ScheduleUpdateParams as ScheduleUpdateParams, type ScheduleListParams as ScheduleListParams, };
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../src/resources/schedule.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAI1F;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAIpF;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gBAAgB,CAAC;IAI/B;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAMvE;AAED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G;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Schedule = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
class Schedule extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new schedule.
|
|
11
|
+
*
|
|
12
|
+
* The cron expression must be a daily, weekly, or monthly pattern. For signal
|
|
13
|
+
* tasks, the cron frequency must match the task's monitoring_frequency.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const scheduleResponse = await client.schedule.create({
|
|
18
|
+
* cron_expression: 'cron_expression',
|
|
19
|
+
* icp_id: '5eb7cf5a86d9755df3a6c593',
|
|
20
|
+
* name: 'x',
|
|
21
|
+
* task_id: '5eb7cf5a86d9755df3a6c593',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(body, options) {
|
|
26
|
+
return this._client.post('/v1/schedule', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get a specific schedule by ID.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const scheduleResponse = await client.schedule.retrieve(
|
|
34
|
+
* '5eb7cf5a86d9755df3a6c593',
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
retrieve(scheduleID, options) {
|
|
39
|
+
return this._client.get((0, path_1.path) `/v1/schedule/${scheduleID}`, options);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Update a schedule.
|
|
43
|
+
*
|
|
44
|
+
* Only provided fields will be updated. The cron expression is validated for
|
|
45
|
+
* frequency restrictions.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const scheduleResponse = await client.schedule.update(
|
|
50
|
+
* '5eb7cf5a86d9755df3a6c593',
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
update(scheduleID, body, options) {
|
|
55
|
+
return this._client.patch((0, path_1.path) `/v1/schedule/${scheduleID}`, { body, ...options });
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* List schedules with pagination and optional filters.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const scheduleListResponse = await client.schedule.list();
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
list(query = {}, options) {
|
|
66
|
+
return this._client.get('/v1/schedule', { query, ...options });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete a schedule.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* await client.schedule.delete('5eb7cf5a86d9755df3a6c593');
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
delete(scheduleID, options) {
|
|
77
|
+
return this._client.delete((0, path_1.path) `/v1/schedule/${scheduleID}`, {
|
|
78
|
+
...options,
|
|
79
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.Schedule = Schedule;
|
|
84
|
+
//# sourceMappingURL=schedule.js.map
|