@onkernel/sdk 0.158.0 → 0.160.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 (57) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/browser-pools.d.mts +23 -0
  10. package/resources/browser-pools.d.mts.map +1 -1
  11. package/resources/browser-pools.d.ts +23 -0
  12. package/resources/browser-pools.d.ts.map +1 -1
  13. package/resources/browsers/browsers.d.mts +45 -7
  14. package/resources/browsers/browsers.d.mts.map +1 -1
  15. package/resources/browsers/browsers.d.ts +45 -7
  16. package/resources/browsers/browsers.d.ts.map +1 -1
  17. package/resources/browsers/browsers.js.map +1 -1
  18. package/resources/browsers/browsers.mjs.map +1 -1
  19. package/resources/browsers/process.d.mts +4 -2
  20. package/resources/browsers/process.d.mts.map +1 -1
  21. package/resources/browsers/process.d.ts +4 -2
  22. package/resources/browsers/process.d.ts.map +1 -1
  23. package/resources/index.d.mts +1 -1
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +1 -1
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs.map +1 -1
  29. package/resources/invocations.d.mts +5 -0
  30. package/resources/invocations.d.mts.map +1 -1
  31. package/resources/invocations.d.ts +5 -0
  32. package/resources/invocations.d.ts.map +1 -1
  33. package/resources/projects/limits.d.mts +7 -0
  34. package/resources/projects/limits.d.mts.map +1 -1
  35. package/resources/projects/limits.d.ts +7 -0
  36. package/resources/projects/limits.d.ts.map +1 -1
  37. package/resources/reports.d.mts +125 -1
  38. package/resources/reports.d.mts.map +1 -1
  39. package/resources/reports.d.ts +125 -1
  40. package/resources/reports.d.ts.map +1 -1
  41. package/resources/reports.js +22 -0
  42. package/resources/reports.js.map +1 -1
  43. package/resources/reports.mjs +22 -0
  44. package/resources/reports.mjs.map +1 -1
  45. package/src/client.ts +4 -0
  46. package/src/resources/browser-pools.ts +27 -0
  47. package/src/resources/browsers/browsers.ts +51 -7
  48. package/src/resources/browsers/process.ts +4 -2
  49. package/src/resources/index.ts +2 -0
  50. package/src/resources/invocations.ts +6 -0
  51. package/src/resources/projects/limits.ts +8 -0
  52. package/src/resources/reports.ts +141 -0
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. package/version.mjs +1 -1
@@ -44,6 +44,26 @@ export declare class Reports extends APIResource {
44
44
  * ```
45
45
  */
46
46
  list(query: ReportListParams, options?: RequestOptions): PagePromise<ReportsOffsetPagination, Report>;
47
+ /**
48
+ * Aggregate reports of one type, grouped by fields of their data. Results come
49
+ * from exported analytics data, which lags by about 75 minutes, so recently
50
+ * submitted reports may not be included yet. Tasks with no matching report do not
51
+ * appear, and with count_distinct a task can be counted in more than one group. A
52
+ * query that runs for more than 10 seconds returns 422 with code query_timeout.
53
+ * Requires tasks:read on the whole project.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const response = await client.reports.query({
58
+ * aggregate: { operation: 'count' },
59
+ * group_by: ['data.symptom'],
60
+ * occurred_after: '2019-12-27T18:11:19.117Z',
61
+ * occurred_before: '2019-12-27T18:11:19.117Z',
62
+ * type: 'bot_detection.observation',
63
+ * });
64
+ * ```
65
+ */
66
+ query(body: ReportQueryParams, options?: RequestOptions): APIPromise<ReportQueryResponse>;
47
67
  }
48
68
  export type ReportsOffsetPagination = OffsetPagination<Report>;
49
69
  /**
@@ -86,6 +106,24 @@ export interface Report {
86
106
  */
87
107
  session_id?: string | null;
88
108
  }
