@inploi/plugin-chatbot 14.13.3 → 14.15.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.
@@ -0,0 +1 @@
1
+ export {};
package/dist/chatbot.d.ts CHANGED
@@ -23,6 +23,8 @@ type InternalChatbotPluginParams = {
23
23
  theme: ChatbotTheme;
24
24
  feedback?: ChatbotFeedback;
25
25
  terms?: ChatbotTranslationTerms;
26
+ /** Offer email alerts after a submitted application reports that the role closed. */
27
+ jobAlerts?: boolean;
26
28
  /** @deprecated For internal usage only */
27
29
  _internal_domManager?: ChatbotDomManager;
28
30
  };
@@ -30,6 +32,8 @@ export type ChatbotPlugin = typeof chatbotPlugin;
30
32
  export type ChatbotPluginParams = RemoveInternal<InternalChatbotPluginParams>;
31
33
  export type Chatbot = ReturnType<ReturnType<ChatbotPlugin>>;
32
34
  export type OpenChatbotParams = {
35
+ /** Overrides the plugin's job-alert offer for this application. */
36
+ jobAlerts?: boolean;
33
37
  /** The application flow to be interpreted */
34
38
  flow: Flow;
35
39
  /** Specify the cache keys for restoring this flow from local state.
@@ -41,7 +45,9 @@ export type OpenChatbotParams = {
41
45
  /** Data to be forwarded to analytics events as custom properties. */
42
46
  customProperties?: Record<string, unknown>;
43
47
  };
44
- /** Context to be used by nodes internally. */
48
+ /** Job context returned by the API; host context wins at every leaf. */
49
+ jobContext?: Record<string, unknown>;
50
+ /** Host context to be used by nodes internally and to identify saved drafts. */
45
51
  context?: Record<string, unknown>;
46
52
  /** Title to display in the status bar */
47
53
  title: string;
@@ -62,7 +68,7 @@ export type FetchFlowByJobIdAdditionalProperties = Partial<OpenChatbotParams & {
62
68
  idType: 'inploi' | 'ats';
63
69
  }>;
64
70
  export type FetchFlowByIdAdditionalProperties = Partial<OpenChatbotParams>;
