@pushwoosh/rpc-gateway-ai-assistant 0.1.618 → 0.1.620

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/data.js CHANGED
@@ -1021,6 +1021,32 @@ export const data = {
1021
1021
  }
1022
1022
  }
1023
1023
  },
1024
+ "pushwoosh.aibuilder.v1.InAppFormSuccess": {
1025
+ "type": "I",
1026
+ "fields": {
1027
+ "title": {
1028
+ "type": "string"
1029
+ },
1030
+ "titleTranslations": {
1031
+ "type": "string",
1032
+ "mapKeyType": "string"
1033
+ },
1034
+ "text": {
1035
+ "type": "string"
1036
+ },
1037
+ "textTranslations": {
1038
+ "type": "string",
1039
+ "mapKeyType": "string"
1040
+ },
1041
+ "buttonLabel": {
1042
+ "type": "string"
1043
+ },
1044
+ "buttonLabelTranslations": {
1045
+ "type": "string",
1046
+ "mapKeyType": "string"
1047
+ }
1048
+ }
1049
+ },
1024
1050
  "pushwoosh.aibuilder.v1.InAppForm": {
1025
1051
  "type": "I",
1026
1052
  "fields": {
@@ -1033,6 +1059,12 @@ export const data = {
1033
1059
  },
1034
1060
  "submit": {
1035
1061
  "type": "pushwoosh.aibuilder.v1.AnswerSubmit"
1062
+ },
1063
+ "subscribed": {
1064
+ "type": "pushwoosh.aibuilder.v1.InAppFormSuccess"
1065
+ },
1066
+ "confirmEmail": {
1067
+ "type": "pushwoosh.aibuilder.v1.InAppFormSuccess"
1036
1068
  }
1037
1069
  }
1038
1070
  },
@@ -3473,6 +3505,9 @@ export const data = {
3473
3505
  },
3474
3506
  "position": {
3475
3507
  "type": "pushwoosh.aigen.v1.PopupPosition"
3508
+ },
3509
+ "deviceApiUrl": {
3510
+ "type": "string"
3476
3511
  }
3477
3512
  }
3478
3513
  },
@@ -4021,6 +4056,15 @@ export const data = {
4021
4056
  },
4022
4057
  "isAdvisor": {
4023
4058
  "type": "boolean"
4059
+ },
4060
+ "kind": {
4061
+ "type": "string"
4062
+ },
4063
+ "cardId": {
4064
+ "type": "number"
4065
+ },
4066
+ "needsDecision": {
4067
+ "type": "boolean"
4024
4068
  }
4025
4069
  }
4026
4070
  },
@@ -5455,6 +5499,12 @@ export const data = {
5455
5499
  "method": "post",
5456
5500
  "path": "/api/v1/applications/{application}/board/cards/{card_id}/chat"
5457
5501
  },
5502
+ "GetCardTimeline": {
5503
+ "request": "pushwoosh.uds.onyx.v1.GetCardTimelineRequest",
5504
+ "response": "pushwoosh.uds.onyx.v1.GetCardTimelineResponse",
5505
+ "method": "get",
5506
+ "path": "/api/v1/applications/{application}/board/cards/{card_id}/timeline"
5507
+ },
5458
5508
  "GetAgentAccess": {
5459
5509
  "request": "pushwoosh.uds.onyx.v1.GetAgentAccessRequest",
5460
5510
  "response": "pushwoosh.uds.onyx.v1.GetAgentAccessResponse",
@@ -5860,6 +5910,97 @@ export const data = {
5860
5910
  }
5861
5911
  }
5862
5912
  },
