@debales/ai 1.1.52-canary.0 → 1.1.53-canary.1

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,6 +1,6 @@
1
1
  import { DebalesContextType } from '../../types/debales';
2
2
  import { default as React } from 'react';
3
- import { EcommercePlatform, Message, Product, ShopifyStoreMeta, UiData } from '../../types';
3
+ import { ECOMMERCE_PLATFORM, Message, Product, ShopifyStoreMeta, UiData } from '../../types';
4
4
  interface ProductSliderProps {
5
5
  message: Message;
6
6
  botId: string;
@@ -8,7 +8,7 @@ interface ProductSliderProps {
8
8
  onSendMessage: DebalesContextType["onSendMessage"];
9
9
  loading: boolean;
10
10
  storeMetaData: ShopifyStoreMeta | null;
11
- platform: EcommercePlatform;
11
+ platform: (typeof ECOMMERCE_PLATFORM)[keyof typeof ECOMMERCE_PLATFORM];
12
12
  setShowVariantModel: (show: boolean) => void;
13
13
  setSelectedProduct: (product: Product) => void;
14
14
  }
@@ -1,4 +1,4 @@
1
- import { EcommercePlatform } from '../types/index';
1
+ import { ECOMMERCE_PLATFORM } from '../types/index';
2
2
  export declare class PlatformDetector {
3
- static detect(): EcommercePlatform;
3
+ static detect(): (typeof ECOMMERCE_PLATFORM)[keyof typeof ECOMMERCE_PLATFORM];
4
4
  }
@@ -1,4 +1,4 @@
1
- import { CartState, EventType, LeadingQueries, MessageEvent, MessageRole, UserInfo } from '@debales/shared';
1
+ import { CartState, EVENT_TYPE, LeadingQueries, MESSAGE_ROLE, MessageEvent, UserInfo } from '@debales/shared';
2
2
  import { DisplayMode, Product, ShopifyStoreMeta, SuggestedQuestionAnswer, UiData, VariantQuantity, Message } from '.';
3
3
  export interface OnSendMessageOptions {
4
4
  message: string;
@@ -46,8 +46,8 @@ export interface DebalesContextType {
46
46
  setIsFormClosedByUser: React.Dispatch<React.SetStateAction<boolean>>;
47
47
  }
48
48
  export interface WebsocketMessageEvent extends MessageEvent {
49
- type: typeof EventType.MESSAGE | typeof EventType.USER_ACTION;
50
- role: (typeof MessageRole)[keyof typeof MessageRole];
49
+ type: typeof EVENT_TYPE.MESSAGE | typeof EVENT_TYPE.USER_ACTION;
50
+ role: (typeof MESSAGE_ROLE)[keyof typeof MESSAGE_ROLE];
51
51
  query: string;
52
52
  nameSpace: string;
53
53
  conversationId?: string;
@@ -1,4 +1,4 @@
1
- import { IProductOption, IProductVariant } from '@debales/shared';
1
+ import { IProductOption, IProductVariant, ObjectValues } from '@debales/shared';
2
2
  interface ChatBoxProps {
3
3
  botId: string;
4
4
  botName?: string;
@@ -145,14 +145,15 @@ export interface VariantQuantity {
145
145
  price?: string;
146
146
  productLink?: string;
147
147
  }
148
- export declare enum EcommercePlatform {
149
- DEFAULT = "DEFAULT",
150
- SHOPIFY = "SHOPIFY",
151
- WOOCOMMERCE = "WOOCOMMERCE",
152
- MAGENTO = "MAGENTO",
153
- UNKNOWN = "UNKNOWN",
154
- THE_COLLECTIVE = "THE_COLLECTIVE"
155
- }
148
+ export declare const ECOMMERCE_PLATFORM: {
149
+ readonly DEFAULT: "DEFAULT";
150
+ readonly SHOPIFY: "SHOPIFY";
151
+ readonly WOOCOMMERCE: "WOOCOMMERCE";
152
+ readonly MAGENTO: "MAGENTO";
153
+ readonly UNKNOWN: "UNKNOWN";
154
+ readonly THE_COLLECTIVE: "THE_COLLECTIVE";
155
+ };
156
+ export type EcommercePlatform = ObjectValues<typeof ECOMMERCE_PLATFORM>;
156
157
  export interface ShadowDOMRef {
157
158
  shadowRoot: ShadowRoot;
158
159
  container: HTMLElement;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@debales/ai",
3
3
  "private": false,
4
4
  "access": "public",
5
- "version": "1.1.52-canary.0",
5
+ "version": "1.1.53-canary.1",
6
6
  "type": "module",
7
7
  "main": "./dist/module/ai.js",
8
8
  "types": "./dist/module/index.d.ts",