@toloka-platform/sdk 0.19.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/toloka.js +155 -153
- package/dist/cli/toloka.js.jsc +0 -0
- package/dist/cli/toloka.js.jsc.sha256 +1 -1
- package/dist/cli/toloka.js.sha256 +1 -1
- package/openapi/gen/api.schemas.ts +130 -0
- package/openapi/gen/api.ts +354 -0
- package/package.json +2 -2
- package/skills/catalog.json +6 -6
- package/skills/toloka-build/references/human-work.md +11 -0
- package/src/cli/commands/expert-ban-list.ts +69 -0
- package/src/cli/commands/expert-list.ts +124 -0
- package/src/cli/experts.ts +293 -0
- package/src/cli/program.ts +4 -0
- package/src/cli/project.ts +30 -1
- package/src/client.ts +43 -0
- package/src/pipeline-graph-v1.contract.json +64 -48
package/dist/cli/toloka.js.jsc
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
b0a1b6198d423d3992490960410aff79c8e31c9496a22e4783cf32b9656d89cb toloka.js.jsc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0196ccf913664169c118176958d7aa21465d3f464956d67644e9ea9048ef3490 toloka.js
|
|
@@ -824,6 +824,60 @@ export interface Specialization {
|
|
|
824
824
|
expertsCount: number;
|
|
825
825
|
}
|
|
826
826
|
|
|
827
|
+
export interface ExpertList {
|
|
828
|
+
id: string;
|
|
829
|
+
projectId: ProjectId;
|
|
830
|
+
name: string;
|
|
831
|
+
hidden: boolean;
|
|
832
|
+
expertCount: number;
|
|
833
|
+
createdAt: string;
|
|
834
|
+
updatedAt: string;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export interface ExpertListStats {
|
|
838
|
+
available: number;
|
|
839
|
+
pending: number;
|
|
840
|
+
unavailable: number;
|
|
841
|
+
notFound: number;
|
|
842
|
+
banned: number;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
export interface ExpertListDetails {
|
|
846
|
+
id: string;
|
|
847
|
+
projectId: ProjectId;
|
|
848
|
+
name: string;
|
|
849
|
+
hidden: boolean;
|
|
850
|
+
expertCount: number;
|
|
851
|
+
createdAt: string;
|
|
852
|
+
updatedAt: string;
|
|
853
|
+
stats: ExpertListStats;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export interface ExpertChangeResult {
|
|
857
|
+
changedCount: number;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
export type ExpertBanListDetailsStats = {
|
|
861
|
+
pending: number;
|
|
862
|
+
banned: number;
|
|
863
|
+
notFound: number;
|
|
864
|
+
unbanning: number;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
export interface ExpertBanListDetails {
|
|
868
|
+
projectId: ProjectId;
|
|
869
|
+
expertCount: number;
|
|
870
|
+
stats: ExpertBanListDetailsStats;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
export type ExpertBanListExpertStatus = 'pending' | 'banned' | 'not_found' | 'unbanning' | 'unbanned';
|
|
874
|
+
export interface ExpertBanListExpert {
|
|
875
|
+
expertId: string;
|
|
876
|
+
reason: string;
|
|
877
|
+
status: ExpertBanListExpertStatus;
|
|
878
|
+
createdAt: string;
|
|
879
|
+
}
|
|
880
|
+
|
|
827
881
|
export type GenerationBudgetReasoningEffort = 'low' | 'medium' | 'high';
|
|
828
882
|
export interface GenerationBudget {
|
|
829
883
|
reasoningEffort?: GenerationBudgetReasoningEffort;
|
|
@@ -1556,10 +1610,12 @@ export type PipelineGraphSnapshotGraphNodesItem = {
|
|
|
1556
1610
|
qaMode: 'human_only';
|
|
1557
1611
|
smartSamplingPercent?: number;
|
|
1558
1612
|
humanQaTimeForTask?: number;
|
|
1613
|
+
expertListId?: string | null;
|
|
1559
1614
|
} | {
|
|
1560
1615
|
qaMode: 'hybrid';
|
|
1561
1616
|
smartSamplingPercent?: number;
|
|
1562
1617
|
humanQaTimeForTask?: number;
|
|
1618
|
+
expertListId?: string | null;
|
|
1563
1619
|
llmQaModelId?: 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5' | 'gpt-5-mini' | 'claude-sonnet-4-6';
|
|
1564
1620
|
};
|
|
1565
1621
|
audienceAndPricing?: {
|
|
@@ -1587,6 +1643,7 @@ export type PipelineGraphSnapshotGraphNodesItem = {
|
|
|
1587
1643
|
timeForTask: number;
|
|
1588
1644
|
perExpertCapEnabled?: boolean;
|
|
1589
1645
|
perExpertCapValue?: number;
|
|
1646
|
+
expertListId?: string | null;
|
|
1590
1647
|
audienceType: 'human';
|
|
1591
1648
|
} | {
|
|
1592
1649
|
audienceType: 'synthetic';
|
|
@@ -1719,6 +1776,7 @@ export type PipelineGraphSnapshotGraphNodesItem = {
|
|
|
1719
1776
|
pipelineId: string;
|
|
1720
1777
|
nodeId: string;
|
|
1721
1778
|
} | null;
|
|
1779
|
+
audienceMode?: 'legacy' | 'service';
|
|
1722
1780
|
smartSearch?: {
|
|
1723
1781
|
briefDescription: string;
|
|
1724
1782
|
projectDescription: string | null;
|
|
@@ -1796,6 +1854,7 @@ export type PipelineGraphSnapshotGraphNodesItem = {
|
|
|
1796
1854
|
timeForTask: number;
|
|
1797
1855
|
perExpertCapEnabled?: boolean;
|
|
1798
1856
|
perExpertCapValue?: number;
|
|
1857
|
+
expertListId?: string | null;
|
|
1799
1858
|
audienceType: 'human';
|
|
1800
1859
|
};
|
|
1801
1860
|
entities: {
|
|
@@ -2056,6 +2115,7 @@ export type PipelineGraphSnapshotGraphNodesItem = {
|
|
|
2056
2115
|
pipelineId: string;
|
|
2057
2116
|
nodeId: string;
|
|
2058
2117
|
} | null;
|
|
2118
|
+
audienceMode?: 'legacy' | 'service';
|
|
2059
2119
|
smartSearch?: {
|
|
2060
2120
|
briefDescription: string;
|
|
2061
2121
|
projectDescription: string | null;
|
|
@@ -2610,6 +2670,7 @@ export interface CodeNode {
|
|
|
2610
2670
|
export type GenerationNodeSettingsAboutProjectType = 'general' | 'data_collection';
|
|
2611
2671
|
export type GenerationNodeSettingsExamGradedEntitiesItemMode = 'ground_truth' | 'quality_criteria' | 'not_graded';
|
|
2612
2672
|
export type GenerationNodeSettingsExamGradedEntitiesItemGroundTruthType = 'direct' | 'custom';
|
|
2673
|
+
export type GenerationNodeSettingsAudienceMode = 'legacy' | 'service';
|
|
2613
2674
|
export type GenerationNodeSettingsAbout = {
|
|
2614
2675
|
name: string;
|
|
2615
2676
|
description?: string;
|
|
@@ -2753,10 +2814,12 @@ export type GenerationNodeSettingsQualityAssurance = {
|
|
|
2753
2814
|
qaMode: 'human_only';
|
|
2754
2815
|
smartSamplingPercent?: number;
|
|
2755
2816
|
humanQaTimeForTask?: number;
|
|
2817
|
+
expertListId?: string | null;
|
|
2756
2818
|
} | {
|
|
2757
2819
|
qaMode: 'hybrid';
|
|
2758
2820
|
smartSamplingPercent?: number;
|
|
2759
2821
|
humanQaTimeForTask?: number;
|
|
2822
|
+
expertListId?: string | null;
|
|
2760
2823
|
llmQaModelId?: 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5' | 'gpt-5-mini' | 'claude-sonnet-4-6';
|
|
2761
2824
|
};
|
|
2762
2825
|
|
|
@@ -2785,6 +2848,7 @@ export type GenerationNodeSettingsAudienceAndPricing = {
|
|
|
2785
2848
|
timeForTask: number;
|
|
2786
2849
|
perExpertCapEnabled?: boolean;
|
|
2787
2850
|
perExpertCapValue?: number;
|
|
2851
|
+
expertListId?: string | null;
|
|
2788
2852
|
audienceType: 'human';
|
|
2789
2853
|
} | {
|
|
2790
2854
|
audienceType: 'synthetic';
|
|
@@ -2960,6 +3024,7 @@ export interface GenerationNodeSettings {
|
|
|
2960
3024
|
onboarding: GenerationNodeSettingsOnboarding;
|
|
2961
3025
|
exam?: GenerationNodeSettingsExam;
|
|
2962
3026
|
reuseAudienceWithNodeId?: GenerationNodeSettingsReuseAudienceWithNodeId;
|
|
3027
|
+
audienceMode?: GenerationNodeSettingsAudienceMode;
|
|
2963
3028
|
smartSearch?: GenerationNodeSettingsSmartSearch;
|
|
2964
3029
|
checks?: Partial<Record<'ui' | 'llmqa' | 'annotation_qa' | 'qc_lint' | 'ui_types_lint' | 'exam_dataset' | 'synthgen', GenerationNodeSettingsChecksItem[]>>;
|
|
2965
3030
|
}
|
|
@@ -3020,6 +3085,7 @@ export type QuorumNodeSettingsAudienceAndPricingAudienceCountriesType = 'or';
|
|
|
3020
3085
|
export type QuorumNodeSettingsOffboardingRulesItemType = 'mv_agreement';
|
|
3021
3086
|
export type QuorumNodeSettingsExamGradedEntitiesItemMode = 'ground_truth' | 'quality_criteria' | 'not_graded';
|
|
3022
3087
|
export type QuorumNodeSettingsExamGradedEntitiesItemGroundTruthType = 'direct' | 'custom';
|
|
3088
|
+
export type QuorumNodeSettingsAudienceMode = 'legacy' | 'service';
|
|
3023
3089
|
export type QuorumNodeSettingsAbout = {
|
|
3024
3090
|
name: string;
|
|
3025
3091
|
description?: string;
|
|
@@ -3063,6 +3129,7 @@ export type QuorumNodeSettingsAudienceAndPricing = {
|
|
|
3063
3129
|
timeForTask: number;
|
|
3064
3130
|
perExpertCapEnabled?: boolean;
|
|
3065
3131
|
perExpertCapValue?: number;
|
|
3132
|
+
expertListId?: string | null;
|
|
3066
3133
|
audienceType: 'human';
|
|
3067
3134
|
};
|
|
3068
3135
|
|
|
@@ -3377,6 +3444,7 @@ export interface QuorumNodeSettings {
|
|
|
3377
3444
|
onboarding: QuorumNodeSettingsOnboarding;
|
|
3378
3445
|
exam?: QuorumNodeSettingsExam;
|
|
3379
3446
|
reuseAudienceWithNodeId?: QuorumNodeSettingsReuseAudienceWithNodeId;
|
|
3447
|
+
audienceMode?: QuorumNodeSettingsAudienceMode;
|
|
3380
3448
|
smartSearch?: QuorumNodeSettingsSmartSearch;
|
|
3381
3449
|
checks?: Partial<Record<'ui' | 'llmqa' | 'annotation_qa' | 'qc_lint' | 'ui_types_lint' | 'exam_dataset', QuorumNodeSettingsChecksItem[]>>;
|
|
3382
3450
|
}
|
|
@@ -3490,6 +3558,62 @@ export type ListAudienceSpecializations200 = {
|
|
|
3490
3558
|
pagination: Pagination;
|
|
3491
3559
|
};
|
|
3492
3560
|
|
|
3561
|
+
export type ListExpertLists200 = {
|
|
3562
|
+
expertLists: ExpertList[];
|
|
3563
|
+
};
|
|
3564
|
+
|
|
3565
|
+
export type CreateExpertListBody = {
|
|
3566
|
+
name: string;
|
|
3567
|
+
};
|
|
3568
|
+
|
|
3569
|
+
export type UpdateExpertListBody = {
|
|
3570
|
+
name?: string;
|
|
3571
|
+
hidden?: boolean;
|
|
3572
|
+
};
|
|
3573
|
+
|
|
3574
|
+
export type ListExpertListExpertsParams = {
|
|
3575
|
+
after?: string;
|
|
3576
|
+
limit?: number;
|
|
3577
|
+
};
|
|
3578
|
+
|
|
3579
|
+
export type ListExpertListExperts200ExpertsItemStatus = 'pending' | 'available' | 'unavailable' | 'not_found' | 'banned';
|
|
3580
|
+
export type ListExpertListExperts200ExpertsItem = {
|
|
3581
|
+
expertId: string;
|
|
3582
|
+
status: ListExpertListExperts200ExpertsItemStatus;
|
|
3583
|
+
};
|
|
3584
|
+
|
|
3585
|
+
export type ListExpertListExperts200 = {
|
|
3586
|
+
experts: ListExpertListExperts200ExpertsItem[];
|
|
3587
|
+
nextAfter: string | null;
|
|
3588
|
+
};
|
|
3589
|
+
|
|
3590
|
+
export type AddExpertListExpertsBody = {
|
|
3591
|
+
expertIds: string[];
|
|
3592
|
+
};
|
|
3593
|
+
|
|
3594
|
+
export type RemoveExpertListExpertsBody = {
|
|
3595
|
+
expertIds: string[];
|
|
3596
|
+
};
|
|
3597
|
+
|
|
3598
|
+
export type ListExpertBanListExpertsParams = {
|
|
3599
|
+
after?: string;
|
|
3600
|
+
limit?: number;
|
|
3601
|
+
};
|
|
3602
|
+
|
|
3603
|
+
export type ListExpertBanListExperts200 = {
|
|
3604
|
+
experts: ExpertBanListExpert[];
|
|
3605
|
+
nextAfter: string | null;
|
|
3606
|
+
};
|
|
3607
|
+
|
|
3608
|
+
export type AddExpertBanListExpertsBody = {
|
|
3609
|
+
expertIds: string[];
|
|
3610
|
+
reason: string;
|
|
3611
|
+
};
|
|
3612
|
+
|
|
3613
|
+
export type RemoveExpertBanListExpertsBody = {
|
|
3614
|
+
expertIds: string[];
|
|
3615
|
+
};
|
|
3616
|
+
|
|
3493
3617
|
export type ListGenerationModels200DefaultGenerationModelId = 'gpt-5.4' | 'gpt-5.4-mini' | 'claude-sonnet-4-6' | 'gemini-3.1-pro-preview' | 'gemini-3.5-flash' | 'gemini-3.7-flash' | 'claude-sonnet-5' | 'claude-opus-5' | 'claude-fable-5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-5.6-sol';
|
|
3494
3618
|
export type ListGenerationModels200 = {
|
|
3495
3619
|
defaultGenerationModelId: ListGenerationModels200DefaultGenerationModelId;
|
|
@@ -4319,10 +4443,12 @@ export type ValidatePipelineGraphBodyGraphNodesItem = {
|
|
|
4319
4443
|
qaMode: 'human_only';
|
|
4320
4444
|
smartSamplingPercent?: number;
|
|
4321
4445
|
humanQaTimeForTask?: number;
|
|
4446
|
+
expertListId?: string | null;
|
|
4322
4447
|
} | {
|
|
4323
4448
|
qaMode: 'hybrid';
|
|
4324
4449
|
smartSamplingPercent?: number;
|
|
4325
4450
|
humanQaTimeForTask?: number;
|
|
4451
|
+
expertListId?: string | null;
|
|
4326
4452
|
llmQaModelId?: 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5' | 'gpt-5-mini' | 'claude-sonnet-4-6';
|
|
4327
4453
|
};
|
|
4328
4454
|
audienceAndPricing?: {
|
|
@@ -4350,6 +4476,7 @@ export type ValidatePipelineGraphBodyGraphNodesItem = {
|
|
|
4350
4476
|
timeForTask: number;
|
|
4351
4477
|
perExpertCapEnabled?: boolean;
|
|
4352
4478
|
perExpertCapValue?: number;
|
|
4479
|
+
expertListId?: string | null;
|
|
4353
4480
|
audienceType: 'human';
|
|
4354
4481
|
} | {
|
|
4355
4482
|
audienceType: 'synthetic';
|
|
@@ -4482,6 +4609,7 @@ export type ValidatePipelineGraphBodyGraphNodesItem = {
|
|
|
4482
4609
|
pipelineId: string;
|
|
4483
4610
|
nodeId: string;
|
|
4484
4611
|
} | null;
|
|
4612
|
+
audienceMode?: 'legacy' | 'service';
|
|
4485
4613
|
smartSearch?: {
|
|
4486
4614
|
briefDescription: string;
|
|
4487
4615
|
projectDescription: string | null;
|
|
@@ -4559,6 +4687,7 @@ export type ValidatePipelineGraphBodyGraphNodesItem = {
|
|
|
4559
4687
|
timeForTask: number;
|
|
4560
4688
|
perExpertCapEnabled?: boolean;
|
|
4561
4689
|
perExpertCapValue?: number;
|
|
4690
|
+
expertListId?: string | null;
|
|
4562
4691
|
audienceType: 'human';
|
|
4563
4692
|
};
|
|
4564
4693
|
entities: {
|
|
@@ -4819,6 +4948,7 @@ export type ValidatePipelineGraphBodyGraphNodesItem = {
|
|
|
4819
4948
|
pipelineId: string;
|
|
4820
4949
|
nodeId: string;
|
|
4821
4950
|
} | null;
|
|
4951
|
+
audienceMode?: 'legacy' | 'service';
|
|
4822
4952
|
smartSearch?: {
|
|
4823
4953
|
briefDescription: string;
|
|
4824
4954
|
projectDescription: string | null;
|
package/openapi/gen/api.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AddDatasetItems200,
|
|
3
3
|
AddDatasetItemsBody,
|
|
4
|
+
AddExpertBanListExpertsBody,
|
|
5
|
+
AddExpertListExpertsBody,
|
|
4
6
|
AttachPipelineDatasetBody,
|
|
5
7
|
BaseModel,
|
|
6
8
|
BaseModelId,
|
|
@@ -18,6 +20,7 @@ import type {
|
|
|
18
20
|
CreateDatasetSliceBody,
|
|
19
21
|
CreateDatasetUpload200,
|
|
20
22
|
CreateDatasetUploadBody,
|
|
23
|
+
CreateExpertListBody,
|
|
21
24
|
CreatePipelineCheckBody,
|
|
22
25
|
CreateProjectBody,
|
|
23
26
|
CreateProjectFileUpload200,
|
|
@@ -34,6 +37,10 @@ import type {
|
|
|
34
37
|
DatasetSlice,
|
|
35
38
|
EstimatePipelineCostBody,
|
|
36
39
|
EstimateTrainingCostBody,
|
|
40
|
+
ExpertBanListDetails,
|
|
41
|
+
ExpertChangeResult,
|
|
42
|
+
ExpertList,
|
|
43
|
+
ExpertListDetails,
|
|
37
44
|
ExportId,
|
|
38
45
|
ExportJob,
|
|
39
46
|
ExportPipeline200,
|
|
@@ -53,6 +60,11 @@ import type {
|
|
|
53
60
|
ListDatasetSlices200,
|
|
54
61
|
ListDatasetSlicesParams,
|
|
55
62
|
ListDeliveryOrders200,
|
|
63
|
+
ListExpertBanListExperts200,
|
|
64
|
+
ListExpertBanListExpertsParams,
|
|
65
|
+
ListExpertListExperts200,
|
|
66
|
+
ListExpertListExpertsParams,
|
|
67
|
+
ListExpertLists200,
|
|
56
68
|
ListGenerationModels200,
|
|
57
69
|
ListModelVersions200,
|
|
58
70
|
ListModelVersionsParams,
|
|
@@ -95,6 +107,8 @@ import type {
|
|
|
95
107
|
ProjectId,
|
|
96
108
|
ProjectSecret,
|
|
97
109
|
ProjectSecretName,
|
|
110
|
+
RemoveExpertBanListExpertsBody,
|
|
111
|
+
RemoveExpertListExpertsBody,
|
|
98
112
|
ReplacePipelineGraphBody,
|
|
99
113
|
ReplaceTrainingConfigurationBody,
|
|
100
114
|
RevokedScopedTokens,
|
|
@@ -119,6 +133,7 @@ import type {
|
|
|
119
133
|
TrainingRunLogs,
|
|
120
134
|
TrainingRunMetricHistory,
|
|
121
135
|
TrainingRunMetrics,
|
|
136
|
+
UpdateExpertListBody,
|
|
122
137
|
UpdatePipelineBody,
|
|
123
138
|
UpdateProjectBody,
|
|
124
139
|
UpdateTrainingMetadataBody,
|
|
@@ -828,6 +843,345 @@ export const listAudienceSpecializations = async (params?: ListAudienceSpecializ
|
|
|
828
843
|
|
|
829
844
|
|
|
830
845
|
|
|
846
|
+
export const getListExpertListsUrl = (projectId: ProjectId,) => {
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
return `/api/v2-beta/projects/${projectId}/expert-lists`
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
export const listExpertLists = async (projectId: ProjectId, options?: Parameters<typeof potatoFetch>[1]): Promise<ListExpertLists200> => {
|
|
855
|
+
|
|
856
|
+
return potatoFetch<ListExpertLists200>(getListExpertListsUrl(projectId),
|
|
857
|
+
{
|
|
858
|
+
...options,
|
|
859
|
+
method: 'GET'
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
}
|
|
863
|
+
);}
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
export const getCreateExpertListUrl = (projectId: ProjectId,) => {
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
return `/api/v2-beta/projects/${projectId}/expert-lists`
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
export const createExpertList = async (projectId: ProjectId,
|
|
876
|
+
createExpertListBody: CreateExpertListBody, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertList> => {
|
|
877
|
+
|
|
878
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
879
|
+
if (!h) return {};
|
|
880
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
881
|
+
if (Symbol.iterator in h) {
|
|
882
|
+
return Object.fromEntries(
|
|
883
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
887
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
888
|
+
if (value !== undefined) headers[name] = value;
|
|
889
|
+
}
|
|
890
|
+
return headers;
|
|
891
|
+
};
|
|
892
|
+
return potatoFetch<ExpertList>(getCreateExpertListUrl(projectId),
|
|
893
|
+
{
|
|
894
|
+
...options,
|
|
895
|
+
method: 'POST',
|
|
896
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
897
|
+
body: JSON.stringify(createExpertListBody)
|
|
898
|
+
}
|
|
899
|
+
);}
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
export const getGetExpertListUrl = (expertListId: string,) => {
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
return `/api/v2-beta/expert-lists/${expertListId}`
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export const getExpertList = async (expertListId: string, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertListDetails> => {
|
|
912
|
+
|
|
913
|
+
return potatoFetch<ExpertListDetails>(getGetExpertListUrl(expertListId),
|
|
914
|
+
{
|
|
915
|
+
...options,
|
|
916
|
+
method: 'GET'
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
}
|
|
920
|
+
);}
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
export const getUpdateExpertListUrl = (expertListId: string,) => {
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
return `/api/v2-beta/expert-lists/${expertListId}`
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export const updateExpertList = async (expertListId: string,
|
|
933
|
+
updateExpertListBody: UpdateExpertListBody, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertList> => {
|
|
934
|
+
|
|
935
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
936
|
+
if (!h) return {};
|
|
937
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
938
|
+
if (Symbol.iterator in h) {
|
|
939
|
+
return Object.fromEntries(
|
|
940
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
944
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
945
|
+
if (value !== undefined) headers[name] = value;
|
|
946
|
+
}
|
|
947
|
+
return headers;
|
|
948
|
+
};
|
|
949
|
+
return potatoFetch<ExpertList>(getUpdateExpertListUrl(expertListId),
|
|
950
|
+
{
|
|
951
|
+
...options,
|
|
952
|
+
method: 'PATCH',
|
|
953
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
954
|
+
body: JSON.stringify(updateExpertListBody)
|
|
955
|
+
}
|
|
956
|
+
);}
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
export const getListExpertListExpertsUrl = (expertListId: string,
|
|
961
|
+
params?: ListExpertListExpertsParams,) => {
|
|
962
|
+
const normalizedParams = new URLSearchParams();
|
|
963
|
+
|
|
964
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
965
|
+
|
|
966
|
+
if (value !== undefined) {
|
|
967
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
const stringifiedParams = normalizedParams.toString();
|
|
972
|
+
|
|
973
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/expert-lists/${expertListId}/experts?${stringifiedParams}` : `/api/v2-beta/expert-lists/${expertListId}/experts`
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
export const listExpertListExperts = async (expertListId: string,
|
|
977
|
+
params?: ListExpertListExpertsParams, options?: Parameters<typeof potatoFetch>[1]): Promise<ListExpertListExperts200> => {
|
|
978
|
+
|
|
979
|
+
return potatoFetch<ListExpertListExperts200>(getListExpertListExpertsUrl(expertListId,params),
|
|
980
|
+
{
|
|
981
|
+
...options,
|
|
982
|
+
method: 'GET'
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
}
|
|
986
|
+
);}
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
export const getAddExpertListExpertsUrl = (expertListId: string,) => {
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
return `/api/v2-beta/expert-lists/${expertListId}/experts/add`
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export const addExpertListExperts = async (expertListId: string,
|
|
999
|
+
addExpertListExpertsBody: AddExpertListExpertsBody, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertChangeResult> => {
|
|
1000
|
+
|
|
1001
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
1002
|
+
if (!h) return {};
|
|
1003
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
1004
|
+
if (Symbol.iterator in h) {
|
|
1005
|
+
return Object.fromEntries(
|
|
1006
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
1007
|
+
);
|
|
1008
|
+
}
|
|
1009
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
1010
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
1011
|
+
if (value !== undefined) headers[name] = value;
|
|
1012
|
+
}
|
|
1013
|
+
return headers;
|
|
1014
|
+
};
|
|
1015
|
+
return potatoFetch<ExpertChangeResult>(getAddExpertListExpertsUrl(expertListId),
|
|
1016
|
+
{
|
|
1017
|
+
...options,
|
|
1018
|
+
method: 'POST',
|
|
1019
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
1020
|
+
body: JSON.stringify(addExpertListExpertsBody)
|
|
1021
|
+
}
|
|
1022
|
+
);}
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
export const getRemoveExpertListExpertsUrl = (expertListId: string,) => {
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
return `/api/v2-beta/expert-lists/${expertListId}/experts/remove`
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
export const removeExpertListExperts = async (expertListId: string,
|
|
1035
|
+
removeExpertListExpertsBody: RemoveExpertListExpertsBody, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertChangeResult> => {
|
|
1036
|
+
|
|
1037
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
1038
|
+
if (!h) return {};
|
|
1039
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
1040
|
+
if (Symbol.iterator in h) {
|
|
1041
|
+
return Object.fromEntries(
|
|
1042
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
1046
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
1047
|
+
if (value !== undefined) headers[name] = value;
|
|
1048
|
+
}
|
|
1049
|
+
return headers;
|
|
1050
|
+
};
|
|
1051
|
+
return potatoFetch<ExpertChangeResult>(getRemoveExpertListExpertsUrl(expertListId),
|
|
1052
|
+
{
|
|
1053
|
+
...options,
|
|
1054
|
+
method: 'POST',
|
|
1055
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
1056
|
+
body: JSON.stringify(removeExpertListExpertsBody)
|
|
1057
|
+
}
|
|
1058
|
+
);}
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
export const getGetExpertBanListUrl = (projectId: ProjectId,) => {
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
return `/api/v2-beta/projects/${projectId}/expert-ban-list`
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
export const getExpertBanList = async (projectId: ProjectId, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertBanListDetails> => {
|
|
1071
|
+
|
|
1072
|
+
return potatoFetch<ExpertBanListDetails>(getGetExpertBanListUrl(projectId),
|
|
1073
|
+
{
|
|
1074
|
+
...options,
|
|
1075
|
+
method: 'GET'
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
}
|
|
1079
|
+
);}
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
export const getListExpertBanListExpertsUrl = (projectId: ProjectId,
|
|
1084
|
+
params?: ListExpertBanListExpertsParams,) => {
|
|
1085
|
+
const normalizedParams = new URLSearchParams();
|
|
1086
|
+
|
|
1087
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1088
|
+
|
|
1089
|
+
if (value !== undefined) {
|
|
1090
|
+
normalizedParams.append(key, value === null ? 'null' : String(value))
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1095
|
+
|
|
1096
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/expert-ban-list/experts?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/expert-ban-list/experts`
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
export const listExpertBanListExperts = async (projectId: ProjectId,
|
|
1100
|
+
params?: ListExpertBanListExpertsParams, options?: Parameters<typeof potatoFetch>[1]): Promise<ListExpertBanListExperts200> => {
|
|
1101
|
+
|
|
1102
|
+
return potatoFetch<ListExpertBanListExperts200>(getListExpertBanListExpertsUrl(projectId,params),
|
|
1103
|
+
{
|
|
1104
|
+
...options,
|
|
1105
|
+
method: 'GET'
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
}
|
|
1109
|
+
);}
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
export const getAddExpertBanListExpertsUrl = (projectId: ProjectId,) => {
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
return `/api/v2-beta/projects/${projectId}/expert-ban-list/experts/add`
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
export const addExpertBanListExperts = async (projectId: ProjectId,
|
|
1122
|
+
addExpertBanListExpertsBody: AddExpertBanListExpertsBody, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertChangeResult> => {
|
|
1123
|
+
|
|
1124
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
1125
|
+
if (!h) return {};
|
|
1126
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
1127
|
+
if (Symbol.iterator in h) {
|
|
1128
|
+
return Object.fromEntries(
|
|
1129
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
1133
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
1134
|
+
if (value !== undefined) headers[name] = value;
|
|
1135
|
+
}
|
|
1136
|
+
return headers;
|
|
1137
|
+
};
|
|
1138
|
+
return potatoFetch<ExpertChangeResult>(getAddExpertBanListExpertsUrl(projectId),
|
|
1139
|
+
{
|
|
1140
|
+
...options,
|
|
1141
|
+
method: 'POST',
|
|
1142
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
1143
|
+
body: JSON.stringify(addExpertBanListExpertsBody)
|
|
1144
|
+
}
|
|
1145
|
+
);}
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
export const getRemoveExpertBanListExpertsUrl = (projectId: ProjectId,) => {
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
return `/api/v2-beta/projects/${projectId}/expert-ban-list/experts/remove`
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
export const removeExpertBanListExperts = async (projectId: ProjectId,
|
|
1158
|
+
removeExpertBanListExpertsBody: RemoveExpertBanListExpertsBody, options?: Parameters<typeof potatoFetch>[1]): Promise<ExpertChangeResult> => {
|
|
1159
|
+
|
|
1160
|
+
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
|
1161
|
+
if (!h) return {};
|
|
1162
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
1163
|
+
if (Symbol.iterator in h) {
|
|
1164
|
+
return Object.fromEntries(
|
|
1165
|
+
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
const headers: Record<string, string | readonly string[]> = {};
|
|
1169
|
+
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
|
1170
|
+
if (value !== undefined) headers[name] = value;
|
|
1171
|
+
}
|
|
1172
|
+
return headers;
|
|
1173
|
+
};
|
|
1174
|
+
return potatoFetch<ExpertChangeResult>(getRemoveExpertBanListExpertsUrl(projectId),
|
|
1175
|
+
{
|
|
1176
|
+
...options,
|
|
1177
|
+
method: 'POST',
|
|
1178
|
+
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
|
|
1179
|
+
body: JSON.stringify(removeExpertBanListExpertsBody)
|
|
1180
|
+
}
|
|
1181
|
+
);}
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
|
|
831
1185
|
export const getListGenerationModelsUrl = () => {
|
|
832
1186
|
|
|
833
1187
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toloka-platform/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build, inspect, and operate Toloka pipeline projects as TypeScript source. The public API may change between minor versions before 1.0.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
"bun": ">=1.4.0"
|
|
79
79
|
},
|
|
80
80
|
"tolokaBuild": {
|
|
81
|
-
"commit": "
|
|
81
|
+
"commit": "f0d62dc526a8897f20a7b3082b966ac1955897a5"
|
|
82
82
|
}
|
|
83
83
|
}
|