5913
+ "pushwoosh.uds.onyx.v1.GetCardTimelineRequest": {
5914
+ "type": "I",
5915
+ "fields": {
5916
+ "application": {
5917
+ "type": "string"
5918
+ },
5919
+ "cardId": {
5920
+ "type": "number"
5921
+ },
5922
+ "cursor": {
5923
+ "type": "string"
5924
+ },
5925
+ "limit": {
5926
+ "type": "number"
5927
+ }
5928
+ }
5929
+ },
5930
+ "pushwoosh.uds.onyx.v1.GetCardTimelineResponse": {
5931
+ "type": "I",
5932
+ "fields": {
5933
+ "chatId": {
5934
+ "type": "number"
5935
+ },
5936
+ "items": {
5937
+ "type": "pushwoosh.uds.onyx.v1.TimelineItem",
5938
+ "array": true
5939
+ },
5940
+ "nextCursor": {
5941
+ "type": "string"
5942
+ }
5943
+ }
5944
+ },
5945
+ "pushwoosh.uds.onyx.v1.TimelineItem": {
5946
+ "type": "I",
5947
+ "fields": {
5948
+ "at": {
5949
+ "type": "Date"
5950
+ },
5951
+ "event": {
5952
+ "type": "pushwoosh.uds.onyx.v1.CardEvent"
5953
+ },
5954
+ "message": {
5955
+ "type": "pushwoosh.accounts.assistant.v1.Message"
5956
+ }
5957
+ },
5958
+ "oneofs": {
5959
+ "item": {
5960
+ "oneof": [
5961
+ "event",
5962
+ "message"
5963
+ ]
5964
+ }
5965
+ }
5966
+ },
5967
+ "pushwoosh.uds.onyx.v1.CardEvent": {
5968
+ "type": "I",
5969
+ "fields": {
5970
+ "id": {
5971
+ "type": "number"
5972
+ },
5973
+ "fromState": {
5974
+ "type": "string"
5975
+ },
5976
+ "toState": {
5977
+ "type": "string"
5978
+ },
5979
+ "actor": {
5980
+ "type": "string"
5981
+ },
5982
+ "reason": {
5983
+ "type": "string"
5984
+ },
5985
+ "chatId": {
5986
+ "type": "number"
5987
+ },
5988
+ "sourceChat": {
5989
+ "type": "pushwoosh.uds.onyx.v1.SourceChat"
5990
+ }
5991
+ }
5992
+ },
5993
+ "pushwoosh.uds.onyx.v1.SourceChat": {
5994
+ "type": "I",
5995
+ "fields": {
5996
+ "id": {
5997
+ "type": "number"
5998
+ },
5999
+ "title": {
6000
+ "type": "string"
6001
+ }
6002
+ }
6003
+ },
5863
6004
  "pushwoosh.uds.onyx.v1.GetAgentAccessRequest": {
5864
6005
  "type": "I",
5865
6006
  "fields": {
@@ -5876,6 +6017,12 @@ export const data = {
5876
6017
  },
5877
6018
  "hasGoal": {
5878
6019
  "type": "boolean"
6020
+ },
6021
+ "stage": {
6022
+ "type": "string"
6023
+ },
6024
+ "agencyChatId": {
6025
+ "type": "number"
5879
6026
  }
5880
6027
  }
5881
6028
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.618",
3
+ "version": "0.1.620",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -100,6 +100,12 @@ export type Chat = {
100
100
  * holding the marketing agent's cards and reports. It cannot be deleted, cleared or renamed.
101
101
  */
102
102
  isAdvisor: boolean;
103
+ /** kind is regular, onboarding, agency (the advisor chat) or card; a card chat is the card's own, 1:1. */
104
+ kind: string;
105
+ /** card_id is the card a card chat belongs to. */
106
+ cardId: number;
107
+ /** needs_decision marks a card chat whose card waits for the user (GetAllChats only). */
108
+ needsDecision: boolean;
103
109
  };
104
110
  /** CreateChatRequest for creating a new chat */
105
111
  export type CreateChatRequest = {
@@ -808,6 +808,15 @@ export type InAppFormField = {
808
808
  /** EMAIL / PHONE only; unset = no consent checkbox. */
809
809
  consent?: InAppFormConsent;
810
810
  };
811
+ /** What replaces the in-app after the form went out; its button closes the in-app. */
812
+ export type InAppFormSuccess = {
813
+ title: string;
814
+ titleTranslations: Record<string, string>;
815
+ text: string;
816
+ textTranslations: Record<string, string>;
817
+ buttonLabel: string;
818
+ buttonLabelTranslations: Record<string, string>;
819
+ };
811
820
  /**
812
821
  * Field form (in-app only): email / phone become the user's channels, name / text go to tags.
813
822
  * Posts PW_InAppAnswer {question, inapp_code}; field values never go to the event.
@@ -817,6 +826,10 @@ export type InAppForm = {
817
826
  question: string;
818
827
  fields: InAppFormField[];
819
828
  submit: AnswerSubmit;
829
+ /** Shown when nothing waits for a confirmation; unset = the stock copy. */
830
+ subscribed: InAppFormSuccess;
831
+ /** Shown when the application's double opt-in sent a confirmation letter. */
832
+ confirmEmail: InAppFormSuccess;
820
833
  };
821
834
  /**
822
835
  * Countdown timer. Renders in email HTML as an animated GIF served by this
@@ -1033,6 +1033,8 @@ export type AiGenDocumentToPopupHtmlRequest = {
1033
1033
  closeButton: PopupCloseButton;
1034
1034
  /** An edge offset authored on the document outranks this. */
1035
1035
  position: PopupPosition;
1036
+ /** Public device-api origin the in-app form posts email / phone to; empty = the form writes tags only. */
1037
+ deviceApiUrl: string;
1036
1038
  };
