@toloka-platform/sdk 0.20.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -219,19 +219,11 @@
219
219
  ]
220
220
  },
221
221
  "value": {
222
- "anyOf": [
223
- {
224
- "type": "string"
225
- },
226
- {
227
- "type": "number"
228
- },
229
- {
230
- "type": "boolean"
231
- },
232
- {
233
- "type": "null"
234
- }
222
+ "type": [
223
+ "string",
224
+ "number",
225
+ "boolean",
226
+ "null"
235
227
  ]
236
228
  },
237
229
  "fieldId": {
@@ -432,7 +424,7 @@
432
424
  "createdBefore": {
433
425
  "type": "string",
434
426
  "format": "date-time",
435
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
427
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
436
428
  }
437
429
  },
438
430
  "additionalProperties": false
@@ -1029,13 +1021,9 @@
1029
1021
  "const": true
1030
1022
  },
1031
1023
  "maxEntities": {
1032
- "anyOf": [
1033
- {
1034
- "type": "number"
1035
- },
1036
- {
1037
- "type": "null"
1038
- }
1024
+ "type": [
1025
+ "number",
1026
+ "null"
1039
1027
  ]
1040
1028
  }
1041
1029
  },
@@ -1323,13 +1311,9 @@
1323
1311
  "const": true
1324
1312
  },
1325
1313
  "maxEntities": {
1326
- "anyOf": [
1327
- {
1328
- "type": "number"
1329
- },
1330
- {
1331
- "type": "null"
1332
- }
1314
+ "type": [
1315
+ "number",
1316
+ "null"
1333
1317
  ]
1334
1318
  }
1335
1319
  },
@@ -1536,6 +1520,20 @@
1536
1520
  "qaMode"
1537
1521
  ],
1538
1522
  "additionalProperties": false
1523
+ },
1524
+ {
1525
+ "type": "object",
1526
+ "properties": {
1527
+ "qaMode": {
1528
+ "type": "string",
1529
+ "const": "customer_review",
1530
+ "description": "Review mode: `customer_review` has your team accept or reject every task of the node; an LLM QA check verifies the evidence of each reject. Only for teams with customer review enabled."
1531
+ }
1532
+ },
1533
+ "required": [
1534
+ "qaMode"
1535
+ ],
1536
+ "additionalProperties": false
1539
1537
  }
1540
1538
  ]
1541
1539
  },
@@ -2048,7 +2046,7 @@
2048
2046
  "type": "string"
2049
2047
  },
2050
2048
  "additionalProperties": {
2051
- "$ref": "#/$defs/__schema3"
2049
+ "$ref": "#/$defs/__schema2"
2052
2050
  }
2053
2051
  },
2054
2052
  "checks": {
@@ -2067,7 +2065,7 @@
2067
2065
  "type": "string"
2068
2066
  },
2069
2067
  "golden": {
2070
- "$ref": "#/$defs/__schema4"
2068
+ "$ref": "#/$defs/__schema2"
2071
2069
  },
2072
2070
  "hint": {
2073
2071
  "type": "string"
@@ -2353,13 +2351,9 @@
2353
2351
  "type": "string"
2354
2352
  },
2355
2353
  "projectDescription": {
2356
- "anyOf": [
2357
- {
2358
- "type": "string"
2359
- },
2360
- {
2361
- "type": "null"
2362
- }
2354
+ "type": [
2355
+ "string",
2356
+ "null"
2363
2357
  ]
2364
2358
  },
2365
2359
  "extraHardRequirements": {
@@ -2550,19 +2544,11 @@
2550
2544
  ]
2551
2545
  },
2552
2546
  "value": {
2553
- "anyOf": [
2554
- {
2555
- "type": "string"
2556
- },
2557
- {
2558
- "type": "number"
2559
- },
2560
- {
2561
- "type": "boolean"
2562
- },
2563
- {
2564
- "type": "null"
2565
- }
2547
+ "type": [
2548
+ "string",
2549
+ "number",
2550
+ "boolean",
2551
+ "null"
2566
2552
  ]
2567
2553
  }
2568
2554
  },
@@ -3087,13 +3073,9 @@
3087
3073
  "const": true
3088
3074
  },
3089
3075
  "maxEntities": {
3090
- "anyOf": [
3091
- {
3092
- "type": "number"
3093
- },
3094
- {
3095
- "type": "null"
3096
- }
3076
+ "type": [
3077
+ "number",
3078
+ "null"
3097
3079
  ]
3098
3080
  }
3099
3081
  },
@@ -3381,13 +3363,9 @@
3381
3363
  "const": true
3382
3364
  },
3383
3365
  "maxEntities": {
3384
- "anyOf": [
3385
- {
3386
- "type": "number"
3387
- },
3388
- {
3389
- "type": "null"
3390
- }
3366
+ "type": [
3367
+ "number",
3368
+ "null"
3391
3369
  ]
3392
3370
  }
3393
3371
  },
@@ -3872,7 +3850,7 @@
3872
3850
  "type": "string"
3873
3851
  },
3874
3852
  "additionalProperties": {
3875
- "$ref": "#/$defs/__schema3"
3853
+ "$ref": "#/$defs/__schema2"
3876
3854
  }
