@d-id/client-sdk 1.1.15-staging.65 → 1.1.15-staging.66

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,4 @@
1
- import { c as x, a as N, S as O, C as g, b as U, d as P, e as $, A as T, f as q, T as J } from "./index-Cp8BAOdx.js";
1
+ import { c as x, a as N, S as O, C as g, b as U, d as P, e as $, A as T, f as q, T as J } from "./index-BjgMVt64.js";
2
2
  function Q(u, p, h, i) {
3
3
  const w = x(u, `${p}/v2/agents/${h}`, i);
4
4
  return {
@@ -1,7 +1,7 @@
1
1
  import { Agent, AgentPayload, Auth, Chat, ChatPayload, ChatResponse, RatingEntity, RatingPayload, STTTokenResponse } from '../types/index';
2
2
  import { RequestOptions } from './apiClient';
3
3
 
4
- export declare function createAgentsApi(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void): {
4
+ export declare function createAgentsApi(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void, externalId?: string): {
5
5
  create(payload: AgentPayload, options?: RequestOptions): Promise<Agent>;
6
6
  getAgents(tag?: string, options?: RequestOptions): Promise<Agent[]>;
7
7
  getById(id: string, options?: RequestOptions): Promise<Agent>;
@@ -3,7 +3,7 @@ import { Auth } from '../types/auth';
3
3
  export type RequestOptions = RequestInit & {
4
4
  skipErrorHandler?: boolean;
5
5
  };
6
- export declare function createClient(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void): {
6
+ export declare function createClient(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void, externalId?: string): {
7
7
  get<T = any>(url: string, options?: RequestOptions): Promise<T>;
8
8
  post<T = any>(url: string, body?: any, options?: RequestOptions): Promise<T>;
9
9
  delete<T = any>(url: string, body?: any, options?: RequestOptions): Promise<T>;
@@ -1,4 +1,4 @@
1
1
  import { Auth } from '../types/auth';
2
2
 
3
- export declare function getExternalId(): string;
4
- export declare function getAuthHeader(auth: Auth): string;
3
+ export declare function getExternalId(externalId?: string): string;
4
+ export declare function getAuthHeader(auth: Auth, externalId?: string): string;
@@ -1,4 +1,4 @@
1
- import { Agent, AgentManager, AgentManagerOptions, Auth, Chat, ChatMode, CreateStreamOptions, Message } from '../../types';
1
+ import { AgentManager, AgentManagerOptions, Chat, ChatMode, CreateStreamOptions, Message } from '../../types';
2
2
  import { SocketManager } from '../socket-manager';
3
3
  import { StreamingManager } from '../streaming-manager';
4
4
 
@@ -22,4 +22,3 @@ export interface AgentManagerItems {
22
22
  * const agentManager = await createAgentManager('id-agent123', { auth: { type: 'key', clientKey: '123', externalId: '123' } });
23
23
  */
24
24
  export declare function createAgentManager(agent: string, options: AgentManagerOptions): Promise<AgentManager>;
25
- export declare function getAgent(agentId: string, auth: Auth, baseURL?: string): Promise<Agent>;
@@ -2,7 +2,7 @@ export interface AnalyticsOptions {
2
2
  token: string;
3
3
  agentId: string;
4
4
  isEnabled?: boolean;
5
- distinctId?: string;
5
+ externalId?: string;
6
6
  mixpanelAdditionalProperties?: Record<string, any>;
7
7
  }
8
8
  export interface Analytics {
@@ -9,4 +9,4 @@ export interface SocketManager {
9
9
  export declare function createSocketManager(auth: Auth, host: string, callbacks: {
10
10
  onMessage: ChatProgressCallback;
11
11
  onError?: (error: Error) => void;
12
- }): Promise<SocketManager>;
12
+ }, externalId?: string): Promise<SocketManager>;
@@ -134,10 +134,7 @@ export interface AgentManagerOptions {
134
134
  enableAnalitics?: boolean;
135
135
  mixpanelKey?: string;
136
136
  mixpanelAdditionalProperties?: Record<string, any>;
137
- /**
138
- * Unique ID of agent user used in analytics. Pass it to override the default way to get distinctId
139
- */
140
- distinctId?: string;
137
+ externalId?: string;
141
138
  streamOptions?: StreamOptions;
142
139
  initialMessages?: Message[];
143
140
  persistentChat?: boolean;
@@ -62,7 +62,6 @@ export interface ManagerCallbacks {
62
62
  }
63
63
  export type ManagerCallbackKeys = keyof ManagerCallbacks;
64
64
  export interface StreamEndUserData {
65
- distinct_id?: string;
66
65
  plan?: string;
67
66
  }
68
67
  export interface TalkStreamOptions extends CreateTalkStreamRequest {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@d-id/client-sdk",
3
3
  "private": false,
4
- "version": "1.1.15-staging.65",
4
+ "version": "1.1.15-staging.66",
5
5
  "type": "module",
6
6
  "description": "d-id client sdk",
7
7
  "repository": {