1037
1039
  export type AiGenDocumentToPopupHtmlResponse = {
1038
1040
  html: string;
@@ -1,4 +1,5 @@
1
1
  import { RpcMethod, JsonObject } from './commonTypes';
2
+ import { Message as pushwoosh_accounts_assistant_v1_Message } from './pushwoosh_accounts_assistant_v1';
2
3
  /**
3
4
  * AgentProfileService turns the marketing agent on per application (ai_agent_profiles).
4
5
  * Private port :9191 only: identity comes from account-id / user-id metadata.
@@ -8,6 +9,7 @@ export interface AgentProfileService {
8
9
  export type BoardService_GetBoard = RpcMethod<GetBoardRequest, GetBoardResponse>;
9
10
  export type BoardService_MoveCard = RpcMethod<MoveCardRequest, MoveCardResponse>;
10
11
  export type BoardService_OpenCardChat = RpcMethod<OpenCardChatRequest, OpenCardChatResponse>;
12
+ export type BoardService_GetCardTimeline = RpcMethod<GetCardTimelineRequest, GetCardTimelineResponse>;
11
13
  export type BoardService_GetAgentAccess = RpcMethod<GetAgentAccessRequest, GetAgentAccessResponse>;
12
14
  /**
13
15
  * BoardService is the marketing agent's board: cards laid out in columns, each rendered by its kind.
@@ -17,8 +19,10 @@ export interface BoardService {
17
19
  GetBoard: BoardService_GetBoard;
18
20
  /** Applies one of the card's view.actions; any other transition is FailedPrecondition. */
19
21
  MoveCard: BoardService_MoveCard;
20
- /** The chat that last touched the card; with none, the application's advisor chat. */
22
+ /** The card's own chat, created with the card; a card without one (wake) is NotFound. */
21
23
  OpenCardChat: BoardService_OpenCardChat;
24
+ /** The card's history newest first: its events and its chat's messages merged by time. */
25
+ GetCardTimeline: BoardService_GetCardTimeline;
22
26
  GetAgentAccess: BoardService_GetAgentAccess;
23
27
  }
24
28
  export type Card = {
@@ -181,6 +185,51 @@ export type OpenCardChatRequest = {
181
185
  export type OpenCardChatResponse = {
182
186
  chatId: number;
183
187
  };
188
+ export type GetCardTimelineRequest = {
189
+ application: string;
190
+ cardId: number;
191
+ /** next_cursor of the previous page; empty for the newest page. */
192
+ cursor: string;
193
+ /** Items per page; 0 is 50, capped at 200. */
194
+ limit: number;
195
+ };
196
+ export type GetCardTimelineResponse = {
197
+ chatId: number;
198
+ /** Newest first. */
199
+ items: TimelineItem[];
200
+ /** Empty on the last page. */
201
+ nextCursor: string;
202
+ };
203
+ export type TimelineItem_item_event = {
204
+ type: 'event';
205
+ data: CardEvent;
206
+ };
207
+ export type TimelineItem_item_message = {
208
+ type: 'message';
209
+ data: pushwoosh_accounts_assistant_v1_Message;
210
+ };
211
+ export type TimelineItem_item = TimelineItem_item_event | TimelineItem_item_message;
212
+ export type TimelineItem = {
213
+ at: Date;
214
+ item: TimelineItem_item;
215
+ };
216
+ /** CardEvent is one row of the card's history, the only record of its moves. */
217
+ export type CardEvent = {
218
+ id: number;
219
+ fromState: string;
220
+ toState: string;
221
+ /** agent, user or system. */
222
+ actor: string;
223
+ reason: string;
224
+ /** The chat the move was made from, 0 when none. */
225
+ chatId: number;
226
+ /** Set when chat_id is another chat than the card's: "decided in chat <title>". */
227
+ sourceChat: SourceChat;
228
+ };
229
+ export type SourceChat = {
230
+ id: number;
231
+ title: string;
232
+ };
184
233
  export type GetAgentAccessRequest = {
185
234
  application: string;
186
235
  };
@@ -189,4 +238,8 @@ export type GetAgentAccessResponse = {
189
238
  enabled: boolean;
190
239
  /** A goal is active, or reached and still on the board. */
191
240
  hasGoal: boolean;
241
+ /** no_goal | goal_proposed | goal_active: goal_active as has_goal, goal_proposed when only a goal card waits for the client. */
242
+ stage: string;
243
+ /** The application's agency (advisor) chat, created on first read; 0 when the agent is off. */
244
+ agencyChatId: number;
192
245
  };