65
- export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, terms, feedback, }: InternalChatbotPluginParams) => ({ apiClient, rpcClient, logger, analytics, publishableKey, env }: {
71
+ export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, terms, feedback, jobAlerts, }: InternalChatbotPluginParams) => ({ apiClient, rpcClient, logger, analytics, publishableKey, env }: {
66
72
  apiClient: import('@inploi/sdk').ApiClient;
67
73
  rpcClient: import('@inploi/sdk').InploiRpcClient;
68
74
  logger: import('@inploi/sdk').Logger;
@@ -3,13 +3,16 @@ import { OpenChatbotParams } from '.';
3
3
  import { Flow } from './chatbot.api';
4
4
  import { ChatbotFlowProgress } from './progress';
5
5
 
6
- export declare const getCacheKey: (flow: Pick<StartedFlow, "flowKeys" | "id" | "version" | "build" | "context">) => string;
6
+ export declare const getCacheKey: (flow: Pick<StartedFlow, "flowKeys" | "id" | "version" | "build" | "context" | "hostContext">) => string;
7
7
  export type StartedFlow = Flow & {
8
+ jobAlerts?: boolean;
8
9
  flowKeys: string[];
9
10
  title: string;
10
11
  data: FlowStateData;
11
12
  startedAt: Date;
12
13
  context: Record<string, unknown>;
14
+ /** Original host context for draft keys when interpretation includes served job context. */
15
+ hostContext?: Record<string, unknown>;
13
16
  job: OpenChatbotParams['job'];
14
17
  locationOrigin: OpenChatbotParams['locationOrigin'];
15
18
  nodeIdToProgress: Record<string, ChatbotFlowProgress>;
@@ -42,6 +45,9 @@ type CurrentFlow = {
42
45
  } | {
43
46
  state: 'loaded';
44
47
  flow: StartedFlow;
48
+ } | {
49
+ state: 'closed';
50
+ flow?: never;
45
51
  }
46
52
  /** The reason is logged; the candidate sees only the translated heading. */
47
53
  | {
@@ -50,8 +56,8 @@ type CurrentFlow = {
50
56
  };
51
57
  export declare const store: {
52
58
  current$: import('@preact/signals').Signal<CurrentFlow>;
53
- viewState$: import('@preact/signals').Signal<"maximised" | "minimised" | "closed">;
54
- prepareFlow: ({ flow, context, flowKeys, title, analytics, job, locationOrigin, }: OpenChatbotParams) => Promise<StartedFlow>;
59
+ viewState$: import('@preact/signals').Signal<"closed" | "maximised" | "minimised">;
60
+ prepareFlow: ({ jobAlerts, flow, context, jobContext, flowKeys, title, analytics, job, locationOrigin, }: OpenChatbotParams) => Promise<StartedFlow>;
55
61
  commitFlow: (flow: StartedFlow) => void;
56
62
  /** The candidate chose to continue or start again, so this page does not ask about this application again. */
57
63
  settleResume: (flow: StartedFlow) => void;
@@ -1 +1,3 @@
1
- export declare const ChatError: () => import("preact").JSX.Element;
1
+ export declare const ChatError: ({ heading }: {
2
+ heading: "error_heading" | "flow_closed";
3
+ }) => import("preact").JSX.Element;
@@ -1,10 +1,11 @@
1
- import { AnalyticsService, ApiClient, Logger, TalentBankClient } from '@inploi/sdk';
1
+ import { AnalyticsService, ApiClient, Logger, InploiRpcClient, TalentBankClient } from '@inploi/sdk';
2
2
 
3
3
  type ChatbotBodyProps = {
4
+ rpcClient?: InploiRpcClient;
4
5
  apiClient: ApiClient;
5
6
  logger: Logger;
6
7
  analytics: AnalyticsService;
7
8
  talentBankClient?: TalentBankClient;
8
9
  };
9
- export declare const ChatbotBody: ({ logger, apiClient, analytics, talentBankClient }: ChatbotBodyProps) => import("preact").JSX.Element;
10
+ export declare const ChatbotBody: ({ logger, apiClient, rpcClient, analytics, talentBankClient }: ChatbotBodyProps) => import("preact").JSX.Element;
10
11
  export {};
@@ -1,12 +1,13 @@
1
- import { AnalyticsService, ApiClient, Logger, TalentBankClient } from '@inploi/sdk';
1
+ import { AnalyticsService, ApiClient, Logger, InploiRpcClient, TalentBankClient } from '@inploi/sdk';
2
2
  import { ChatbotPluginParams } from '..';
3
3
 
4
4
  type ChatbotProps = {
5
+ rpcClient?: InploiRpcClient;
5
6
  apiClient: ApiClient;
6
7
  logger: Logger;
7
8
  analytics: AnalyticsService;
8
9
  talentBankClient?: TalentBankClient;
9
10
  params: ChatbotPluginParams;
10
11
  };
11
- export declare const Chatbot: ({ logger, apiClient, analytics, talentBankClient, params }: ChatbotProps) => import("preact").JSX.Element;
12
+ export declare const Chatbot: ({ logger, apiClient, rpcClient, analytics, talentBankClient, params }: ChatbotProps) => import("preact").JSX.Element;
12
13
  export {};
@@ -1,5 +1,7 @@
1
+ import { InploiRpcClient } from '@inploi/sdk';
1
2
  import { VNode } from 'preact';
2
3
 
3
- export declare const Conversation: ({ lastSentMessageFooter }: {
4
+ export declare const Conversation: ({ lastSentMessageFooter, rpcClient, }: {
4
5
  lastSentMessageFooter: VNode | null;
6
+ rpcClient?: InploiRpcClient;
5
7
  }) => import("preact").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { InploiRpcClient } from '@inploi/sdk';
2
+ import { StartedFlow } from '../chatbot.state';
3
+
4
+ export declare const JobAlertsOffer: ({ flow, rpcClient }: {
5
+ flow: StartedFlow;
6
+ rpcClient: InploiRpcClient;
7
+ }) => import("preact").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export {};
package/dist/i18n.d.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  export declare const TranslationProvider: (props: {
2
2
  terms?: Partial<import('@inploi/i18n/translation').TranslationDict<{
3
3
  readonly error_heading: "Something unexpected happened";
4
+ readonly flow_closed: "This role is no longer accepting applications.";
4
5
  readonly undo: "Change answer";
5
- readonly submission_closed: "This role is no longer accepting applications.";
6
+ readonly job_alerts_offer: "Want to hear about similar roles? We can email you at {{email}} when new ones open.";
7
+ readonly job_alerts_accept: "Get job alerts";
8
+ readonly job_alerts_decline: "No thanks";
9
+ readonly job_alerts_privacy: "We'll use your email only for these alerts. You can unsubscribe at any time.";
10
+ readonly job_alerts_success: "Done. We'll email you about similar roles.";
11
+ readonly job_alerts_error: "Sorry, we couldn't set that up. Please try again later.";
6
12
  readonly submission_duplicate: "You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.";
7
13
  readonly submission_retryable: "We couldn't submit your application. Please try again.";
8
14
  readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
@@ -18,6 +24,7 @@ export declare const TranslationProvider: (props: {
18
24
  readonly submitting: string;
19
25
  readonly skip: string;
20
26
  readonly skipped: string;
27
+ readonly submission_closed: string;
21
28
  readonly submission_duplicate_earlier_attempt: string;
22
29
  readonly submission_failed: string;
23
30
  readonly submission_unknown_do_not_resubmit: string;
@@ -123,8 +130,14 @@ export declare const TranslationProvider: (props: {
123
130
  children?: import('preact').ComponentChildren;
124
131
  }) => import("preact").JSX.Element, useTranslation: <T extends {
125
132
  readonly error_heading: "Something unexpected happened";
133
+ readonly flow_closed: "This role is no longer accepting applications.";
126
134
  readonly undo: "Change answer";
127
- readonly submission_closed: "This role is no longer accepting applications.";
135
+ readonly job_alerts_offer: "Want to hear about similar roles? We can email you at {{email}} when new ones open.";
136
+ readonly job_alerts_accept: "Get job alerts";
137
+ readonly job_alerts_decline: "No thanks";
138
+ readonly job_alerts_privacy: "We'll use your email only for these alerts. You can unsubscribe at any time.";
139
+ readonly job_alerts_success: "Done. We'll email you about similar roles.";
140
+ readonly job_alerts_error: "Sorry, we couldn't set that up. Please try again later.";
128
141
  readonly submission_duplicate: "You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.";
129
142
  readonly submission_retryable: "We couldn't submit your application. Please try again.";
130
143
  readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
@@ -140,6 +153,7 @@ export declare const TranslationProvider: (props: {
140
153
  readonly submitting: string;
141
154
  readonly skip: string;
142
155
  readonly skipped: string;
156
+ readonly submission_closed: string;
143
157
  readonly submission_duplicate_earlier_attempt: string;
144
158
  readonly submission_failed: string;
145
159
  readonly submission_unknown_do_not_resubmit: string;
@@ -242,8 +256,14 @@ export declare const TranslationProvider: (props: {
242
256
  readonly optional: "optional";
243
257
  } = {
244
258
  readonly error_heading: "Something unexpected happened";
259
+ readonly flow_closed: "This role is no longer accepting applications.";
245
260
  readonly undo: "Change answer";
246
- readonly submission_closed: "This role is no longer accepting applications.";
261
+ readonly job_alerts_offer: "Want to hear about similar roles? We can email you at {{email}} when new ones open.";
262
+ readonly job_alerts_accept: "Get job alerts";
263
+ readonly job_alerts_decline: "No thanks";
264
+ readonly job_alerts_privacy: "We'll use your email only for these alerts. You can unsubscribe at any time.";
265
+ readonly job_alerts_success: "Done. We'll email you about similar roles.";
266
+ readonly job_alerts_error: "Sorry, we couldn't set that up. Please try again later.";
247
267
  readonly submission_duplicate: "You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.";
248
268
  readonly submission_retryable: "We couldn't submit your application. Please try again.";
249
269
  readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
@@ -259,6 +279,7 @@ export declare const TranslationProvider: (props: {
259
279
  readonly submitting: string;
260
280
  readonly skip: string;
261
281
  readonly skipped: string;
282
+ readonly submission_closed: string;
262
283
  readonly submission_duplicate_earlier_attempt: string;
263
284
  readonly submission_failed: string;
264
285
  readonly submission_unknown_do_not_resubmit: string;
@@ -364,8 +385,14 @@ export declare const TranslationProvider: (props: {
364
385
  locale: string | undefined;
365
386
  }, createTFunction: <T extends {
366
387
  readonly error_heading: "Something unexpected happened";
388
+ readonly flow_closed: "This role is no longer accepting applications.";
367
389
  readonly undo: "Change answer";
368
- readonly submission_closed: "This role is no longer accepting applications.";
390
+ readonly job_alerts_offer: "Want to hear about similar roles? We can email you at {{email}} when new ones open.";
391
+ readonly job_alerts_accept: "Get job alerts";
392
+ readonly job_alerts_decline: "No thanks";
393
+ readonly job_alerts_privacy: "We'll use your email only for these alerts. You can unsubscribe at any time.";
394
+ readonly job_alerts_success: "Done. We'll email you about similar roles.";
395
+ readonly job_alerts_error: "Sorry, we couldn't set that up. Please try again later.";
369
396
  readonly submission_duplicate: "You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.";
370
397
  readonly submission_retryable: "We couldn't submit your application. Please try again.";
371
398
  readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
@@ -381,6 +408,7 @@ export declare const TranslationProvider: (props: {
381
408
  readonly submitting: string;
382
409
  readonly skip: string;
383
410
  readonly skipped: string;
411
+ readonly submission_closed: string;
384
412
  readonly submission_duplicate_earlier_attempt: string;
385
413
  readonly submission_failed: string;
386
414
  readonly submission_unknown_do_not_resubmit: string;
@@ -483,8 +511,14 @@ export declare const TranslationProvider: (props: {
483
511
  readonly optional: "optional";
484
512
  } = {
485
513
  readonly error_heading: "Something unexpected happened";
514
+ readonly flow_closed: "This role is no longer accepting applications.";
486
515
  readonly undo: "Change answer";
487
- readonly submission_closed: "This role is no longer accepting applications.";
516
+ readonly job_alerts_offer: "Want to hear about similar roles? We can email you at {{email}} when new ones open.";
517
+ readonly job_alerts_accept: "Get job alerts";
518
+ readonly job_alerts_decline: "No thanks";
519
+ readonly job_alerts_privacy: "We'll use your email only for these alerts. You can unsubscribe at any time.";
520
+ readonly job_alerts_success: "Done. We'll email you about similar roles.";
521
+ readonly job_alerts_error: "Sorry, we couldn't set that up. Please try again later.";
488
522
  readonly submission_duplicate: "You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.";
489
523
  readonly submission_retryable: "We couldn't submit your application. Please try again.";
490
524
  readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
@@ -500,6 +534,7 @@ export declare const TranslationProvider: (props: {
500
534
  readonly submitting: string;
501
535
  readonly skip: string;
502
536
  readonly skipped: string;
537
+ readonly submission_closed: string;
503
538
  readonly submission_duplicate_earlier_attempt: string;
504
539
  readonly submission_failed: string;
505
540
  readonly submission_unknown_do_not_resubmit: string;
@@ -603,8 +638,14 @@ export declare const TranslationProvider: (props: {
603
638
  }>(options: {
604
639
  overrides: Partial<import('@inploi/i18n/translation').TranslationDict<{
605
640
  readonly error_heading: "Something unexpected happened";
641
+ readonly flow_closed: "This role is no longer accepting applications.";
606
642
  readonly undo: "Change answer";
607
- readonly submission_closed: "This role is no longer accepting applications.";
643
+ readonly job_alerts_offer: "Want to hear about similar roles? We can email you at {{email}} when new ones open.";
644
+ readonly job_alerts_accept: "Get job alerts";
645
+ readonly job_alerts_decline: "No thanks";
646
+ readonly job_alerts_privacy: "We'll use your email only for these alerts. You can unsubscribe at any time.";
647
+ readonly job_alerts_success: "Done. We'll email you about similar roles.";
648
+ readonly job_alerts_error: "Sorry, we couldn't set that up. Please try again later.";
608
649
  readonly submission_duplicate: "You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.";
609
650
  readonly submission_retryable: "We couldn't submit your application. Please try again.";
610
651
  readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
@@ -620,6 +661,7 @@ export declare const TranslationProvider: (props: {
620
661
  readonly submitting: string;
621
662
  readonly skip: string;
622
663
  readonly skipped: string;
664
+ readonly submission_closed: string;
623
665
  readonly submission_duplicate_earlier_attempt: string;
624
666
  readonly submission_failed: string;
625
667
  readonly submission_unknown_do_not_resubmit: string;