@inploi/plugin-chatbot 7.1.1 → 9.0.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.
package/dist/chatbot.d.ts CHANGED
@@ -80,5 +80,6 @@ export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, terms,
80
80
  fetchFlowById: (flowId: string, additionalProperties?: FetchFlowByIdAdditionalProperties) => Promise<OpenChatbotParams>;
81
81
  open: (params: OpenChatbotParams | Promise<OpenChatbotParams>) => Promise<void>;
82
82
  close: () => Promise<void>;
83
+ destroy: () => void;
83
84
  };
84
85
  export {};
@@ -1,4 +1,5 @@
1
1
  export declare const createChatbotDomManager: () => {
2
- getOrCreateChatbotElement: () => Element;
2
+ getChatbotElement: () => HTMLDivElement | null;
3
+ getOrCreateChatbotElement: () => HTMLDivElement;
3
4
  };
4
5
  export type ChatbotDomManager = ReturnType<typeof createChatbotDomManager>;
@@ -14,5 +14,6 @@ export declare const idb: {
14
14
  sequence: number;
15
15
  submissions: KeyToSubmissionMap;
16
16
  } | undefined>;
17
- setStateData: (params: StartedFlow) => Promise<string | undefined>;
17
+ setStateData: (params: StartedFlow) => void;
18
+ flushStateData: () => Promise<unknown>;
18
19
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -36,7 +36,253 @@ export declare const store: {
36
36
  current$: import('@preact/signals').Signal<CurrentFlow>;
37
37
  viewState$: import('@preact/signals').Signal<"maximised" | "minimised" | "closed">;
38
38
  inputHeight$: import('@preact/signals').Signal<number>;
39
- startFlow: ({ flow, context, flowKeys, title, analytics, job, locationOrigin }: OpenChatbotParams) => Promise<void>;
39
+ prepareFlow: ({ flow, context, flowKeys, title, analytics, job, locationOrigin }: OpenChatbotParams) => Promise<{
40
+ data: FlowStateData;
41
+ startedAt: Date;
42
+ nodeIdToProgress: Record<string, ChatbotFlowProgress>;
43
+ flowKeys: string[];
44
+ id: string;
45
+ version: number;
46
+ nodes: ({
47
+ type: "text";
48
+ id: string;
49
+ data: {
50
+ text: string;
51
+ };
52
+ isHead?: boolean | undefined;
53
+ nextId?: string | undefined;
54
+ } | {
55
+ type: "end-flow";
56
+ id: string;
57
+ data: {
58
+ systemMessage: string;
59
+ };
60
+ isHead?: boolean | undefined;
61
+ nextId?: string | undefined;
62
+ } | {
63
+ type: "integration-application-submit";
64
+ id: string;
65
+ data: {
66
+ integrationId: string;
67
+ skipConfirmation: boolean;
68
+ submitLabel: string;
69
+ submitKeys: "all" | string[];
70
+ key?: string | undefined;
71
+ };
72
+ isHead?: boolean | undefined;
73
+ nextId?: string | undefined;
74
+ } | {
75
+ type: "integration-workflow-get";
76
+ id: string;
77
+ data: {
78
+ integrationId: string;
79
+ };
80
+ isHead?: boolean | undefined;
81
+ nextId?: string | undefined;
82
+ } | {
83
+ type: "link";
84
+ id: string;
85
+ data: {
86
+ href: string;
87
+ cta: string;
88
+ };
89
+ isHead?: boolean | undefined;
90
+ nextId?: string | undefined;
91
+ } | {
92
+ type: "image";
93
+ id: string;
94
+ data: {
95
+ url: string;
96
+ width: number;
97
+ height: number;
98
+ };
99
+ isHead?: boolean | undefined;
100
+ nextId?: string | undefined;
101
+ } | {
102
+ type: "question-boolean";
103
+ id: string;
104
+ data: {
105
+ key: string;
106
+ question: string;
107
+ trueLabel: string;
108
+ falseLabel: string;
109
+ optional: boolean;
110
+ };
111
+ isHead?: boolean | undefined;
112
+ nextId?: string | undefined;
113
+ } | {
114
+ type: "question-text";
115
+ id: string;
116
+ data: {
117
+ key: string;
118
+ question: string;
119
+ optional: boolean;
120
+ format: "date" | "text" | "url" | "email" | "phone";
121
+ placeholder?: string | undefined;
122
+ maxChars?: number | undefined;
123
+ minChars?: number | undefined;
124
+ };
125
+ isHead?: boolean | undefined;
126
+ nextId?: string | undefined;
127
+ } | {
128
+ type: "question-number";
129
+ id: string;
130
+ data: {
131
+ key: string;
132
+ question: string;
133
+ optional: boolean;
134
+ placeholder?: string | undefined;
135
+ decimalCases?: number | undefined;
136
+ min?: number | undefined;
137
+ max?: number | undefined;
138
+ };
139
+ isHead?: boolean | undefined;
140
+ nextId?: string | undefined;
141
+ } | {
142
+ type: "question-phone";
143
+ id: string;
144
+ data: {
145
+ key: string;
146
+ question: string;
147
+ optional: boolean;
148
+ placeholder: string;
149
+ minChars: number;
150
+ defaultCountryCode: string;
151
+ };
152
+ isHead?: boolean | undefined;
153
+ nextId?: string | undefined;
154
+ } | {
155
+ type: "question-enum";
156
+ id: string;
157
+ data: {
158
+ options: {
159
+ value: string;
160
+ label: string;
161
+ }[];
162
+ key: string;
163
+ question: string;
164
+ maxSelected: number;
165
+ minSelected: number;
166
+ };
167
+ isHead?: boolean | undefined;
168
+ nextId?: string | undefined;
169
+ } | {
170
+ type: "question-file";
171
+ id: string;
172
+ data: {
173
+ key: string;
174
+ question: string;
175
+ optional: boolean;
176
+ extensions: string[];
177
+ multiple?: boolean | undefined;
178
+ maxSizeKb?: number | undefined;
179
+ };
180
+ isHead?: boolean | undefined;
181
+ nextId?: string | undefined;
182
+ } | {
183
+ type: "question-address";
184
+ id: string;
185
+ data: {
186
+ keys: {
187
+ line1: string | null;
188
+ line2: string | null;
189
+ line3: string | null;
190
+ city: string | null;
191
+ state: string | null;
192
+ postcode: string | null;
193
+ country: string | null;
194
+ };
195
+ key: string;
196
+ question: string;
197
+ optional: boolean;
198
+ placeholder?: string | undefined;
199
+ };
200
+ isHead?: boolean | undefined;
201
+ nextId?: string | undefined;
202
+ } | {
203
+ type: "if-block";
204
+ id: string;
205
+ data: {
206
+ compareKey: string;
207
+ compareValue: string;
208
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
209
+ } | {
210
+ combinator: "and" | "or";
211
+ conditions: {
212
+ compareKey: string;
213
+ compareValue: string;
214
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
215
+ }[];
216
+ };
217
+ isHead?: boolean | undefined;
218
+ nextId?: string | undefined;
219
+ branchId?: string | undefined;
220
+ } | {
221
+ type: "jump";
222
+ id: string;
223
+ data: {
224
+ targetId: string;
225
+ };
226
+ isHead?: boolean | undefined;
227
+ nextId?: string | undefined;
228
+ } | {
229
+ type: "add-submission";
230
+ id: string;
231
+ data: {
232
+ value: string;
233
+ key: string;
234
+ };
235
+ isHead?: boolean | undefined;
236
+ nextId?: string | undefined;
237
+ } | {
238
+ type: "identify";
239
+ id: string;
240
+ data: {
241
+ key: string;
242
+ email?: string | undefined;
243
+ firstName?: string | undefined;
244
+ lastName?: string | undefined;
245
+ phoneNumber?: string | undefined;
246
+ customTraits?: {
247
+ value: string;
248
+ key: string;
249
+ }[] | undefined;
250
+ };
251
+ isHead?: boolean | undefined;
252
+ nextId?: string | undefined;
253
+ } | {
254
+ type: "check-duplicate";
255
+ id: string;
256
+ data: {
257
+ key: string;
258
+ email: string;
259
+ scope: "job" | "company";
260
+ };
261
+ isHead?: boolean | undefined;
262
+ nextId?: string | undefined;
263
+ } | {
264
+ type: "feedback";
265
+ id: string;
266
+ data: {};
267
+ isHead?: boolean | undefined;
268
+ nextId?: string | undefined;
269
+ })[];
270
+ build: number;
271
+ context: Record<string, unknown>;
272
+ title: string;
273
+ analytics: {
274
+ customProperties?: Record<string, unknown>;
275
+ } | undefined;
276
+ job: {
277
+ id: string;
278
+ id_type: "internal" | "external";
279
+ } | undefined;
280
+ locationOrigin: {
281
+ lat?: number;
282
+ lng?: number;
283
+ } | undefined;
284
+ }>;
285
+ commitFlow: (flow: StartedFlow) => void;
40
286
  cancelCurrentFlow: () => void;
41
287
  markAsFinished: () => void;
42
288
  setCurrentNodeId: (currentNodeId: string) => void;
@@ -235,7 +235,6 @@ export declare function gzip(string: string): string | Promise<string>;
235
235
  export declare class AbortedError extends Error {
236
236
  constructor();
237
237
  }
238
- export declare function debounce<TFn extends (...params: any[]) => void>(func: TFn, timeout?: number): TFn;
239
238
  export declare const isString: (value: unknown) => value is string;
240
239
  /** Creates a deterministic hash string from an object by JSON stringifying with sorted keys */
241
240
  export declare const hashObject: (obj: Record<string, unknown>) => string;
@@ -1,10 +1,10 @@
1
- import { AnalyticsService, ApiClient, Logger, PlatformClient } from '@inploi/sdk';
1
+ import { AnalyticsService, ApiClient, Logger, TalentBankClient } from '@inploi/sdk';
2
2
 
3
3
  type ChatbotBodyProps = {
4
4
  apiClient: ApiClient;
5
5
  logger: Logger;
6
6
  analytics: AnalyticsService;
7
- platformClient?: PlatformClient;
7
+ talentBankClient?: TalentBankClient;
8
8
  };
9
- export declare const ChatbotBody: ({ logger, apiClient, analytics, platformClient }: ChatbotBodyProps) => import("preact").JSX.Element;
9
+ export declare const ChatbotBody: ({ logger, apiClient, analytics, talentBankClient }: ChatbotBodyProps) => import("preact").JSX.Element;
10
10
  export {};
@@ -1,12 +1,12 @@
1
- import { AnalyticsService, ApiClient, Logger, PlatformClient } from '@inploi/sdk';
1
+ import { AnalyticsService, ApiClient, Logger, TalentBankClient } from '@inploi/sdk';
2
2
  import { ChatbotPluginParams } from '..';
3
3
 
4
4
  type ChatbotProps = {
5
5
  apiClient: ApiClient;
6
6
  logger: Logger;
7
7
  analytics: AnalyticsService;
8
- platformClient?: PlatformClient;
8
+ talentBankClient?: TalentBankClient;
9
9
  params: ChatbotPluginParams;
10
10
  };
11
- export declare const Chatbot: ({ logger, apiClient, analytics, platformClient, params }: ChatbotProps) => import("preact").JSX.Element;
11
+ export declare const Chatbot: ({ logger, apiClient, analytics, talentBankClient, params }: ChatbotProps) => import("preact").JSX.Element;
12
12
  export {};