@cognigy/rest-api-client 4.99.0 → 4.100.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 (41) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/build/apigroups/ResourcesAPIGroup_2_0.js +3 -1
  3. package/build/shared/charts/descriptors/index.js +5 -1
  4. package/build/shared/charts/descriptors/service/LLMEntityExtract.js +1 -1
  5. package/build/shared/charts/descriptors/service/LLMModerate.js +275 -0
  6. package/build/shared/charts/descriptors/service/index.js +5 -1
  7. package/build/shared/charts/descriptors/service/niceCXOneAAHAuthenticationConnection.js +12 -0
  8. package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +9 -10
  9. package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +25 -5
  10. package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -0
  11. package/build/shared/interfaces/messageAPI/endpoints.js +44 -119
  12. package/build/shared/interfaces/resources/IEndpoint.js +23 -4
  13. package/build/shared/interfaces/resources/ISipConnectivityInfo.js +16 -0
  14. package/build/shared/interfaces/resources/IWebrtcWidgetConfig.js +11 -0
  15. package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IConversationCounterPreAggregatedValue_3_0.js +3 -0
  16. package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterOrganisationRest_3_0.js +3 -0
  17. package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterRest_3_0.js +3 -0
  18. package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/index.js +3 -0
  19. package/build/shared/interfaces/security/IConversationCounterPreAggregatedValue.js +3 -0
  20. package/build/shared/json-schema.js +2 -1
  21. package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +3 -1
  22. package/dist/esm/shared/charts/descriptors/index.js +6 -2
  23. package/dist/esm/shared/charts/descriptors/service/LLMEntityExtract.js +1 -1
  24. package/dist/esm/shared/charts/descriptors/service/LLMModerate.js +273 -0
  25. package/dist/esm/shared/charts/descriptors/service/index.js +2 -0
  26. package/dist/esm/shared/charts/descriptors/service/niceCXOneAAHAuthenticationConnection.js +9 -0
  27. package/dist/esm/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +9 -10
  28. package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +25 -5
  29. package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -0
  30. package/dist/esm/shared/interfaces/messageAPI/endpoints.js +43 -118
  31. package/dist/esm/shared/interfaces/resources/IEndpoint.js +26 -7
  32. package/dist/esm/shared/interfaces/resources/ISipConnectivityInfo.js +13 -0
  33. package/dist/esm/shared/interfaces/resources/IWebrtcWidgetConfig.js +8 -0
  34. package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IConversationCounterPreAggregatedValue_3_0.js +2 -0
  35. package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterOrganisationRest_3_0.js +2 -0
  36. package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterRest_3_0.js +2 -0
  37. package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/index.js +2 -0
  38. package/dist/esm/shared/interfaces/security/IConversationCounterPreAggregatedValue.js +2 -0
  39. package/dist/esm/shared/json-schema.js +2 -1
  40. package/package.json +1 -1
  41. package/types/index.d.ts +83 -40
package/types/index.d.ts CHANGED
@@ -2391,6 +2391,14 @@ export interface IEndpointTranslationSettings {
2391
2391
  alwaysRemoveNoTranslateMarker: boolean;
2392
2392
  setInputLanguageOnExecutionCount: number;
2393
2393
  }