3877
3855
  },
3878
3856
  "checks": {
@@ -3891,7 +3869,7 @@
3891
3869
  "type": "string"
3892
3870
  },
3893
3871
  "golden": {
3894
- "$ref": "#/$defs/__schema4"
3872
+ "$ref": "#/$defs/__schema2"
3895
3873
  },
3896
3874
  "hint": {
3897
3875
  "type": "string"
@@ -4177,13 +4155,9 @@
4177
4155
  "type": "string"
4178
4156
  },
4179
4157
  "projectDescription": {
4180
- "anyOf": [
4181
- {
4182
- "type": "string"
4183
- },
4184
- {
4185
- "type": "null"
4186
- }
4158
+ "type": [
4159
+ "string",
4160
+ "null"
4187
4161
  ]
4188
4162
  },
4189
4163
  "extraHardRequirements": {
@@ -4385,7 +4359,10 @@
4385
4359
  "type": "number",
4386
4360
  "description": "Y"
4387
4361
  }
4388
- ]
4362
+ ],
4363
+ "items": false,
4364
+ "minItems": 2,
4365
+ "maxItems": 2
4389
4366
  },
4390
4367
  "maxProperties": 2
4391
4368
  },
@@ -4407,7 +4384,8 @@
4407
4384
  },
4408
4385
  "additionalProperties": {
4409
4386
  "$ref": "#/$defs/__schema1"
4410
- }
4387
+ },
4388
+ "ref": "JsonSchemaProperties"
4411
4389
  },
4412
4390
  "__schema1": {
4413
4391
  "type": "object",
@@ -4554,9 +4532,11 @@
4554
4532
  }
4555
4533
  }
4556
4534
  },
4557
- "additionalProperties": false
4535
+ "additionalProperties": false,
4536
+ "ref": "JsonSchema"
4558
4537
  },
4559
4538
  "__schema2": {
4539
+ "ref": "JsonValue",
4560
4540
  "anyOf": [
4561
4541
  {
4562
4542
  "type": "string"
@@ -4586,68 +4566,6 @@
4586
4566
  }
4587
4567
  }
4588
4568
  ]
4589
- },
4590
- "__schema3": {
4591
- "anyOf": [
4592
- {
4593
- "type": "string"
4594
- },
4595
- {
4596
- "type": "number"
4597
- },
4598
- {
4599
- "type": "boolean"
4600
- },
4601
- {
4602
- "type": "null"
4603
- },
4604
- {
4605
- "type": "array",
4606
- "items": {
4607
- "$ref": "#/$defs/__schema3"
4608
- }
4609
- },
4610
- {
4611
- "type": "object",
4612
- "propertyNames": {
4613
- "type": "string"
4614
- },
4615
- "additionalProperties": {
4616
- "$ref": "#/$defs/__schema3"
4617
- }
4618
- }
4619
- ]
4620
- },
4621
- "__schema4": {
4622
- "anyOf": [
4623
- {
4624
- "type": "string"
4625
- },
4626
- {
4627
- "type": "number"
4628
- },
4629
- {
4630
- "type": "boolean"
4631
- },
4632
- {
4633
- "type": "null"
4634
- },
4635
- {
4636
- "type": "array",
4637
- "items": {
4638
- "$ref": "#/$defs/__schema4"
4639
- }
4640
- },
4641
- {
4642
- "type": "object",
4643
- "propertyNames": {
4644
- "type": "string"
4645
- },
4646
- "additionalProperties": {
4647
- "$ref": "#/$defs/__schema4"
4648
- }
4649
- }
4650
- ]
4651
4569
  }
4652
4570
  }
4653
4571
  }
@@ -108,12 +108,21 @@ const playwrightSpecifier = (resolveFrom: string | undefined): string => {
108
108
  }
109
109
  };
110
110
 
111
+ export const TASK_UI_IGNORE_CERTIFICATE_ERRORS_ENV = "TOLOKA_TASK_UI_IGNORE_CERTIFICATE_ERRORS";
112
+
113
+ export const taskUiBrowserLaunchOptions = (
114
+ environment: NodeJS.ProcessEnv = process.env,
115
+ ): Parameters<typeof Playwright.chromium.launch>[0] => ({
116
+ headless: true,
117
+ args: environment[TASK_UI_IGNORE_CERTIFICATE_ERRORS_ENV] === "1" ? ["--ignore-certificate-errors"] : [],
118
+ });
119
+
111
120
  export const launchDefaultBrowser = async ({
112
121
  resolveFrom,
113
122
  }: { resolveFrom?: string } = {}): Promise<Browser> => {
114
123
  try {
115
124
  const { chromium }: typeof Playwright = await import(playwrightSpecifier(resolveFrom));
116
- return await chromium.launch({ headless: true });
125
+ return await chromium.launch(taskUiBrowserLaunchOptions());
117
126
  } catch (error) {
118
127
  throw new TaskUiInfrastructureError(
119
128
  "Local Task UI testing requires Playwright and Chromium. Run `bun add --dev playwright vitest` and `bunx playwright install chromium`.",