@cognigy/rest-api-client 2025.22.0 → 2025.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/apigroups/SimulationAPIGroup_2_0.js +2 -1
  3. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderOauth2Connection.js +3 -1
  4. package/build/shared/charts/descriptors/index.js +2 -0
  5. package/build/shared/charts/descriptors/nlu/matchPattern.js +1 -0
  6. package/build/shared/charts/descriptors/service/agentTools/knowledgeTool.js +340 -0
  7. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +3 -2
  8. package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +63 -30
  9. package/build/shared/charts/descriptors/service/handoverConnections.js +9 -1
  10. package/build/shared/charts/descriptors/service/index.js +4 -1
  11. package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +3 -2
  12. package/build/shared/interfaces/IProfile.js +6 -1
  13. package/build/shared/interfaces/resources/INodeDescriptorSet.js +11 -1
  14. package/build/shared/interfaces/resources/TRestChannelType.js +2 -2
  15. package/build/shared/interfaces/resources/settings/IAgentSettings.js +12 -7
  16. package/build/shared/interfaces/resources/settings/IPiiDataRedactionSettings.js +142 -0
  17. package/build/shared/interfaces/resources/settings/index.js +4 -1
  18. package/build/shared/interfaces/restAPI/resources/project/v2.0/settings/IAgentSettings_2_0.js +104 -0
  19. package/build/shared/interfaces/restAPI/simulation/persona/IGeneratePersonaFromTranscriptRest_2_0.js +20 -0
  20. package/dist/esm/apigroups/SimulationAPIGroup_2_0.js +2 -1
  21. package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderOauth2Connection.js +3 -1
  22. package/dist/esm/shared/charts/descriptors/index.js +3 -1
  23. package/dist/esm/shared/charts/descriptors/nlu/matchPattern.js +1 -0
  24. package/dist/esm/shared/charts/descriptors/service/agentTools/knowledgeTool.js +338 -0
  25. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +3 -2
  26. package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +61 -29
  27. package/dist/esm/shared/charts/descriptors/service/handoverConnections.js +8 -0
  28. package/dist/esm/shared/charts/descriptors/service/index.js +2 -1
  29. package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +3 -2
  30. package/dist/esm/shared/interfaces/IProfile.js +5 -0
  31. package/dist/esm/shared/interfaces/resources/INodeDescriptorSet.js +11 -1
  32. package/dist/esm/shared/interfaces/resources/TRestChannelType.js +2 -2
  33. package/dist/esm/shared/interfaces/resources/settings/IAgentSettings.js +16 -11
  34. package/dist/esm/shared/interfaces/resources/settings/IPiiDataRedactionSettings.js +139 -0
  35. package/dist/esm/shared/interfaces/resources/settings/index.js +5 -4
  36. package/dist/esm/shared/interfaces/restAPI/resources/project/v2.0/settings/IAgentSettings_2_0.js +103 -1
  37. package/dist/esm/shared/interfaces/restAPI/simulation/persona/IGeneratePersonaFromTranscriptRest_2_0.js +19 -0
  38. package/package.json +1 -1
  39. package/types/index.d.ts +245 -18