2394
+ export interface ISipConnectivityInfo {
2395
+ realm: string;
2396
+ username: string;
2397
+ password: string;
2398
+ applicationSid: string;
2399
+ wsUri?: string;
2400
+ clientSid: string;
2401
+ }
2394
2402
  export interface IEndpoint extends IEntityMeta {
2395
2403
  channel: TChannelType;
2396
2404
  /**
@@ -2402,6 +2410,10 @@ export interface IEndpoint extends IEntityMeta {
2402
2410
  * The ID of the Snapshot or Project to target
2403
2411
  */
2404
2412
  entrypoint: TMongoId;
2413
+ /**
2414
+ * The custom icon for the endpoint.
2415
+ */
2416
+ customIcon: string;
2405
2417
  /** The URL Token we publish on the endpoints and use to retrieve the correct endpoint configurations */
2406
2418
  URLToken: string;
2407
2419
  /** The name of the endpoint resource */
@@ -2417,8 +2429,8 @@ export interface IEndpoint extends IEntityMeta {
2417
2429
  */
2418
2430
  useConversations: boolean;
2419
2431
  /**
2420
- * Whether to mask sensitive IP address in input object and analytics data for this endpoint
2421
- */
2432
+ * Whether to mask sensitive IP address in input object and analytics data for this endpoint
2433
+ */
2422
2434
  maskIPAddress: boolean;
2423
2435
  /**
2424
2436
  * Whether to mask sensitive data in analytics for this endpoint
@@ -2473,6 +2485,13 @@ export interface IEndpoint extends IEntityMeta {
2473
2485
  * with those of the Agent */
2474
2486
  overrideSnapshotConnections: boolean;
2475
2487
  fileStorageSettings: IFileStorageSettings;
2488
+ /** Whether to use the webrtc application exists for this endpoint */
2489
+ webrtcClient?: boolean;
2490
+ sipConnectivityInfo?: ISipConnectivityInfo;
2491
+ /** The label of the webrtc widget */
2492
+ webrtcWidgetConfig?: {
2493
+ label: string;
2494
+ };
2476
2495
  }
2477
2496
  export interface IGraphEndpoint {
2478
2497
  type: "endpoint";
@@ -2667,7 +2686,7 @@ export interface IVoiceGatewayEndpointSettings extends IEndpointSessionSettings
2667
2686
  genericSettings?: IVGGenericSettings;
2668
2687
  isFeatureAccmEnabled?: boolean;
2669
2688
  }
2670
- export declare type AnyEndpointSettings = IFacebookEndpointSettings | IWorkplaceEndpointSettings | ISlackEndpointSettings | IGenericEndpointSettings | IAlexaEndpointSettings | IWebchat2EndpointSettings | IWebchat3EndpointSettings | ILineEndpointSettings | ITwilioEndpointSettings | ITwilioSmsEndpointSettings | IIntercomEndpointSettings | IRealtimeEndpointSettings | ISunshineConversationsEndpointSettings | IAvayaEndpointSettings | IUserlikeEndpointSettings | IBandwidthEndpointSettings | IAudioCodesEndpointSettings | IWhatsAppEndpointSettings | IAmazonLexEndpointSettings | IEightByEightEndpointSettings | IMicrosoftBotFrameworkEndpointSettings | IVoiceGatewayEndpointSettings | IGenesysBotConnectorEndpointSettings | INiceCXOneEndpointSettings | IAgentAssistVoiceEndpointSettings | {};
2689
+ export declare type AnyEndpointSettings = IFacebookEndpointSettings | IWorkplaceEndpointSettings | ISlackEndpointSettings | IGenericEndpointSettings | IAlexaEndpointSettings | IWebchat2EndpointSettings | IWebchat3EndpointSettings | ILineEndpointSettings | ITwilioEndpointSettings | ITwilioSmsEndpointSettings | IIntercomEndpointSettings | IRealtimeEndpointSettings | ISunshineConversationsEndpointSettings | IAvayaEndpointSettings | IUserlikeEndpointSettings | IBandwidthEndpointSettings | IAudioCodesEndpointSettings | IWhatsAppEndpointSettings | IAmazonLexEndpointSettings | IEightByEightEndpointSettings | IMicrosoftBotFrameworkEndpointSettings | IVoiceGatewayEndpointSettings | IGenesysBotConnectorEndpointSettings | INiceCXOneEndpointSettings | INiceCXOneAAHEndpointSettings | IAgentAssistVoiceEndpointSettings | {};
2671
2690
  export declare type TAvayaVoice = "man" | "woman" | string;
2672
2691
  declare const avayaSttTtsLanguages: readonly [
2673
2692
  "cy-GB",
@@ -4289,6 +4308,9 @@ export interface IGenesysBotConnectorEndpointSettings {
4289
4308
  export interface INiceCXOneEndpointSettings {
4290
4309
  verifyToken: string;
4291
4310
  }
4311
+ export interface INiceCXOneAAHEndpointSettings {
4312
+ niceCXOneAAHConnection: string;
4313
+ }
4292
4314
  declare const arrayNLUConnectorType_2_0: readonly [
4293
4315
  "alexa",
4294
4316
  "dialogflow",
@@ -4336,7 +4358,8 @@ declare const generativeAIModels: readonly [
4336
4358
  "text-embedding-3-large",
4337
4359
  "text-embedding-ada-002",
4338
4360
  "luminous-embedding-128",
4339
- "amazon.titan-embed-text-v2:0"
4361
+ "amazon.titan-embed-text-v2:0",
4362
+ "Pharia-1-Embedding-4608"
4340
4363
  ];
4341
4364
  /**
4342
4365
  * @openapi
@@ -4354,6 +4377,7 @@ declare const generativeAIModels: readonly [
4354
4377
  * - text-embedding-ada-002
4355
4378
  * - luminous-extended-control
4356
4379
  * - luminous-embedding-128
4380
+ * - Pharia-1-Embedding-4608
4357
4381
  * - claude-v1-100k
4358
4382
  * - claude-instant-v1
4359
4383
  * - claude-3-opus-20240229
@@ -7232,6 +7256,13 @@ export interface IEndpoint_2_0 {
7232
7256
  overrideSnapshotConnections: boolean;
7233
7257
  fileStorageSettings: IEndpointFileStorageSettings_2_0;
7234
7258
  orgDataPrivacySettings?: IEndpoitOrgDataPrivacySettings_2_0;
7259
+ /** Whether to use the webrtc application exists for this endpoint */
7260
+ webrtcClient?: boolean;
7261
+ sipConnectivityInfo?: ISipConnectivityInfo;
7262
+ /** The label of the webrtc widget */
7263
+ webrtcWidgetConfig?: {
7264
+ label: string;
7265
+ };
7235
7266
  }
7236
7267
  export interface ITransformerFunction_2_0 {
7237
7268
  /**
@@ -7389,6 +7420,7 @@ export interface IReadEndpointRestData_2_0 extends IReadEndpointRestDataParams_2
7389
7420
  export interface IReadEndpointRestReturnValue_2_0 extends IEndpoint_2_0 {
7390
7421
  }
7391
7422
  export interface IUpdateEndpointRestDataBody_2_0 extends Partial<Omit<IEndpoint_2_0, keyof IEntityMeta | "URLToken">> {
7423
+ createWebrtcClient?: boolean;
7392
7424
  }
7393
7425
  export interface IUpdateEndpointRestDataParams_2_0 {
7394
7426
  endpointId: string;
@@ -7399,6 +7431,7 @@ export interface IUpdateEndpointRestReturnValue_2_0 {
7399
7431
  }
7400
7432
  export interface IDeleteEndpointRestDataParams_2_0 {
7401
7433
  endpointId: string;
7434
+ channelType?: TChannelType;
7402
7435
  }
7403
7436
  export interface IDeleteEndpointRestData_2_0 extends IDeleteEndpointRestDataParams_2_0 {
7404
7437
  }
@@ -10264,6 +10297,9 @@ export interface IAzureOpenAIProviderOauth2Fields {
10264
10297
  oauthUrl: string;
10265
10298
  scope: string;
10266
10299
  }
10300
+ export interface IAlephAlphaProviderFields {
10301
+ token: string;
10302
+ }
10267
10303
  export interface IAwsBedrockProviderFields {
10268
10304
  accessKeyId: string;
10269
10305
  secretAccessKey: string;
@@ -10300,7 +10336,7 @@ export interface IProviderOauth2Fields extends IAzureOpenAIProviderOauth2Fields
10300
10336
  }
10301
10337
  export interface ISearchLLMCredentials {
10302
10338
  provider: TGenerativeAIProviders;
10303
- connectionFields: IAzureOpenAIProviderFieldsV2 | IProviderOauth2Fields | IAwsBedrockProviderFields;
10339
+ connectionFields: IAzureOpenAIProviderFieldsV2 | IProviderOauth2Fields | IAwsBedrockProviderFields | IAlephAlphaProviderFields;
10304
10340
  providerMetaData: IAzureOpenAIMeta;
10305
10341
  }
10306
10342
  export interface ISearchTagsData {
@@ -10440,6 +10476,38 @@ export interface IGoalEscalations extends IGoalAnalyticsData, IAnalyticsEndpoint
10440
10476
  export interface IEndpointSettings {
10441
10477
  isFeatureAccmEnabled?: boolean;
10442
10478
  }
10479
+ export interface IChartExecutableNode<C extends INodeFunctionBaseParams = INodeFunctionBaseParams> extends IProjectScope, IOrganisationScope {
10480
+ id: string;
10481
+ _id?: string;
10482
+ type: string;
10483
+ label?: string;
10484
+ extension: string;
10485
+ behavior: {
10486
+ stopping: boolean;
10487
+ };
10488
+ fields: INodeFieldSet;
10489
+ children: string[];
10490
+ next: string | null;
10491
+ config: C["config"];
10492
+ /**
10493
+ * Whether the node contain trustedCode.
10494
+ * Our cognigy nodes have trustedCodes - custom modules do not
10495
+ * have trusted-codes by default. This determines whether the nodes
10496
+ * function is executed in service-ai or service-execution.
10497
+ */
10498
+ trustedCode: boolean;
10499
+ pathToPackageExecutable: string;
10500
+ /**
10501
+ * Whether the node is a standard
10502
+ * Cognigy node, e.g. a sendText node.
10503
+ */
10504
+ isCognigy: boolean;
10505
+ /**
10506
+ * Whether the node is disabled
10507
+ */
10508
+ isDisabled: boolean;
10509
+ analyticsLabel?: string;
10510
+ }
10443
10511
  export interface IGetConversationTranscriptParams {
10444
10512
  turnLimit: number;
10445
10513
  }
@@ -10482,6 +10550,11 @@ export interface IRephraseSentenceWithAIOptions {
10482
10550
  answer?: string;
10483
10551
  }
10484
10552
  export declare type TBrainSessionState = Partial<Pick<ISessionState, "frustration" | "lastFlowPath" | "apps" | "lastConversationEntries" | "analytics" | "lastToolCall" | "tokenUsage">>;
10553
+ export declare type TNodeAnalyticsParams = {
10554
+ nodeId: IChartExecutableNode["id"];
10555
+ nodeLabel: IChartExecutableNode["label"];
10556
+ nodeType: IChartExecutableNode["type"];
10557
+ };
10485
10558
  export interface IActions {
10486
10559
  addConditionalEntrypoint?: (actions: IActions, flowId: string) => (addConditionalEntrypointParams: IAddConditionalEntrypointParams) => void;
10487
10560
  addHandoverInactivityTimer?: (params: {
@@ -10555,7 +10628,7 @@ export interface IActions {
10555
10628
  rephraseSentenceWithAI(sentence: string, options: IRephraseSentenceWithAIOptions): Promise<string>;
10556
10629
  rephraseMultipleSentencesWithAI(sentences: string[], options: IRephraseSentenceWithAIOptions): Promise<string[]>;
10557
10630
  requestHandover?: (text: string, cancel: string, userId: string, sessionId: string, requestHandover: string, inputAnalyticsData: IAnalyticsSourceData, handoverVersion?: IHandoverRequestStatus["handoverVersion"], repeatHandoverMessage?: boolean, sendResolveEvent?: boolean, resolveBehavior?: IHandoverRequestStatus["resolveBehavior"], nodeType?: IHandoverRequestStatus["nodeType"], agentAssistInitMessage?: string, providerResponse?: any, sendOnQueueEvent?: boolean, sendOnActiveEvent?: boolean) => void;
10558
- runGenerativeAIPrompt?: (options: IRunGenerativeAIPromptOptions, useCase: TGenerativeAIUseCases) => Promise<any>;
10631
+ runGenerativeAIPrompt?: (options: IRunGenerativeAIPromptOptions, useCase: TGenerativeAIUseCases, nodeAnalyticsParams?: TNodeAnalyticsParams) => Promise<any>;
10559
10632
  resetContext?: () => object;
10560
10633
  resetFormBrain?: () => Promise<void>;
10561
10634
  resetState?: () => Promise<string>;
@@ -10593,7 +10666,7 @@ export interface IActions {
10593
10666
  thinkV2?: (nodeId: string) => (text: string, data: any) => void;
10594
10667
  trackAnalyticsStep?: (stepLabel: string) => (trackArgs?: ITrackAnalyticsStepsArguments) => void;
10595
10668
  updateProfile?: (profileSchemaField: string, value: any) => Promise<any>;
10596
- knowledgeSearch: (data: IKnowledgeSearchData) => Promise<IKnowledgeSearchReturnValue>;
10669
+ knowledgeSearch: (data: IKnowledgeSearchData, nodeAnalyticsParams?: TNodeAnalyticsParams) => Promise<IKnowledgeSearchReturnValue>;
10597
10670
  matchPattern: (patternType: IPatternTypes, phrase: string, locale?: string) => IPatternMatchResult;
10598
10671
  getAgentAssistConfigId: () => string;
10599
10672
  getNluEmbeddingCredentials: () => INluEmbeddingCredentials;
@@ -11231,7 +11304,8 @@ export interface INodeExecutionAPI extends Omit<IActions, "parseCognigyScriptCon
11231
11304
  getAppSessionPin: () => Promise<string>;
11232
11305
  validateDatepickerFunctionInSecureContext?: (codeToValidate: string) => string | null;
11233
11306
  completeGoal: (goal: string) => void;
11234
- knowledgeSearch: (data: IKnowledgeSearchData) => Promise<IKnowledgeSearchReturnValue>;
11307
+ knowledgeSearch: (data: IKnowledgeSearchData, nodeAnalyticsParams?: TNodeAnalyticsParams) => Promise<IKnowledgeSearchReturnValue>;
11308
+ runGenerativeAIPrompt: (options: IRunGenerativeAIPromptOptions, useCase: TGenerativeAIUseCases, nodeAnalyticsParams?: TNodeAnalyticsParams) => Promise<any>;
11235
11309
  matchPattern: (patternType: IPatternTypes, phrase: string, locale?: string) => IPatternMatchResult;
11236
11310
  getAgentAssistConfigId: () => string;
11237
11311
  countGPTTokens: (prompt: string) => number;
@@ -11264,38 +11338,6 @@ export interface INodeExecutionCognigyObject extends IExecutionObjects {
11264
11338
  api: INodeExecutionAPI;
11265
11339
  flowReferenceId?: string;
11266
11340
  }
11267
- export interface IChartExecutableNode<C extends INodeFunctionBaseParams = INodeFunctionBaseParams> extends IProjectScope, IOrganisationScope {
11268
- id: string;
11269
- _id?: string;
11270
- type: string;
11271
- label?: string;
11272
- extension: string;
11273
- behavior: {
11274
- stopping: boolean;
11275
- };
11276
- fields: INodeFieldSet;
11277
- children: string[];
11278
- next: string | null;
11279
- config: C["config"];
11280
- /**
11281
- * Whether the node contain trustedCode.
11282
- * Our cognigy nodes have trustedCodes - custom modules do not
11283
- * have trusted-codes by default. This determines whether the nodes
11284
- * function is executed in service-ai or service-execution.
11285
- */
11286
- trustedCode: boolean;
11287
- pathToPackageExecutable: string;
11288
- /**
11289
- * Whether the node is a standard
11290
- * Cognigy node, e.g. a sendText node.
11291
- */
11292
- isCognigy: boolean;
11293
- /**
11294
- * Whether the node is disabled
11295
- */
11296
- isDisabled: boolean;
11297
- analyticsLabel?: string;
11298
- }
11299
11341
  export interface INodeFunctionInputOptions {
11300
11342
  handledIntentReconfirmation?: boolean;
11301
11343
  nluLanguage?: TNluLanguage;
@@ -16087,6 +16129,7 @@ export interface IVoiceConfigParams {
16087
16129
  azureSpeechRecognitionMode: string;
16088
16130
  azureEnableAudioLogging: boolean;
16089
16131
  azureHintsBoost: number;
16132
+ azureProfanityOption: "masked" | "removed" | "raw";
16090
16133
  googleDisablePunctuation: boolean;
16091
16134
  googleInteractionType: string;
16092
16135
  googleHintsBoost: number;