109
+ export interface ReportQueryResponse {
110
+ groups: Array<ReportQueryResponse.Group>;
111
+ }
112
+ export declare namespace ReportQueryResponse {
113
+ interface Group {
114
+ /**
115
+ * Value of each group_by field for this group, such as {"data.symptom":"captcha"};
116
+ * null when reports lack the field.
117
+ */
118
+ key: {
119
+ [key: string]: unknown;
120
+ };
121
+ /**
122
+ * The aggregate for this group.
123
+ */
124
+ value: number;
125
+ }
126
+ }
89
127
  export interface ReportCreateParams {
90
128
  /**
91
129
  * Report data. It must match the schema of the report type's version and encode to
@@ -130,7 +168,93 @@ export interface ReportListParams extends OffsetPaginationParams {
130
168
  */
131
169
  type?: string;
132
170
  }
171
+ export interface ReportQueryParams {
172
+ /**
173
+ * The value computed for each group.
174
+ */
175
+ aggregate: ReportQueryParams.Aggregate;
176
+ /**
177
+ * Fields of the report data to group by, such as data.symptom. Enums, numbers,
178
+ * booleans and strings of at most 255 characters can be grouped by. A report
179
+ * without a field groups under null.
180
+ */
181
+ group_by: Array<string>;
182
+ /**
183
+ * Include reports that occurred at or after this time.
184
+ */
185
+ occurred_after: string;
186
+ /**
187
+ * Include reports that occurred before this time. At most 30 days after
188
+ * occurred_after.
189
+ */
190
+ occurred_before: string;
191
+ /**
192
+ * Report type to query.
193
+ */
194
+ type: string;
195
+ /**
196
+ * Exact matches on fields of the report data, keyed by field, such as
197
+ * {"data.site":"booking.com"}. Reports without the field do not match.
198
+ */
199
+ filters?: {
200
+ [key: string]: string | number | boolean;
201
+ };
202
+ /**
203
+ * Maximum number of groups to return, largest value first.
204
+ */
205
+ limit?: number;
206
+ /**
207
+ * Schema version to query. Fields are checked against this version's schema and
208
+ * only reports submitted with it are included. Defaults to the type's latest
209
+ * version.
210
+ */
211
+ schema_version?: number;
212
+ /**
213
+ * Only include reports whose task matches every filter given.
214
+ */
215
+ task_filter?: ReportQueryParams.TaskFilter;
216
+ }
217
+ export declare namespace ReportQueryParams {
218
+ /**
219
+ * The value computed for each group.
220
+ */
221
+ interface Aggregate {
222
+ /**
223
+ * count counts reports; count_distinct counts distinct task_id values; sum and avg
224
+ * aggregate a numeric field of the report data, leaving out reports without it.
225
+ */
226
+ operation: 'count' | 'count_distinct' | 'sum' | 'avg';
227
+ /**
228
+ * Optional for count, where it can only be id. task_id for count_distinct, or a
229
+ * numeric data field such as data.expected_amount.minor_units for sum and avg.
230
+ */
231
+ field?: string;
232
+ }
233
+ /**
234
+ * Only include reports whose task matches every filter given.
235
+ */
236
+ interface TaskFilter {
237
+ /**
238
+ * Only tasks linked to at least one of these browsers.
239
+ */
240
+ browser_ids?: Array<string>;
241
+ /**
242
+ * Task metadata entries the task must have, with these exact values.
243
+ */
244
+ metadata?: {
245
+ [key: string]: string;
246
+ };
247
+ /**
248
+ * Only tasks that started at or after this time.
249
+ */
250
+ started_after?: string;
251
+ /**
252
+ * Only tasks that started before this time.
253
+ */
254
+ started_before?: string;
255
+ }
256
+ }
133
257
  export declare namespace Reports {
134
- export { type Report as Report, type ReportsOffsetPagination as ReportsOffsetPagination, type ReportCreateParams as ReportCreateParams, type ReportListParams as ReportListParams, };
258
+ export { type Report as Report, type ReportQueryResponse as ReportQueryResponse, type ReportsOffsetPagination as ReportsOffsetPagination, type ReportCreateParams as ReportCreateParams, type ReportListParams as ReportListParams, type ReportQueryParams as ReportQueryParams, };
135
259
  }
136
260
  //# sourceMappingURL=reports.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.d.mts","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,E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
