@coveo/quantic 3.14.2 → 3.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.
Files changed (56) hide show
  1. package/docs/out/quantic-docs.json +2 -2
  2. package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +819 -0
  3. package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +23 -0
  4. package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +51 -0
  5. package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +152 -0
  6. package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +269 -0
  7. package/force-app/main/default/lwc/quanticCaseClassification/quanticCaseClassification.html +6 -6
  8. package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +178 -0
  9. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +63 -0
  10. package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +23 -0
  11. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +82 -0
  12. package/force-app/main/default/lwc/quanticFacetManager/quanticFacetManager.js +1 -0
  13. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +54 -10
  14. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.js +19 -1
  15. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.css +4 -0
  16. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +17 -0
  17. package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +1 -1
  18. package/force-app/main/default/staticresources/coveobueno/definitions/index.d.ts +7 -7
  19. package/force-app/main/default/staticresources/coveobueno/definitions/values/boolean-value.d.ts +2 -2
  20. package/force-app/main/default/staticresources/coveobueno/definitions/values/complex-value.d.ts +5 -5
  21. package/force-app/main/default/staticresources/coveobueno/definitions/values/enum-value.d.ts +2 -2
  22. package/force-app/main/default/staticresources/coveobueno/definitions/values/number-value.d.ts +2 -2
  23. package/force-app/main/default/staticresources/coveobueno/definitions/values/string-value.d.ts +2 -2
  24. package/force-app/main/default/staticresources/coveobueno/definitions/values/value.d.ts +1 -1
  25. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +7 -9
  26. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/product.d.ts +6 -0
  27. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +1 -1
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/types/core-engine.d.ts +9 -0
  29. package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +6 -1
  30. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/field-suggestions/headless-category-field-suggestions.d.ts +5 -1
  31. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/field-suggestions/headless-field-suggestions-generator.d.ts +9 -2
  32. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/filter-suggestions/headless-category-filter-suggestions.d.ts +87 -0
  33. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/filter-suggestions/headless-filter-suggestions-generator.d.ts +38 -0
  34. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +16 -0
  35. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/filter-suggestions/headless-filter-suggestions.d.ts +88 -0
  36. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet-options.d.ts +3 -1
  37. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/facet/headless-core-facet-options.d.ts +3 -1
  38. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-filter.d.ts +3 -1
  39. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-date-facet-options.d.ts +3 -1
  40. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-filter.d.ts +3 -1
  41. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-numeric-facet-options.d.ts +3 -1
  42. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet-options.d.ts +3 -1
  43. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-actions.d.ts +3 -1
  44. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-api/request.d.ts +4 -1
  45. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-actions.d.ts +3 -1
  46. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/date-facet-set/date-facet-actions.d.ts +3 -1
  47. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/numeric-facet-set/numeric-facet-actions.d.ts +3 -1
  48. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +2 -2
  49. package/force-app/main/default/staticresources/coveoheadless/definitions/utils/fetch-event-source/fetch.d.ts +44 -0
  50. package/force-app/main/default/staticresources/coveoheadless/definitions/utils/fetch-event-source/index.d.ts +2 -0
  51. package/force-app/main/default/staticresources/coveoheadless/definitions/utils/fetch-event-source/parse.d.ts +36 -0
  52. package/force-app/main/default/staticresources/coveoheadless/headless.js +9 -11
  53. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +8 -10
  54. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -9
  55. package/package.json +6 -6
  56. package/force-app/main/default/staticresources/coveoheadless/definitions/tsdoc-metadata.json +0 -11
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Represents a message sent in an event stream
3
+ * https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format
4
+ */
5
+ export interface EventSourceMessage {
6
+ /** The event ID to set the EventSource object's last event ID value. */
7
+ id: string;
8
+ /** A string identifying the type of event described. */
9
+ event: string;
10
+ /** The event data */
11
+ data: string;
12
+ /** The reconnection interval (in milliseconds) to wait before retrying the connection */
13
+ retry?: number;
14
+ }
15
+ /**
16
+ * Converts a ReadableStream into a callback pattern.
17
+ * @param stream The input ReadableStream.
18
+ * @param onChunk A function that will be called on each new byte chunk in the stream.
19
+ * @returns {Promise<void>} A promise that will be resolved when the stream closes.
20
+ */
21
+ export declare function getBytes(stream: ReadableStream<Uint8Array>, onChunk: (arr: Uint8Array) => void): Promise<void>;
22
+ /**
23
+ * Parses arbitrary byte chunks into EventSource line buffers.
24
+ * Each line should be of the format "field: value" and ends with \r, \n, or \r\n.
25
+ * @param onLine A function that will be called on each new EventSource line.
26
+ * @returns A function that should be called for each incoming byte chunk.
27
+ */
28
+ export declare function getLines(onLine: (line: Uint8Array, fieldLength: number) => void): (arr: Uint8Array) => void;
29
+ /**
30
+ * Parses line buffers into EventSourceMessages.
31
+ * @param onId A function that will be called on each `id` field.
32
+ * @param onRetry A function that will be called on each `retry` field.
33
+ * @param onMessage A function that will be called on each message.
34
+ * @returns A function that should be called for each incoming line buffer.
35
+ */
36
+ export declare function getMessages(onId: (id: string) => void, onRetry: (retry: number) => void, onMessage?: (msg: EventSourceMessage) => void): (line: Uint8Array, fieldLength: number) => void;