@droz-js/sdk 0.25.17 → 0.25.18

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@droz-js/sdk",
3
3
  "description": "Droz SDK",
4
- "version": "0.25.17",
4
+ "version": "0.25.18",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
package/src/nucleus.d.ts CHANGED
@@ -214,6 +214,10 @@ declare const Nucleus_base: new (options?: import("./client/http").HttpClientOpt
214
214
  withCustomer?: import("./sdks/nucleus").InputMaybe<import("./sdks/nucleus").Scalars["Boolean"]["input"]>;
215
215
  withAttributes?: import("./sdks/nucleus").InputMaybe<import("./sdks/nucleus").Scalars["Boolean"]["input"]>;
216
216
  }>, options?: unknown): Promise<import("./sdks/nucleus").GetSessionQuery>;
217
+ getActiveSession(variables: import("./sdks/nucleus").Exact<{
218
+ customer: import("./sdks/nucleus").GetOrCreateCustomerInput;
219
+ triggerDrn: import("./sdks/nucleus").Scalars["ID"]["input"];
220
+ }>, options?: unknown): Promise<import("./sdks/nucleus").GetActiveSessionQuery>;
217
221
  getSessionSchema(variables?: import("./sdks/nucleus").Exact<{
218
222
  lang?: import("./sdks/nucleus").InputMaybe<import("./sdks/nucleus").Scalars["String"]["input"]>;
219
223
  }>, options?: unknown): Promise<import("./sdks/nucleus").GetSessionSchemaQuery>;
package/src/sdks/ai.d.ts CHANGED
@@ -1036,6 +1036,7 @@ export type AiAgentSpec = {
1036
1036
  /** `inform_limitation` (default) ou `general_knowledge`; ausente vale o mais restritivo. */
1037
1037
  knowledgeFallback?: Maybe<Scalars['String']['output']>;
1038
1038
  toolIds: Array<Scalars['ID']['output']>;
1039
+ typingIndicator?: Maybe<Scalars['Boolean']['output']>;
1039
1040
  };
