@getsupervisor/agents-studio-sdk 1.38.0 → 1.39.0-patch.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.
- package/README.md +22 -0
- package/dist/index.cjs +129 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -12
- package/dist/index.d.ts +96 -12
- 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,6 +245,9 @@ type components = {
|
|
|
245
245
|
criticalRules?: string[];
|
|
246
246
|
topicsAllowed?: string[];
|
|
247
247
|
topicsForbidden?: string[];
|
|
248
|
+
contentHash: string | null;
|
|
249
|
+
contentVariables: string[];
|
|
250
|
+
variablesCache: string[];
|
|
248
251
|
createdAt: string;
|
|
249
252
|
updatedAt: string;
|
|
250
253
|
};
|
|
@@ -303,6 +306,8 @@ type components = {
|
|
|
303
306
|
metadata?: {
|
|
304
307
|
[key: string]: unknown;
|
|
305
308
|
} | null;
|
|
309
|
+
contentHash: string | null;
|
|
310
|
+
variables: string[];
|
|
306
311
|
createdAt: string;
|
|
307
312
|
updatedAt: string;
|
|
308
313
|
};
|
|
@@ -604,6 +609,45 @@ type components = {
|
|
|
604
609
|
UpdateEventSubscriptionRequest: {
|
|
605
610
|
isActive?: boolean;
|
|
606
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';
|
|
607
651
|
ForkAgentFromTemplateRequest: {
|
|
608
652
|
templateId: string;
|
|
609
653
|
templateVersionId?: string;
|
|
@@ -707,6 +751,7 @@ type components = {
|
|
|
707
751
|
TagId: string;
|
|
708
752
|
StageId: string;
|
|
709
753
|
TriggerId: string;
|
|
754
|
+
CampaignId: string;
|
|
710
755
|
WorkspaceId: string;
|
|
711
756
|
ToolId: string;
|
|
712
757
|
ResourceId: string;
|
|
@@ -890,11 +935,15 @@ type AgentBlueprint = {
|
|
|
890
935
|
personalityInitialGreeting: string;
|
|
891
936
|
personalityMessageStyleId: string;
|
|
892
937
|
personalityToneStyleId: string;
|
|
938
|
+
voiceId: string | null;
|
|
893
939
|
startSpeaker: 'user' | 'agent';
|
|
894
940
|
requiredData: string[];
|
|
895
941
|
criticalRules: string[];
|
|
896
942
|
topicsAllowed: string[];
|
|
897
943
|
topicsForbidden: string[];
|
|
944
|
+
contentHash: string | null;
|
|
945
|
+
contentVariables: string[];
|
|
946
|
+
variablesCache: string[];
|
|
898
947
|
createdAt: string;
|
|
899
948
|
updatedAt: string;
|
|
900
949
|
};
|
|
@@ -942,6 +991,8 @@ type BlueprintStageSchema = components['schemas']['BlueprintStage'];
|
|
|
942
991
|
type BlueprintStage = Omit<BlueprintStageSchema, 'prompt'> & {
|
|
943
992
|
goalPrompt: string;
|
|
944
993
|
promptInstructions: string[];
|
|
994
|
+
contentHash: string | null;
|
|
995
|
+
variables: string[];
|
|
945
996
|
};
|
|
946
997
|
type BlueprintStageListResponseSchema = components['schemas']['BlueprintStageListResponse'];
|
|
947
998
|
type BlueprintStageListResponse = Omit<BlueprintStageListResponseSchema, 'data'> & {
|
|
@@ -975,6 +1026,11 @@ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
|
|
|
975
1026
|
type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
|
|
976
1027
|
type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
|
|
977
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'];
|
|
978
1034
|
type WebhookSummary = components['schemas']['WebhookSummary'];
|
|
979
1035
|
type WebhookDetail = components['schemas']['WebhookDetail'];
|
|
980
1036
|
type WebhookListResponse = components['schemas']['WebhookListResponse'];
|
|
@@ -1028,17 +1084,6 @@ declare function createAgentPhonesApi(cfg: ClientConfig & {
|
|
|
1028
1084
|
disconnect(agentId: string, phoneId: string): Promise<void>;
|
|
1029
1085
|
};
|
|
1030
1086
|
|
|
1031
|
-
type ListAgentScheduleExceptionsOptions = ListQueryOptions;
|
|
1032
|
-
declare function createAgentScheduleExceptionsApi(cfg: ClientConfig & {
|
|
1033
|
-
retry?: RetryPolicy;
|
|
1034
|
-
}): {
|
|
1035
|
-
list(agentId: string, options?: ListAgentScheduleExceptionsOptions): Promise<PaginatedResult<AgentScheduleExceptionListResponse, ListAgentScheduleExceptionsOptions>>;
|
|
1036
|
-
get(agentId: string, exceptionId: string): Promise<AgentScheduleException>;
|
|
1037
|
-
create(agentId: string, payload: CreateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1038
|
-
update(agentId: string, exceptionId: string, payload: UpdateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1039
|
-
delete(agentId: string, exceptionId: string): Promise<void>;
|
|
1040
|
-
};
|
|
1041
|
-
|
|
1042
1087
|
type ListAgentSchedulesOptions = ListQueryOptions;
|
|
1043
1088
|
type AgentScheduleApi = {
|
|
1044
1089
|
list(agentId: string, options?: ListAgentSchedulesOptions): Promise<PaginatedResult<AgentScheduleListResponse, ListAgentSchedulesOptions>>;
|
|
@@ -1050,6 +1095,17 @@ declare function createAgentScheduleApi(cfg: ClientConfig & {
|
|
|
1050
1095
|
retry?: RetryPolicy;
|
|
1051
1096
|
}): AgentScheduleApi;
|
|
1052
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
|
+
|
|
1053
1109
|
type ListAgentStageTriggersOptions = ListQueryOptions;
|
|
1054
1110
|
type AgentStageTriggersApi$1 = {
|
|
1055
1111
|
list(agentId: string, blueprintId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
@@ -1549,6 +1605,22 @@ declare function createApiKeysApi(cfg: ClientConfig & {
|
|
|
1549
1605
|
retry?: RetryPolicy;
|
|
1550
1606
|
}): ApiKeysApi;
|
|
1551
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
|
+
|
|
1552
1624
|
type ListCatalogTemplatesOptions = {
|
|
1553
1625
|
visibility?: CatalogTemplateVisibility;
|
|
1554
1626
|
tags?: string[];
|
|
@@ -1759,6 +1831,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1759
1831
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1760
1832
|
remove(itemId: string): Promise<void>;
|
|
1761
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
|
+
};
|
|
1762
1840
|
voices: {
|
|
1763
1841
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1764
1842
|
};
|
|
@@ -1866,6 +1944,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1866
1944
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1867
1945
|
remove(itemId: string): Promise<void>;
|
|
1868
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
|
+
};
|
|
1869
1953
|
voices: {
|
|
1870
1954
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1871
1955
|
};
|
|
@@ -1907,4 +1991,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
1907
1991
|
resolveAccessToken: () => string;
|
|
1908
1992
|
};
|
|
1909
1993
|
|
|
1910
|
-
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,6 +245,9 @@ type components = {
|
|
|
245
245
|
criticalRules?: string[];
|
|
246
246
|
topicsAllowed?: string[];
|
|
247
247
|
topicsForbidden?: string[];
|
|
248
|
+
contentHash: string | null;
|
|
249
|
+
contentVariables: string[];
|
|
250
|
+
variablesCache: string[];
|
|
248
251
|
createdAt: string;
|
|
249
252
|
updatedAt: string;
|
|
250
253
|
};
|
|
@@ -303,6 +306,8 @@ type components = {
|
|
|
303
306
|
metadata?: {
|
|
304
307
|
[key: string]: unknown;
|
|
305
308
|
} | null;
|
|
309
|
+
contentHash: string | null;
|
|
310
|
+
variables: string[];
|
|
306
311
|
createdAt: string;
|
|
307
312
|
updatedAt: string;
|
|
308
313
|
};
|
|
@@ -604,6 +609,45 @@ type components = {
|
|
|
604
609
|
UpdateEventSubscriptionRequest: {
|
|
605
610
|
isActive?: boolean;
|
|
606
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';
|
|
607
651
|
ForkAgentFromTemplateRequest: {
|
|
608
652
|
templateId: string;
|
|
609
653
|
templateVersionId?: string;
|
|
@@ -707,6 +751,7 @@ type components = {
|
|
|
707
751
|
TagId: string;
|
|
708
752
|
StageId: string;
|
|
709
753
|
TriggerId: string;
|
|
754
|
+
CampaignId: string;
|
|
710
755
|
WorkspaceId: string;
|
|
711
756
|
ToolId: string;
|
|
712
757
|
ResourceId: string;
|
|
@@ -890,11 +935,15 @@ type AgentBlueprint = {
|
|
|
890
935
|
personalityInitialGreeting: string;
|
|
891
936
|
personalityMessageStyleId: string;
|
|
892
937
|
personalityToneStyleId: string;
|
|
938
|
+
voiceId: string | null;
|
|
893
939
|
startSpeaker: 'user' | 'agent';
|
|
894
940
|
requiredData: string[];
|
|
895
941
|
criticalRules: string[];
|
|
896
942
|
topicsAllowed: string[];
|
|
897
943
|
topicsForbidden: string[];
|
|
944
|
+
contentHash: string | null;
|
|
945
|
+
contentVariables: string[];
|
|
946
|
+
variablesCache: string[];
|
|
898
947
|
createdAt: string;
|
|
899
948
|
updatedAt: string;
|
|
900
949
|
};
|
|
@@ -942,6 +991,8 @@ type BlueprintStageSchema = components['schemas']['BlueprintStage'];
|
|
|
942
991
|
type BlueprintStage = Omit<BlueprintStageSchema, 'prompt'> & {
|
|
943
992
|
goalPrompt: string;
|
|
944
993
|
promptInstructions: string[];
|
|
994
|
+
contentHash: string | null;
|
|
995
|
+
variables: string[];
|
|
945
996
|
};
|
|
946
997
|
type BlueprintStageListResponseSchema = components['schemas']['BlueprintStageListResponse'];
|
|
947
998
|
type BlueprintStageListResponse = Omit<BlueprintStageListResponseSchema, 'data'> & {
|
|
@@ -975,6 +1026,11 @@ type ToolConnectionAuth = components['schemas']['ToolConnectionAuth'];
|
|
|
975
1026
|
type ToolConnectionRequest = components['schemas']['ToolConnectionRequest'];
|
|
976
1027
|
type ToolConnectionResponse = components['schemas']['ToolConnectionResponse'];
|
|
977
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'];
|
|
978
1034
|
type WebhookSummary = components['schemas']['WebhookSummary'];
|
|
979
1035
|
type WebhookDetail = components['schemas']['WebhookDetail'];
|
|
980
1036
|
type WebhookListResponse = components['schemas']['WebhookListResponse'];
|
|
@@ -1028,17 +1084,6 @@ declare function createAgentPhonesApi(cfg: ClientConfig & {
|
|
|
1028
1084
|
disconnect(agentId: string, phoneId: string): Promise<void>;
|
|
1029
1085
|
};
|
|
1030
1086
|
|
|
1031
|
-
type ListAgentScheduleExceptionsOptions = ListQueryOptions;
|
|
1032
|
-
declare function createAgentScheduleExceptionsApi(cfg: ClientConfig & {
|
|
1033
|
-
retry?: RetryPolicy;
|
|
1034
|
-
}): {
|
|
1035
|
-
list(agentId: string, options?: ListAgentScheduleExceptionsOptions): Promise<PaginatedResult<AgentScheduleExceptionListResponse, ListAgentScheduleExceptionsOptions>>;
|
|
1036
|
-
get(agentId: string, exceptionId: string): Promise<AgentScheduleException>;
|
|
1037
|
-
create(agentId: string, payload: CreateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1038
|
-
update(agentId: string, exceptionId: string, payload: UpdateAgentScheduleExceptionRequest): Promise<AgentScheduleException>;
|
|
1039
|
-
delete(agentId: string, exceptionId: string): Promise<void>;
|
|
1040
|
-
};
|
|
1041
|
-
|
|
1042
1087
|
type ListAgentSchedulesOptions = ListQueryOptions;
|
|
1043
1088
|
type AgentScheduleApi = {
|
|
1044
1089
|
list(agentId: string, options?: ListAgentSchedulesOptions): Promise<PaginatedResult<AgentScheduleListResponse, ListAgentSchedulesOptions>>;
|
|
@@ -1050,6 +1095,17 @@ declare function createAgentScheduleApi(cfg: ClientConfig & {
|
|
|
1050
1095
|
retry?: RetryPolicy;
|
|
1051
1096
|
}): AgentScheduleApi;
|
|
1052
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
|
+
|
|
1053
1109
|
type ListAgentStageTriggersOptions = ListQueryOptions;
|
|
1054
1110
|
type AgentStageTriggersApi$1 = {
|
|
1055
1111
|
list(agentId: string, blueprintId: string, stageId: string, options?: ListAgentStageTriggersOptions): Promise<PaginatedResult<BlueprintStageTriggerListResponse, ListAgentStageTriggersOptions>>;
|
|
@@ -1549,6 +1605,22 @@ declare function createApiKeysApi(cfg: ClientConfig & {
|
|
|
1549
1605
|
retry?: RetryPolicy;
|
|
1550
1606
|
}): ApiKeysApi;
|
|
1551
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
|
+
|
|
1552
1624
|
type ListCatalogTemplatesOptions = {
|
|
1553
1625
|
visibility?: CatalogTemplateVisibility;
|
|
1554
1626
|
tags?: string[];
|
|
@@ -1759,6 +1831,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1759
1831
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1760
1832
|
remove(itemId: string): Promise<void>;
|
|
1761
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
|
+
};
|
|
1762
1840
|
voices: {
|
|
1763
1841
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1764
1842
|
};
|
|
@@ -1866,6 +1944,12 @@ declare function createClient(initialCfg: ClientConfig & {
|
|
|
1866
1944
|
create(payload: CatalogItemCreateRequest): Promise<CatalogItemDetail>;
|
|
1867
1945
|
remove(itemId: string): Promise<void>;
|
|
1868
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
|
+
};
|
|
1869
1953
|
voices: {
|
|
1870
1954
|
list(options?: ListVoicesOptions): Promise<PaginatedResult<VoiceListResponse, ListVoicesOptions>>;
|
|
1871
1955
|
};
|
|
@@ -1907,4 +1991,4 @@ declare function createHttp(cfg: ClientConfig & {
|
|
|
1907
1991
|
resolveAccessToken: () => string;
|
|
1908
1992
|
};
|
|
1909
1993
|
|
|
1910
|
-
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,
|