@getsupervisor/agents-studio-sdk 1.40.0 → 1.41.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/CHANGELOG.md +77 -0
- package/README.md +22 -0
- package/dist/index.cjs +129 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -14
- package/dist/index.d.ts +87 -14
- package/dist/index.js +128 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -245,7 +245,7 @@ type components = {
|
|
|
245
245
|
criticalRules?: string[];
|
|
246
246
|
topicsAllowed?: string[];
|
|
247
247
|
topicsForbidden?: string[];
|
|
248
|
-
contentHash
|
|
248
|
+
contentHash: string | null;
|
|
249
249
|
contentVariables: string[];
|
|
250
250
|
variablesCache: string[];
|
|
251
251
|
createdAt: string;
|
|
@@ -306,7 +306,7 @@ type components = {
|
|
|
306
306
|
metadata?: {
|
|
307
307
|
[key: string]: unknown;
|
|
308
308
|
} | null;
|
|
309
|
-
contentHash
|
|
309
|
+
contentHash: string | null;
|
|
310
310
|
variables: string[];
|
|
311
311
|
createdAt: string;
|
|
312
312
|
updatedAt: string;
|
|
@@ -609,6 +609,45 @@ type components = {
|
|
|
609
609
|
UpdateEventSubscriptionRequest: {
|
|
610
610
|
isActive?: boolean;
|
|
611
611
|
};
|
|
612
|
+
Campaign: {
|
|
613
|
+
campaignId: string;
|
|
614
|
+
workspaceId: string;
|
|
615
|
+
agentId: string;
|
|
616
|
+
agentVersionId: string;
|
|
617
|
+
name: string;
|
|
618
|
+
objective?: string | null;
|
|
619
|
+
status: components['schemas']['CampaignStatus'];
|
|
620
|
+
inputFileKey: string;
|
|
621
|
+
totalRecords: number;
|
|
622
|
+
processedRecords: number;
|
|
623
|
+
successfulRecords: number;
|
|
624
|
+
failedRecords: number;
|
|
625
|
+
createdAt: string;
|
|
626
|
+
updatedAt: string;
|
|
627
|
+
startedAt?: string | null;
|
|
628
|
+
completedAt?: string | null;
|
|
629
|
+
};
|
|
630
|
+
CampaignListResponse: {
|
|
631
|
+
data: components['schemas']['Campaign'][];
|
|
632
|
+
meta: components['schemas']['PaginationMeta'];
|
|
633
|
+
};
|
|
634
|
+
CampaignExecution: {
|
|
635
|
+
campaignExecutionId: string;
|
|
636
|
+
campaignId: string;
|
|
637
|
+
rowNumber: number;
|
|
638
|
+
status: 'PENDING' | 'SUCCESS' | 'ERROR';
|
|
639
|
+
agentExecutionId?: string | null;
|
|
640
|
+
inputData: {
|
|
641
|
+
[key: string]: unknown;
|
|
642
|
+
};
|
|
643
|
+
errorMessage?: string | null;
|
|
644
|
+
createdAt: string;
|
|
645
|
+
};
|
|
646
|
+
CampaignExecutionListResponse: {
|
|
647
|
+
data: components['schemas']['CampaignExecution'][];
|
|
648
|
+
meta: components['schemas']['PaginationMeta'];
|
|
649
|
+
};
|
|
650
|
+
CampaignStatus: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PARTIALLY_COMPLETED';
|
|
612
651
|
ForkAgentFromTemplateRequest: {
|
|
613
652
|
templateId: string;
|
|
614
653
|
templateVersionId?: string;
|
|
@@ -712,6 +751,7 @@ type components = {
|
|
|
712
751
|
TagId: string;
|
|
713
752
|
StageId: string;
|
|
714
753
|
TriggerId: string;
|
|
754
|
+
CampaignId: string;
|
|
715
755
|
WorkspaceId: string;
|
|
716
756
|
ToolId: string;
|
|
717
757
|
ResourceId: string;
|
|
@@ -986,6 +1026,11 @@ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
|
|
|
986
1026
|
type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
|
|
987
1027
|
type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
|
|
988
1028
|
type ErrorResponse = components['schemas']['ErrorResponse'];
|
|
1029
|
+
type CampaignStatus = components['schemas']['CampaignStatus'];
|
|
1030
|
+
type Campaign = components['schemas']['Campaign'];
|
|
1031
|
+
type CampaignListResponse = components['schemas']['CampaignListResponse'];
|
|
1032
|
+
type CampaignExecution = components['schemas']['CampaignExecution'];
|
|
1033
|
+
type CampaignExecutionListResponse = components['schemas']['CampaignExecutionListResponse'];
|
|
989
1034
|
type WebhookSummary = components['schemas']['WebhookSummary'];
|
|
990
1035
|
type WebhookDetail = components['schemas']['WebhookDetail'];
|
|
991
1036
|
type WebhookListResponse = components['schemas']['WebhookListResponse'];
|
|
@@ -1039,17 +1084,6 @@ declare function createAgentPhonesApi(cfg: ClientConfig & {
|
|
|
1039
1084
|
disconnect(agentId: string, phoneId: string): Promise<void>;
|
|
1040
1085
|
};
|
|
1041
1086
|
|
|
1042
|
-
type ListAgentScheduleExceptionsOptions = ListQueryOptions;
|
|
1043
|
-
declare function createAgentScheduleExceptionsApi(cfg: ClientConfig & {
|
|
1044
|
-
retry?: RetryPolicy;
|
|
1045
|
-
}): {
|
|
1046
|
-
list(agentId: string, options?: ListAgentScheduleExceptionsOptions): Promise<PaginatedResult<AgentScheduleExceptionListResponse, ListAgentScheduleExceptionsOptions>>;
|
|
1047
|
-
get(agentId: string, exceptionId: string): Promise<AgentScheduleException>;
|
|
1048
|
-
create(agentId: string, payload: CreateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1049
|
-
update(agentId: string, exceptionId: string, payload: UpdateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1050
|
-
delete(agentId: string, exceptionId: string): Promise<void>;
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
1087
|
type ListAgentSchedulesOptions = ListQueryOptions;
|
|
1054
1088
|
type AgentScheduleApi = {
|
|
1055
1089
|
list(agentId: string, options?: ListAgentSchedulesOptions): Promise<PaginatedResult<AgentScheduleListResponse, ListAgentSchedulesOptions>>;
|
|
@@ -1061,6 +1095,17 @@ declare function createAgentScheduleApi(cfg: ClientConfig & {
|
|
|
1061
1095
|
retry?: RetryPolicy;
|
|
1062
1096
|
}): AgentScheduleApi;
|
|
1063
1097
|
|
|
1098
|
+
type ListAgentScheduleExceptionsOptions = ListQueryOptions;
|
|
1099
|
+
declare function createAgentScheduleExceptionsApi(cfg: ClientConfig & {
|
|
1100
|
+
retry?: RetryPolicy;
|
|
1101
|
+
}): {
|
|
1102
|
+
list(agentId: string, options?: ListAgentScheduleExceptionsOptions): Promise<PaginatedResult<AgentScheduleExceptionListResponse, ListAgentScheduleExceptionsOptions>>;
|
|
1103
|
+
get(agentId: string, exceptionId: string): Promise<AgentScheduleException>;
|
|
1104
|
+
create(agentId: string, payload: CreateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1105
|
+
update(agentId: string, exceptionId: string, payload: UpdateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1106
|
+
delete(agentId: string, exceptionId: string): Promise<void>;
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1064
1109
|
type ListAgentStageTriggersOptions = ListQueryOptions;
|
|
1065
1110
|
type AgentStageTriggersApi$1 = {
|
|
1066
1111
|
list(agentId: string, blueprintId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
@@ -1560,6 +1605,22 @@ declare function createApiKeysApi(cfg: ClientConfig & {
|
|
|
1560
1605
|
retry?: RetryPolicy;
|
|
1561
1606
|
}): ApiKeysApi;
|
|
1562
1607
|
|
|
1608
|
+
type ListCampaignsOptions = ListQueryOptions;
|
|
1609
|
+
type ListCampaignExecutionsOptions = Pick<ListQueryOptions, 'page' | 'limit'>;
|
|
1610
|
+
type CreateCampaignPayload = {
|
|
1611
|
+
name: string;
|
|
1612
|
+
file: unknown;
|
|
1613
|
+
objective?: string | null;
|
|
1614
|
+
} | FormData;
|
|
1615
|
+
declare function createCampaignsApi(cfg: ClientConfig & {
|
|
1616
|
+
retry?: RetryPolicy;
|
|
1617
|
+
}): {
|
|
1618
|
+
list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
|
|
1619
|
+
get(campaignId: string): Promise<Campaign>;
|
|
1620
|
+
create(agentId: string, versionId: string, payload: CreateCampaignPayload): Promise<Campaign>;
|
|
1621
|
+
listExecutions(campaignId: string, options?: ListCampaignExecutionsOptions): Promise<PaginatedResult<CampaignExecutionListResponse, ListCampaignExecutionsOptions>>;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1563
1624
|
type ListCatalogTemplatesOptions = {
|
|
1564
1625
|
visibility?: CatalogTemplateVisibility;
|
|
1565
1626
|
tags?: string[];
|
|
@@ -1770,6 +1831,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1770
1831
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1771
1832
|
remove(itemId: string): Promise<void>;
|
|
1772
1833
|
};
|
|
1834
|
+
campaigns: {
|
|
1835
|
+
list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
|
|
1836
|
+
get(campaignId: string): Promise<Campaign>;
|
|
1837
|
+
create(agentId: string, versionId: string, payload: CreateCampaignPayload): Promise<Campaign>;
|
|
1838
|
+
listExecutions(campaignId: string, options?: ListCampaignExecutionsOptions): Promise<PaginatedResult<CampaignExecutionListResponse, ListCampaignExecutionsOptions>>;
|
|
1839
|
+
};
|
|
1773
1840
|
voices: {
|
|
1774
1841
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1775
1842
|
};
|
|
@@ -1877,6 +1944,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1877
1944
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1878
1945
|
remove(itemId: string): Promise<void>;
|
|
1879
1946
|
};
|
|
1947
|
+
campaigns: {
|
|
1948
|
+
list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
|
|
1949
|
+
get(campaignId: string): Promise<Campaign>;
|
|
1950
|
+
create(agentId: string, versionId: string, payload: CreateCampaignPayload): Promise<Campaign>;
|
|
1951
|
+
listExecutions(campaignId: string, options?: ListCampaignExecutionsOptions): Promise<PaginatedResult<CampaignExecutionListResponse, ListCampaignExecutionsOptions>>;
|
|
1952
|
+
};
|
|
1880
1953
|
voices: {
|
|
1881
1954
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1882
1955
|
};
|
|
@@ -1918,4 +1991,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
1918
1991
|
resolveAccessToken: () => string;
|
|
1919
1992
|
};
|
|
1920
1993
|
|
|
1921
|
-
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, TimeoutError, type ToolConnectionAuth, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
|
|
1994
|
+
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, TimeoutError, type ToolConnectionAuth, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -245,7 +245,7 @@ type components = {
|
|
|
245
245
|
criticalRules?: string[];
|
|
246
246
|
topicsAllowed?: string[];
|
|
247
247
|
topicsForbidden?: string[];
|
|
248
|
-
contentHash
|
|
248
|
+
contentHash: string | null;
|
|
249
249
|
contentVariables: string[];
|
|
250
250
|
variablesCache: string[];
|
|
251
251
|
createdAt: string;
|
|
@@ -306,7 +306,7 @@ type components = {
|
|
|
306
306
|
metadata?: {
|
|
307
307
|
[key: string]: unknown;
|
|
308
308
|
} | null;
|
|
309
|
-
contentHash
|
|
309
|
+
contentHash: string | null;
|
|
310
310
|
variables: string[];
|
|
311
311
|
createdAt: string;
|
|
312
312
|
updatedAt: string;
|
|
@@ -609,6 +609,45 @@ type components = {
|
|
|
609
609
|
UpdateEventSubscriptionRequest: {
|
|
610
610
|
isActive?: boolean;
|
|
611
611
|
};
|
|
612
|
+
Campaign: {
|
|
613
|
+
campaignId: string;
|
|
614
|
+
workspaceId: string;
|
|
615
|
+
agentId: string;
|
|
616
|
+
agentVersionId: string;
|
|
617
|
+
name: string;
|
|
618
|
+
objective?: string | null;
|
|
619
|
+
status: components['schemas']['CampaignStatus'];
|
|
620
|
+
inputFileKey: string;
|
|
621
|
+
totalRecords: number;
|
|
622
|
+
processedRecords: number;
|
|
623
|
+
successfulRecords: number;
|
|
624
|
+
failedRecords: number;
|
|
625
|
+
createdAt: string;
|
|
626
|
+
updatedAt: string;
|
|
627
|
+
startedAt?: string | null;
|
|
628
|
+
completedAt?: string | null;
|
|
629
|
+
};
|
|
630
|
+
CampaignListResponse: {
|
|
631
|
+
data: components['schemas']['Campaign'][];
|
|
632
|
+
meta: components['schemas']['PaginationMeta'];
|
|
633
|
+
};
|
|
634
|
+
CampaignExecution: {
|
|
635
|
+
campaignExecutionId: string;
|
|
636
|
+
campaignId: string;
|
|
637
|
+
rowNumber: number;
|
|
638
|
+
status: 'PENDING' | 'SUCCESS' | 'ERROR';
|
|
639
|
+
agentExecutionId?: string | null;
|
|
640
|
+
inputData: {
|
|
641
|
+
[key: string]: unknown;
|
|
642
|
+
};
|
|
643
|
+
errorMessage?: string | null;
|
|
644
|
+
createdAt: string;
|
|
645
|
+
};
|
|
646
|
+
CampaignExecutionListResponse: {
|
|
647
|
+
data: components['schemas']['CampaignExecution'][];
|
|
648
|
+
meta: components['schemas']['PaginationMeta'];
|
|
649
|
+
};
|
|
650
|
+
CampaignStatus: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PARTIALLY_COMPLETED';
|
|
612
651
|
ForkAgentFromTemplateRequest: {
|
|
613
652
|
templateId: string;
|
|
614
653
|
templateVersionId?: string;
|
|
@@ -712,6 +751,7 @@ type components = {
|
|
|
712
751
|
TagId: string;
|
|
713
752
|
StageId: string;
|
|
714
753
|
TriggerId: string;
|
|
754
|
+
CampaignId: string;
|
|
715
755
|
WorkspaceId: string;
|
|
716
756
|
ToolId: string;
|
|
717
757
|
ResourceId: string;
|
|
@@ -986,6 +1026,11 @@ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
|
|
|
986
1026
|
type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
|
|
987
1027
|
type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
|
|
988
1028
|
type ErrorResponse = components['schemas']['ErrorResponse'];
|
|
1029
|
+
type CampaignStatus = components['schemas']['CampaignStatus'];
|
|
1030
|
+
type Campaign = components['schemas']['Campaign'];
|
|
1031
|
+
type CampaignListResponse = components['schemas']['CampaignListResponse'];
|
|
1032
|
+
type CampaignExecution = components['schemas']['CampaignExecution'];
|
|
1033
|
+
type CampaignExecutionListResponse = components['schemas']['CampaignExecutionListResponse'];
|
|
989
1034
|
type WebhookSummary = components['schemas']['WebhookSummary'];
|
|
990
1035
|
type WebhookDetail = components['schemas']['WebhookDetail'];
|
|
991
1036
|
type WebhookListResponse = components['schemas']['WebhookListResponse'];
|
|
@@ -1039,17 +1084,6 @@ declare function createAgentPhonesApi(cfg: ClientConfig & {
|
|
|
1039
1084
|
disconnect(agentId: string, phoneId: string): Promise<void>;
|
|
1040
1085
|
};
|
|
1041
1086
|
|
|
1042
|
-
type ListAgentScheduleExceptionsOptions = ListQueryOptions;
|
|
1043
|
-
declare function createAgentScheduleExceptionsApi(cfg: ClientConfig & {
|
|
1044
|
-
retry?: RetryPolicy;
|
|
1045
|
-
}): {
|
|
1046
|
-
list(agentId: string, options?: ListAgentScheduleExceptionsOptions): Promise<PaginatedResult<AgentScheduleExceptionListResponse, ListAgentScheduleExceptionsOptions>>;
|
|
1047
|
-
get(agentId: string, exceptionId: string): Promise<AgentScheduleException>;
|
|
1048
|
-
create(agentId: string, payload: CreateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1049
|
-
update(agentId: string, exceptionId: string, payload: UpdateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1050
|
-
delete(agentId: string, exceptionId: string): Promise<void>;
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
1087
|
type ListAgentSchedulesOptions = ListQueryOptions;
|
|
1054
1088
|
type AgentScheduleApi = {
|
|
1055
1089
|
list(agentId: string, options?: ListAgentSchedulesOptions): Promise<PaginatedResult<AgentScheduleListResponse, ListAgentSchedulesOptions>>;
|
|
@@ -1061,6 +1095,17 @@ declare function createAgentScheduleApi(cfg: ClientConfig & {
|
|
|
1061
1095
|
retry?: RetryPolicy;
|
|
1062
1096
|
}): AgentScheduleApi;
|
|
1063
1097
|
|
|
1098
|
+
type ListAgentScheduleExceptionsOptions = ListQueryOptions;
|
|
1099
|
+
declare function createAgentScheduleExceptionsApi(cfg: ClientConfig & {
|
|
1100
|
+
retry?: RetryPolicy;
|
|
1101
|
+
}): {
|
|
1102
|
+
list(agentId: string, options?: ListAgentScheduleExceptionsOptions): Promise<PaginatedResult<AgentScheduleExceptionListResponse, ListAgentScheduleExceptionsOptions>>;
|
|
1103
|
+
get(agentId: string, exceptionId: string): Promise<AgentScheduleException>;
|
|
1104
|
+
create(agentId: string, payload: CreateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1105
|
+
update(agentId: string, exceptionId: string, payload: UpdateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1106
|
+
delete(agentId: string, exceptionId: string): Promise<void>;
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1064
1109
|
type ListAgentStageTriggersOptions = ListQueryOptions;
|
|
1065
1110
|
type AgentStageTriggersApi$1 = {
|
|
1066
1111
|
list(agentId: string, blueprintId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
@@ -1560,6 +1605,22 @@ declare function createApiKeysApi(cfg: ClientConfig & {
|
|
|
1560
1605
|
retry?: RetryPolicy;
|
|
1561
1606
|
}): ApiKeysApi;
|
|
1562
1607
|
|
|
1608
|
+
type ListCampaignsOptions = ListQueryOptions;
|
|
1609
|
+
type ListCampaignExecutionsOptions = Pick<ListQueryOptions, 'page' | 'limit'>;
|
|
1610
|
+
type CreateCampaignPayload = {
|
|
1611
|
+
name: string;
|
|
1612
|
+
file: unknown;
|
|
1613
|
+
objective?: string | null;
|
|
1614
|
+
} | FormData;
|
|
1615
|
+
declare function createCampaignsApi(cfg: ClientConfig & {
|
|
1616
|
+
retry?: RetryPolicy;
|
|
1617
|
+
}): {
|
|
1618
|
+
list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
|
|
1619
|
+
get(campaignId: string): Promise<Campaign>;
|
|
1620
|
+
create(agentId: string, versionId: string, payload: CreateCampaignPayload): Promise<Campaign>;
|
|
1621
|
+
listExecutions(campaignId: string, options?: ListCampaignExecutionsOptions): Promise<PaginatedResult<CampaignExecutionListResponse, ListCampaignExecutionsOptions>>;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1563
1624
|
type ListCatalogTemplatesOptions = {
|
|
1564
1625
|
visibility?: CatalogTemplateVisibility;
|
|
1565
1626
|
tags?: string[];
|
|
@@ -1770,6 +1831,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1770
1831
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1771
1832
|
remove(itemId: string): Promise<void>;
|
|
1772
1833
|
};
|
|
1834
|
+
campaigns: {
|
|
1835
|
+
list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
|
|
1836
|
+
get(campaignId: string): Promise<Campaign>;
|
|
1837
|
+
create(agentId: string, versionId: string, payload: CreateCampaignPayload): Promise<Campaign>;
|
|
1838
|
+
listExecutions(campaignId: string, options?: ListCampaignExecutionsOptions): Promise<PaginatedResult<CampaignExecutionListResponse, ListCampaignExecutionsOptions>>;
|
|
1839
|
+
};
|
|
1773
1840
|
voices: {
|
|
1774
1841
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1775
1842
|
};
|
|
@@ -1877,6 +1944,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1877
1944
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1878
1945
|
remove(itemId: string): Promise<void>;
|
|
1879
1946
|
};
|
|
1947
|
+
campaigns: {
|
|
1948
|
+
list(options?: ListCampaignsOptions): Promise<PaginatedResult<CampaignListResponse, ListCampaignsOptions>>;
|
|
1949
|
+
get(campaignId: string): Promise<Campaign>;
|
|
1950
|
+
create(agentId: string, versionId: string, payload: CreateCampaignPayload): Promise<Campaign>;
|
|
1951
|
+
listExecutions(campaignId: string, options?: ListCampaignExecutionsOptions): Promise<PaginatedResult<CampaignExecutionListResponse, ListCampaignExecutionsOptions>>;
|
|
1952
|
+
};
|
|
1880
1953
|
voices: {
|
|
1881
1954
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1882
1955
|
};
|
|
@@ -1918,4 +1991,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
1918
1991
|
resolveAccessToken: () => string;
|
|
1919
1992
|
};
|
|
1920
1993
|
|
|
1921
|
-
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, TimeoutError, type ToolConnectionAuth, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
|
|
1994
|
+
export { type AgentBlueprint, type AgentBlueprintListItem, type AgentBlueprintListResponse, type AgentBlueprintsApi$1 as AgentBlueprintsApi, type AgentDetail, type AgentEntity, type AgentEntityFactoryOptions, type AgentListResponse, type AgentSchedule, type AgentScheduleApi, type AgentScheduleException, type AgentScheduleExceptionListResponse, type AgentScheduleListResponse, type AgentStageTriggersApi$1 as AgentStageTriggersApi, type AgentStagesApi$1 as AgentStagesApi, type AgentSummary, type AgentTagRequest, type AgentTagsResponse, type AgentVersionDetail, type AgentVersionListResponse, type AgentVersionSummary, type AgentsApi, type AgentsApiWithEntities, type ApiKeyListResponse, type ApiKeySummary, type ApiKeysApi, type BlueprintStage, type BlueprintStageListResponse, type BlueprintStageReorderRequest, type BlueprintStageTrigger, type BlueprintStageTriggerListResponse, type Campaign, type CampaignExecution, type CampaignExecutionListResponse, type CampaignListResponse, type CampaignStatus, type CatalogItemCreateRequest, type CatalogItemDetail, type CatalogItemLinks, type CatalogItemListResponse, type CatalogItemSummary, type CatalogTemplateDetail, type CatalogTemplateListResponse, type CatalogTemplateSummary, type CatalogTemplateVisibility, type ClientConfig, type ConnectPhoneRequest, type CreateAgentBlueprintRequest, type CreateAgentRequest, type CreateAgentScheduleExceptionRequest, type CreateAgentVersionRequest, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBlueprintStageRequest, type CreateBlueprintStageTriggerRequest, type CreateCampaignPayload, type CreateEventSubscriptionRequest, type CreateInstructionRequest, type CreateWebhookRequest, type ErrorResponse, type EventSubscriptionDetail, type EventSubscriptionListResponse, type EventSubscriptionSummary, type ExecuteToolRequest, type ExecuteToolResponse, type ForkAgentFromTemplateRequest, HttpError, type Instruction, type InstructionCreatedResponse, type InstructionListResponse, type ListAgentBlueprintsOptions, type ListAgentScheduleExceptionsOptions, type ListAgentSchedulesOptions, type ListAgentStageTriggersOptions, type ListAgentStagesOptions, type ListAgentVersionInstructionsOptions, type ListAgentVersionsOptions, type ListAgentsOptions, type ListCampaignExecutionsOptions, type ListCampaignsOptions, type ListCatalogItemsOptions, type ListCatalogTemplatesOptions, type ListQueryOptions, type ListToolResourcesOptions, type ListToolsOptions, type ListVoicesOptions, type ListWebhooksOptions, type ListWorkspacePhonesOptions, NetworkError, type PaginatedResult, type PaginationMeta, type PhoneAssignmentResponse, type PublishAgentVersionRequest, type QueryBuilderInput, type QueryBuilderSerializable, type QueryFilterOperators, type QueryFilters, type QueryOrGroups, type QueryValue, type RetryPolicy, TimeoutError, type ToolConnectionAuth, type ToolConnectionRequest, type ToolConnectionResponse, type ToolListResponse, type ToolResourceListResponse, type ToolResourceReloadResponse, type ToolResourceSummary, type ToolResourceUploadRequest, type ToolResourceUploadResponse, type ToolSummary, type UpdateAgentBlueprintRequest, type UpdateAgentRequest, type UpdateAgentScheduleExceptionRequest, type UpdateAgentScheduleRequest, type UpdateAgentVersionNotesRequest, type UpdateBlueprintStageRequest, type UpdateBlueprintStageTriggerRequest, type UpdateEventSubscriptionRequest, type UpdateInstructionRequest, type UpdateWebhookRequest, type VoiceListResponse, type VoiceSummary, type WebhookDetail, type WebhookListResponse, type WebhookSummary, type WorkspaceEnableRequest, type WorkspaceEnableResponse, type WorkspacePhone, type WorkspacePhoneChannel, type WorkspacePhonesResponse, bindAgentBlueprints, bindAgentPhones, bindAgentSchedule, bindAgentScheduleExceptions, bindAgentSchedules, bindAgentStageTriggers, bindAgentStages, bindAgentTags, bindAgentVersions, createAgentBlueprintsApi, createAgentEntity, createAgentPhonesApi, createAgentScheduleApi, createAgentScheduleExceptionsApi, createAgentStageTriggersApi, createAgentStagesApi, createAgentTagsApi, createAgentVersionsApi, createAgentsApi, createApiKeysApi, createCampaignsApi, createCatalogTemplatesApi, createCatalogsApi, createClient, createHttp, createToolsApi, createVoicesApi, createWebhooksApi, createWorkspacesApi };
|
package/dist/index.js
CHANGED
|
@@ -460,6 +460,56 @@ function attachPaginator(response, fetchPage, options) {
|
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
+
// src/api/agent-schedule.ts
|
|
464
|
+
function createAgentScheduleApi(cfg) {
|
|
465
|
+
const { base, doFetch } = createHttp(cfg);
|
|
466
|
+
const jsonHeaders = { "content-type": "application/json" };
|
|
467
|
+
const fetchSchedulesPage = async (agentId, options = {}) => {
|
|
468
|
+
const query = serializeListOptions({ ...options ?? {} });
|
|
469
|
+
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
470
|
+
method: "GET",
|
|
471
|
+
query
|
|
472
|
+
});
|
|
473
|
+
return res.json();
|
|
474
|
+
};
|
|
475
|
+
return {
|
|
476
|
+
async list(agentId, options = {}) {
|
|
477
|
+
const normalized = { ...options ?? {} };
|
|
478
|
+
const fetchPage = (pageOptions) => fetchSchedulesPage(agentId, pageOptions);
|
|
479
|
+
const response = await fetchPage(normalized);
|
|
480
|
+
return attachPaginator(response, fetchPage, normalized);
|
|
481
|
+
},
|
|
482
|
+
async get(agentId, scheduleId) {
|
|
483
|
+
const res = await doFetch(
|
|
484
|
+
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
485
|
+
{
|
|
486
|
+
method: "GET"
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
return res.json();
|
|
490
|
+
},
|
|
491
|
+
async create(agentId, payload) {
|
|
492
|
+
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
493
|
+
method: "POST",
|
|
494
|
+
headers: jsonHeaders,
|
|
495
|
+
body: JSON.stringify(payload)
|
|
496
|
+
});
|
|
497
|
+
return res.json();
|
|
498
|
+
},
|
|
499
|
+
async update(agentId, scheduleId, payload) {
|
|
500
|
+
const res = await doFetch(
|
|
501
|
+
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
502
|
+
{
|
|
503
|
+
method: "PUT",
|
|
504
|
+
headers: jsonHeaders,
|
|
505
|
+
body: JSON.stringify(payload)
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
return res.json();
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
463
513
|
// src/api/agent-schedule-exceptions.ts
|
|
464
514
|
function createAgentScheduleExceptionsApi(cfg) {
|
|
465
515
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -526,56 +576,6 @@ function createAgentScheduleExceptionsApi(cfg) {
|
|
|
526
576
|
};
|
|
527
577
|
}
|
|
528
578
|
|
|
529
|
-
// src/api/agent-schedule.ts
|
|
530
|
-
function createAgentScheduleApi(cfg) {
|
|
531
|
-
const { base, doFetch } = createHttp(cfg);
|
|
532
|
-
const jsonHeaders = { "content-type": "application/json" };
|
|
533
|
-
const fetchSchedulesPage = async (agentId, options = {}) => {
|
|
534
|
-
const query = serializeListOptions({ ...options ?? {} });
|
|
535
|
-
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
536
|
-
method: "GET",
|
|
537
|
-
query
|
|
538
|
-
});
|
|
539
|
-
return res.json();
|
|
540
|
-
};
|
|
541
|
-
return {
|
|
542
|
-
async list(agentId, options = {}) {
|
|
543
|
-
const normalized = { ...options ?? {} };
|
|
544
|
-
const fetchPage = (pageOptions) => fetchSchedulesPage(agentId, pageOptions);
|
|
545
|
-
const response = await fetchPage(normalized);
|
|
546
|
-
return attachPaginator(response, fetchPage, normalized);
|
|
547
|
-
},
|
|
548
|
-
async get(agentId, scheduleId) {
|
|
549
|
-
const res = await doFetch(
|
|
550
|
-
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
551
|
-
{
|
|
552
|
-
method: "GET"
|
|
553
|
-
}
|
|
554
|
-
);
|
|
555
|
-
return res.json();
|
|
556
|
-
},
|
|
557
|
-
async create(agentId, payload) {
|
|
558
|
-
const res = await doFetch(`${base}/agents/${agentId}/schedules`, {
|
|
559
|
-
method: "POST",
|
|
560
|
-
headers: jsonHeaders,
|
|
561
|
-
body: JSON.stringify(payload)
|
|
562
|
-
});
|
|
563
|
-
return res.json();
|
|
564
|
-
},
|
|
565
|
-
async update(agentId, scheduleId, payload) {
|
|
566
|
-
const res = await doFetch(
|
|
567
|
-
`${base}/agents/${agentId}/schedules/${scheduleId}`,
|
|
568
|
-
{
|
|
569
|
-
method: "PUT",
|
|
570
|
-
headers: jsonHeaders,
|
|
571
|
-
body: JSON.stringify(payload)
|
|
572
|
-
}
|
|
573
|
-
);
|
|
574
|
-
return res.json();
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
|
|
579
579
|
// src/api/agent-stage-triggers.ts
|
|
580
580
|
function createAgentStageTriggersApi(cfg) {
|
|
581
581
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -1244,6 +1244,82 @@ function createApiKeysApi(cfg) {
|
|
|
1244
1244
|
};
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
1247
|
+
// src/api/campaigns.ts
|
|
1248
|
+
function createCampaignsApi(cfg) {
|
|
1249
|
+
const { base, doFetch } = createHttp(cfg);
|
|
1250
|
+
const isFormData2 = (value) => {
|
|
1251
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
1252
|
+
};
|
|
1253
|
+
const fetchCampaignsPage = async (options = {}) => {
|
|
1254
|
+
const query = serializeListOptions(options ?? {});
|
|
1255
|
+
const res = await doFetch(`${base}/campaigns`, {
|
|
1256
|
+
method: "GET",
|
|
1257
|
+
query
|
|
1258
|
+
});
|
|
1259
|
+
return res.json();
|
|
1260
|
+
};
|
|
1261
|
+
const fetchExecutionsPage = async (campaignId, options = {}) => {
|
|
1262
|
+
const query = serializeListOptions({
|
|
1263
|
+
page: options.page,
|
|
1264
|
+
limit: options.limit
|
|
1265
|
+
});
|
|
1266
|
+
const res = await doFetch(`${base}/campaigns/${campaignId}/executions`, {
|
|
1267
|
+
method: "GET",
|
|
1268
|
+
query
|
|
1269
|
+
});
|
|
1270
|
+
return res.json();
|
|
1271
|
+
};
|
|
1272
|
+
const buildMultipart = (payload) => {
|
|
1273
|
+
if (isFormData2(payload)) {
|
|
1274
|
+
return payload;
|
|
1275
|
+
}
|
|
1276
|
+
if (typeof FormData === "undefined") {
|
|
1277
|
+
throw new TypeError(
|
|
1278
|
+
"FormData is not available in this environment. Pass a FormData instance instead."
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
const form = new FormData();
|
|
1282
|
+
form.append("name", payload.name);
|
|
1283
|
+
if (payload.objective !== void 0 && payload.objective !== null) {
|
|
1284
|
+
form.append("objective", payload.objective);
|
|
1285
|
+
}
|
|
1286
|
+
form.append("file", payload.file);
|
|
1287
|
+
return form;
|
|
1288
|
+
};
|
|
1289
|
+
return {
|
|
1290
|
+
async list(options = {}) {
|
|
1291
|
+
const normalizedOptions = { ...options ?? {} };
|
|
1292
|
+
const response = await fetchCampaignsPage(normalizedOptions);
|
|
1293
|
+
return attachPaginator(response, fetchCampaignsPage, normalizedOptions);
|
|
1294
|
+
},
|
|
1295
|
+
async get(campaignId) {
|
|
1296
|
+
const res = await doFetch(`${base}/campaigns/${campaignId}`, {
|
|
1297
|
+
method: "GET"
|
|
1298
|
+
});
|
|
1299
|
+
return res.json();
|
|
1300
|
+
},
|
|
1301
|
+
async create(agentId, versionId, payload) {
|
|
1302
|
+
const body = buildMultipart(payload);
|
|
1303
|
+
const res = await doFetch(
|
|
1304
|
+
`${base}/agents/${agentId}/versions/${versionId}/campaigns`,
|
|
1305
|
+
{
|
|
1306
|
+
method: "POST",
|
|
1307
|
+
body
|
|
1308
|
+
}
|
|
1309
|
+
);
|
|
1310
|
+
return res.json();
|
|
1311
|
+
},
|
|
1312
|
+
async listExecutions(campaignId, options = {}) {
|
|
1313
|
+
const normalizedOptions = {
|
|
1314
|
+
...options ?? {}
|
|
1315
|
+
};
|
|
1316
|
+
const response = await fetchExecutionsPage(campaignId, normalizedOptions);
|
|
1317
|
+
const fetchPage = (opts) => fetchExecutionsPage(campaignId, opts);
|
|
1318
|
+
return attachPaginator(response, fetchPage, normalizedOptions);
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1247
1323
|
// src/api/catalog-templates.ts
|
|
1248
1324
|
function createCatalogTemplatesApi(cfg) {
|
|
1249
1325
|
const { base, doFetch } = createHttp(cfg);
|
|
@@ -1900,6 +1976,7 @@ function createClient(initialCfg) {
|
|
|
1900
1976
|
...catalogsApi,
|
|
1901
1977
|
templates: catalogTemplatesApi
|
|
1902
1978
|
},
|
|
1979
|
+
campaigns: createCampaignsApi(runtimeCfg),
|
|
1903
1980
|
voices: voicesApi,
|
|
1904
1981
|
apiKeys: apiKeysApi,
|
|
1905
1982
|
webhooks: webhooksApi
|
|
@@ -1983,6 +2060,7 @@ export {
|
|
|
1983
2060
|
createAgentVersionsApi,
|
|
1984
2061
|
createAgentsApi,
|
|
1985
2062
|
createApiKeysApi,
|
|
2063
|
+
createCampaignsApi,
|
|
1986
2064
|
createCatalogTemplatesApi,
|
|
1987
2065
|
createCatalogsApi,
|
|
1988
2066
|
createClient,
|