@linkt/sdk 0.4.0 → 0.6.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +4 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +11 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +11 -2
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/entity.d.mts +165 -27
  18. package/resources/entity.d.mts.map +1 -1
  19. package/resources/entity.d.ts +165 -27
  20. package/resources/entity.d.ts.map +1 -1
  21. package/resources/entity.js +32 -14
  22. package/resources/entity.js.map +1 -1
  23. package/resources/entity.mjs +32 -14
  24. package/resources/entity.mjs.map +1 -1
  25. package/resources/index.d.mts +1 -0
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +1 -0
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js +3 -1
  30. package/resources/index.js.map +1 -1
  31. package/resources/index.mjs +1 -0
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/schedule.d.mts +308 -0
  34. package/resources/schedule.d.mts.map +1 -0
  35. package/resources/schedule.d.ts +308 -0
  36. package/resources/schedule.d.ts.map +1 -0
  37. package/resources/schedule.js +84 -0
  38. package/resources/schedule.js.map +1 -0
  39. package/resources/schedule.mjs +80 -0
  40. package/resources/schedule.mjs.map +1 -0
  41. package/resources/signal.d.mts +1 -0
  42. package/resources/signal.d.mts.map +1 -1
  43. package/resources/signal.d.ts +1 -0
  44. package/resources/signal.d.ts.map +1 -1
  45. package/src/client.ts +32 -2
  46. package/src/internal/parse.ts +6 -0
  47. package/src/resources/entity.ts +183 -27
  48. package/src/resources/index.ts +10 -0
  49. package/src/resources/schedule.ts +378 -0
  50. package/src/resources/signal.ts +2 -0
  51. package/src/version.ts +1 -1
  52. package/version.d.mts +1 -1
  53. package/version.d.ts +1 -1
  54. package/version.js +1 -1
  55. package/version.mjs +1 -1
