indicesio 0.0.4

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 (343) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/LICENSE +201 -0
  3. package/README.md +386 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +196 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +196 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +480 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +476 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/request-options.d.mts +75 -0
  109. package/internal/request-options.d.mts.map +1 -0
  110. package/internal/request-options.d.ts +75 -0
  111. package/internal/request-options.d.ts.map +1 -0
  112. package/internal/request-options.js +14 -0
  113. package/internal/request-options.js.map +1 -0
  114. package/internal/request-options.mjs +10 -0
  115. package/internal/request-options.mjs.map +1 -0
  116. package/internal/shim-types.d.mts +17 -0
  117. package/internal/shim-types.d.mts.map +1 -0
  118. package/internal/shim-types.d.ts +17 -0
  119. package/internal/shim-types.d.ts.map +1 -0
  120. package/internal/shim-types.js +4 -0
  121. package/internal/shim-types.js.map +1 -0
  122. package/internal/shim-types.mjs +3 -0
  123. package/internal/shim-types.mjs.map +1 -0
  124. package/internal/shims.d.mts +20 -0
  125. package/internal/shims.d.mts.map +1 -0
  126. package/internal/shims.d.ts +20 -0
  127. package/internal/shims.d.ts.map +1 -0
  128. package/internal/shims.js +92 -0
  129. package/internal/shims.js.map +1 -0
  130. package/internal/shims.mjs +85 -0
  131. package/internal/shims.mjs.map +1 -0
  132. package/internal/to-file.d.mts +45 -0
  133. package/internal/to-file.d.mts.map +1 -0
  134. package/internal/to-file.d.ts +45 -0
  135. package/internal/to-file.d.ts.map +1 -0
  136. package/internal/to-file.js +91 -0
  137. package/internal/to-file.js.map +1 -0
  138. package/internal/to-file.mjs +88 -0
  139. package/internal/to-file.mjs.map +1 -0
  140. package/internal/tslib.js +81 -0
  141. package/internal/tslib.mjs +17 -0
  142. package/internal/types.d.mts +69 -0
  143. package/internal/types.d.mts.map +1 -0
  144. package/internal/types.d.ts +69 -0
  145. package/internal/types.d.ts.map +1 -0
  146. package/internal/types.js +4 -0
  147. package/internal/types.js.map +1 -0
  148. package/internal/types.mjs +3 -0
  149. package/internal/types.mjs.map +1 -0
  150. package/internal/uploads.d.mts +42 -0
  151. package/internal/uploads.d.mts.map +1 -0
  152. package/internal/uploads.d.ts +42 -0
  153. package/internal/uploads.d.ts.map +1 -0
  154. package/internal/uploads.js +141 -0
  155. package/internal/uploads.js.map +1 -0
  156. package/internal/uploads.mjs +131 -0
  157. package/internal/uploads.mjs.map +1 -0
  158. package/internal/utils/base64.d.mts +3 -0
  159. package/internal/utils/base64.d.mts.map +1 -0
  160. package/internal/utils/base64.d.ts +3 -0
  161. package/internal/utils/base64.d.ts.map +1 -0
  162. package/internal/utils/base64.js +38 -0
  163. package/internal/utils/base64.js.map +1 -0
  164. package/internal/utils/base64.mjs +33 -0
  165. package/internal/utils/base64.mjs.map +1 -0
  166. package/internal/utils/bytes.d.mts +4 -0
  167. package/internal/utils/bytes.d.mts.map +1 -0
  168. package/internal/utils/bytes.d.ts +4 -0
  169. package/internal/utils/bytes.d.ts.map +1 -0
  170. package/internal/utils/bytes.js +31 -0
  171. package/internal/utils/bytes.js.map +1 -0
  172. package/internal/utils/bytes.mjs +26 -0
  173. package/internal/utils/bytes.mjs.map +1 -0
  174. package/internal/utils/env.d.mts +9 -0
  175. package/internal/utils/env.d.mts.map +1 -0
  176. package/internal/utils/env.d.ts +9 -0
  177. package/internal/utils/env.d.ts.map +1 -0
  178. package/internal/utils/env.js +22 -0
  179. package/internal/utils/env.js.map +1 -0
  180. package/internal/utils/env.mjs +18 -0
  181. package/internal/utils/env.mjs.map +1 -0
  182. package/internal/utils/log.d.mts +37 -0
  183. package/internal/utils/log.d.mts.map +1 -0
  184. package/internal/utils/log.d.ts +37 -0
  185. package/internal/utils/log.d.ts.map +1 -0
  186. package/internal/utils/log.js +85 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +79 -0
  189. package/internal/utils/log.mjs.map +1 -0
  190. package/internal/utils/path.d.mts +15 -0
  191. package/internal/utils/path.d.mts.map +1 -0
  192. package/internal/utils/path.d.ts +15 -0
  193. package/internal/utils/path.d.ts.map +1 -0
  194. package/internal/utils/path.js +79 -0
  195. package/internal/utils/path.js.map +1 -0
  196. package/internal/utils/path.mjs +74 -0
  197. package/internal/utils/path.mjs.map +1 -0
  198. package/internal/utils/query.d.mts +5 -0
  199. package/internal/utils/query.d.mts.map +1 -0
  200. package/internal/utils/query.d.ts +5 -0
  201. package/internal/utils/query.d.ts.map +1 -0
  202. package/internal/utils/query.js +23 -0
  203. package/internal/utils/query.js.map +1 -0
  204. package/internal/utils/query.mjs +20 -0
  205. package/internal/utils/query.mjs.map +1 -0
  206. package/internal/utils/sleep.d.mts +2 -0
  207. package/internal/utils/sleep.d.mts.map +1 -0
  208. package/internal/utils/sleep.d.ts +2 -0
  209. package/internal/utils/sleep.d.ts.map +1 -0
  210. package/internal/utils/sleep.js +7 -0
  211. package/internal/utils/sleep.js.map +1 -0
  212. package/internal/utils/sleep.mjs +3 -0
  213. package/internal/utils/sleep.mjs.map +1 -0
  214. package/internal/utils/uuid.d.mts +5 -0
  215. package/internal/utils/uuid.d.mts.map +1 -0
  216. package/internal/utils/uuid.d.ts +5 -0
  217. package/internal/utils/uuid.d.ts.map +1 -0
  218. package/internal/utils/uuid.js +19 -0
  219. package/internal/utils/uuid.js.map +1 -0
  220. package/internal/utils/uuid.mjs +15 -0
  221. package/internal/utils/uuid.mjs.map +1 -0
  222. package/internal/utils/values.d.mts +18 -0
  223. package/internal/utils/values.d.mts.map +1 -0
  224. package/internal/utils/values.d.ts +18 -0
  225. package/internal/utils/values.d.ts.map +1 -0
  226. package/internal/utils/values.js +112 -0
  227. package/internal/utils/values.js.map +1 -0
  228. package/internal/utils/values.mjs +94 -0
  229. package/internal/utils/values.mjs.map +1 -0
  230. package/internal/utils.d.mts +8 -0
  231. package/internal/utils.d.mts.map +1 -0
  232. package/internal/utils.d.ts +8 -0
  233. package/internal/utils.d.ts.map +1 -0
  234. package/internal/utils.js +12 -0
  235. package/internal/utils.js.map +1 -0
  236. package/internal/utils.mjs +9 -0
  237. package/internal/utils.mjs.map +1 -0
  238. package/package.json +146 -0
  239. package/resource.d.mts +2 -0
  240. package/resource.d.mts.map +1 -0
  241. package/resource.d.ts +2 -0
  242. package/resource.d.ts.map +1 -0
  243. package/resource.js +6 -0
  244. package/resource.js.map +1 -0
  245. package/resource.mjs +2 -0
  246. package/resource.mjs.map +1 -0
  247. package/resources/index.d.mts +4 -0
  248. package/resources/index.d.mts.map +1 -0
  249. package/resources/index.d.ts +4 -0
  250. package/resources/index.d.ts.map +1 -0
  251. package/resources/index.js +11 -0
  252. package/resources/index.js.map +1 -0
  253. package/resources/index.mjs +5 -0
  254. package/resources/index.mjs.map +1 -0
  255. package/resources/runs.d.mts +104 -0
  256. package/resources/runs.d.mts.map +1 -0
  257. package/resources/runs.d.ts +104 -0
  258. package/resources/runs.d.ts.map +1 -0
  259. package/resources/runs.js +37 -0
  260. package/resources/runs.js.map +1 -0
  261. package/resources/runs.mjs +33 -0
  262. package/resources/runs.mjs.map +1 -0
  263. package/resources/secrets.d.mts +109 -0
  264. package/resources/secrets.d.mts.map +1 -0
  265. package/resources/secrets.d.ts +109 -0
  266. package/resources/secrets.d.ts.map +1 -0
  267. package/resources/secrets.js +37 -0
  268. package/resources/secrets.js.map +1 -0
  269. package/resources/secrets.mjs +33 -0
  270. package/resources/secrets.mjs.map +1 -0
  271. package/resources/tasks.d.mts +290 -0
  272. package/resources/tasks.d.mts.map +1 -0
  273. package/resources/tasks.d.ts +290 -0
  274. package/resources/tasks.d.ts.map +1 -0
  275. package/resources/tasks.js +49 -0
  276. package/resources/tasks.js.map +1 -0
  277. package/resources/tasks.mjs +45 -0
  278. package/resources/tasks.mjs.map +1 -0
  279. package/resources.d.mts +2 -0
  280. package/resources.d.mts.map +1 -0
  281. package/resources.d.ts +2 -0
  282. package/resources.d.ts.map +1 -0
  283. package/resources.js +5 -0
  284. package/resources.js.map +1 -0
  285. package/resources.mjs +2 -0
  286. package/resources.mjs.map +1 -0
  287. package/src/api-promise.ts +2 -0
  288. package/src/client.ts +786 -0
  289. package/src/core/README.md +3 -0
  290. package/src/core/api-promise.ts +92 -0
  291. package/src/core/error.ts +130 -0
  292. package/src/core/resource.ts +11 -0
  293. package/src/core/uploads.ts +2 -0
  294. package/src/error.ts +2 -0
  295. package/src/index.ts +22 -0
  296. package/src/internal/README.md +3 -0
  297. package/src/internal/builtin-types.ts +93 -0
  298. package/src/internal/detect-platform.ts +196 -0
  299. package/src/internal/errors.ts +33 -0
  300. package/src/internal/headers.ts +97 -0
  301. package/src/internal/parse.ts +56 -0
  302. package/src/internal/request-options.ts +91 -0
  303. package/src/internal/shim-types.ts +26 -0
  304. package/src/internal/shims.ts +107 -0
  305. package/src/internal/to-file.ts +154 -0
  306. package/src/internal/types.ts +95 -0
  307. package/src/internal/uploads.ts +187 -0
  308. package/src/internal/utils/base64.ts +40 -0
  309. package/src/internal/utils/bytes.ts +32 -0
  310. package/src/internal/utils/env.ts +18 -0
  311. package/src/internal/utils/log.ts +126 -0
  312. package/src/internal/utils/path.ts +88 -0
  313. package/src/internal/utils/query.ts +23 -0
  314. package/src/internal/utils/sleep.ts +3 -0
  315. package/src/internal/utils/uuid.ts +17 -0
  316. package/src/internal/utils/values.ts +105 -0
  317. package/src/internal/utils.ts +9 -0
  318. package/src/lib/.keep +4 -0
  319. package/src/resource.ts +2 -0
  320. package/src/resources/index.ts +27 -0
  321. package/src/resources/runs.ts +132 -0
  322. package/src/resources/secrets.ts +149 -0
  323. package/src/resources/tasks.ts +364 -0
  324. package/src/resources.ts +1 -0
  325. package/src/tsconfig.json +11 -0
  326. package/src/uploads.ts +2 -0
  327. package/src/version.ts +1 -0
  328. package/uploads.d.mts +2 -0
  329. package/uploads.d.mts.map +1 -0
  330. package/uploads.d.ts +2 -0
  331. package/uploads.d.ts.map +1 -0
  332. package/uploads.js +6 -0
  333. package/uploads.js.map +1 -0
  334. package/uploads.mjs +2 -0
  335. package/uploads.mjs.map +1 -0
  336. package/version.d.mts +2 -0
  337. package/version.d.mts.map +1 -0
  338. package/version.d.ts +2 -0
  339. package/version.d.ts.map +1 -0
  340. package/version.js +5 -0
  341. package/version.js.map +1 -0
  342. package/version.mjs +2 -0
  343. package/version.mjs.map +1 -0