44
44
  * ```
45
45
  */
46
46
  list(query: ReportListParams, options?: RequestOptions): PagePromise<ReportsOffsetPagination, Report>;
47
+ /**
48
+ * Aggregate reports of one type, grouped by fields of their data. Results come
49
+ * from exported analytics data, which lags by about 75 minutes, so recently
50
+ * submitted reports may not be included yet. Tasks with no matching report do not
51
+ * appear, and with count_distinct a task can be counted in more than one group. A
52
+ * query that runs for more than 10 seconds returns 422 with code query_timeout.
53
+ * Requires tasks:read on the whole project.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const response = await client.reports.query({
58
+ * aggregate: { operation: 'count' },
59
+ * group_by: ['data.symptom'],
60
+ * occurred_after: '2019-12-27T18:11:19.117Z',
61
+ * occurred_before: '2019-12-27T18:11:19.117Z',
62
+ * type: 'bot_detection.observation',
63
+ * });
64
+ * ```
65
+ */
66
+ query(body: ReportQueryParams, options?: RequestOptions): APIPromise<ReportQueryResponse>;
47
67
  }
48
68
  export type ReportsOffsetPagination = OffsetPagination<Report>;
49
69
  /**
@@ -86,6 +106,24 @@ export interface Report {
86
106
  */
87
107
  session_id?: string | null;
88
108
  }
109
+ export interface ReportQueryResponse {
110
+ groups: Array<ReportQueryResponse.Group>;
111
+ }
112
+ export declare namespace ReportQueryResponse {
113
+ interface Group {
114
+ /**
115
+ * Value of each group_by field for this group, such as {"data.symptom":"captcha"};
116
+ * null when reports lack the field.
117
+ */
118
+ key: {
119
+ [key: string]: unknown;
120
+ };
121
+ /**
122
+ * The aggregate for this group.
123
+ */
124
+ value: number;
125
+ }
126
+ }
89
127
  export interface ReportCreateParams {
90
128
  /**
91
129
  * Report data. It must match the schema of the report type's version and encode to
@@ -130,7 +168,93 @@ export interface ReportListParams extends OffsetPaginationParams {
130
168
  */
131
169
  type?: string;
132
170
  }
171
+ export interface ReportQueryParams {
172
+ /**
173
+ * The value computed for each group.
174
+ */
175
+ aggregate: ReportQueryParams.Aggregate;
176
+ /**
177
+ * Fields of the report data to group by, such as data.symptom. Enums, numbers,
178
+ * booleans and strings of at most 255 characters can be grouped by. A report
179
+ * without a field groups under null.
180
+ */
181
+ group_by: Array<string>;
182
+ /**
183
+ * Include reports that occurred at or after this time.
184
+ */
185
+ occurred_after: string;
186
+ /**
187
+ * Include reports that occurred before this time. At most 30 days after
188
+ * occurred_after.
189
+ */
190
+ occurred_before: string;
191
+ /**
192
+ * Report type to query.
193
+ */
194
+ type: string;
195
+ /**
196
+ * Exact matches on fields of the report data, keyed by field, such as
197
+ * {"data.site":"booking.com"}. Reports without the field do not match.
198
+ */
199
+ filters?: {
200
+ [key: string]: string | number | boolean;
201
+ };
202
+ /**
203
+ * Maximum number of groups to return, largest value first.
204
+ */
205
+ limit?: number;
206
+ /**
207
+ * Schema version to query. Fields are checked against this version's schema and
208
+ * only reports submitted with it are included. Defaults to the type's latest
209
+ * version.
210
+ */
211
+ schema_version?: number;
212
+ /**
213
+ * Only include reports whose task matches every filter given.
214
+ */
215
+ task_filter?: ReportQueryParams.TaskFilter;
216
+ }
217
+ export declare namespace ReportQueryParams {
218
+ /**
219
+ * The value computed for each group.
220
+ */
221
+ interface Aggregate {
222
+ /**
223
+ * count counts reports; count_distinct counts distinct task_id values; sum and avg
224
+ * aggregate a numeric field of the report data, leaving out reports without it.
225
+ */
226
+ operation: 'count' | 'count_distinct' | 'sum' | 'avg';
227
+ /**
228
+ * Optional for count, where it can only be id. task_id for count_distinct, or a
229
+ * numeric data field such as data.expected_amount.minor_units for sum and avg.
230
+ */
231
+ field?: string;
232
+ }
233
+ /**
234
+ * Only include reports whose task matches every filter given.
235
+ */
236
+ interface TaskFilter {
237
+ /**
238
+ * Only tasks linked to at least one of these browsers.
239
+ */
240
+ browser_ids?: Array<string>;
241
+ /**
242
+ * Task metadata entries the task must have, with these exact values.
243
+ */
244
+ metadata?: {
245
+ [key: string]: string;
246
+ };
247
+ /**
248
+ * Only tasks that started at or after this time.
249
+ */
250
+ started_after?: string;
251
+ /**
252
+ * Only tasks that started before this time.
253
+ */
254
+ started_before?: string;
255
+ }
256
+ }
133
257
  export declare namespace Reports {
134
- export { type Report as Report, type ReportsOffsetPagination as ReportsOffsetPagination, type ReportCreateParams as ReportCreateParams, type ReportListParams as ReportListParams, };
258
+ export { type Report as Report, type ReportQueryResponse as ReportQueryResponse, type ReportsOffsetPagination as ReportsOffsetPagination, type ReportCreateParams as ReportCreateParams, type ReportListParams as ReportListParams, type ReportQueryParams as ReportQueryParams, };
135
259
  }