1040
1041
  export type AiAgentSpecInput = {
1041
1042
  /** @deprecated Ignorado. O tipo da ferramenta sai do método do conector. O campo sai na próxima versão. */
@@ -1056,6 +1057,7 @@ export type AiAgentSpecInput = {
1056
1057
  /** `inform_limitation` (default) ou `general_knowledge`; ausente vale o mais restritivo. */
1057
1058
  knowledgeFallback?: InputMaybe<Scalars['String']['input']>;
1058
1059
  toolIds: Array<Scalars['ID']['input']>;
1060
+ typingIndicator?: InputMaybe<Scalars['Boolean']['input']>;
1059
1061
  };
1060
1062
  export type AiAgentSummary = {
1061
1063
  agentId: Scalars['ID']['output'];
@@ -1811,7 +1813,7 @@ export type UpdateQnAInstanceInput = {
1811
1813
  };
1812
1814
  export type AiAgentSummaryFragment = Pick<AiAgentSummary, 'agentId' | 'name' | 'liveVersion' | 'channels' | 'updatedAt' | 'queuedApprovals' | 'status'>;
1813
1815
  export type AiAgentVersionFragment = Pick<AiAgentVersion, 'agentId' | 'version' | 'status' | 'createdAt'>;
1814
- export type AiAgentSpecFragment = (Pick<AiAgentSpec, 'can' | 'cannot' | 'knowledgeBaseIds' | 'knowledgeFallback' | 'toolIds' | 'channels'> & {
1816
+ export type AiAgentSpecFragment = (Pick<AiAgentSpec, 'can' | 'cannot' | 'knowledgeBaseIds' | 'knowledgeFallback' | 'toolIds' | 'channels' | 'typingIndicator'> & {
1815
1817
  identity: Pick<AiAgentIdentity, 'displayName' | 'role' | 'tone' | 'toneNotes' | 'openingMessage' | 'outOfScopeBehaviour'>;
1816
1818
  budget: Pick<AiAgentBudget, 'maxSteps' | 'maxToolCalls' | 'maxTokens' | 'maxCostMicroUsd' | 'maxPeriodCostMicroUsd' | 'onExceeded'>;
1817
1819
  handoff?: Maybe<Pick<AiAgentHandoff, 'transition' | 'target'>>;
@@ -2255,7 +2257,7 @@ export type RemoveQnAInstanceMutation = {
2255
2257
  };
2256
2258
  export declare const AiAgentSummaryFragmentDoc = "\n fragment aiAgentSummary on AiAgentSummary {\n agentId\n name\n liveVersion\n channels\n updatedAt\n queuedApprovals\n status\n}\n ";
2257
2259
  export declare const AiAgentVersionFragmentDoc = "\n fragment aiAgentVersion on AiAgentVersion {\n agentId\n version\n status\n createdAt\n}\n ";
2258
- export declare const AiAgentSpecFragmentDoc = "\n fragment aiAgentSpec on AiAgentSpec {\n identity {\n displayName\n role\n tone\n toneNotes\n openingMessage\n outOfScopeBehaviour\n }\n can\n cannot\n knowledgeBaseIds\n knowledgeFallback\n toolIds\n budget {\n maxSteps\n maxToolCalls\n maxTokens\n maxCostMicroUsd\n maxPeriodCostMicroUsd\n onExceeded\n }\n handoff {\n transition\n target\n }\n channels\n conversationTiming {\n channel\n abandonAfterMs\n remindAfterMs\n metaWindowMs\n reminderMessage\n renewalMessage\n }\n}\n ";
2260
+ export declare const AiAgentSpecFragmentDoc = "\n fragment aiAgentSpec on AiAgentSpec {\n identity {\n displayName\n role\n tone\n toneNotes\n openingMessage\n outOfScopeBehaviour\n }\n can\n cannot\n knowledgeBaseIds\n knowledgeFallback\n toolIds\n budget {\n maxSteps\n maxToolCalls\n maxTokens\n maxCostMicroUsd\n maxPeriodCostMicroUsd\n onExceeded\n }\n handoff {\n transition\n target\n }\n channels\n conversationTiming {\n channel\n abandonAfterMs\n remindAfterMs\n metaWindowMs\n reminderMessage\n renewalMessage\n }\n typingIndicator\n}\n ";
2259
2261
  export declare const AiAgentToolExclusionFragmentDoc = "\n fragment aiAgentToolExclusion on AiAgentToolExclusion {\n toolId\n reason\n}\n ";
2260
2262
  export declare const AiAgentVersionWithSpecFragmentDoc = "\n fragment aiAgentVersionWithSpec on AiAgentVersion {\n agentId\n version\n status\n createdAt\n spec {\n ...aiAgentSpec\n }\n excludedTools {\n ...aiAgentToolExclusion\n }\n}\n ";
2261
2263
  export declare const AiAgentListingMetricsFragmentDoc = "\n fragment aiAgentListingMetrics on AiAgentMetrics {\n agentId\n conversations\n conversationsResolved\n conversationsHandoffRequested\n resolutionRate\n resolutionDefinition\n costMicroUsd\n}\n ";
@@ -2311,7 +2313,7 @@ export declare const CheckAiAgentVersionDocument = "\n mutation checkAiAgentV
2311
2313
  export declare const GetAiAgentCheckRunDocument = "\n query getAiAgentCheckRun($agentId: ID!, $runId: ID!) {\n getAiAgentCheckRun(agentId: $agentId, runId: $runId) {\n ...aiAgentCheckRun\n }\n}\n \n fragment aiAgentCheckRun on AiAgentCheckRun {\n runId\n agentId\n version\n status\n requestedAt\n startedAt\n finishedAt\n totalRuns\n completedRuns\n error\n excludedTools {\n ...aiAgentToolExclusion\n }\n result {\n safeToPublish\n authoring {\n useCases\n procedures\n updatedAt\n }\n reports {\n scenarioId\n runs\n cut\n measured\n passed\n rate\n handoffReasons {\n key\n count\n }\n turns {\n turn\n runs\n answered\n grounded\n blocked\n identificationRequired\n toolNames {\n key\n count\n }\n blockCategories {\n key\n count\n }\n }\n }\n regressions {\n scenarioId\n before\n after\n }\n }\n}\n \n\n fragment aiAgentToolExclusion on AiAgentToolExclusion {\n toolId\n reason\n}\n ";
2312
2314
  export declare const AiAgentCheckLimitsDocument = "\n query aiAgentCheckLimits($agentId: ID!) {\n aiAgentCheckLimits(agentId: $agentId) {\n minRunsPerScenario\n maxRunsPerScenario\n maxSuiteRuns\n scenarioCount\n }\n}\n ";
2313
2315
  export declare const AiAgentMetricsDocument = "\n query aiAgentMetrics($input: AiAgentMetricsInput!) {\n aiAgentMetrics(input: $input) {\n ...aiAgentMetricsReport\n }\n}\n \n fragment aiAgentMetricsReport on AiAgentMetrics {\n agentId\n from\n to\n truncated\n conversations\n conversationsResolved\n conversationsInconclusive\n conversationsHandoffRequested\n resolutionRate\n resolutionDefinition\n classificationBreakdown {\n state\n subcategory\n technicalFailure\n count\n }\n conversationsEligible\n conversationsResolvedByDefinition\n conversationsProvisional\n conversationsAwaitingClassification\n resolvedRate\n unresolvedRate\n handoffProcedureRate\n handoffNeedRate\n abandonmentRate\n classificationDefinitionVersion\n classificationDefinitionVersions {\n key\n count\n }\n analyzedConversations\n estimatedSatisfactionAvg\n sentimentAtStart {\n key\n count\n }\n sentimentAtEnd {\n key\n count\n }\n riskAlerts {\n key\n count\n }\n topKnowledgeGaps {\n key\n count\n }\n analysisCostMicroUsd\n failedAnalyses\n analysesTruncated\n agentScoreAvg\n agentScoreAvgBand\n agentScoreBands {\n key\n count\n }\n agentClarityAvg\n customerEffortScoreAvg\n contactReasons {\n all {\n key\n count\n }\n handoff {\n key\n count\n }\n abandonment {\n key\n count\n }\n }\n escalatedToHuman\n escalatedToFlow\n escalatedTargetUndeclared\n handoffsByReason {\n key\n count\n }\n humanRequestedTurns\n costMicroUsd\n costMicroUsdPerResolvedConversation\n unpricedTurns\n inputTokens\n outputTokens\n totalTokens\n cachedInputTokens\n cachedTurns\n llmCalls\n turnsByModel {\n key\n count\n }\n avgTurnDurationMs\n p95TurnDurationMs\n avgLlmLatencyMs\n turns\n answeredTurns\n answeredWithFailedConnectionTurns\n unansweredTurns\n unansweredDefinition\n topTopics {\n key\n count\n }\n topUnansweredQuestions {\n key\n count\n }\n blockedTurns\n blocksByCategory {\n key\n count\n }\n haltedTurns\n haltReasons {\n key\n count\n }\n budgetExceededTurns\n identificationRequiredTurns\n toolCalls\n toolCallsFailed\n toolErrorsByConnection {\n key\n count\n }\n toolErrorsByClass {\n key\n count\n }\n knowledgeRetrieved\n knowledgeEmpty\n knowledgeUnavailable\n knowledgeSkipped\n}\n ";
2314
- export declare const AiAgentVersionSpecDocument = "\n query aiAgentVersionSpec($agentId: ID!) {\n listAiAgentVersions(agentId: $agentId) {\n ...aiAgentVersionWithSpec\n }\n}\n \n fragment aiAgentVersionWithSpec on AiAgentVersion {\n agentId\n version\n status\n createdAt\n spec {\n ...aiAgentSpec\n }\n excludedTools {\n ...aiAgentToolExclusion\n }\n}\n \n\n fragment aiAgentSpec on AiAgentSpec {\n identity {\n displayName\n role\n tone\n toneNotes\n openingMessage\n outOfScopeBehaviour\n }\n can\n cannot\n knowledgeBaseIds\n knowledgeFallback\n toolIds\n budget {\n maxSteps\n maxToolCalls\n maxTokens\n maxCostMicroUsd\n maxPeriodCostMicroUsd\n onExceeded\n }\n handoff {\n transition\n target\n }\n channels\n conversationTiming {\n channel\n abandonAfterMs\n remindAfterMs\n metaWindowMs\n reminderMessage\n renewalMessage\n }\n}\n \n\n fragment aiAgentToolExclusion on AiAgentToolExclusion {\n toolId\n reason\n}\n ";
2316
+ export declare const AiAgentVersionSpecDocument = "\n query aiAgentVersionSpec($agentId: ID!) {\n listAiAgentVersions(agentId: $agentId) {\n ...aiAgentVersionWithSpec\n }\n}\n \n fragment aiAgentVersionWithSpec on AiAgentVersion {\n agentId\n version\n status\n createdAt\n spec {\n ...aiAgentSpec\n }\n excludedTools {\n ...aiAgentToolExclusion\n }\n}\n \n\n fragment aiAgentSpec on AiAgentSpec {\n identity {\n displayName\n role\n tone\n toneNotes\n openingMessage\n outOfScopeBehaviour\n }\n can\n cannot\n knowledgeBaseIds\n knowledgeFallback\n toolIds\n budget {\n maxSteps\n maxToolCalls\n maxTokens\n maxCostMicroUsd\n maxPeriodCostMicroUsd\n onExceeded\n }\n handoff {\n transition\n target\n }\n channels\n conversationTiming {\n channel\n abandonAfterMs\n remindAfterMs\n metaWindowMs\n reminderMessage\n renewalMessage\n }\n typingIndicator\n}\n \n\n fragment aiAgentToolExclusion on AiAgentToolExclusion {\n toolId\n reason\n}\n ";
2315
2317
  export declare const AiAgentRoutingPreviewDocument = "\n query aiAgentRoutingPreview($input: AiAgentRoutingPreviewInput!) {\n aiAgentRoutingPreview(input: $input) {\n high\n medium\n examples {\n message\n useCaseId\n score\n confidence\n }\n }\n}\n ";
2316
2318
  export declare const AiAgentKnowledgeBasesDocument = "\n query aiAgentKnowledgeBases {\n aiAgentKnowledgeBases {\n id\n title\n isPublic\n }\n}\n ";
2317
2319
  export declare const ExtractImageMetadataDocument = "\n mutation extractImageMetadata($input: ExtractImageMetadataInput!) {\n extractImageMetadata(input: $input) {\n success\n model\n extractedMetadata\n tokenUsage {\n prompt\n completion\n total\n }\n }\n}\n ";
package/src/sdks/ai.js CHANGED
@@ -311,6 +311,7 @@ exports.AiAgentSpecFragmentDoc = `
311
311
  reminderMessage
312
312
  renewalMessage
313
313
  }
314
+ typingIndicator
314
315
  }
315
316
  `;
316
317
  exports.AiAgentToolExclusionFragmentDoc = `
@@ -173,6 +173,8 @@ export type ChatWidgetMessage = {
173
173
  payload: Array<ChatWidgetMessagePayload>;
174
174
  sessionClosed: Scalars['Boolean']['output'];
175
175
  type: Scalars['String']['output'];
176
+ typing?: Maybe<Scalars['Boolean']['output']>;
177
+ typingExpiresInMs?: Maybe<Scalars['Int']['output']>;
176
178
  };
177
179
  export type ChatWidgetMessagePayload = {
178
180
  channelId: Scalars['String']['output'];
@@ -365,7 +367,7 @@ export type UpdateChatWidgetInput = {
365
367
  };
366
368
  export type ChatWidgetFragment = Pick<ChatWidget, 'id' | 'name' | 'allowedDomains' | 'drn' | 'createdAt' | 'updatedAt'>;
367
369
  export type ChatWidgetStylingFragment = Pick<ChatWidget, 'headerTitle' | 'mainColor' | 'fontSize' | 'fontFamily' | 'buttonsBorderRadius' | 'headerBorderRadius' | 'messagesBorderRadius' | 'avatarUrl' | 'iconButtonUrl'>;
368
- export type ChatWidgetMessageFragment = (Pick<ChatWidgetMessage, 'id' | 'type' | 'sessionClosed'> & {
370
+ export type ChatWidgetMessageFragment = (Pick<ChatWidgetMessage, 'id' | 'type' | 'sessionClosed' | 'typing' | 'typingExpiresInMs'> & {
369
371
  payload: Array<Pick<ChatWidgetMessagePayload, 'from' | 'to' | 'channelId' | 'contentType' | 'content' | 'filename'>>;
370
372
  });
371
373
  export type GetChatWidgetQueryVariables = Exact<{
@@ -423,16 +425,16 @@ export type OnChatWidgetMessageSubscription = {
423
425
  };
424
426
  export declare const ChatWidgetFragmentDoc = "\n fragment chatWidget on ChatWidget {\n id\n name\n allowedDomains\n drn\n createdAt\n updatedAt\n}\n ";
425
427
  export declare const ChatWidgetStylingFragmentDoc = "\n fragment chatWidgetStyling on ChatWidget {\n headerTitle\n mainColor\n fontSize\n fontFamily\n buttonsBorderRadius\n headerBorderRadius\n messagesBorderRadius\n avatarUrl\n iconButtonUrl\n}\n ";
426
- export declare const ChatWidgetMessageFragmentDoc = "\n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n type\n sessionClosed\n payload {\n from\n to\n channelId\n contentType\n content\n filename\n }\n}\n ";
428
+ export declare const ChatWidgetMessageFragmentDoc = "\n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n type\n sessionClosed\n typing\n typingExpiresInMs\n payload {\n from\n to\n channelId\n contentType\n content\n filename\n }\n}\n ";
427
429
  export declare const GetChatWidgetDocument = "\n query getChatWidget($id: ID!, $stylesOnly: Boolean = false) {\n getChatWidget(id: $id) {\n ...chatWidget @skip(if: $stylesOnly)\n ...chatWidgetStyling\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n allowedDomains\n drn\n createdAt\n updatedAt\n}\n \n\n fragment chatWidgetStyling on ChatWidget {\n headerTitle\n mainColor\n fontSize\n fontFamily\n buttonsBorderRadius\n headerBorderRadius\n messagesBorderRadius\n avatarUrl\n iconButtonUrl\n}\n ";
428
430
  export declare const ListChatWidgetsDocument = "\n query listChatWidgets {\n listChatWidgets {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n allowedDomains\n drn\n createdAt\n updatedAt\n}\n ";
429
431
  export declare const CreateChatWidgetDocument = "\n mutation createChatWidget($input: CreateChatWidgetInput!) {\n createChatWidget(input: $input) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n allowedDomains\n drn\n createdAt\n updatedAt\n}\n ";
430
432
  export declare const UpdateChatWidgetDocument = "\n mutation updateChatWidget($input: UpdateChatWidgetInput!) {\n updateChatWidget(input: $input) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n allowedDomains\n drn\n createdAt\n updatedAt\n}\n ";
431
433
  export declare const RemoveChatWidgetDocument = "\n mutation removeChatWidget($input: RemoveChatWidgetInput!) {\n removeChatWidget(input: $input) {\n ...chatWidget\n }\n}\n \n fragment chatWidget on ChatWidget {\n id\n name\n allowedDomains\n drn\n createdAt\n updatedAt\n}\n ";
432
434
  export declare const StartChatWidgetSessionDocument = "\n mutation startChatWidgetSession($input: StartChatWidgetSessionInput!) {\n startChatWidgetSession(input: $input) {\n id\n }\n}\n ";
433
- export declare const SendMessageToChatWidgetDocument = "\n mutation sendMessageToChatWidget($input: SendMessageToChatWidgetInput!) {\n sendMessageToChatWidget(input: $input) {\n ...chatWidgetMessage\n }\n}\n \n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n type\n sessionClosed\n payload {\n from\n to\n channelId\n contentType\n content\n filename\n }\n}\n ";
435
+ export declare const SendMessageToChatWidgetDocument = "\n mutation sendMessageToChatWidget($input: SendMessageToChatWidgetInput!) {\n sendMessageToChatWidget(input: $input) {\n ...chatWidgetMessage\n }\n}\n \n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n type\n sessionClosed\n typing\n typingExpiresInMs\n payload {\n from\n to\n channelId\n contentType\n content\n filename\n }\n}\n ";
434
436
  export declare const CloseChatWidgetSessionDocument = "\n mutation closeChatWidgetSession($input: CloseChatWidgetSessionInput!) {\n closeChatWidgetSession(input: $input)\n}\n ";
435
- export declare const OnChatWidgetMessageDocument = "\n subscription onChatWidgetMessage($sessionId: ID!) {\n onChatWidgetMessage(sessionId: $sessionId) {\n ...chatWidgetMessage\n }\n}\n \n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n type\n sessionClosed\n payload {\n from\n to\n channelId\n contentType\n content\n filename\n }\n}\n ";
437
+ export declare const OnChatWidgetMessageDocument = "\n subscription onChatWidgetMessage($sessionId: ID!) {\n onChatWidgetMessage(sessionId: $sessionId) {\n ...chatWidgetMessage\n }\n}\n \n fragment chatWidgetMessage on ChatWidgetMessage {\n id\n type\n sessionClosed\n typing\n typingExpiresInMs\n payload {\n from\n to\n channelId\n contentType\n content\n filename\n }\n}\n ";
436
438
  export type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
437
439
  export declare function getSdk<C>(requester: Requester<C>): {
438
440
  getChatWidget(variables: GetChatWidgetQueryVariables, options?: C): Promise<GetChatWidgetQuery>;
@@ -58,6 +58,8 @@ exports.ChatWidgetMessageFragmentDoc = `
58
58
  id
59
59
  type
60
60
  sessionClosed
61
+ typing
62
+ typingExpiresInMs
61
63
  payload {
62
64
  from
63
65
  to
@@ -767,6 +767,7 @@ export type Query = {
767
767
  countCredentials: Scalars['Int']['output'];
768
768
  countLiveStateMachineConfigs: Scalars['Int']['output'];
769
769
  dynamicSearchCustomer: CustomerSearchResults;
770
+ getActiveSession?: Maybe<Session>;
770
771
  getAgent?: Maybe<Agent>;
771
772
  getAgentByEmail?: Maybe<Agent>;
772
773
  getAgents: Array<Maybe<Agent>>;
@@ -824,6 +825,10 @@ export type QueryDynamicSearchCustomerArgs = {
824
825
  data: DynamicSearchInput;
825
826
  page?: InputMaybe<Scalars['Number']['input']>;
826
827
  };
828
+ export type QueryGetActiveSessionArgs = {
829
+ customer: GetOrCreateCustomerInput;
830
+ triggerDrn: Scalars['ID']['input'];
831
+ };
827
832
  export type QueryGetAgentArgs = {
828
833
  id: Scalars['ID']['input'];
829
834
  };
@@ -1023,8 +1028,10 @@ export type SecureCronJob = {
1023
1028
  export type Session = {
1024
1029
  attributes: Scalars['JSON']['output'];
1025
1030
  context: SessionContext;
1031
+ createdAt: Scalars['DateTime']['output'];
1026
1032
  customer: Customer;
1027
1033
  customerId: Scalars['ID']['output'];
1034
+ lastMessageAt?: Maybe<Scalars['DateTime']['output']>;
1028
1035
  sessionId: Scalars['ID']['output'];
1029
1036
  stateMachineId: Scalars['ID']['output'];
1030
1037
  status: SessionStatus;
@@ -1687,7 +1694,7 @@ export type CheckPermissionsQueryVariables = Exact<{
1687
1694
  resources: Array<Scalars['String']['input']> | Scalars['String']['input'];
1688
1695
  }>;
1689
1696
  export type CheckPermissionsQuery = Pick<Query, 'checkPermissions'>;
1690
- export type SessionFragment = Pick<Session, 'sessionId' | 'customerId' | 'stateMachineId' | 'triggerDrn' | 'status'>;
1697
+ export type SessionFragment = Pick<Session, 'sessionId' | 'customerId' | 'stateMachineId' | 'triggerDrn' | 'status' | 'createdAt' | 'lastMessageAt'>;
1691
1698
  export type IndexedSessionFragment = Pick<IndexedSession, 'sessionId' | 'customerId' | 'stateMachineId' | 'triggerDrn' | 'status' | 'customer' | 'attributes' | 'context' | 'messages'>;
1692
1699
  export type SessionSchemaFragment = (Pick<AppSessionSchemaFields, 'name'> & {
1693
1700
  fields: Array<Pick<AppSessionSchemaFieldDescription, 'name' | 'description'>>;
@@ -1717,6 +1724,13 @@ export type GetSessionQuery = {
1717
1724
  customer?: CustomerFragment;
1718
1725
  } & SessionFragment)>;
1719
1726
  };
1727
+ export type GetActiveSessionQueryVariables = Exact<{
1728
+ customer: GetOrCreateCustomerInput;
1729
+ triggerDrn: Scalars['ID']['input'];
1730
+ }>;
1731
+ export type GetActiveSessionQuery = {
1732
+ getActiveSession?: Maybe<SessionFragment>;
1733
+ };
1720
1734
  export type GetSessionSchemaQueryVariables = Exact<{
1721
1735
  lang?: InputMaybe<Scalars['String']['input']>;
1722
1736
  }>;
@@ -1910,7 +1924,7 @@ export declare const CustomerFragmentDoc = "\n fragment customer on Customer
1910
1924
  export declare const CronJobFragmentDoc = "\n fragment cronJob on CronJob {\n appId\n id\n description\n expression\n event\n payload\n status\n timestamp\n times\n runs\n}\n ";
1911
1925
  export declare const PolicyFragmentDoc = "\n fragment policy on Policy {\n id\n action\n effect\n resource\n}\n ";
1912
1926
  export declare const RoleFragmentDoc = "\n fragment role on Role {\n id\n name\n policies {\n ...policy\n }\n}\n ";
1913
- export declare const SessionFragmentDoc = "\n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n}\n ";
1927
+ export declare const SessionFragmentDoc = "\n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n createdAt\n lastMessageAt\n}\n ";
1914
1928
  export declare const IndexedSessionFragmentDoc = "\n fragment indexedSession on IndexedSession {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n customer\n attributes\n context\n messages\n}\n ";
1915
1929
  export declare const SessionSchemaFragmentDoc = "\n fragment sessionSchema on AppSessionSchemaFields {\n name\n fields {\n name\n description\n }\n}\n ";
1916
1930
  export declare const SettingsFragmentDoc = "\n fragment settings on Settings {\n doNotAllowUserSignup\n allowedEmailDomains\n groupsMapping {\n from\n to\n }\n}\n ";
@@ -1980,9 +1994,10 @@ export declare const RemoveCronJobDocument = "\n mutation removeCronJob($inpu
1980
1994
  export declare const ListSystemRolesDocument = "\n query listSystemRoles {\n listSystemRoles {\n ...role\n }\n}\n \n fragment role on Role {\n id\n name\n policies {\n ...policy\n }\n}\n \n\n fragment policy on Policy {\n id\n action\n effect\n resource\n}\n ";
1981
1995
  export declare const GetSystemRoleDocument = "\n query getSystemRole($id: SystemRole!) {\n getSystemRole(id: $id) {\n ...role\n }\n}\n \n fragment role on Role {\n id\n name\n policies {\n ...policy\n }\n}\n \n\n fragment policy on Policy {\n id\n action\n effect\n resource\n}\n ";
1982
1996
  export declare const CheckPermissionsDocument = "\n query checkPermissions($can: Can!, $resources: [String!]!) {\n checkPermissions(can: $can, resources: $resources)\n}\n ";
1983
- export declare const StartSessionDocument = "\n mutation startSession($input: StartSessionInput!, $withCustomer: Boolean = true) {\n startSession(input: $input) {\n ...session\n customer @include(if: $withCustomer) {\n ...customer\n }\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n}\n \n\n fragment customer on Customer {\n id\n name\n alternateName\n email\n phone\n document\n externalId\n emails\n phones\n documents\n externalIds\n apps {\n id\n name\n }\n status\n createdAt\n updatedAt\n}\n ";
1984
- export declare const StartCustomSessionDocument = "\n mutation startCustomSession($input: StartSessionInput!) {\n startCustomSession(input: $input) {\n ...session\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n}\n ";
1985
- export declare const GetSessionDocument = "\n query getSession($sessionId: ID!, $withCustomer: Boolean = true, $withAttributes: Boolean = true) {\n getSession(sessionId: $sessionId) {\n ...session\n customer @include(if: $withCustomer) {\n ...customer\n }\n attributes @include(if: $withAttributes)\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n}\n \n\n fragment customer on Customer {\n id\n name\n alternateName\n email\n phone\n document\n externalId\n emails\n phones\n documents\n externalIds\n apps {\n id\n name\n }\n status\n createdAt\n updatedAt\n}\n ";
1997
+ export declare const StartSessionDocument = "\n mutation startSession($input: StartSessionInput!, $withCustomer: Boolean = true) {\n startSession(input: $input) {\n ...session\n customer @include(if: $withCustomer) {\n ...customer\n }\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n createdAt\n lastMessageAt\n}\n \n\n fragment customer on Customer {\n id\n name\n alternateName\n email\n phone\n document\n externalId\n emails\n phones\n documents\n externalIds\n apps {\n id\n name\n }\n status\n createdAt\n updatedAt\n}\n ";
1998
+ export declare const StartCustomSessionDocument = "\n mutation startCustomSession($input: StartSessionInput!) {\n startCustomSession(input: $input) {\n ...session\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n createdAt\n lastMessageAt\n}\n ";
1999
+ export declare const GetSessionDocument = "\n query getSession($sessionId: ID!, $withCustomer: Boolean = true, $withAttributes: Boolean = true) {\n getSession(sessionId: $sessionId) {\n ...session\n customer @include(if: $withCustomer) {\n ...customer\n }\n attributes @include(if: $withAttributes)\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n createdAt\n lastMessageAt\n}\n \n\n fragment customer on Customer {\n id\n name\n alternateName\n email\n phone\n document\n externalId\n emails\n phones\n documents\n externalIds\n apps {\n id\n name\n }\n status\n createdAt\n updatedAt\n}\n ";
2000
+ export declare const GetActiveSessionDocument = "\n query getActiveSession($customer: GetOrCreateCustomerInput!, $triggerDrn: ID!) {\n getActiveSession(customer: $customer, triggerDrn: $triggerDrn) {\n ...session\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n createdAt\n lastMessageAt\n}\n ";
1986
2001
  export declare const GetSessionSchemaDocument = "\n query getSessionSchema($lang: String) {\n getSessionSchema(lang: $lang) {\n ...sessionSchema\n }\n}\n \n fragment sessionSchema on AppSessionSchemaFields {\n name\n fields {\n name\n description\n }\n}\n ";
1987
2002
  export declare const GetSessionSchemaForAppIdDocument = "\n query getSessionSchemaForAppId($appId: ID!, $lang: String) {\n getSessionSchemaForAppId(appId: $appId, lang: $lang) {\n ...sessionSchema\n }\n}\n \n fragment sessionSchema on AppSessionSchemaFields {\n name\n fields {\n name\n description\n }\n}\n ";
1988
2003
  export declare const SearchSessionsDocument = "\n query searchSessions($q: String, $filters: [SessionSearchFilterInput!], $page: Number, $perPage: Number) {\n searchSessions(q: $q, filters: $filters, page: $page, perPage: $perPage) {\n nodes {\n ...indexedSession\n }\n stats {\n found\n outOf\n page\n totalPages\n perPage\n searchTime\n }\n }\n}\n \n fragment indexedSession on IndexedSession {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n customer\n attributes\n context\n messages\n}\n ";
@@ -1990,7 +2005,7 @@ export declare const SetSessionAttributeDocument = "\n mutation setSessionAtt
1990
2005
  export declare const PatchSessionAttributesDocument = "\n mutation patchSessionAttributes($input: PatchSessionAttributesInput!) {\n patchSessionAttributes(input: $input)\n}\n ";
1991
2006
  export declare const AddTagsToSessionAttributesDocument = "\n mutation addTagsToSessionAttributes($input: AddTagsToSessionAttributesInput!) {\n addTagsToSessionAttributes(input: $input)\n}\n ";
1992
2007
  export declare const RemoveTagsFromSessionAttributesDocument = "\n mutation removeTagsFromSessionAttributes($input: RemoveTagsFromSessionAttributesInput!) {\n removeTagsFromSessionAttributes(input: $input)\n}\n ";
1993
- export declare const ReactivateSessionDocument = "\n mutation reactivateSession($sessionId: ID!) {\n reactivateSession(sessionId: $sessionId) {\n ...session\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n}\n ";
2008
+ export declare const ReactivateSessionDocument = "\n mutation reactivateSession($sessionId: ID!) {\n reactivateSession(sessionId: $sessionId) {\n ...session\n }\n}\n \n fragment session on Session {\n sessionId\n customerId\n stateMachineId\n triggerDrn\n status\n createdAt\n lastMessageAt\n}\n ";
1994
2009
  export declare const GetSettingsDocument = "\n query getSettings {\n getSettings {\n ...settings\n }\n}\n \n fragment settings on Settings {\n doNotAllowUserSignup\n allowedEmailDomains\n groupsMapping {\n from\n to\n }\n}\n ";
1995
2010
  export declare const UpdateSettingsDocument = "\n mutation updateSettings($input: UpdateSettingsInput!) {\n updateSettings(input: $input) {\n ...settings\n }\n}\n \n fragment settings on Settings {\n doNotAllowUserSignup\n allowedEmailDomains\n groupsMapping {\n from\n to\n }\n}\n ";
1996
2011
  export declare const GetStateMachineDocument = "\n query getStateMachine($id: ID!, $versionId: ID!) {\n getStateMachineConfig(id: $id, versionId: $versionId) {\n ...stateMachineConfig\n }\n}\n \n fragment stateMachineConfig on StateMachineConfig {\n id\n versionId\n stateMachineId\n title\n description\n status\n triggers\n states {\n ...stateMachineConfigState\n }\n createdAt\n updatedAt\n}\n \n\n fragment stateMachineConfigState on StateMachineConfigState {\n stateId\n on {\n ...stateMachineConfigStateOn\n }\n meta\n}\n \n\n fragment stateMachineConfigStateOn on StateMachineConfigStatesOn {\n event\n target\n}\n ";
@@ -2077,6 +2092,7 @@ export declare function getSdk<C>(requester: Requester<C>): {
2077
2092
  startSession(variables: StartSessionMutationVariables, options?: C): Promise<StartSessionMutation>;
2078
2093
  startCustomSession(variables: StartCustomSessionMutationVariables, options?: C): Promise<StartCustomSessionMutation>;
2079
2094
  getSession(variables: GetSessionQueryVariables, options?: C): Promise<GetSessionQuery>;
2095
+ getActiveSession(variables: GetActiveSessionQueryVariables, options?: C): Promise<GetActiveSessionQuery>;
2080
2096
  getSessionSchema(variables?: GetSessionSchemaQueryVariables, options?: C): Promise<GetSessionSchemaQuery>;
2081
2097
  getSessionSchemaForAppId(variables: GetSessionSchemaForAppIdQueryVariables, options?: C): Promise<GetSessionSchemaForAppIdQuery>;
2082
2098
  searchSessions(variables?: SearchSessionsQueryVariables, options?: C): Promise<SearchSessionsQuery>;
@@ -2,8 +2,8 @@
2
2
  /* istanbul ignore file */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.RemoveRoleFromAgentDocument = exports.AddRoleToAgentDocument = exports.RemoveSystemApiKeyAgentDocument = exports.RemoveAgentDocument = exports.UpdateAgentDocument = exports.CreateSystemApiKeyAgentDocument = exports.CreateApiKeyAgentDocument = exports.CreateAgentDocument = exports.ChangeAgentStatusDocument = exports.UpdateMyProfileDocument = exports.SearchAgentsDocument = exports.ListApiKeyAgentsDocument = exports.ListAgentsDocument = exports.GetAgentsDocument = exports.GetAgentByEmailDocument = exports.GetAgentDocument = exports.GetMeDocument = exports.StorageFragmentDoc = exports.StateMachineConfigConnectionFragmentDoc = exports.StateMachineConfigFragmentDoc = exports.StateMachineConfigStateFragmentDoc = exports.StateMachineConfigStateOnFragmentDoc = exports.SettingsFragmentDoc = exports.SessionSchemaFragmentDoc = exports.IndexedSessionFragmentDoc = exports.SessionFragmentDoc = exports.RoleFragmentDoc = exports.PolicyFragmentDoc = exports.CronJobFragmentDoc = exports.CustomerFragmentDoc = exports.CredentialsWithSecretFragmentDoc = exports.SafeCredentialsFragmentDoc = exports.AppWithInstancesFragmentDoc = exports.AppInstanceFragmentDoc = exports.AppFragmentDoc = exports.ApiKeyFragmentDoc = exports.AgentFragmentDoc = exports.Typenames = exports.SystemRole = exports.StateMachineConfigStatus = exports.SessionStatus = exports.PatchOperation = exports.OperationMode = exports.CustomerStatus = exports.CustomerIndex = exports.CredentialsType = exports.Can = exports.AppType = exports.AppInstanceStatus = exports.AgentStatus = void 0;
5
- exports.SearchSessionsDocument = exports.GetSessionSchemaForAppIdDocument = exports.GetSessionSchemaDocument = exports.GetSessionDocument = exports.StartCustomSessionDocument = exports.StartSessionDocument = exports.CheckPermissionsDocument = exports.GetSystemRoleDocument = exports.ListSystemRolesDocument = exports.RemoveCronJobDocument = exports.UpdateCronJobDocument = exports.CreateCronJobDocument = exports.ListCronJobsDocument = exports.GetCronJobDocument = exports.DeleteCustomerDocument = exports.UpdateCustomerDocument = exports.RefreshContactDataDocument = exports.GetOrCreateCustomerDocument = exports.CreateCustomerDocument = exports.DynamicSearchCustomerDocument = exports.SearchCustomersDocument = exports.ListCustomersDocument = exports.BatchGetCustomersByIdDocument = exports.GetCustomerDocument = exports.RemoveSystemCredentialsDocument = exports.RemoveCredentialsDocument = exports.UpdateCredentialsDocument = exports.CreateSystemCredentialsDocument = exports.CreateCredentialsDocument = exports.GetMercadoLivreAuthInfoDocument = exports.CountCredentialsDocument = exports.ListCredentialsDocument = exports.GetMetaAuthInfoDocument = exports.GetCredentialsSecretDocument = exports.GetCredentialsDocument = exports.GetAuthInfoDocument = exports.GetAmplifyConfigDocument = exports.GetFederationMetadataDocument = exports.UnregisterAppInstanceDocument = exports.RegisterAppInstanceDocument = exports.CountAppInstancesDocument = exports.ListAppInstancesDocument = exports.GetAppInstancesDocument = exports.GetAppInstanceDocument = exports.ListAppsDocument = exports.GetAppDocument = exports.ResendConfirmationEmailDocument = exports.LeaveOrganizationDocument = exports.JoinAsSuperAdminDocument = exports.ChangeAgentRoleDocument = void 0;
6
- exports.serviceName = exports.CreatePresignedUploadUrlDocument = exports.GetStorageDocument = exports.RemoveStateMachineConfigStateDocument = exports.UpdateStateMachineConfigStateDocument = exports.CreateStateMachineConfigStateDocument = exports.PublishStateMachineConfigDocument = exports.EditStateMachineConfigDocument = exports.RemoveStateMachineConfigDocument = exports.UpdateStateMachineConfigDocument = exports.CreateStateMachineConfigDocument = exports.IsAppInstanceInUseDocument = exports.GetXStateMachineConfigDocument = exports.ListStateMachineConfigVersionsDocument = exports.ListStateMachineConfigsByStatusDocument = exports.ListDraftStateMachineConfigsDocument = exports.ListLiveStateMachineConfigsDocument = exports.CountLiveStateMachineConfigsDocument = exports.GetStateMachineDocument = exports.UpdateSettingsDocument = exports.GetSettingsDocument = exports.ReactivateSessionDocument = exports.RemoveTagsFromSessionAttributesDocument = exports.AddTagsToSessionAttributesDocument = exports.PatchSessionAttributesDocument = exports.SetSessionAttributeDocument = void 0;
5
+ exports.GetSessionSchemaForAppIdDocument = exports.GetSessionSchemaDocument = exports.GetActiveSessionDocument = exports.GetSessionDocument = exports.StartCustomSessionDocument = exports.StartSessionDocument = exports.CheckPermissionsDocument = exports.GetSystemRoleDocument = exports.ListSystemRolesDocument = exports.RemoveCronJobDocument = exports.UpdateCronJobDocument = exports.CreateCronJobDocument = exports.ListCronJobsDocument = exports.GetCronJobDocument = exports.DeleteCustomerDocument = exports.UpdateCustomerDocument = exports.RefreshContactDataDocument = exports.GetOrCreateCustomerDocument = exports.CreateCustomerDocument = exports.DynamicSearchCustomerDocument = exports.SearchCustomersDocument = exports.ListCustomersDocument = exports.BatchGetCustomersByIdDocument = exports.GetCustomerDocument = exports.RemoveSystemCredentialsDocument = exports.RemoveCredentialsDocument = exports.UpdateCredentialsDocument = exports.CreateSystemCredentialsDocument = exports.CreateCredentialsDocument = exports.GetMercadoLivreAuthInfoDocument = exports.CountCredentialsDocument = exports.ListCredentialsDocument = exports.GetMetaAuthInfoDocument = exports.GetCredentialsSecretDocument = exports.GetCredentialsDocument = exports.GetAuthInfoDocument = exports.GetAmplifyConfigDocument = exports.GetFederationMetadataDocument = exports.UnregisterAppInstanceDocument = exports.RegisterAppInstanceDocument = exports.CountAppInstancesDocument = exports.ListAppInstancesDocument = exports.GetAppInstancesDocument = exports.GetAppInstanceDocument = exports.ListAppsDocument = exports.GetAppDocument = exports.ResendConfirmationEmailDocument = exports.LeaveOrganizationDocument = exports.JoinAsSuperAdminDocument = exports.ChangeAgentRoleDocument = void 0;
6
+ exports.serviceName = exports.CreatePresignedUploadUrlDocument = exports.GetStorageDocument = exports.RemoveStateMachineConfigStateDocument = exports.UpdateStateMachineConfigStateDocument = exports.CreateStateMachineConfigStateDocument = exports.PublishStateMachineConfigDocument = exports.EditStateMachineConfigDocument = exports.RemoveStateMachineConfigDocument = exports.UpdateStateMachineConfigDocument = exports.CreateStateMachineConfigDocument = exports.IsAppInstanceInUseDocument = exports.GetXStateMachineConfigDocument = exports.ListStateMachineConfigVersionsDocument = exports.ListStateMachineConfigsByStatusDocument = exports.ListDraftStateMachineConfigsDocument = exports.ListLiveStateMachineConfigsDocument = exports.CountLiveStateMachineConfigsDocument = exports.GetStateMachineDocument = exports.UpdateSettingsDocument = exports.GetSettingsDocument = exports.ReactivateSessionDocument = exports.RemoveTagsFromSessionAttributesDocument = exports.AddTagsToSessionAttributesDocument = exports.PatchSessionAttributesDocument = exports.SetSessionAttributeDocument = exports.SearchSessionsDocument = void 0;
7
7
  exports.getSdk = getSdk;
8
8
  var AgentStatus;
9
9
  (function (AgentStatus) {
@@ -297,6 +297,8 @@ exports.SessionFragmentDoc = `
297
297
  stateMachineId
298
298
  triggerDrn
299
299
  status
300
+ createdAt
301
+ lastMessageAt
300
302
  }
301
303
  `;
302
304
  exports.IndexedSessionFragmentDoc = `
@@ -913,6 +915,13 @@ exports.GetSessionDocument = `
913
915
  }
914
916
  ${exports.SessionFragmentDoc}
915
917
  ${exports.CustomerFragmentDoc}`;
918
+ exports.GetActiveSessionDocument = `
919
+ query getActiveSession($customer: GetOrCreateCustomerInput!, $triggerDrn: ID!) {
920
+ getActiveSession(customer: $customer, triggerDrn: $triggerDrn) {
921
+ ...session
922
+ }
923
+ }
924
+ ${exports.SessionFragmentDoc}`;
916
925
  exports.GetSessionSchemaDocument = `
917
926
  query getSessionSchema($lang: String) {
918
927
  getSessionSchema(lang: $lang) {
@@ -1335,6 +1344,9 @@ function getSdk(requester) {
1335
1344
  getSession(variables, options) {
1336
1345
  return requester(exports.GetSessionDocument, variables, options);
1337
1346
  },
1347
+ getActiveSession(variables, options) {
1348
+ return requester(exports.GetActiveSessionDocument, variables, options);
1349
+ },
1338
1350
  getSessionSchema(variables, options) {
1339
1351
  return requester(exports.GetSessionSchemaDocument, variables, options);
1340
1352
  },