@@ -0,0 +1,290 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ /**
5
+ * Create a task to repeatedly perform an action on an external website.
6
+ */
7
+ export declare class Tasks extends APIResource {
8
+ /**
9
+ * <p>Create a new task to repeatedly perform an action on an external website.</p><p>Once created and ready, it can be repeatedly executed using the <code>run</code> endpoint.</p>
10
+ */
11
+ create(body: TaskCreateParams, options?: RequestOptions): APIPromise<Task>;
12
+ /**
13
+ * <p>Retrieve a task by its ID.</p><p>For tasks that are still being generated, <code>input_schema</code> and <code>output_schema</code> may be <code>null</code>. They are guaranteed to be present once the task reaches the ready state.</p>
14
+ */
15
+ retrieve(id: string, options?: RequestOptions): APIPromise<Task>;
16
+ /**
17
+ * <p>List all tasks that have been created.</p><p>For tasks that are still being generated, <code>input_schema</code> and <code>output_schema</code> may be <code>null</code>. They are guaranteed to be present once the task reaches the ready state.</p>
18
+ */
19
+ list(options?: RequestOptions): APIPromise<TaskListResponse>;
20
+ /**
21
+ * <p>Delete a task by its ID.</p>
22
+ */
23
+ delete(id: string, options?: RequestOptions): APIPromise<unknown>;
24
+ /**
25
+ * <p>Mark the manual browser session as complete and continue the task workflow.</p>
26
+ */
27
+ completeManualSession(id: string, options?: RequestOptions): APIPromise<Task>;
28
+ /**
29
+ * <p>Spawn a browser session for manual task completion. If a session already exists, it will be closed and replaced.</p>
30
+ */
31
+ startManualSession(id: string, body?: TaskStartManualSessionParams | null | undefined, options?: RequestOptions): APIPromise<TaskStartManualSessionResponse>;
32
+ }
33
+ export interface Task {
34
+ /**
35
+ * Unique identifier for the object.
36
+ */
37
+ id: string;
38
+ /**
39
+ * Timestamp when the object was created.
40
+ */
41
+ created_at: string;
42
+ /**
43
+ * Parameters set during the creation of this task.
44
+ */
45
+ creation: Task.Creation;
46
+ /**
47
+ * Current state of the task, in particular whether it is ready to use.
48
+ */
49
+ current_state: 'not_ready' | 'waiting_for_manual_completion' | 'ready' | 'failed';
50
+ /**
51
+ * Short title shown in the dashboard. Informational only.
52
+ */
53
+ display_name: string;
54
+ /**
55
+ * Task input schema as a JSON schema string. May be null while the task is not
56
+ * ready (e.g. schema generation in progress). Guaranteed non-null when
57
+ * current_state is ready.
58
+ */
59
+ input_schema: string | null;
60
+ /**
61
+ * Task output schema as a JSON schema string. May be null while the task is not
62
+ * ready (e.g. schema generation in progress). Guaranteed non-null when
63
+ * current_state is ready.
64
+ */
65
+ output_schema: string | null;
66
+ /**
67
+ * Detailed explanation of the task to be performed.
68
+ */
69
+ task: string;
70
+ /**
71
+ * Timestamp when the object was last updated.
72
+ */
73
+ updated_at: string;
74
+ /**
75
+ * The website to perform the task on.
76
+ */
77
+ website: string;
78
+ /**
79
+ * Information about why a task failed, for user display.
80
+ */
81
+ failure_info?: Task.FailureInfo | null;
82
+ /**
83
+ * List of secrets that must be provided when running this task.
84
+ */
85
+ required_secrets?: Array<Task.RequiredSecret>;
86
+ }
87
+ export declare namespace Task {
88
+ /**
89
+ * Parameters set during the creation of this task.
90
+ */
91
+ interface Creation {
92
+ /**
93
+ * Whether schemas were configured to auto-generate during task creation.
94
+ */
95
+ auto_generate_schemas: boolean;
96
+ /**
97
+ * Mapping of required secret slot names to secret UUIDs bound during task
98
+ * creation.
99
+ */
100
+ secret_bindings?: {
101
+ [key: string]: string;
102
+ };
103
+ /**
104
+ * List of secrets provided during task creation.
105
+ */
106
+ secrets?: Array<Creation.Secret>;
107
+ }
108
+ namespace Creation {
109
+ /**
110
+ * A secret provided during task creation
111
+ */
112
+ interface Secret {
113
+ /**
114
+ * UUID of the secret to bind.
115
+ */
116
+ secret_uuid: string;
117
+ /**
118
+ * Optional description of what this secret is used for (helps generate meaningful
119
+ * slot names).
120
+ */
121
+ description?: string | null;
122
+ }
123
+ }
124
+ /**
125
+ * Information about why a task failed, for user display.
126
+ */
127
+ interface FailureInfo {
128
+ /**
129
+ * Primary failure category
130
+ */
131
+ category: string;
132
+ /**
133
+ * Summary of the failure cause
134
+ */
135
+ message: string;
136
+ }
137
+ /**
138
+ * Definition of a secret slot that a task requires.
139
+ */
140
+ interface RequiredSecret {
141
+ /**
142
+ * Name of the secret slot (used as env var prefix, e.g., 'LOGIN' →
143
+ * LOGIN_USERNAME).
144
+ */
145
+ name: string;
146
+ /**
147
+ * Type of secret required: 'login' or 'string'.
148
+ */
149
+ type: 'login' | 'string';
150
+ /**
151
+ * Whether this login slot requires 2FA/TOTP. Only applicable for 'login' type.
152
+ */
153
+ requires_totp?: boolean;
154
+ }
155
+ }
156
+ export type TaskListResponse = Array<Task>;
157
+ export type TaskDeleteResponse = unknown;
158
+ export interface TaskStartManualSessionResponse {
159
+ /**
160
+ * URL to embed in an iframe to control the browser.
161
+ */
162
+ iframe_url: string;
163
+ /**
164
+ * Opaque identifier for the spawned browser session.
165
+ */
166
+ session_id: string;
167
+ }
168
+ export interface TaskCreateParams {
169
+ /**
170
+ * Information used during task creation.
171
+ */
172
+ creation_params: TaskCreateParams.CreationParams;
173
+ /**
174
+ * Short title shown in the dashboard. Informational only; not used to generate the
175
+ * task.
176
+ */
177
+ display_name: string;
178
+ /**
179
+ * Detailed explanation of the task to be performed.
180
+ */
181
+ task: string;
182
+ /**
183
+ * The website to perform the task on.
184
+ */
185
+ website: string;
186
+ /**
187
+ * Task input parameters as a JSON schema string. Required when
188
+ * auto_generate_schemas is disabled. Must be omitted when auto_generate_schemas is
189
+ * enabled; remains null until generation completes.
190
+ */
191
+ input_schema?: string | null;
192
+ /**
193
+ * Task output schema as a JSON schema string. Required when auto_generate_schemas
194
+ * is disabled. Must be omitted when auto_generate_schemas is enabled; remains null
195
+ * until generation completes.
196
+ */
197
+ output_schema?: string | null;
198
+ }
199
+ export declare namespace TaskCreateParams {
200
+ /**
201
+ * Information used during task creation.
202
+ */
203
+ interface CreationParams {
204
+ /**
205
+ * If true, input and output schemas will be automatically generated from captured
206
+ * HAR traffic. When enabled, input_schema and output_schema must be omitted from
207
+ * the request. Task responses may return null for these fields until generation
208
+ * completes.
209
+ */
210
+ auto_generate_schemas?: boolean;
211
+ /**
212
+ * Initial values for input schema fields, keyed by property name. Used during task
213
+ * creation to demonstrate the task. Especially important for tasks requiring
214
+ * authentication, as initial credentials must be provided.
215
+ */
216
+ initial_input_values?: {
217
+ [key: string]: unknown;
218
+ };
219
+ /**
220
+ * If true, the server will run the browser task autonomously. If false, the user
221
+ * must complete the task manually in a spawned browser.
222
+ */
223
+ is_fully_autonomous?: boolean;
224
+ /**
225
+ * List of secrets to use for this task.
226
+ */
227
+ secrets?: Array<CreationParams.Secret>;
228
+ }
229
+ namespace CreationParams {
230
+ /**
231
+ * A secret provided during task creation
232
+ */
233
+ interface Secret {
234
+ /**
235
+ * UUID of the secret to bind.
236
+ */
237
+ secret_uuid: string;
238
+ /**
239
+ * Optional description of what this secret is used for (helps generate meaningful
240
+ * slot names).
241
+ */
242
+ description?: string | null;
243
+ }
244
+ }
245
+ }
246
+ export interface TaskStartManualSessionParams {
247
+ /**
248
+ * Initial cookies to set in the browser session.
249
+ */
250
+ cookies?: Array<TaskStartManualSessionParams.Cookie>;
251
+ /**
252
+ * If true, spawn the browser session using a proxy.
253
+ */
254
+ use_proxy?: boolean;
255
+ }
256
+ export declare namespace TaskStartManualSessionParams {
257
+ /**
258
+ * A cookie to set in the browser session.
259
+ */
260
+ interface Cookie {
261
+ /**
262
+ * The name of the cookie.
263
+ */
264
+ name: string;
265
+ /**
266
+ * The value of the cookie.
267
+ */
268
+ value: string;
269
+ /**
270
+ * The domain of the cookie.
271
+ */
272
+ domain?: string | null;
273
+ /**
274
+ * Whether the cookie is HTTP only.
275
+ */
276
+ http_only?: boolean | null;
277
+ /**
278
+ * The path of the cookie.
279
+ */
280
+ path?: string | null;
281
+ /**
282
+ * Whether the cookie is secure.
283
+ */
284
+ secure?: boolean | null;
285
+ }
286
+ }
287
+ export declare namespace Tasks {
288
+ export { type Task as Task, type TaskListResponse as TaskListResponse, type TaskDeleteResponse as TaskDeleteResponse, type TaskStartManualSessionResponse as TaskStartManualSessionResponse, type TaskCreateParams as TaskCreateParams, type TaskStartManualSessionParams as TaskStartManualSessionParams, };
289
+ }
290
+ //# sourceMappingURL=tasks.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.mts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAI1E;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAIhE;;OAEG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAI5D;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIjE;;OAEG;IACH,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAI7E;;OAEG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,4BAA4B,GAAG,IAAI,GAAG,SAAc,EAC1D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,C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H,UAAiB,MAAM;YACrB;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YAEpB;;;eAGG;YACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SAC7B;KACF;CACF;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;IAErD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,yBAAiB,4BAA4B,CAAC;IAC5C;;OAEG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAEvB;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAErB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;KACzB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
@@ -0,0 +1,290 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ /**
5
+ * Create a task to repeatedly perform an action on an external website.
6
+ */
7
+ export declare class Tasks extends APIResource {
8
+ /**
9
+ * <p>Create a new task to repeatedly perform an action on an external website.</p><p>Once created and ready, it can be repeatedly executed using the <code>run</code> endpoint.</p>
10
+ */
11
+ create(body: TaskCreateParams, options?: RequestOptions): APIPromise<Task>;
12
+ /**
13
+ * <p>Retrieve a task by its ID.</p><p>For tasks that are still being generated, <code>input_schema</code> and <code>output_schema</code> may be <code>null</code>. They are guaranteed to be present once the task reaches the ready state.</p>
14
+ */
15
+ retrieve(id: string, options?: RequestOptions): APIPromise<Task>;
16
+ /**
17
+ * <p>List all tasks that have been created.</p><p>For tasks that are still being generated, <code>input_schema</code> and <code>output_schema</code> may be <code>null</code>. They are guaranteed to be present once the task reaches the ready state.</p>
18
+ */
19
+ list(options?: RequestOptions): APIPromise<TaskListResponse>;
20
+ /**
21
+ * <p>Delete a task by its ID.</p>
22
+ */
23
+ delete(id: string, options?: RequestOptions): APIPromise<unknown>;
24
+ /**
25
+ * <p>Mark the manual browser session as complete and continue the task workflow.</p>
26
+ */
27
+ completeManualSession(id: string, options?: RequestOptions): APIPromise<Task>;
28
+ /**
29
+ * <p>Spawn a browser session for manual task completion. If a session already exists, it will be closed and replaced.</p>
30
+ */
31
+ startManualSession(id: string, body?: TaskStartManualSessionParams | null | undefined, options?: RequestOptions): APIPromise<TaskStartManualSessionResponse>;
32
+ }
33
+ export interface Task {
34
+ /**
35
+ * Unique identifier for the object.
36
+ */
37
+ id: string;
38
+ /**
39
+ * Timestamp when the object was created.
40
+ */
41
+ created_at: string;
42
+ /**
43
+ * Parameters set during the creation of this task.
44
+ */
45
+ creation: Task.Creation;
46
+ /**
47
+ * Current state of the task, in particular whether it is ready to use.
48
+ */
49
+ current_state: 'not_ready' | 'waiting_for_manual_completion' | 'ready' | 'failed';
50
+ /**
51
+ * Short title shown in the dashboard. Informational only.
52
+ */
53
+ display_name: string;
54
+ /**
55
+ * Task input schema as a JSON schema string. May be null while the task is not
56
+ * ready (e.g. schema generation in progress). Guaranteed non-null when
57
+ * current_state is ready.
58
+ */
59
+ input_schema: string | null;
60
+ /**
61
+ * Task output schema as a JSON schema string. May be null while the task is not
62
+ * ready (e.g. schema generation in progress). Guaranteed non-null when
63
+ * current_state is ready.
64
+ */
65
+ output_schema: string | null;
66
+ /**
67
+ * Detailed explanation of the task to be performed.
68
+ */
69
+ task: string;
70
+ /**
71
+ * Timestamp when the object was last updated.
72
+ */
73
+ updated_at: string;
74
+ /**
75
+ * The website to perform the task on.
76
+ */
77
+ website: string;
78
+ /**
79
+ * Information about why a task failed, for user display.
80
+ */
81
+ failure_info?: Task.FailureInfo | null;
82
+ /**
83
+ * List of secrets that must be provided when running this task.
84
+ */
85
+ required_secrets?: Array<Task.RequiredSecret>;
86
+ }
87
+ export declare namespace Task {
88
+ /**
89
+ * Parameters set during the creation of this task.
90
+ */
91
+ interface Creation {
92
+ /**
93
+ * Whether schemas were configured to auto-generate during task creation.
94
+ */
95
+ auto_generate_schemas: boolean;
96
+ /**
97
+ * Mapping of required secret slot names to secret UUIDs bound during task
98
+ * creation.
99
+ */
100
+ secret_bindings?: {
101
+ [key: string]: string;
102
+ };
103
+ /**
104
+ * List of secrets provided during task creation.
105
+ */
106
+ secrets?: Array<Creation.Secret>;
107
+ }
108
+ namespace Creation {
109
+ /**
110
+ * A secret provided during task creation
111
+ */
112
+ interface Secret {
113
+ /**
114
+ * UUID of the secret to bind.
115
+ */
116
+ secret_uuid: string;
117
+ /**
118
+ * Optional description of what this secret is used for (helps generate meaningful
119
+ * slot names).
120
+ */
121
+ description?: string | null;
122
+ }
123
+ }
124
+ /**
125
+ * Information about why a task failed, for user display.
126
+ */
127
+ interface FailureInfo {
128
+ /**
129
+ * Primary failure category
130
+ */
131
+ category: string;
132
+ /**
133
+ * Summary of the failure cause
134
+ */
135
+ message: string;
136
+ }
137
+ /**
138
+ * Definition of a secret slot that a task requires.
139
+ */
140
+ interface RequiredSecret {
141
+ /**
142
+ * Name of the secret slot (used as env var prefix, e.g., 'LOGIN' →
143
+ * LOGIN_USERNAME).
144
+ */
145
+ name: string;
146
+ /**
147
+ * Type of secret required: 'login' or 'string'.
148
+ */
149
+ type: 'login' | 'string';
150
+ /**
151
+ * Whether this login slot requires 2FA/TOTP. Only applicable for 'login' type.
152
+ */
153
+ requires_totp?: boolean;
154
+ }
155
+ }
156
+ export type TaskListResponse = Array<Task>;
157
+ export type TaskDeleteResponse = unknown;
158
+ export interface TaskStartManualSessionResponse {
159
+ /**
160
+ * URL to embed in an iframe to control the browser.
161
+ */
162
+ iframe_url: string;
163
+ /**
164
+ * Opaque identifier for the spawned browser session.
165
+ */
166
+ session_id: string;
167
+ }
168
+ export interface TaskCreateParams {
169
+ /**
170
+ * Information used during task creation.
171
+ */
172
+ creation_params: TaskCreateParams.CreationParams;
173
+ /**
174
+ * Short title shown in the dashboard. Informational only; not used to generate the
175
+ * task.
176
+ */
177
+ display_name: string;
178
+ /**
179
+ * Detailed explanation of the task to be performed.
180
+ */
181
+ task: string;
182
+ /**
183
+ * The website to perform the task on.
184
+ */
185
+ website: string;
186
+ /**
187
+ * Task input parameters as a JSON schema string. Required when
188
+ * auto_generate_schemas is disabled. Must be omitted when auto_generate_schemas is
189
+ * enabled; remains null until generation completes.
190
+ */
191
+ input_schema?: string | null;
192
+ /**
193
+ * Task output schema as a JSON schema string. Required when auto_generate_schemas
194
+ * is disabled. Must be omitted when auto_generate_schemas is enabled; remains null
195
+ * until generation completes.
196
+ */
197
+ output_schema?: string | null;
198
+ }
199
+ export declare namespace TaskCreateParams {
200
+ /**
201
+ * Information used during task creation.
202
+ */
203
+ interface CreationParams {
204
+ /**
205
+ * If true, input and output schemas will be automatically generated from captured
206
+ * HAR traffic. When enabled, input_schema and output_schema must be omitted from
207
+ * the request. Task responses may return null for these fields until generation
208
+ * completes.
209
+ */
210
+ auto_generate_schemas?: boolean;
211
+ /**
212
+ * Initial values for input schema fields, keyed by property name. Used during task
213
+ * creation to demonstrate the task. Especially important for tasks requiring
214
+ * authentication, as initial credentials must be provided.
215
+ */
216
+ initial_input_values?: {
217
+ [key: string]: unknown;
218
+ };
219
+ /**
220
+ * If true, the server will run the browser task autonomously. If false, the user
221
+ * must complete the task manually in a spawned browser.
222
+ */
223
+ is_fully_autonomous?: boolean;
224
+ /**
225
+ * List of secrets to use for this task.
226
+ */
227
+ secrets?: Array<CreationParams.Secret>;
228
+ }
229
+ namespace CreationParams {
230
+ /**
231
+ * A secret provided during task creation
232
+ */
233
+ interface Secret {
234
+ /**
235
+ * UUID of the secret to bind.
236
+ */
237
+ secret_uuid: string;
238
+ /**
239
+ * Optional description of what this secret is used for (helps generate meaningful
240
+ * slot names).
241
+ */
242
+ description?: string | null;
243
+ }
244
+ }
245
+ }
246
+ export interface TaskStartManualSessionParams {
247
+ /**
248
+ * Initial cookies to set in the browser session.
249
+ */
250
+ cookies?: Array<TaskStartManualSessionParams.Cookie>;
251
+ /**
252
+ * If true, spawn the browser session using a proxy.
253
+ */
254
+ use_proxy?: boolean;
255
+ }
256
+ export declare namespace TaskStartManualSessionParams {
257
+ /**
258
+ * A cookie to set in the browser session.
259
+ */
260
+ interface Cookie {
261
+ /**
262
+ * The name of the cookie.
263
+ */
264
+ name: string;
265
+ /**
266
+ * The value of the cookie.
267
+ */
268
+ value: string;
269
+ /**
270
+ * The domain of the cookie.
271
+ */
272
+ domain?: string | null;
273
+ /**
274
+ * Whether the cookie is HTTP only.
275
+ */
276
+ http_only?: boolean | null;
277
+ /**
278
+ * The path of the cookie.
279
+ */
280
+ path?: string | null;
281
+ /**
282
+ * Whether the cookie is secure.
283
+ */
284
+ secure?: boolean | null;
285
+ }
286
+ }
287
+ export declare namespace Tasks {
288
+ export { type Task as Task, type TaskListResponse as TaskListResponse, type TaskDeleteResponse as TaskDeleteResponse, type TaskStartManualSessionResponse as TaskStartManualSessionResponse, type TaskCreateParams as TaskCreateParams, type TaskStartManualSessionParams as TaskStartManualSessionParams, };
289
+ }
290
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UA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,MAAM,GAAG,IAAI,CAAC;QAEvB;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAErB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;KACzB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
@@ -0,0 +1,49 @@
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.Tasks = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
7
+ /**
8
+ * Create a task to repeatedly perform an action on an external website.
9
+ */
10
+ class Tasks extends resource_1.APIResource {
11
+ /**
12
+ * <p>Create a new task to repeatedly perform an action on an external website.</p><p>Once created and ready, it can be repeatedly executed using the <code>run</code> endpoint.</p>
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/v1beta/tasks', { body, ...options });
16
+ }
17
+ /**
18
+ * <p>Retrieve a task by its ID.</p><p>For tasks that are still being generated, <code>input_schema</code> and <code>output_schema</code> may be <code>null</code>. They are guaranteed to be present once the task reaches the ready state.</p>
19
+ */
20
+ retrieve(id, options) {
21
+ return this._client.get((0, path_1.path) `/v1beta/tasks/${id}`, options);
22
+ }
23
+ /**
24
+ * <p>List all tasks that have been created.</p><p>For tasks that are still being generated, <code>input_schema</code> and <code>output_schema</code> may be <code>null</code>. They are guaranteed to be present once the task reaches the ready state.</p>
25
+ */
26
+ list(options) {
27
+ return this._client.get('/v1beta/tasks', options);
28
+ }
29
+ /**
30
+ * <p>Delete a task by its ID.</p>
31
+ */
32
+ delete(id, options) {
33
+ return this._client.delete((0, path_1.path) `/v1beta/tasks/${id}`, options);
34
+ }
35
+ /**
36
+ * <p>Mark the manual browser session as complete and continue the task workflow.</p>
37
+ */
38
+ completeManualSession(id, options) {
39
+ return this._client.post((0, path_1.path) `/v1beta/tasks/${id}/complete-manual-session`, options);
40
+ }
41
+ /**
42
+ * <p>Spawn a browser session for manual task completion. If a session already exists, it will be closed and replaced.</p>
43
+ */
44
+ startManualSession(id, body = {}, options) {
45
+ return this._client.post((0, path_1.path) `/v1beta/tasks/${id}/start-manual-session`, { body, ...options });
46
+ }
47
+ }
48
+ exports.Tasks = Tasks;
49
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,I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