@@ -0,0 +1,378 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Schedule extends APIResource {
10
+ /**
11
+ * Create a new schedule.
12
+ *
13
+ * The cron expression must be a daily, weekly, or monthly pattern. For signal
14
+ * tasks, the cron frequency must match the task's monitoring_frequency.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const scheduleResponse = await client.schedule.create({
19
+ * cron_expression: 'cron_expression',
20
+ * icp_id: '5eb7cf5a86d9755df3a6c593',
21
+ * name: 'x',
22
+ * task_id: '5eb7cf5a86d9755df3a6c593',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body: ScheduleCreateParams, options?: RequestOptions): APIPromise<ScheduleResponse> {
27
+ return this._client.post('/v1/schedule', { body, ...options });
28
+ }
29
+
30
+ /**
31
+ * Get a specific schedule by ID.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const scheduleResponse = await client.schedule.retrieve(
36
+ * '5eb7cf5a86d9755df3a6c593',
37
+ * );
38
+ * ```
39
+ */
40
+ retrieve(scheduleID: string, options?: RequestOptions): APIPromise<ScheduleResponse> {
41
+ return this._client.get(path`/v1/schedule/${scheduleID}`, options);
42
+ }
43
+
44
+ /**
45
+ * Update a schedule.
46
+ *
47
+ * Only provided fields will be updated. The cron expression is validated for
48
+ * frequency restrictions.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const scheduleResponse = await client.schedule.update(
53
+ * '5eb7cf5a86d9755df3a6c593',
54
+ * );
55
+ * ```
56
+ */
57
+ update(
58
+ scheduleID: string,
59
+ body: ScheduleUpdateParams,
60
+ options?: RequestOptions,
61
+ ): APIPromise<ScheduleResponse> {
62
+ return this._client.patch(path`/v1/schedule/${scheduleID}`, { body, ...options });
63
+ }
64
+
65
+ /**
66
+ * List schedules with pagination and optional filters.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const scheduleListResponse = await client.schedule.list();
71
+ * ```
72
+ */
73
+ list(
74
+ query: ScheduleListParams | null | undefined = {},
75
+ options?: RequestOptions,
76
+ ): APIPromise<ScheduleListResponse> {
77
+ return this._client.get('/v1/schedule', { query, ...options });
78
+ }
79
+
80
+ /**
81
+ * Delete a schedule.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await client.schedule.delete('5eb7cf5a86d9755df3a6c593');
86
+ * ```
87
+ */
88
+ delete(scheduleID: string, options?: RequestOptions): APIPromise<void> {
89
+ return this._client.delete(path`/v1/schedule/${scheduleID}`, {
90
+ ...options,
91
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
92
+ });
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Request model for creating a new schedule.
98
+ *
99
+ * Attributes: name: Human-readable name for the schedule. task_id: ID of the task
100
+ * to execute. icp_id: ID of the ICP context for execution. cron_expression: 5-part
101
+ * cron expression (must be daily/weekly/monthly). description: Optional
102
+ * description. parameters: Optional execution parameters.
103
+ */
104
+ export interface CreateScheduleRequest {
105
+ /**
106
+ * Cron expression (5 parts: minute hour day month day_of_week). Must be daily,
107
+ * weekly, or monthly.
108
+ */
109
+ cron_expression: string;
110
+
111
+ /**
112
+ * ICP context for execution
113
+ */
114
+ icp_id: string;
115
+
116
+ /**
117
+ * Schedule name
118
+ */
119
+ name: string;
120
+
121
+ /**
122
+ * Task to execute
123
+ */
124
+ task_id: string;
125
+
126
+ /**
127
+ * Schedule description
128
+ */
129
+ description?: string | null;
130
+
131
+ /**
132
+ * Execution parameters
133
+ */
134
+ parameters?: { [key: string]: unknown };
135
+ }
136
+
137
+ /**
138
+ * Response model for paginated schedule list.
139
+ *
140
+ * Attributes: schedules: List of schedules. total: Total number of schedules
141
+ * matching filters. page: Current page number (1-based). page_size: Number of
142
+ * items per page.
143
+ */
144
+ export interface ScheduleListResponse {
145
+ /**
146
+ * Current page number (1-based)
147
+ */
148
+ page: number;
149
+
150
+ /**
151
+ * Number of items per page
152
+ */
153
+ page_size: number;
154
+
155
+ /**
156
+ * List of schedules
157
+ */
158
+ schedules: Array<ScheduleResponse>;
159
+
160
+ /**
161
+ * Total number of schedules matching filters
162
+ */
163
+ total: number;
164
+ }
165
+
166
+ /**
167
+ * Response model for schedule data.
168
+ *
169
+ * Attributes: id: Schedule ID. name: Schedule name. task_id: Task ID. icp_id: ICP
170
+ * ID. cron_expression: Cron expression. status: Schedule status. description:
171
+ * Optional description. parameters: Execution parameters. created_at: Creation
172
+ * timestamp. updated_at: Last update timestamp.
173
+ */
174
+ export interface ScheduleResponse {
175
+ /**
176
+ * Schedule ID
177
+ */
178
+ id: string;
179
+
180
+ /**
181
+ * Creation timestamp
182
+ */
183
+ created_at: string;
184
+
185
+ /**
186
+ * Cron expression
187
+ */
188
+ cron_expression: string;
189
+
190
+ /**
191
+ * ICP ID
192
+ */
193
+ icp_id: string;
194
+
195
+ /**
196
+ * Schedule name
197
+ */
198
+ name: string;
199
+
200
+ /**
201
+ * Schedule status
202
+ */
203
+ status: string;
204
+
205
+ /**
206
+ * Task ID
207
+ */
208
+ task_id: string;
209
+
210
+ /**
211
+ * Last update timestamp
212
+ */
213
+ updated_at: string;
214
+
215
+ /**
216
+ * Description
217
+ */
218
+ description?: string | null;
219
+
220
+ /**
221
+ * Execution parameters
222
+ */
223
+ parameters?: { [key: string]: unknown };
224
+ }
225
+
226
+ /**
227
+ * Request model for updating a schedule.
228
+ *
229
+ * At least one field must be provided.
230
+ *
231
+ * Attributes: name: Updated schedule name. description: Updated description.
232
+ * cron_expression: Updated cron expression (validated for frequency). parameters:
233
+ * Updated execution parameters. status: Updated schedule status.
234
+ */
235
+ export interface UpdateScheduleRequest {
236
+ /**
237
+ * Updated cron expression
238
+ */
239
+ cron_expression?: string | null;
240
+
241
+ /**
242
+ * Updated description
243
+ */
244
+ description?: string | null;
245
+
246
+ /**
247
+ * Updated schedule name
248
+ */
249
+ name?: string | null;
250
+
251
+ /**
252
+ * Updated execution parameters
253
+ */
254
+ parameters?: { [key: string]: unknown } | null;
255
+
256
+ /**
257
+ * Schedule status values.
258
+ *
259
+ * ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
260
+ * be resumed DISABLED: Permanently disabled (requires manual intervention)
261
+ */
262
+ status?: 'active' | 'paused' | 'disabled' | null;
263
+ }
264
+
265
+ export interface ScheduleCreateParams {
266
+ /**
267
+ * Cron expression (5 parts: minute hour day month day_of_week). Must be daily,
268
+ * weekly, or monthly.
269
+ */
270
+ cron_expression: string;
271
+
272
+ /**
273
+ * ICP context for execution
274
+ */
275
+ icp_id: string;
276
+
277
+ /**
278
+ * Schedule name
279
+ */
280
+ name: string;
281
+
282
+ /**
283
+ * Task to execute
284
+ */
285
+ task_id: string;
286
+
287
+ /**
288
+ * Schedule description
289
+ */
290
+ description?: string | null;
291
+
292
+ /**
293
+ * Execution parameters
294
+ */
295
+ parameters?: { [key: string]: unknown };
296
+ }
297
+
298
+ export interface ScheduleUpdateParams {
299
+ /**
300
+ * Updated cron expression
301
+ */
302
+ cron_expression?: string | null;
303
+
304
+ /**
305
+ * Updated description
306
+ */
307
+ description?: string | null;
308
+
309
+ /**
310
+ * Updated schedule name
311
+ */
312
+ name?: string | null;
313
+
314
+ /**
315
+ * Updated execution parameters
316
+ */
317
+ parameters?: { [key: string]: unknown } | null;
318
+
319
+ /**
320
+ * Schedule status values.
321
+ *
322
+ * ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
323
+ * be resumed DISABLED: Permanently disabled (requires manual intervention)
324
+ */
325
+ status?: 'active' | 'paused' | 'disabled' | null;
326
+ }
327
+
328
+ export interface ScheduleListParams {
329
+ /**
330
+ * Filter by ICP
331
+ */
332
+ icp_id?: string | null;
333
+
334
+ /**
335
+ * Sort order: -1 descending, 1 ascending
336
+ */
337
+ order?: number | null;
338
+
339
+ /**
340
+ * Page number (1-based)
341
+ */
342
+ page?: number;
343
+
344
+ /**
345
+ * Items per page (max 100)
346
+ */
347
+ page_size?: number;
348
+
349
+ /**
350
+ * Field to sort by (e.g., 'created_at')
351
+ */
352
+ sort_by?: string | null;
353
+
354
+ /**
355
+ * Schedule status values.
356
+ *
357
+ * ACTIVE: Schedule is eligible for execution PAUSED: Temporarily suspended but can
358
+ * be resumed DISABLED: Permanently disabled (requires manual intervention)
359
+ */
360
+ status?: 'active' | 'paused' | 'disabled' | null;
361
+
362
+ /**
363
+ * Filter by task
364
+ */
365
+ task_id?: string | null;
366
+ }
367
+
368
+ export declare namespace Schedule {
369
+ export {
370
+ type CreateScheduleRequest as CreateScheduleRequest,
371
+ type ScheduleListResponse as ScheduleListResponse,
372
+ type ScheduleResponse as ScheduleResponse,
373
+ type UpdateScheduleRequest as UpdateScheduleRequest,
374
+ type ScheduleCreateParams as ScheduleCreateParams,
375
+ type ScheduleUpdateParams as ScheduleUpdateParams,
376
+ type ScheduleListParams as ScheduleListParams,
377
+ };
378
+ }
@@ -42,6 +42,8 @@ export interface SignalResponse {
42
42
 
43
43
  references: Array<string>;
44
44
 
45
+ score: number | null;
46
+
45
47
  signal_type: string | null;
46
48
 
47
49
  strength: string | null;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.4.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.4.0'; // x-release-please-version
4
+ exports.VERSION = '0.6.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.4.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map