@hachther/akilio-widget 1.0.0 → 1.1.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,4 @@
1
+ import type { AkilioCapability, AkilioCommercePublicAction, AkilioProduct } from '../types';
2
+ /** Discovered backend capabilities control product-card cart visibility. */
3
+ export declare const CartCapabilitiesContext: import("react").Context<AkilioCapability[]>;
4
+ export declare function productCartActions(product: AkilioProduct, capabilities: AkilioCapability[]): AkilioCommercePublicAction[];
@@ -1,4 +1,4 @@
1
- import type { AkilioAuthConfig, AkilioCapability, AkilioCapabilityConfirmation, AkilioChatRequest, AkilioChatResponse, AkilioChatStreamHandlers, AkilioCommerceEvent, AkilioContactRequest, AkilioContactRequestResponse, AkilioConversationResponse, AkilioCurrentCartResponse, AkilioCustomerServiceToolResponse, AkilioEntryContext, AkilioFeedbackRating, AkilioMode, AkilioProjectConfig, AkilioWidgetAnalyticsEvent, IntegrationType } from '../types';
1
+ import type { AkilioAuthConfig, AkilioCapability, AkilioCapabilityConfirmation, AkilioChatRequest, AkilioChatResponse, AkilioChatStreamHandlers, AkilioCommerceEvent, AkilioContactRequest, AkilioContactRequestResponse, AkilioConversationResponse, AkilioCurrentCartResponse, AkilioCustomerServiceToolResponse, AkilioEntryContext, AkilioFeedbackRating, AkilioIdentitySession, AkilioIdentityVerification, AkilioMode, AkilioProjectConfig, AkilioWidgetAnalyticsEvent, IntegrationType } from '../types';
2
2
  export interface AkilioClientOptions {
3
3
  apiBaseUrl: string;
4
4
  auth?: AkilioAuthConfig;
@@ -18,6 +18,7 @@ export declare class AkilioClient {
18
18
  private fetchImpl;
19
19
  private auth?;
20
20
  private widgetToken;
21
+ private voiceRequestIds;
21
22
  private widgetTokenPromise;
22
23
  private widgetTokenPromiseKey;
23
24
  private mode;
@@ -48,6 +49,18 @@ export declare class AkilioClient {
48
49
  entryContext?: AkilioEntryContext | null;
49
50
  }): Promise<AkilioCustomerServiceToolResponse>;
50
51
  sendWidgetEvent(projectKey: string, subject: string | undefined, event: AkilioWidgetAnalyticsEvent): Promise<void>;
52
+ transcribeVoice(projectKey: string, subject: string | undefined, audio: Blob, signal?: AbortSignal): Promise<{
53
+ transcript: string;
54
+ id: string;
55
+ }>;
56
+ requestIdentityVerification(projectKey: string, subject: string | undefined, conversationId: string, value: string, purpose?: 'identity' | 'step_up', signal?: AbortSignal, identifierType?: 'email' | 'phone'): Promise<AkilioIdentityVerification>;
57
+ confirmIdentityVerification(projectKey: string, subject: string | undefined, conversationId: string, verificationId: string, code: string, signal?: AbortSignal): Promise<{
58
+ verified: boolean;
59
+ assurance_level: string | null;
60
+ expires_at: string | null;
61
+ }>;
62
+ resendIdentityVerification(projectKey: string, subject: string | undefined, conversationId: string, verificationId: string, signal?: AbortSignal): Promise<AkilioIdentityVerification>;
63
+ getIdentitySession(projectKey: string, subject: string | undefined, conversationId: string, signal?: AbortSignal): Promise<AkilioIdentitySession>;
51
64
  sendMessage(projectKey: string, subject: string | undefined, request: AkilioChatRequest): Promise<AkilioChatResponse>;
52
65
  sendMessageStream(projectKey: string, subject: string | undefined, request: AkilioChatRequest, handlers?: AkilioChatStreamHandlers, signal?: AbortSignal): Promise<AkilioChatResponse>;
53
66
  getConversation(projectKey: string, subject: string | undefined, conversationId: string): Promise<AkilioConversationResponse>;
@@ -0,0 +1,5 @@
1
+ import type { AkilioCommercePublicAction, AkilioProduct } from '../types';
2
+ /** Offer direct cart operations only for a supported, same-origin storefront. */
3
+ export declare function storefrontActions(product: AkilioProduct): AkilioCommercePublicAction[];
4
+ /** Shopify Ajax Cart uses the browser session, sharing the theme's actual cart. */
5
+ export declare function addToStorefrontCart(product: AkilioProduct, variantId: string): Promise<void>;
package/dist/loader.js CHANGED
@@ -6,10 +6,10 @@
6
6
  loader.dataset.akilioLoaderStarted = 'true';
7
7
 
8
8
  var release = document.createElement('script');
9
- var releasePath = 'releases/1.0.0/akilio-widget.min.js';
9
+ var releasePath = 'releases/1.1.0/akilio-widget.min.js';
10
10
  release.src = new URL(releasePath, loader.src).href;
11
11
  release.async = true;
12
- release.dataset.akilioRelease = '1.0.0';
12
+ release.dataset.akilioRelease = '1.1.0';
13
13
 
14
14
  for (var index = 0; index < loader.attributes.length; index += 1) {
15
15
  var attribute = loader.attributes[index];
@@ -23,7 +23,7 @@
23
23
  window.dispatchEvent(
24
24
  new CustomEvent('akilio:loader-ready', {
25
25
  detail: {
26
- version: '1.0.0',
26
+ version: '1.1.0',
27
27
  url: release.src,
28
28
  },
29
29
  })
@@ -34,7 +34,7 @@
34
34
  window.dispatchEvent(
35
35
  new CustomEvent('akilio:loader-error', {
36
36
  detail: {
37
- version: '1.0.0',
37
+ version: '1.1.0',
38
38
  url: release.src,
39
39
  },
40
40
  })
@@ -1,6 +1,40 @@
1
1
  export declare const en: {
2
2
  direction: "ltr";
3
3
  messages: {
4
+ identityGenericTitle: string;
5
+ identityPhone: string;
6
+ identityPhoneHint: string;
7
+ identityPhoneSent: string;
8
+ identityPhoneCodeTitle: string;
9
+ identityPhoneCodeHint: string;
10
+ identityPhoneVerified: string;
11
+ identityChangePhone: string;
12
+ identityCodeTitle: string;
13
+ identityDescription: string;
14
+ identityCodeHint: string;
15
+ identitySending: string;
16
+ identityTitle: string;
17
+ identityEmail: string;
18
+ identityCode: string;
19
+ identitySend: string;
20
+ identityConfirm: string;
21
+ identityResend: string;
22
+ identityCancel: string;
23
+ identitySent: string;
24
+ identityVerified: string;
25
+ identityInvalid: string;
26
+ identityExpired: string;
27
+ identityUnavailable: string;
28
+ identityLimited: string;
29
+ identityChangeEmail: string;
30
+ identityBusy: string;
31
+ recordVoice: string;
32
+ stopVoice: string;
33
+ sendVoice: string;
34
+ cancelVoice: string;
35
+ voiceTranscribing: string;
36
+ voiceFailure: string;
37
+ voicePermissionError: string;
4
38
  launcher: string;
5
39
  title: string;
6
40
  description: string;
@@ -1,6 +1,40 @@
1
1
  export declare const fr: {
2
2
  direction: "ltr";
3
3
  messages: {
4
+ identityGenericTitle: string;
5
+ identityPhone: string;
6
+ identityPhoneHint: string;
7
+ identityPhoneSent: string;
8
+ identityPhoneCodeTitle: string;
9
+ identityPhoneCodeHint: string;
10
+ identityPhoneVerified: string;
11
+ identityChangePhone: string;
12
+ identityCodeTitle: string;
13
+ identityDescription: string;
14
+ identityCodeHint: string;
15
+ identitySending: string;
16
+ identityTitle: string;
17
+ identityEmail: string;
18
+ identityCode: string;
19
+ identitySend: string;
20
+ identityConfirm: string;
21
+ identityResend: string;
22
+ identityCancel: string;
23
+ identitySent: string;
24
+ identityVerified: string;
25
+ identityInvalid: string;
26
+ identityExpired: string;
27
+ identityUnavailable: string;
28
+ identityLimited: string;
29
+ identityChangeEmail: string;
30
+ identityBusy: string;
31
+ recordVoice: string;
32
+ stopVoice: string;
33
+ sendVoice: string;
34
+ cancelVoice: string;
35
+ voiceTranscribing: string;
36
+ voiceFailure: string;
37
+ voicePermissionError: string;
4
38
  launcher: string;
5
39
  title: string;
6
40
  description: string;