136
260
  //# sourceMappingURL=reports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIlE;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAGtG;AAED,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE;QAAE,CAAC,GAAG,EA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iB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,SAAS;QACxB;;;WAGG;QACH,SAAS,EAAE,OAAO,GAAG,gBAAgB,GAAG,KAAK,GAAG,KAAK,CAAC;QAEtD;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;IAED;;OAEG;IACH,UAAiB,UAAU;QACzB;;WAEG;QACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAE5B;;WAEG;QACH,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAErC;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -53,6 +53,28 @@ class Reports extends resource_1.APIResource {
53
53
  list(query, options) {
54
54
  return this._client.getAPIList('/reports', (pagination_1.OffsetPagination), { query, ...options });
55
55
  }
56
+ /**
57
+ * Aggregate reports of one type, grouped by fields of their data. Results come
58
+ * from exported analytics data, which lags by about 75 minutes, so recently
59
+ * submitted reports may not be included yet. Tasks with no matching report do not
60
+ * appear, and with count_distinct a task can be counted in more than one group. A
61
+ * query that runs for more than 10 seconds returns 422 with code query_timeout.
62
+ * Requires tasks:read on the whole project.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const response = await client.reports.query({
67
+ * aggregate: { operation: 'count' },
68
+ * group_by: ['data.symptom'],
69
+ * occurred_after: '2019-12-27T18:11:19.117Z',
70
+ * occurred_before: '2019-12-27T18:11:19.117Z',
71
+ * type: 'bot_detection.observation',
72
+ * });
73
+ * ```
74
+ */
75
+ query(body, options) {
76
+ return this._client.post('/reports/query', { body, ...options });
77
+ }
56
78
  }
57
79
  exports.Reports = Reports;
58
80
  //# sourceMappingURL=reports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.js","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAgG;AAEhG,oDAA8C;AAE9C;;GAEG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,6BAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF;AA/CD,0BA+CC"}
1
+ {"version":3,"file":"reports.js","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAgG;AAEhG,oDAA8C;AAE9C;;GAEG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,6BAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,IAAuB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AAtED,0BAsEC"}
@@ -50,5 +50,27 @@ export class Reports extends APIResource {
50
50
  list(query, options) {
51
51
  return this._client.getAPIList('/reports', (OffsetPagination), { query, ...options });
52
52
  }
53
+ /**
54
+ * Aggregate reports of one type, grouped by fields of their data. Results come
55
+ * from exported analytics data, which lags by about 75 minutes, so recently
56
+ * submitted reports may not be included yet. Tasks with no matching report do not
57
+ * appear, and with count_distinct a task can be counted in more than one group. A
58
+ * query that runs for more than 10 seconds returns 422 with code query_timeout.
59
+ * Requires tasks:read on the whole project.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const response = await client.reports.query({
64
+ * aggregate: { operation: 'count' },
65
+ * group_by: ['data.symptom'],
66
+ * occurred_after: '2019-12-27T18:11:19.117Z',
67
+ * occurred_before: '2019-12-27T18:11:19.117Z',
68
+ * type: 'bot_detection.observation',
69
+ * });
70
+ * ```
71
+ */
72
+ query(body, options) {
73
+ return this._client.post('/reports/query', { body, ...options });
74
+ }
53
75
  }