package/types/index.d.ts CHANGED
@@ -2862,8 +2862,6 @@ declare const generativeAIModels: readonly [
2862
2862
  * - luminous-extended-control
2863
2863
  * - luminous-embedding-128
2864
2864
  * - Pharia-1-Embedding-4608
2865
- * - claude-v1-100k
2866
- * - claude-instant-v1
2867
2865
  * - claude-3-opus-20240229
2868
2866
  * - custom-model
2869
2867
  * - custom-embedding-model
@@ -4137,6 +4135,23 @@ export interface IWebchat3EndpointLayoutSettings {
4137
4135
  * Configure the width of the Webchat in px
4138
4136
  */
4139
4137
  chatWindowWidth: number;
4138
+ /**
4139
+ * The URL that links to the logo
4140
+ * we display as the chatbot icon when using bottom right position
4141
+ */
4142
+ iconUrl: string;
4143
+ /**
4144
+ * The animation to apply to the chatbot icon
4145
+ */
4146
+ iconAnimation: string;
4147
+ /**
4148
+ * The interval to apply to the chatbot icon animation when using bottom right position
4149
+ */
4150
+ iconAnimationInterval: number;
4151
+ /**
4152
+ * The speed to apply to the chatbot icon animation when using bottom right position
4153
+ */
4154
+ iconAnimationSpeed: number;
4140
4155
  }
4141
4156
  export interface IWebchat3EndpointColorsSettings {
4142
4157
  /**
@@ -5638,6 +5653,8 @@ export interface ISharedSettings_2_0 {
5638
5653
  * example: "USD"
5639
5654
  * knowledgeAISettings:
5640
5655
  * $ref: '#/components/schemas/IKnowledgeAISettings_2_0'
5656
+ * piiDataRedactionSettings:
5657
+ * $ref: '#/components/schemas/IPiiDataRedactionSettings_2_0'
5641
5658
  *
5642
5659
  * IAgentSettings_2_0:
5643
5660
  * allOf:
@@ -5666,6 +5683,7 @@ export interface IAgentSettings_2_0 extends ISharedSettings_2_0 {
5666
5683
  currency: string;
5667
5684
  };
5668
5685
  knowledgeAISettings: IKnowledgeAISettings_2_0;
5686
+ piiDataRedactionSettings?: IPiiDataRedactionSettings_2_0;
5669
5687
  }
5670
5688
  /**
5671
5689
  * @openapi
@@ -5784,7 +5802,7 @@ export declare type TAudioPreviewProvider_2_0 = "microsoft" | "google" | "aws" |
5784
5802
  /**
5785
5803
  * The supporting optional fields are not shown in Open API documentation
5786
5804
  * as those are just place holders and not supported in iteration 1
5787
- */
5805
+ */
5788
5806
  export interface IAudioPreviewSettings_2_0 {
5789
5807
  provider: TAudioPreviewProvider_2_0;
5790
5808
  connections: {
@@ -5887,6 +5905,39 @@ export interface IKnowledgeAISettings_2_0 {
5887
5905
  fileExtractor: TFileExtractorOptions_2_0;
5888
5906
  azureDIConnectionId?: string;
5889
5907
  }
5908
+ declare enum EPiiBehaviorType {
5909
+ PREDEFINED_ALIAS = "predefined-alias",
5910
+ CUSTOM_ALIAS = "custom-alias"
5911
+ }
5912
+ export declare type IRedactionBehavior = {
5913
+ type: EPiiBehaviorType.PREDEFINED_ALIAS;
5914
+ customAlias: null;
5915
+ } | {
5916
+ type: EPiiBehaviorType.CUSTOM_ALIAS;
5917
+ customAlias: string;
5918
+ };
5919
+ export declare type IRedactionScope = {
5920
+ logs: boolean;
5921
+ analytics: boolean;
5922
+ };
5923
+ export interface IPiiFieldSettings {
5924
+ enabled: boolean;
5925
+ behavior: IRedactionBehavior;
5926
+ scope: IRedactionScope;
5927
+ name: string;
5928
+ }
5929
+ export interface ICustomPatternSettings extends Omit<IPiiFieldSettings, "enabled"> {
5930
+ regex: string;
5931
+ }
5932
+ export interface IPiiDataRedactionSettings_2_0 {
5933
+ emailAddress: IPiiFieldSettings;
5934
+ phoneNumber: IPiiFieldSettings;
5935
+ creditCard: IPiiFieldSettings;
5936
+ ssn: IPiiFieldSettings;
5937
+ ipAddressV4: IPiiFieldSettings;
5938
+ ipAddressV6: IPiiFieldSettings;
5939
+ customTypes?: Record<string, ICustomPatternSettings>;
5940
+ }
5890
5941
  /**
5891
5942
  * @openapi
5892
5943
  *
@@ -6017,12 +6068,12 @@ export interface IMongoosePaginationPluginReturnValue<T = any> {
6017
6068
  * total:
6018
6069
  * type: integer
6019
6070
  * example: 1
6020
- * next:
6071
+ * nextCursor:
6021
6072
  * allOf:
6022
6073
  * - $ref: '#/components/schemas/TMongoId'
6023
6074
  * nullable: true
6024
6075
  * example: 5ce7c2d833ea1e04d7e6c432
6025
- * previous:
6076
+ * previousCursor:
6026
6077
  * allOf:
6027
6078
  * - $ref: '#/components/schemas/TMongoId'
6028
6079
  * nullable: true
@@ -10148,6 +10199,7 @@ export declare type ValueOf<T> = T[keyof T];
10148
10199
  * @param excludeDataOnlyMessagesFilter: (optional) the roles for which data only messages (emtpy text field) will be excluded if type is input/output
10149
10200
  * @param useTextAlternativeForLLM: (optional) if true, graphical outputs will be included in the transcript, either using the value from the graphical description / fallbackText field, or by converting the data where possible
10150
10201
  * @param includeTextAlternativeInTranscript: (optional) if true, the text alternative for LLM will be included in the transcript
10202
+ * @param excludeUserEventMessages: (optional) if true, user event messages will be excluded from the transcript
10151
10203
  */
10152
10204
  export declare type TReadTranscriptOptions = {
10153
10205
  limit: number;
@@ -10155,6 +10207,7 @@ export declare type TReadTranscriptOptions = {
10155
10207
  excludeDataOnlyMessagesFilter?: (TranscriptRole.USER | TranscriptRole.AGENT | TranscriptRole.ASSISTANT)[];
10156
10208
  useTextAlternativeForLLM?: boolean;
10157
10209
  includeTextAlternativeInTranscript?: boolean;
10210
+ excludeUserEventMessages?: boolean;
10158
10211
  };
10159
10212
  declare enum TranscriptRole {
10160
10213
  ASSISTANT = "assistant",
@@ -10435,6 +10488,8 @@ export interface IAzureOpenAIProviderOauth2Fields {
10435
10488
  clientSecret: string;
10436
10489
  oauthUrl: string;
10437
10490
  scope: string;
10491
+ additionalHeaderName?: string;
10492
+ additionalHeaderValue?: string;
10438
10493
  }
10439
10494
  export interface IAlephAlphaProviderFields {
10440
10495
  token: string;
@@ -11752,7 +11807,7 @@ export declare type TNodeTagType = TCognigyNodeTagType | string;
11752
11807
  export interface INodeDescriptor<T extends INodeFunctionBaseParams = any, U extends string = string, FunctionParams extends INodeFunctionBaseParams = any> {
11753
11808
  _id?: TMongoId;
11754
11809
  type: U;
11755
- parentType?: string | null;
11810
+ parentType?: string | string[] | null;
11756
11811
  defaultLabel: string | INodeFieldTranslations;
11757
11812
  summary?: string | INodeFieldTranslations;
11758
11813
  appearance: INodeAppearance;
@@ -13292,14 +13347,6 @@ export interface IChart_2_0 {
13292
13347
  * extension:
13293
13348
  * type: string
13294
13349
  * example: "@cognigy/basic-nodes"
13295
- * enum:
13296
- * - "@cognigy/basic-nodes"
13297
- * - "@cognigy/mongodb"
13298
- * - "@cognigy/mssql"
13299
- * - "@cognigy/smtp"
13300
- * - "@cognigy/voicegateway"
13301
- * - "@cognigy/microsoft"
13302
- * - "@cognigy/voiceGateway2"
13303
13350
  * label:
13304
13351
  * type: string
13305
13352
  * example: A new Node
@@ -13361,6 +13408,7 @@ declare enum ConvertActionType {
13361
13408
  UPDATED = "updated"
13362
13409
  }
13363
13410
  export declare type TConvertAction = (typeof ConvertActionType)[keyof typeof ConvertActionType];
13411
+ export declare type TNodeConversionMetadata = Record<string, TConvertAction>;
13364
13412
  export interface IChartNodeBase {
13365
13413
  _id: TMongoId;
13366
13414
  referenceId: string;
@@ -13408,7 +13456,7 @@ export interface IChartNodeInDB extends Omit<IChartNode, "config" | "preview" |
13408
13456
  }
13409
13457
  export interface IReadChartNodeRestDataQuery_2_0 {
13410
13458
  preferredLocaleId?: string;
13411
- includeConversionMetadata?: boolean;
13459
+ includeConversionMetadata?: string;
13412
13460
  }
13413
13461
  export declare type IReadChartNodeRestDataParams_2_0<P extends string = "resourceId"> = {
13414
13462
  [key in P]: string;
@@ -13419,7 +13467,7 @@ export interface IReadChartNodeRestData_2_0 extends IReadChartNodeRestDataParams
13419
13467
  resourceType: TChartableResourceType;
13420
13468
  }
13421
13469
  export interface IReadChartNodeRestReturnValue_2_0<T extends INodeFunctionBaseParams = any> extends IChartNode_2_0<T> {
13422
- conversionMetadata?: Record<TNodeFieldType, TConvertAction>;
13470
+ conversionMetadata?: TNodeConversionMetadata;
13423
13471
  }
13424
13472
  export interface IReadChartRestData_2_0 extends IReadChartNodeRestDataQuery_2_0 {
13425
13473
  resourceId: string;
@@ -14270,7 +14318,7 @@ export declare type IGetAiAgentJobAndToolsRestReturnValue_2_0 = IAiAgentJobNodeW
14270
14318
  */
14271
14319
  export interface INodeDescriptor_2_0 {
14272
14320
  type: string;
14273
- parentType?: string;
14321
+ parentType?: string | string[];
14274
14322
  defaultLabel: string | INodeFieldTranslations;
14275
14323
  summary: string | INodeFieldTranslations;
14276
14324
  extension: string;
@@ -19966,6 +20014,11 @@ export interface IMemory {
19966
20014
  timestamp: string;
19967
20015
  text: string;
19968
20016
  }
20017
+ declare const profileTypes: readonly [
20018
+ "simulator",
20019
+ "regular"
20020
+ ];
20021
+ export declare type TProfileTypes = (typeof profileTypes)[number];
19969
20022
  /**
19970
20023
  * @openapi
19971
20024
  *
@@ -20079,6 +20132,10 @@ export interface IFlattenedProfile_2_0 {
20079
20132
  * $ref: '#/components/schemas/IFlattenedProfile_2_0'
20080
20133
  * active:
20081
20134
  * type: boolean
20135
+ * type:
20136
+ * type: string
20137
+ * enum:
20138
+ * - simulator
20082
20139
  * contactIds:
20083
20140
  * type: array
20084
20141
  * items:
@@ -20091,6 +20148,7 @@ export interface IFlattenedProfile_2_0 {
20091
20148
  export interface IProfileIndexItem_2_0 {
20092
20149
  _id: TMongoId;
20093
20150
  active: boolean;
20151
+ type?: TProfileTypes;
20094
20152
  profile: Partial<IFlattenedProfile_2_0>;
20095
20153
  projectId: TMongoId;
20096
20154
  lastChanged: number;
@@ -20946,10 +21004,14 @@ export interface IGetConversationCounterOrganisationRestReturnValue_3_0 {
20946
21004
  * type: number
20947
21005
  * processedCalls:
20948
21006
  * type: number
21007
+ * billableCalls:
21008
+ * type: number
20949
21009
  */
20950
21010
  export interface ICallCounterPreAggregatedValue_3_0 {
20951
21011
  /** The number of calls in the time-span */
20952
21012
  processedCalls: number;
21013
+ /** The number of billable calls in the time-span */
21014
+ billableCalls: number;
20953
21015
  /** The day, e.g., 1 for the first day in the month */
20954
21016
  day: number;
20955
21017
  /** The month of the year, e.g., 1 for January */
@@ -23492,6 +23554,7 @@ export interface IScheduleSimulationRestDataBody_2_0 {
23492
23554
  largeLanguageModelReferenceId?: string;
23493
23555
  userId?: string;
23494
23556
  finalPing?: number;
23557
+ data?: Record<string, unknown>;
23495
23558
  };
23496
23559
  projectReference: string;
23497
23560
  numberOfExecutions: number;
@@ -23535,6 +23598,8 @@ export interface ISuccessCriteriaGoalParams_2_0 {
23535
23598
  name: string;
23536
23599
  }
23537
23600
  export interface ISuccessCriteriaRest_2_0 {
23601
+ name?: string;
23602
+ text?: string;
23538
23603
  type: SuccessCriterionType_2_0;
23539
23604
  params: ISuccessCriteriaTextParams_2_0 | ISuccessCriteriaGoalParams_2_0;
23540
23605
  }
@@ -23678,7 +23743,7 @@ export interface IMissionType_2_0 {
23678
23743
  }
23679
23744
  export interface SuccessCriteria {
23680
23745
  name: string;
23681
- description: string;
23746
+ text: string;
23682
23747
  }
23683
23748
  export interface IPersonaType_2_0 {
23684
23749
  name: string;
@@ -23787,6 +23852,167 @@ export interface IGenerateBulkPersonaRestReturnValue_2_0 {
23787
23852
  missionTypesCount: number;
23788
23853
  };
23789
23854
  }
23855
+ /**
23856
+ * POST /testing/beta/personas/from-transcript
23857
+ *
23858
+ * Create a scenario draft by analyzing a conversation transcript. The system uses LLM to extract user intent,
23859
+ * conversation goals, and user characteristics from the transcript, then generates an appropriate persona package.
23860
+ *
23861
+ * The endpoint supports:
23862
+ * - Fetching transcript via sessionId from analytics service (RPC call)
23863
+ * - Direct transcript content via transcriptContent
23864
+ * - Optional flow context for enhanced persona generation
23865
+ * - Content safety validation (warnings only, non-blocking)
23866
+ *
23867
+ * Priority: If both sessionId and transcriptContent are provided, sessionId takes precedence.
23868
+ *
23869
+ * operationId: createScenarioFromTranscript
23870
+ * tags: Personas
23871
+ */
23872
+ export interface IGeneratePersonaFromTranscriptRestData_2_0 {
23873
+ /**
23874
+ * Project reference for context identification (alternative to projectId query parameter)
23875
+ */
23876
+ projectReference?: string;
23877
+ /**
23878
+ * Session identifier to retrieve transcript from analytics service.
23879
+ * If provided, takes precedence over transcriptContent.
23880
+ */
23881
+ sessionId?: string;
23882
+ /**
23883
+ * Direct transcript content. Optional if sessionId is provided.
23884
+ */
23885
+ transcriptContent?: {
23886
+ /**
23887
+ * Array of conversation messages
23888
+ */
23889
+ messages: Array<{
23890
+ /**
23891
+ * Message source type:
23892
+ * - 'user' (customer)
23893
+ * - 'bot' (AI agent)
23894
+ * - 'agent' (live human agent)
23895
+ * - 'suggestion' (system suggestion)
23896
+ */
23897
+ source: "user" | "bot" | "agent" | "suggestion";
23898
+ /**
23899
+ * Message content
23900
+ */
23901
+ content: string;
23902
+ /**
23903
+ * Message timestamp (ISO 8601 format)
23904
+ */
23905
+ timestamp: string;
23906
+ }>;
23907
+ };
23908
+ /**
23909
+ * Optional: Flow ID to associate with and extract agent context for enhanced generation
23910
+ */
23911
+ flowId?: string;
23912
+ /**
23913
+ * Optional: Number of success criteria to generate
23914
+ * @default 3
23915
+ * @minimum 1
23916
+ * @maximum 10
23917
+ */
23918
+ numberOfSuccessCriteria?: number;
23919
+ /**
23920
+ * Optional analysis configuration
23921
+ */
23922
+ analysisOptions?: {
23923
+ /**
23924
+ * Limit transcript to first N turns (default: no limit)
23925
+ * @minimum 1
23926
+ */
23927
+ maxTurns?: number;
23928
+ /**
23929
+ * Focus analysis on extracting user goals (default: true)
23930
+ */
23931
+ focusOnUserGoals?: boolean;
23932
+ };
23933
+ }
23934
+ export interface IGeneratePersonaFromTranscriptRestReturnValue_2_0 {
23935
+ /**
23936
+ * Whether the generation was successful
23937
+ */
23938
+ success: boolean;
23939
+ /**
23940
+ * Generated persona package
23941
+ */
23942
+ personaPackage: {
23943
+ /**
23944
+ * Generated simulation name
23945
+ */
23946
+ simulationName: string;
23947
+ /**
23948
+ * Generated persona name
23949
+ */
23950
+ personaName: string;
23951
+ /**
23952
+ * Generated persona description capturing user characteristics
23953
+ */
23954
+ personaDescription: string;
23955
+ /**
23956
+ * Generated mission based on user goals
23957
+ */
23958
+ mission: string;
23959
+ /**
23960
+ * Generated success criteria
23961
+ */
23962
+ successCriteria: Array<{
23963
+ /**
23964
+ * Success criterion name
23965
+ */
23966
+ name: string;
23967
+ /**
23968
+ * Success criterion description
23969
+ */
23970
+ text: string;
23971
+ }>;
23972
+ };
23973
+ /**
23974
+ * Analysis metadata
23975
+ */
23976
+ metadata: {
23977
+ /**
23978
+ * Brief summary of the analyzed transcript
23979
+ */
23980
+ transcriptSummary: string;
23981
+ /**
23982
+ * When the analysis was performed (ISO 8601 format)
23983
+ */
23984
+ analysisTimestamp: string;
23985
+ /**
23986
+ * Content safety warnings (if any)
23987
+ */
23988
+ warnings?: string[];
23989
+ /**
23990
+ * Number of turns in the transcript
23991
+ */
23992
+ turnCount: number;
23993
+ /**
23994
+ * User intents/goals extracted from transcript
23995
+ */
23996
+ extractedIntents: string[];
23997
+ /**
23998
+ * Original transcript messages
23999
+ */
24000
+ messages: Array<{
24001
+ /**
24002
+ * Message source: 'user', 'bot', 'agent', or 'suggestion'
24003
+ */
24004
+ source: "user" | "bot" | "agent" | "suggestion";
24005
+ /**
24006
+ * Message content
24007
+ */
24008
+ content: string;
24009
+ /**
24010
+ * Message timestamp (ISO 8601 format)
24011
+ */
24012
+ timestamp: string;
24013
+ }>;
24014
+ };
24015
+ }
23790
24016
  export interface IStopSimulationRunBatchRestDataQuery_2_0 {
23791
24017
  projectId: string;
23792
24018
  }
@@ -23815,6 +24041,7 @@ export interface SimulationAPIGroup_2_0 {
23815
24041
  generatePersona: TRestAPIOperation<IGeneratePersonaRestData_2_0, IGeneratePersonaRestReturnValue_2_0>;
23816
24042
  regeneratePersonaField: TRestAPIOperation<IRegeneratePersonaFieldRestData_2_0, IRegeneratePersonaFieldRestReturnValue_2_0>;
23817
24043
  generateBulkPersona: TRestAPIOperation<IGenerateBulkPersonaRestData_2_0, IGenerateBulkPersonaRestReturnValue_2_0>;
24044
+ generatePersonaFromTranscript: TRestAPIOperation<IGeneratePersonaFromTranscriptRestData_2_0, IGeneratePersonaFromTranscriptRestReturnValue_2_0>;
23818
24045
  }
23819
24046
  declare function SimulationAPIGroup_2_0(instance: Base): SimulationAPIGroup_2_0;
23820
24047
  export declare type TRestAPIGroupsTypeByConfiguration<T extends IRestAPIClientConfig> = TResourceAPIVersionType<T> & TJWTAuthAPIVersionType<T> & TInsightsAPIVersionType<T> & TMetricsAPIVersionType<T> & TSessionAPIVersionType<T> & TExternalAPIVersionType<T> & TAdministrationAPIVersionType<T> & TManagementAPIVersionType<T> & TAnalyticsAPIVersionType<T> & TAIOpsCenterAPIVersionType<T> & TSimulationAPIVersionType<T>;