@askdialog/dialog-sdk 1.1.0 → 1.2.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/README.md +78 -10
- package/dist/Dialog.d.ts +2 -0
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +19 -0
- package/dist/EventsHandler.d.ts +5 -0
- package/dist/EventsHandler.d.ts.map +1 -1
- package/dist/EventsHandler.js +28 -1
- package/dist/types/events.d.ts +12 -2
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/events.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,21 +157,89 @@ Example of expected result:
|
|
|
157
157
|
|
|
158
158
|
- Handler for fetch product
|
|
159
159
|
|
|
160
|
+
The `getProduct` callback is called by the assistant to display product information. You must return an object matching the `SimplifiedProduct` interface.
|
|
161
|
+
|
|
162
|
+
**Parameters:**
|
|
163
|
+
|
|
164
|
+
| Parameter | Type | Required | Description |
|
|
165
|
+
|-----------|------|----------|-------------|
|
|
166
|
+
| `productId` | `string` | Yes | The product identifier |
|
|
167
|
+
| `variantId` | `string` | No | The selected variant identifier |
|
|
168
|
+
|
|
169
|
+
**Return type: `SimplifiedProduct`**
|
|
170
|
+
|
|
171
|
+
| Field | Type | Required | Description |
|
|
172
|
+
|-------|------|----------|-------------|
|
|
173
|
+
| `id` | `string` | Yes | Product identifier |
|
|
174
|
+
| `title` | `string` | Yes | Product name |
|
|
175
|
+
| `handle` | `string` | Yes | URL-friendly product slug |
|
|
176
|
+
| `totalInventory` | `number` | Yes | Total available stock across all variants |
|
|
177
|
+
| `variants` | `SimplifiedProductVariant[]` | Yes | List of product variants (see below) |
|
|
178
|
+
| `descriptionHtml` | `string` | No | Product description in HTML |
|
|
179
|
+
| `url` | `string` | No | Product page URL |
|
|
180
|
+
| `featuredImage` | `{ url?: string } \| null` | No | Main product image |
|
|
181
|
+
| `options` | `SimplifiedProductOption[]` | No | Product options (size, color, etc.) |
|
|
182
|
+
|
|
183
|
+
**Variant: `SimplifiedProductVariant`**
|
|
184
|
+
|
|
185
|
+
| Field | Type | Required | Description |
|
|
186
|
+
|-------|------|----------|-------------|
|
|
187
|
+
| `id` | `string` | Yes | Variant identifier |
|
|
188
|
+
| `price` | `string` | Yes | Variant price (e.g. `"29.99"`) |
|
|
189
|
+
| `currencyCode` | `string` | Yes | ISO 4217 currency code (e.g. `"EUR"`, `"USD"`) |
|
|
190
|
+
| `displayName` | `string` | No | Variant display name |
|
|
191
|
+
| `inventoryQuantity` | `number` | No | Available stock for this variant |
|
|
192
|
+
| `compareAtPrice` | `string \| null` | No | Original price before discount |
|
|
193
|
+
| `url` | `string` | No | Variant-specific page URL |
|
|
194
|
+
| `selectedOptions` | `{ name: string; value: string }[]` | No | Option values for this variant (e.g. `[{ name: "Size", value: "M" }]`) |
|
|
195
|
+
| `image` | `{ url?: string } \| null` | No | Variant-specific image |
|
|
196
|
+
|
|
197
|
+
**Option: `SimplifiedProductOption`** *(optional)*
|
|
198
|
+
|
|
199
|
+
| Field | Type | Required | Description |
|
|
200
|
+
|-------|------|----------|-------------|
|
|
201
|
+
| `id` | `string` | Yes | Option identifier |
|
|
202
|
+
| `name` | `string` | Yes | Option name (e.g. `"Size"`, `"Color"`) |
|
|
203
|
+
| `position` | `number` | Yes | Display order |
|
|
204
|
+
| `values` | `string[]` | Yes | Available values (e.g. `["S", "M", "L"]`) |
|
|
205
|
+
|
|
206
|
+
**Example:**
|
|
207
|
+
|
|
160
208
|
```typescript
|
|
161
209
|
const client = new Dialog({
|
|
162
210
|
...,
|
|
163
211
|
callbacks: {
|
|
164
|
-
getProduct: (
|
|
212
|
+
getProduct: async (
|
|
165
213
|
productId: string,
|
|
166
|
-
variantId?: string
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
214
|
+
variantId?: string,
|
|
215
|
+
): Promise<SimplifiedProduct> => {
|
|
216
|
+
const response = await fetch(`https://your-api.com/products/${productId}`);
|
|
217
|
+
const data = await response.json();
|
|
218
|
+
|
|
219
|
+
return {
|
|
220
|
+
id: data.id,
|
|
221
|
+
title: data.name,
|
|
222
|
+
handle: data.slug,
|
|
223
|
+
totalInventory: data.stock,
|
|
224
|
+
featuredImage: { url: data.imageUrl },
|
|
225
|
+
variants: data.variants.map((v: any) => ({
|
|
226
|
+
id: v.id,
|
|
227
|
+
price: v.price.toString(),
|
|
228
|
+
currencyCode: 'EUR',
|
|
229
|
+
displayName: v.name,
|
|
230
|
+
inventoryQuantity: v.stock,
|
|
231
|
+
compareAtPrice: v.originalPrice?.toString() ?? null,
|
|
232
|
+
selectedOptions: v.options,
|
|
233
|
+
image: v.imageUrl ? { url: v.imageUrl } : null,
|
|
234
|
+
})),
|
|
235
|
+
options: data.options?.map((o: any) => ({
|
|
236
|
+
id: o.id,
|
|
237
|
+
name: o.name,
|
|
238
|
+
position: o.position,
|
|
239
|
+
values: o.values,
|
|
240
|
+
})),
|
|
241
|
+
};
|
|
242
|
+
},
|
|
175
243
|
},
|
|
176
244
|
});
|
|
177
245
|
```
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { DetailedLocaleInfo } from "./utils/localization";
|
|
|
4
4
|
import { Suggestion } from "./types/suggestion";
|
|
5
5
|
import { GenericQuestionPayload, OpenAssistantPayload, ProductQuestionPayload } from "./types/events";
|
|
6
6
|
import { SimplifiedProduct } from "./types/product";
|
|
7
|
+
import { EventsHandler } from "./EventsHandler";
|
|
7
8
|
import { AssistantEvent } from "./types/assistantEvent";
|
|
8
9
|
export declare class Dialog {
|
|
9
10
|
static readonly VERSION: string;
|
|
@@ -19,6 +20,7 @@ export declare class Dialog {
|
|
|
19
20
|
get theme(): Theme;
|
|
20
21
|
get userId(): string;
|
|
21
22
|
get locale(): string;
|
|
23
|
+
get eventsHandler(): EventsHandler;
|
|
22
24
|
getLocalizationInformations(): DetailedLocaleInfo | null;
|
|
23
25
|
private _createOrRetrieveUserId;
|
|
24
26
|
getSuggestions(productId: string): Promise<Suggestion>;
|
package/dist/Dialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../src/Dialog.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EACL,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAEL,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../src/Dialog.ts"],"names":[],"mappings":"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"}
|
package/dist/Dialog.js
CHANGED
|
@@ -45,6 +45,9 @@ export class Dialog {
|
|
|
45
45
|
get locale() {
|
|
46
46
|
return this._locale;
|
|
47
47
|
}
|
|
48
|
+
get eventsHandler() {
|
|
49
|
+
return this._eventsHandler;
|
|
50
|
+
}
|
|
48
51
|
getLocalizationInformations() {
|
|
49
52
|
return getDetailedLocaleInfo(this._locale);
|
|
50
53
|
}
|
|
@@ -114,6 +117,14 @@ export class Dialog {
|
|
|
114
117
|
locale: this._locale,
|
|
115
118
|
currency,
|
|
116
119
|
});
|
|
120
|
+
this._eventsHandler.emitExternalEvent(DialogEvents.TRACK_ADD_TO_CART, {
|
|
121
|
+
userId: this._userId,
|
|
122
|
+
productId,
|
|
123
|
+
variantId,
|
|
124
|
+
quantity,
|
|
125
|
+
price,
|
|
126
|
+
currency,
|
|
127
|
+
});
|
|
117
128
|
}
|
|
118
129
|
registerSubmitCheckoutEvent({ productId, quantity, currency, variantId, price, }) {
|
|
119
130
|
this._tracking.track(TrackingEvents.USER_SUBMITTED_CHECKOUT, {
|
|
@@ -125,6 +136,14 @@ export class Dialog {
|
|
|
125
136
|
currency,
|
|
126
137
|
price,
|
|
127
138
|
});
|
|
139
|
+
this._eventsHandler.emitExternalEvent(DialogEvents.TRACK_SUBMIT_CHECKOUT, {
|
|
140
|
+
userId: this._userId,
|
|
141
|
+
productId,
|
|
142
|
+
variantId,
|
|
143
|
+
quantity,
|
|
144
|
+
price,
|
|
145
|
+
currency,
|
|
146
|
+
});
|
|
128
147
|
}
|
|
129
148
|
_loadAssistant() {
|
|
130
149
|
const localeInfo = getDetailedLocaleInfo(this._locale);
|
package/dist/EventsHandler.d.ts
CHANGED
|
@@ -3,8 +3,13 @@ import { DialogEvent } from "./types/events";
|
|
|
3
3
|
export declare class EventsHandler {
|
|
4
4
|
private _locale;
|
|
5
5
|
private _userId?;
|
|
6
|
+
private _consumerReady;
|
|
7
|
+
private _bufferedEvents;
|
|
6
8
|
constructor(locale: string, userId?: string);
|
|
7
9
|
emitExternalEvent(type: DialogEvent["type"], payload?: DialogEvent["payload"]): void;
|
|
10
|
+
notifyConsumerReady(): void;
|
|
11
|
+
notifyConsumerGone(): void;
|
|
12
|
+
private _dispatchExternalEvent;
|
|
8
13
|
emitAssistantEvent(type: AssistantEvent["type"], payload?: GenericAssistantEventPayload): void;
|
|
9
14
|
onAssistantEvent(listener: (event: AssistantEvent<CommonPayload & AssistantEventPayload>) => void): () => void;
|
|
10
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventsHandler.d.ts","sourceRoot":"","sources":["../src/EventsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,aAAa,EAEb,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAuB,WAAW,
|
|
1
|
+
{"version":3,"file":"EventsHandler.d.ts","sourceRoot":"","sources":["../src/EventsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,aAAa,EAEb,4BAA4B,EAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAuB,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAehF,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,eAAe,CAAuB;gBAElC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAKpC,iBAAiB,CACtB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAC/B,IAAI;IAYA,mBAAmB,IAAI,IAAI;IAU3B,kBAAkB,IAAI,IAAI;IAIjC,OAAO,CAAC,sBAAsB;IAWvB,kBAAkB,CACvB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE,4BAA4B,GACrC,IAAI;IAQA,gBAAgB,CACrB,QAAQ,EAAE,CACR,KAAK,EAAE,cAAc,CAAC,aAAa,GAAG,qBAAqB,CAAC,KACzD,IAAI,GACR,MAAM,IAAI;CA0Bd"}
|
package/dist/EventsHandler.js
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
import { DIALOG_ASSISTANT_EVENT, } from "./types/assistantEvent";
|
|
2
|
-
import { DIALOG_CUSTOM_EVENT } from "./types/events";
|
|
2
|
+
import { DIALOG_CUSTOM_EVENT, DialogEvents } from "./types/events";
|
|
3
|
+
// Tracking events can fire (e.g. add-to-cart on page load) before the host app
|
|
4
|
+
// has mounted its listener. We buffer those until a consumer signals readiness,
|
|
5
|
+
// then flush, so none are dispatched into the void.
|
|
6
|
+
const BUFFERED_EVENT_TYPES = new Set([
|
|
7
|
+
DialogEvents.TRACK_ADD_TO_CART,
|
|
8
|
+
DialogEvents.TRACK_SUBMIT_CHECKOUT,
|
|
9
|
+
]);
|
|
3
10
|
export class EventsHandler {
|
|
4
11
|
_locale;
|
|
5
12
|
_userId;
|
|
13
|
+
_consumerReady = false;
|
|
14
|
+
_bufferedEvents = [];
|
|
6
15
|
constructor(locale, userId) {
|
|
7
16
|
this._locale = locale;
|
|
8
17
|
this._userId = userId;
|
|
9
18
|
}
|
|
10
19
|
emitExternalEvent(type, payload) {
|
|
20
|
+
if (!this._consumerReady && BUFFERED_EVENT_TYPES.has(type)) {
|
|
21
|
+
this._bufferedEvents.push({ type, payload });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
this._dispatchExternalEvent(type, payload);
|
|
25
|
+
}
|
|
26
|
+
// Signalled by the host app once its tracking listener is attached. Flushing
|
|
27
|
+
// here (not on emit) guarantees buffered events reach an existing listener.
|
|
28
|
+
notifyConsumerReady() {
|
|
29
|
+
this._consumerReady = true;
|
|
30
|
+
const buffered = this._bufferedEvents;
|
|
31
|
+
this._bufferedEvents = [];
|
|
32
|
+
buffered.forEach(({ type, payload }) => this._dispatchExternalEvent(type, payload));
|
|
33
|
+
}
|
|
34
|
+
notifyConsumerGone() {
|
|
35
|
+
this._consumerReady = false;
|
|
36
|
+
}
|
|
37
|
+
_dispatchExternalEvent(type, payload) {
|
|
11
38
|
const event = new CustomEvent(DIALOG_CUSTOM_EVENT, {
|
|
12
39
|
detail: { type, payload },
|
|
13
40
|
});
|
package/dist/types/events.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export declare enum DialogEvents {
|
|
|
3
3
|
OPEN_ASSISTANT = "open_assistant",
|
|
4
4
|
CLOSE_ASSISTANT = "close_assistant",
|
|
5
5
|
SEND_MESSAGE = "PRODUCT_QUESTION",
|
|
6
|
-
SEND_GENERIC_QUESTION = "GENERIC_QUESTION"
|
|
6
|
+
SEND_GENERIC_QUESTION = "GENERIC_QUESTION",
|
|
7
|
+
TRACK_ADD_TO_CART = "TRACK_ADD_TO_CART",
|
|
8
|
+
TRACK_SUBMIT_CHECKOUT = "TRACK_SUBMIT_CHECKOUT"
|
|
7
9
|
}
|
|
8
10
|
export interface GenericQuestionPayload {
|
|
9
11
|
question: string;
|
|
@@ -32,7 +34,15 @@ export interface DiagnosticPayload {
|
|
|
32
34
|
buttonType: DiagnosticButtonType;
|
|
33
35
|
url: string;
|
|
34
36
|
}
|
|
35
|
-
export
|
|
37
|
+
export interface TrackEventPayload {
|
|
38
|
+
userId?: string;
|
|
39
|
+
productId: string;
|
|
40
|
+
variantId?: string;
|
|
41
|
+
quantity: number;
|
|
42
|
+
price?: string;
|
|
43
|
+
currency?: string;
|
|
44
|
+
}
|
|
45
|
+
export type DialogEventPayload = ProductQuestionPayload | GenericQuestionPayload | DiagnosticPayload | OpenAssistantPayload | TrackEventPayload;
|
|
36
46
|
export interface DialogEvent<T = DialogEventPayload> {
|
|
37
47
|
type: DialogEvents;
|
|
38
48
|
payload: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,YAAY,qBAAqB;IACjC,qBAAqB,qBAAqB;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,YAAY,qBAAqB;IACjC,qBAAqB,qBAAqB;IAC1C,iBAAiB,sBAAsB;IACvC,qBAAqB,0BAA0B;CAChD;AACD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG,cAAc,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,oBAAoB,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;CACb;AAMD,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,sBAAsB,GACtB,iBAAiB,GACjB,oBAAoB,GACpB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,kBAAkB;IACjD,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,CAAC,CAAC;CACZ"}
|
package/dist/types/events.js
CHANGED
|
@@ -5,4 +5,6 @@ export var DialogEvents;
|
|
|
5
5
|
DialogEvents["CLOSE_ASSISTANT"] = "close_assistant";
|
|
6
6
|
DialogEvents["SEND_MESSAGE"] = "PRODUCT_QUESTION";
|
|
7
7
|
DialogEvents["SEND_GENERIC_QUESTION"] = "GENERIC_QUESTION";
|
|
8
|
+
DialogEvents["TRACK_ADD_TO_CART"] = "TRACK_ADD_TO_CART";
|
|
9
|
+
DialogEvents["TRACK_SUBMIT_CHECKOUT"] = "TRACK_SUBMIT_CHECKOUT";
|
|
8
10
|
})(DialogEvents || (DialogEvents = {}));
|