54
76
  //# sourceMappingURL=reports.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.mjs","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,gBAAgB,EAA4C,+BAA2B;AAEhG,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,gBAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF"}
1
+ {"version":3,"file":"reports.mjs","sourceRoot":"","sources":["../src/resources/reports.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,gBAAgB,EAA4C,+BAA2B;AAEhG,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAuB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAA,gBAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,IAAuB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -148,6 +148,8 @@ import {
148
148
  Report,
149
149
  ReportCreateParams,
150
150
  ReportListParams,
151
+ ReportQueryParams,
152
+ ReportQueryResponse,
151
153
  Reports,
152
154
  ReportsOffsetPagination,
153
155
  } from './resources/reports';
@@ -1430,9 +1432,11 @@ export declare namespace Kernel {
1430
1432
  export {
1431
1433
  Reports as Reports,
1432
1434
  type Report as Report,
1435
+ type ReportQueryResponse as ReportQueryResponse,
1433
1436
  type ReportsOffsetPagination as ReportsOffsetPagination,
1434
1437
  type ReportCreateParams as ReportCreateParams,
1435
1438
  type ReportListParams as ReportListParams,
1439
+ type ReportQueryParams as ReportQueryParams,
1436
1440
  };
1437
1441
 
1438
1442
  export {
@@ -311,6 +311,12 @@ export namespace BrowserPool {
311
311
  */
312
312
  refresh_on_profile_update?: boolean;
313
313
 
314
+ /**
315
+ * Seconds a browser acquired from this pool waits after its last connection closes
316
+ * before entering standby. Omitted when the pool uses the platform default.
317
+ */
318
+ standby_idle_timeout_seconds?: number;
319
+
314
320
  /**
315
321
  * Start replay recording automatically when a browser is acquired from this pool.
316
322
  */
@@ -547,6 +553,12 @@ export interface BrowserPoolAcquireResponse {
547
553
  */
548
554
  replay?: BrowserPoolAcquireResponse.Replay;
549
555
 
556
+ /**
557
+ * Seconds the browser waits after its last connection closes before entering
558
+ * standby. Omitted when the browser uses the platform default.
559
+ */
560
+ standby_idle_timeout_seconds?: number;
561
+
550
562
  /**
551
563
  * URL the session was most recently asked to navigate to, if any. Recorded for
552
564
  * debugging. Navigation is fire-and-forget — the URL is dispatched to the browser
@@ -740,6 +752,15 @@ export interface BrowserPoolCreateParams {
740
752
  */
741
753
  region?: 'us-east' | 'us-west' | 'eu-west' | 'ap-southeast';
742
754
 
755
+ /**
756
+ * Seconds a browser acquired from this pool waits after its last connection closes
757
+ * before entering standby. Defaults to the platform default when omitted. Minimum
758
+ * 10, maximum 300. Idle browsers in the pool use the platform default, and a
759
+ * released browser returns to it. An acquired browser can override the pool's
760
+ * value with PATCH /browsers/{id_or_name}.
761
+ */
762
+ standby_idle_timeout_seconds?: number;
763
+
743
764
  /**
744
765
  * Start replay recording automatically when a browser is acquired from this pool.
745
766
  */
@@ -1058,6 +1079,12 @@ export interface BrowserPoolUpdateParams {
1058
1079
  */
1059
1080
  size?: number;
1060
1081
 
1082
+ /**
1083
+ * If provided, replaces the standby idle timeout for browsers in this pool.
1084
+ * Minimum 10, maximum 300. Applies to browsers acquired after the update.
1085
+ */
1086
+ standby_idle_timeout_seconds?: number;
1087
+
1061
1088
  /**
1062
1089
  * If provided, replaces whether replay recording starts automatically for future
1063
1090
  * acquired browsers.
@@ -1152,6 +1152,12 @@ export interface BrowserCreateResponse {
1152
1152
  */
1153
1153
  replay?: BrowserCreateResponse.Replay;
1154
1154
 
1155
+ /**
1156
+ * Seconds the browser waits after its last connection closes before entering
1157
+ * standby. Omitted when the browser uses the platform default.
1158
+ */
1159
+ standby_idle_timeout_seconds?: number;
1160
+
1155
1161
  /**
1156
1162
  * URL the session was most recently asked to navigate to, if any. Recorded for
1157
1163
  * debugging. Navigation is fire-and-forget — the URL is dispatched to the browser
@@ -1401,6 +1407,12 @@ export interface BrowserRetrieveResponse {
1401
1407
  */
1402
1408
  replay?: BrowserRetrieveResponse.Replay;
1403
1409
 
1410
+ /**
1411
+ * Seconds the browser waits after its last connection closes before entering
1412
+ * standby. Omitted when the browser uses the platform default.
1413
+ */
1414
+ standby_idle_timeout_seconds?: number;
1415
+
1404
1416
  /**
1405
1417
  * URL the session was most recently asked to navigate to, if any. Recorded for
1406
1418
  * debugging. Navigation is fire-and-forget — the URL is dispatched to the browser
@@ -1650,6 +1662,12 @@ export interface BrowserUpdateResponse {
1650
1662
  */
1651
1663
  replay?: BrowserUpdateResponse.Replay;
1652
1664
 
1665
+ /**
1666
+ * Seconds the browser waits after its last connection closes before entering
1667
+ * standby. Omitted when the browser uses the platform default.
1668
+ */
1669
+ standby_idle_timeout_seconds?: number;
1670
+
1653
1671
  /**
1654
1672
  * URL the session was most recently asked to navigate to, if any. Recorded for
1655
1673
  * debugging. Navigation is fire-and-forget — the URL is dispatched to the browser
@@ -1899,6 +1917,12 @@ export interface BrowserListResponse {
1899
1917
  */
1900
1918
  replay?: BrowserListResponse.Replay;
1901
1919
 
1920
+ /**
1921
+ * Seconds the browser waits after its last connection closes before entering
1922
+ * standby. Omitted when the browser uses the platform default.
1923
+ */
1924
+ standby_idle_timeout_seconds?: number;
1925
+
1902
1926
  /**
1903
1927
  * URL the session was most recently asked to navigate to, if any. Recorded for
1904
1928
  * debugging. Navigation is fire-and-forget — the URL is dispatched to the browser
@@ -2099,13 +2123,15 @@ export interface BrowserCreateParams {
2099
2123
  /**
2100
2124
  * Host platform for the browser. Omit it, or set `os` to `linux`, for a Linux
2101
2125
  * browser. This is the operating system the browser runs on; `fingerprint.os` only
2102
- * changes what a Linux browser reports to websites. macOS browsers are headful and
2103
- * run only in `us-east`. Requests can return 503 `platform_unavailable` when no
2104
- * macOS capacity is configured. A macOS request that sets `headless: true`,
2105
- * `memory`, `gpu`, `video_memory`, `profile`, `fingerprint`, `bandwidth`, or a
2106
- * region other than `us-east` returns 400 `unsupported_configuration`, listing
2107
- * those fields in `unsupported_fields`. Browser locale and timezone overrides do
2108
- * not change placement.
2126
+ * changes what a Linux browser reports to websites. macOS browsers require an
2127
+ * active paid Start-Up or Enterprise plan; other plans get 403
2128
+ * `insufficient_plan`. macOS browsers are headful and run only in `us-east`.
2129
+ * Requests can return 503 `platform_unavailable` when no macOS capacity is
2130
+ * configured. A macOS request that sets `headless: true`, `memory`, `gpu`,
2131
+ * `video_memory`, `profile`, `fingerprint`, `bandwidth`,
2132
+ * `standby_idle_timeout_seconds`, or a region other than `us-east` returns 400
2133
+ * `unsupported_configuration`, listing those fields in `unsupported_fields`.
2134
+ * Browser locale and timezone overrides do not change placement.
2109
2135
  */
2110
2136
  platform?: BrowserPlatform;
2111
2137
 
@@ -2139,6 +2165,16 @@ export interface BrowserCreateParams {
2139
2165
  */
2140
2166
  region?: 'us-east' | 'us-west' | 'eu-west' | 'ap-southeast';
2141
2167
 
2168
+ /**
2169
+ * Seconds the browser waits after its last connection (CDP, WebDriver, or live
2170
+ * view) closes before entering standby. A shorter value reduces billed idle time
2171
+ * for bursty workloads; a longer value keeps the browser awake between closely
2172
+ * spaced connections. Defaults to the platform default when omitted. Minimum
2173
+ * allowed is 10 seconds. Maximum allowed is 300 seconds. Not supported with
2174
+ * gpu=true or on macOS. Can be changed later via PATCH /browsers/{id_or_name}.
2175
+ */
2176
+ standby_idle_timeout_seconds?: number;
2177
+
2142
2178
  /**
2143
2179
  * Start replay recording as part of creating this browser session.
2144
2180
  */
@@ -2403,6 +2439,14 @@ export interface BrowserUpdateParams {
2403
2439
  */
2404
2440
  proxy_id?: string | null;
2405
2441
 
2442
+ /**
2443
+ * Seconds the browser waits after its last connection closes before entering
2444
+ * standby. Omit to leave unchanged. Minimum allowed is 10 seconds. Maximum allowed
2445
+ * is 300 seconds. Not supported on GPU browsers or macOS browsers. A browser
2446
+ * acquired from a browser pool returns to the platform default when released.
2447
+ */
2448
+ standby_idle_timeout_seconds?: number;
2449
+
2406
2450
  /**
2407
2451
  * Optional URL to navigate the browser to after applying this update. When a
2408
2452
  * profile is loaded in the same update, this overrides the profile's restored
@@ -287,7 +287,8 @@ export interface ProcessStdoutStreamResponse {
287
287
 
288
288
  export interface ProcessExecParams {
289
289
  /**
290
- * Executable or shell command to run.
290
+ * Executable to run, as a path or a name on PATH. Not run through a shell; for
291
+ * shell syntax, use /bin/sh with ["-c", "<script>"] in args.
291
292
  */
292
293
  command: string;
293
294
 
@@ -353,7 +354,8 @@ export interface ProcessResizeParams {
353
354
 
354
355
  export interface ProcessSpawnParams {
355
356
  /**
356
- * Executable or shell command to run.
357
+ * Executable to run, as a path or a name on PATH. Not run through a shell; for
358
+ * shell syntax, use /bin/sh with ["-c", "<script>"] in args.
357
359
  */
358
360
  command: string;
359
361
 
@@ -219,8 +219,10 @@ export {
219
219
  export {
220
220
  Reports,
221
221
  type Report,
222
+ type ReportQueryResponse,
222
223
  type ReportCreateParams,
223
224
  type ReportListParams,
225
+ type ReportQueryParams,
224
226
  type ReportsOffsetPagination,
225
227
  } from './reports';
226
228
  export {
@@ -609,6 +609,12 @@ export namespace InvocationListBrowsersResponse {
609
609
  */
610
610
  replay?: Browser.Replay;
611
611
 
612
+ /**
613
+ * Seconds the browser waits after its last connection closes before entering
614
+ * standby. Omitted when the browser uses the platform default.
615
+ */
616
+ standby_idle_timeout_seconds?: number;
617
+
612
618
  /**
613
619
  * URL the session was most recently asked to navigate to, if any. Recorded for
614
620
  * debugging. Navigation is fire-and-forget — the URL is dispatched to the browser
@@ -42,6 +42,14 @@ export class Limits extends APIResource {
42
42
  }
43
43
 
44
44
  export interface ProjectLimits {
45
+ /**
46
+ * Current concurrent browsers in this project, counting active on-demand sessions
47
+ * and browser pool reservations. Compare against `max_concurrent_sessions`, or the
48
+ * organization's `default_project_max_concurrent_sessions` when this project has
49
+ * no override.
50
+ */
51
+ concurrent_sessions_used: number;
52
+
45
53
  /**
46
54
  * Maximum concurrent app invocations for this project. Null means no project-level
47
55
  * cap.