@inploi/plugin-chatbot 4.3.1 → 5.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.
@@ -1,4 +1,5 @@
1
- import type { FlowNodeInput } from '@inploi/core/flows';
1
+ import { InferInput } from 'valibot';
2
+ import { FlowSchema } from '../chatbot.api';
2
3
  /** Modify only for integration tests */
3
4
  export declare const automatedTestFlow: [{
4
5
  readonly id: "1";
@@ -16,6 +17,7 @@ export declare const automatedTestFlow: [{
16
17
  readonly question: "What is your name?";
17
18
  readonly placeholder: "John";
18
19
  readonly format: "text";
20
+ readonly optional: false;
19
21
  };
20
22
  readonly type: "question-text";
21
23
  }, {
@@ -26,6 +28,7 @@ export declare const automatedTestFlow: [{
26
28
  readonly question: "How old are you?";
27
29
  readonly placeholder: "25";
28
30
  readonly format: "text";
31
+ readonly optional: false;
29
32
  };
30
33
  readonly type: "question-text";
31
34
  }, {
@@ -35,6 +38,7 @@ export declare const automatedTestFlow: [{
35
38
  readonly question: "Do you have right to work in Mars?";
36
39
  readonly trueLabel: "Yes";
37
40
  readonly falseLabel: "No";
41
+ readonly optional: false;
38
42
  };
39
43
  readonly type: "question-boolean";
40
44
  readonly nextId: "ac6db6af-5bc9-4d0f-9282-ecdf204d6c7b";
@@ -68,4 +72,4 @@ export declare const automatedTestFlow: [{
68
72
  };
69
73
  readonly type: "text";
70
74
  }];
71
- export declare const debugFlow: FlowNodeInput[];
75
+ export declare const debugFlow: InferInput<typeof FlowSchema>['nodes'];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-26542f57.cjs");require("@inploi/sdk");exports.chatbotPlugin=e.chatbotPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-d5d1d0e4.cjs");require("@inploi/sdk");exports.chatbotPlugin=e.chatbotPlugin;
@@ -1,4 +1,4 @@
1
- import { X as a } from "./index-d718e966.js";
1
+ import { Y as a } from "./index-f5a052d0.js";
2
2
  import "@inploi/sdk";
3
3
  export {
4
4
  a as chatbotPlugin
package/dist/rpc.d.ts ADDED
@@ -0,0 +1,495 @@
1
+ export declare const flowByJobIdEndpoint: import("@inploi/sdk").RpcEndpoint<"GET", "/flow/job/:id", {
2
+ id: string | number;
3
+ }, {
4
+ id_type: 'internal' | 'external';
5
+ }, never, {
6
+ company: {
7
+ name: string;
8
+ };
9
+ flow: {
10
+ id: string;
11
+ version: number;
12
+ build: number;
13
+ nodes: ({
14
+ data: {
15
+ text: string;
16
+ };
17
+ type: "text";
18
+ id: string;
19
+ isHead?: boolean | undefined;
20
+ nextId?: string | undefined;
21
+ } | {
22
+ data: {
23
+ systemMessage: string;
24
+ };
25
+ type: "end-flow";
26
+ id: string;
27
+ isHead?: boolean | undefined;
28
+ nextId?: string | undefined;
29
+ } | {
30
+ data: {
31
+ integrationId: string;
32
+ skipConfirmation: boolean;
33
+ submitLabel: string;
34
+ submitKeys: (string[] | "all") & (string[] | "all" | undefined);
35
+ key?: string | undefined;
36
+ };
37
+ type: "integration-application-submit";
38
+ id: string;
39
+ isHead?: boolean | undefined;
40
+ nextId?: string | undefined;
41
+ } | {
42
+ data: {
43
+ integrationId: string;
44
+ };
45
+ type: "integration-workflow-get";
46
+ id: string;
47
+ isHead?: boolean | undefined;
48
+ nextId?: string | undefined;
49
+ } | {
50
+ data: {
51
+ href: string;
52
+ cta: string;
53
+ };
54
+ type: "link";
55
+ id: string;
56
+ isHead?: boolean | undefined;
57
+ nextId?: string | undefined;
58
+ } | {
59
+ data: {
60
+ url: string;
61
+ width: number;
62
+ height: number;
63
+ };
64
+ type: "image";
65
+ id: string;
66
+ isHead?: boolean | undefined;
67
+ nextId?: string | undefined;
68
+ } | {
69
+ data: {
70
+ key: string;
71
+ question: string;
72
+ trueLabel: string;
73
+ falseLabel: string;
74
+ optional: boolean;
75
+ };
76
+ type: "question-boolean";
77
+ id: string;
78
+ isHead?: boolean | undefined;
79
+ nextId?: string | undefined;
80
+ } | {
81
+ data: {
82
+ key: string;
83
+ question: string;
84
+ optional: boolean;
85
+ format: "text" | "phone" | "url" | "email";
86
+ placeholder?: string | undefined;
87
+ maxChars?: number | undefined;
88
+ minChars?: number | undefined;
89
+ };
90
+ type: "question-text";
91
+ id: string;
92
+ isHead?: boolean | undefined;
93
+ nextId?: string | undefined;
94
+ } | {
95
+ data: {
96
+ key: string;
97
+ question: string;
98
+ optional: boolean;
99
+ placeholder?: string | undefined;
100
+ decimalCases?: number | undefined;
101
+ min?: number | undefined;
102
+ max?: number | undefined;
103
+ };
104
+ type: "question-number";
105
+ id: string;
106
+ isHead?: boolean | undefined;
107
+ nextId?: string | undefined;
108
+ } | {
109
+ data: {
110
+ key: string;
111
+ question: string;
112
+ optional: boolean;
113
+ placeholder: string;
114
+ minChars: number;
115
+ defaultCountryCode: string;
116
+ };
117
+ type: "question-phone";
118
+ id: string;
119
+ isHead?: boolean | undefined;
120
+ nextId?: string | undefined;
121
+ } | {
122
+ data: {
123
+ options: {
124
+ value: string;
125
+ label: string;
126
+ }[];
127
+ key: string;
128
+ question: string;
129
+ maxSelected: number;
130
+ minSelected: number;
131
+ };
132
+ type: "question-enum";
133
+ id: string;
134
+ isHead?: boolean | undefined;
135
+ nextId?: string | undefined;
136
+ } | {
137
+ data: {
138
+ key: string;
139
+ question: string;
140
+ optional: boolean;
141
+ extensions: string[];
142
+ multiple?: boolean | undefined;
143
+ maxSizeKb?: number | undefined;
144
+ };
145
+ type: "question-file";
146
+ id: string;
147
+ isHead?: boolean | undefined;
148
+ nextId?: string | undefined;
149
+ } | {
150
+ data: {
151
+ keys: {
152
+ line1: string | null;
153
+ line2: string | null;
154
+ line3: string | null;
155
+ city: string | null;
156
+ state: string | null;
157
+ postcode: string | null;
158
+ country: string | null;
159
+ };
160
+ key: string;
161
+ question: string;
162
+ optional: boolean;
163
+ placeholder?: string | undefined;
164
+ };
165
+ type: "question-address";
166
+ id: string;
167
+ isHead?: boolean | undefined;
168
+ nextId?: string | undefined;
169
+ } | {
170
+ data: ({
171
+ compareKey: string;
172
+ compareValue: string;
173
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
174
+ } | {
175
+ combinator: "and" | "or";
176
+ conditions: {
177
+ compareKey: string;
178
+ compareValue: string;
179
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
180
+ }[];
181
+ }) & ({
182
+ compareKey: string;
183
+ compareValue: string;
184
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
185
+ } | {
186
+ combinator: "and" | "or";
187
+ conditions: {
188
+ compareKey: string;
189
+ compareValue: string;
190
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
191
+ }[];
192
+ } | undefined);
193
+ type: "if-block";
194
+ id: string;
195
+ isHead?: boolean | undefined;
196
+ nextId?: string | undefined;
197
+ branchId?: string | undefined;
198
+ } | {
199
+ data: {
200
+ targetId: string;
201
+ };
202
+ type: "jump";
203
+ id: string;
204
+ isHead?: boolean | undefined;
205
+ nextId?: string | undefined;
206
+ } | {
207
+ data: {
208
+ value: string;
209
+ key: string;
210
+ };
211
+ type: "add-submission";
212
+ id: string;
213
+ isHead?: boolean | undefined;
214
+ nextId?: string | undefined;
215
+ } | {
216
+ data: {
217
+ key: string;
218
+ firstName?: string | undefined;
219
+ lastName?: string | undefined;
220
+ phoneNumber?: string | undefined;
221
+ email?: string | undefined;
222
+ customTraits?: {
223
+ value: string;
224
+ key: string;
225
+ }[] | undefined;
226
+ };
227
+ type: "identify";
228
+ id: string;
229
+ isHead?: boolean | undefined;
230
+ nextId?: string | undefined;
231
+ } | {
232
+ data: {};
233
+ type: "feedback";
234
+ id: string;
235
+ isHead?: boolean | undefined;
236
+ nextId?: string | undefined;
237
+ })[];
238
+ context_schema?: {
239
+ [x: string]: {
240
+ required: boolean;
241
+ type: "string" | "number";
242
+ };
243
+ } | null | undefined;
244
+ };
245
+ job: {
246
+ id: string;
247
+ title: string;
248
+ };
249
+ user?: {
250
+ city?: string | undefined;
251
+ country?: string | undefined;
252
+ isEU?: boolean | undefined;
253
+ continent?: string | undefined;
254
+ } | undefined;
255
+ }>;
256
+ export declare const flowByIdEndpoint: import("@inploi/sdk").RpcEndpoint<"GET", "/flow/id/:id", {
257
+ id: string | number;
258
+ }, never, never, {
259
+ flow: {
260
+ id: string;
261
+ version: number;
262
+ build: number;
263
+ nodes: ({
264
+ data: {
265
+ text: string;
266
+ };
267
+ type: "text";
268
+ id: string;
269
+ isHead?: boolean | undefined;
270
+ nextId?: string | undefined;
271
+ } | {
272
+ data: {
273
+ systemMessage: string;
274
+ };
275
+ type: "end-flow";
276
+ id: string;
277
+ isHead?: boolean | undefined;
278
+ nextId?: string | undefined;
279
+ } | {
280
+ data: {
281
+ integrationId: string;
282
+ skipConfirmation: boolean;
283
+ submitLabel: string;
284
+ submitKeys: (string[] | "all") & (string[] | "all" | undefined);
285
+ key?: string | undefined;
286
+ };
287
+ type: "integration-application-submit";
288
+ id: string;
289
+ isHead?: boolean | undefined;
290
+ nextId?: string | undefined;
291
+ } | {
292
+ data: {
293
+ integrationId: string;
294
+ };
295
+ type: "integration-workflow-get";
296
+ id: string;
297
+ isHead?: boolean | undefined;
298
+ nextId?: string | undefined;
299
+ } | {
300
+ data: {
301
+ href: string;
302
+ cta: string;
303
+ };
304
+ type: "link";
305
+ id: string;
306
+ isHead?: boolean | undefined;
307
+ nextId?: string | undefined;
308
+ } | {
309
+ data: {
310
+ url: string;
311
+ width: number;
312
+ height: number;
313
+ };
314
+ type: "image";
315
+ id: string;
316
+ isHead?: boolean | undefined;
317
+ nextId?: string | undefined;
318
+ } | {
319
+ data: {
320
+ key: string;
321
+ question: string;
322
+ trueLabel: string;
323
+ falseLabel: string;
324
+ optional: boolean;
325
+ };
326
+ type: "question-boolean";
327
+ id: string;
328
+ isHead?: boolean | undefined;
329
+ nextId?: string | undefined;
330
+ } | {
331
+ data: {
332
+ key: string;
333
+ question: string;
334
+ optional: boolean;
335
+ format: "text" | "phone" | "url" | "email";
336
+ placeholder?: string | undefined;
337
+ maxChars?: number | undefined;
338
+ minChars?: number | undefined;
339
+ };
340
+ type: "question-text";
341
+ id: string;
342
+ isHead?: boolean | undefined;
343
+ nextId?: string | undefined;
344
+ } | {
345
+ data: {
346
+ key: string;
347
+ question: string;
348
+ optional: boolean;
349
+ placeholder?: string | undefined;
350
+ decimalCases?: number | undefined;
351
+ min?: number | undefined;
352
+ max?: number | undefined;
353
+ };
354
+ type: "question-number";
355
+ id: string;
356
+ isHead?: boolean | undefined;
357
+ nextId?: string | undefined;
358
+ } | {
359
+ data: {
360
+ key: string;
361
+ question: string;
362
+ optional: boolean;
363
+ placeholder: string;
364
+ minChars: number;
365
+ defaultCountryCode: string;
366
+ };
367
+ type: "question-phone";
368
+ id: string;
369
+ isHead?: boolean | undefined;
370
+ nextId?: string | undefined;
371
+ } | {
372
+ data: {
373
+ options: {
374
+ value: string;
375
+ label: string;
376
+ }[];
377
+ key: string;
378
+ question: string;
379
+ maxSelected: number;
380
+ minSelected: number;
381
+ };
382
+ type: "question-enum";
383
+ id: string;
384
+ isHead?: boolean | undefined;
385
+ nextId?: string | undefined;
386
+ } | {
387
+ data: {
388
+ key: string;
389
+ question: string;
390
+ optional: boolean;
391
+ extensions: string[];
392
+ multiple?: boolean | undefined;
393
+ maxSizeKb?: number | undefined;
394
+ };
395
+ type: "question-file";
396
+ id: string;
397
+ isHead?: boolean | undefined;
398
+ nextId?: string | undefined;
399
+ } | {
400
+ data: {
401
+ keys: {
402
+ line1: string | null;
403
+ line2: string | null;
404
+ line3: string | null;
405
+ city: string | null;
406
+ state: string | null;
407
+ postcode: string | null;
408
+ country: string | null;
409
+ };
410
+ key: string;
411
+ question: string;
412
+ optional: boolean;
413
+ placeholder?: string | undefined;
414
+ };
415
+ type: "question-address";
416
+ id: string;
417
+ isHead?: boolean | undefined;
418
+ nextId?: string | undefined;
419
+ } | {
420
+ data: ({
421
+ compareKey: string;
422
+ compareValue: string;
423
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
424
+ } | {
425
+ combinator: "and" | "or";
426
+ conditions: {
427
+ compareKey: string;
428
+ compareValue: string;
429
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
430
+ }[];
431
+ }) & ({
432
+ compareKey: string;
433
+ compareValue: string;
434
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
435
+ } | {
436
+ combinator: "and" | "or";
437
+ conditions: {
438
+ compareKey: string;
439
+ compareValue: string;
440
+ compare: "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo";
441
+ }[];
442
+ } | undefined);
443
+ type: "if-block";
444
+ id: string;
445
+ isHead?: boolean | undefined;
446
+ nextId?: string | undefined;
447
+ branchId?: string | undefined;
448
+ } | {
449
+ data: {
450
+ targetId: string;
451
+ };
452
+ type: "jump";
453
+ id: string;
454
+ isHead?: boolean | undefined;
455
+ nextId?: string | undefined;
456
+ } | {
457
+ data: {
458
+ value: string;
459
+ key: string;
460
+ };
461
+ type: "add-submission";
462
+ id: string;
463
+ isHead?: boolean | undefined;
464
+ nextId?: string | undefined;
465
+ } | {
466
+ data: {
467
+ key: string;
468
+ firstName?: string | undefined;
469
+ lastName?: string | undefined;
470
+ phoneNumber?: string | undefined;
471
+ email?: string | undefined;
472
+ customTraits?: {
473
+ value: string;
474
+ key: string;
475
+ }[] | undefined;
476
+ };
477
+ type: "identify";
478
+ id: string;
479
+ isHead?: boolean | undefined;
480
+ nextId?: string | undefined;
481
+ } | {
482
+ data: {};
483
+ type: "feedback";
484
+ id: string;
485
+ isHead?: boolean | undefined;
486
+ nextId?: string | undefined;
487
+ })[];
488
+ context_schema?: {
489
+ [x: string]: {
490
+ required: boolean;
491
+ type: "string" | "number";
492
+ };
493
+ } | null | undefined;
494
+ };
495
+ }>;
@@ -8,8 +8,8 @@ export declare const tokens: {
8
8
  getToken: TGetToken;
9
9
  }) => {
10
10
  values: {
11
- "color.black": unknown;
12
11
  "color.white": unknown;
12
+ "color.black": unknown;
13
13
  "color.lowest": unknown;
14
14
  "color.highest": unknown;
15
15
  "color.a-1": unknown;
@@ -79,7 +79,7 @@ export declare const tokens: {
79
79
  declarations: {
80
80
  [k: string]: string;
81
81
  };
82
- ref: (path: "font-weight-body" | "font-weight-headings" | "radius-app" | "radius-interactive" | "color.black" | "color.white" | "color.lowest" | "color.highest" | "color.a-1" | "color.a-2" | "color.a-3" | "color.a-4" | "color.a-5" | "color.a-6" | "color.a-7" | "color.a-8" | "color.a-9" | "color.a-10" | "color.a-11" | "color.a-12" | "color.n-1" | "color.n-2" | "color.n-3" | "color.n-4" | "color.n-5" | "color.n-6" | "color.n-7" | "color.n-8" | "color.n-9" | "color.n-10" | "color.n-11" | "color.n-12" | "color.e-1" | "color.e-2" | "color.e-3" | "color.e-4" | "color.e-5" | "color.e-6" | "color.e-7" | "color.e-8" | "color.e-9" | "color.e-10" | "color.e-11" | "color.e-12" | "copy-body" | "copy-headings" | "color.divider" | "font-family.body" | "font-family.headings" | "font-style.body" | "font-style.headings" | "interactive.copy" | "interactive.bg" | "interactive.copy-hover" | "interactive.copy-active" | "interactive.bg-hover" | "interactive.bg-active" | "app.bg" | "overlay.bg" | "bubble.weak-bg" | "bubble.weak-outline" | "bubble.strong-shadow" | "status-bar.bg" | "status-bar.bg-button" | "status-bar.bg-button-hover" | "status-bar.bg-button-active" | "submit-button.bg-active") => string;
82
+ ref: (path: "font-weight-body" | "font-weight-headings" | "radius-app" | "radius-interactive" | "color.white" | "color.black" | "color.lowest" | "color.highest" | "color.a-1" | "color.a-2" | "color.a-3" | "color.a-4" | "color.a-5" | "color.a-6" | "color.a-7" | "color.a-8" | "color.a-9" | "color.a-10" | "color.a-11" | "color.a-12" | "color.n-1" | "color.n-2" | "color.n-3" | "color.n-4" | "color.n-5" | "color.n-6" | "color.n-7" | "color.n-8" | "color.n-9" | "color.n-10" | "color.n-11" | "color.n-12" | "color.e-1" | "color.e-2" | "color.e-3" | "color.e-4" | "color.e-5" | "color.e-6" | "color.e-7" | "color.e-8" | "color.e-9" | "color.e-10" | "color.e-11" | "color.e-12" | "copy-body" | "copy-headings" | "color.divider" | "font-family.body" | "font-family.headings" | "font-style.body" | "font-style.headings" | "interactive.copy" | "interactive.bg" | "interactive.copy-hover" | "interactive.copy-active" | "interactive.bg-hover" | "interactive.bg-active" | "app.bg" | "overlay.bg" | "bubble.weak-bg" | "bubble.weak-outline" | "bubble.strong-shadow" | "status-bar.bg" | "status-bar.bg-button" | "status-bar.bg-button-hover" | "status-bar.bg-button-active" | "submit-button.bg-active") => string;
83
83
  };
84
84
  };
85
85
  export declare const asInploiVar: {