bariweb-widget 0.1.11 → 0.1.13

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 (38) hide show
  1. package/dist/bariweb.iife.js +176 -116
  2. package/dist/bariweb.js +623 -445
  3. package/package.json +1 -1
  4. package/dist/types/components/accordion/accordion-item.d.ts +0 -8
  5. package/dist/types/components/accordion/accordion.d.ts +0 -1
  6. package/dist/types/components/accordion/accordion.styles.d.ts +0 -1
  7. package/dist/types/components/button/button.d.ts +0 -8
  8. package/dist/types/components/button/button.styles.d.ts +0 -1
  9. package/dist/types/components/card/card.d.ts +0 -6
  10. package/dist/types/components/card/card.styles.d.ts +0 -1
  11. package/dist/types/controllers/a11y.controller.d.ts +0 -50
  12. package/dist/types/controllers/ai-a11y.controller.d.ts +0 -17
  13. package/dist/types/controllers/chat.controller.d.ts +0 -100
  14. package/dist/types/controllers/scanner.controller.d.ts +0 -1
  15. package/dist/types/controllers/tts.controller.d.ts +0 -11
  16. package/dist/types/index.d.ts +0 -1
  17. package/dist/types/lib/AdminUI.d.ts +0 -8
  18. package/dist/types/lib/Fingerprint.d.ts +0 -44
  19. package/dist/types/lib/Watcher.d.ts +0 -62
  20. package/dist/types/lib/api/client/client.gen.d.ts +0 -2
  21. package/dist/types/lib/api/client/index.d.ts +0 -8
  22. package/dist/types/lib/api/client/types.gen.d.ts +0 -117
  23. package/dist/types/lib/api/client/utils.gen.d.ts +0 -33
  24. package/dist/types/lib/api/client.gen.d.ts +0 -12
  25. package/dist/types/lib/api/core/auth.gen.d.ts +0 -18
  26. package/dist/types/lib/api/core/bodySerializer.gen.d.ts +0 -25
  27. package/dist/types/lib/api/core/params.gen.d.ts +0 -43
  28. package/dist/types/lib/api/core/pathSerializer.gen.d.ts +0 -33
  29. package/dist/types/lib/api/core/queryKeySerializer.gen.d.ts +0 -18
  30. package/dist/types/lib/api/core/serverSentEvents.gen.d.ts +0 -71
  31. package/dist/types/lib/api/core/types.gen.d.ts +0 -78
  32. package/dist/types/lib/api/core/utils.gen.d.ts +0 -19
  33. package/dist/types/lib/api/index.d.ts +0 -2
  34. package/dist/types/lib/api/sdk.gen.d.ts +0 -118
  35. package/dist/types/lib/api/types.gen.d.ts +0 -694
  36. package/dist/types/lib/icons.d.ts +0 -28
  37. package/dist/types/widget.d.ts +0 -67
  38. package/dist/types/widget.styles.d.ts +0 -1
@@ -1,18 +0,0 @@
1
- /**
2
- * JSON-friendly union that mirrors what Pinia Colada can hash.
3
- */
4
- export type JsonValue = null | string | number | boolean | JsonValue[] | {
5
- [key: string]: JsonValue;
6
- };
7
- /**
8
- * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
9
- */
10
- export declare const queryKeyJsonReplacer: (_key: string, value: unknown) => {} | null | undefined;
11
- /**
12
- * Safely stringifies a value and parses it back into a JsonValue.
13
- */
14
- export declare const stringifyToJsonValue: (input: unknown) => JsonValue | undefined;
15
- /**
16
- * Normalizes any accepted value into a JSON-friendly shape for query keys.
17
- */
18
- export declare const serializeQueryKeyValue: (value: unknown) => JsonValue | undefined;
@@ -1,71 +0,0 @@
1
- import type { Config } from './types.gen';
2
- export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {
3
- /**
4
- * Fetch API implementation. You can use this option to provide a custom
5
- * fetch instance.
6
- *
7
- * @default globalThis.fetch
8
- */
9
- fetch?: typeof fetch;
10
- /**
11
- * Implementing clients can call request interceptors inside this hook.
12
- */
13
- onRequest?: (url: string, init: RequestInit) => Promise<Request>;
14
- /**
15
- * Callback invoked when a network or parsing error occurs during streaming.
16
- *
17
- * This option applies only if the endpoint returns a stream of events.
18
- *
19
- * @param error The error that occurred.
20
- */
21
- onSseError?: (error: unknown) => void;
22
- /**
23
- * Callback invoked when an event is streamed from the server.
24
- *
25
- * This option applies only if the endpoint returns a stream of events.
26
- *
27
- * @param event Event streamed from the server.
28
- * @returns Nothing (void).
29
- */
30
- onSseEvent?: (event: StreamEvent<TData>) => void;
31
- serializedBody?: RequestInit['body'];
32
- /**
33
- * Default retry delay in milliseconds.
34
- *
35
- * This option applies only if the endpoint returns a stream of events.
36
- *
37
- * @default 3000
38
- */
39
- sseDefaultRetryDelay?: number;
40
- /**
41
- * Maximum number of retry attempts before giving up.
42
- */
43
- sseMaxRetryAttempts?: number;
44
- /**
45
- * Maximum retry delay in milliseconds.
46
- *
47
- * Applies only when exponential backoff is used.
48
- *
49
- * This option applies only if the endpoint returns a stream of events.
50
- *
51
- * @default 30000
52
- */
53
- sseMaxRetryDelay?: number;
54
- /**
55
- * Optional sleep function for retry backoff.
56
- *
57
- * Defaults to using `setTimeout`.
58
- */
59
- sseSleepFn?: (ms: number) => Promise<void>;
60
- url: string;
61
- };
62
- export interface StreamEvent<TData = unknown> {
63
- data: TData;
64
- event?: string;
65
- id?: string;
66
- retry?: number;
67
- }
68
- export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
69
- stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
70
- };
71
- export declare const createSseClient: <TData = unknown>({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }: ServerSentEventsOptions) => ServerSentEventsResult<TData>;
@@ -1,78 +0,0 @@
1
- import type { Auth, AuthToken } from './auth.gen';
2
- import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen';
3
- export type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
4
- export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
5
- /**
6
- * Returns the final request URL.
7
- */
8
- buildUrl: BuildUrlFn;
9
- getConfig: () => Config;
10
- request: RequestFn;
11
- setConfig: (config: Config) => Config;
12
- } & {
13
- [K in HttpMethod]: MethodFn;
14
- } & ([SseFn] extends [never] ? {
15
- sse?: never;
16
- } : {
17
- sse: {
18
- [K in HttpMethod]: SseFn;
19
- };
20
- });
21
- export interface Config {
22
- /**
23
- * Auth token or a function returning auth token. The resolved value will be
24
- * added to the request payload as defined by its `security` array.
25
- */
26
- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
27
- /**
28
- * A function for serializing request body parameter. By default,
29
- * {@link JSON.stringify()} will be used.
30
- */
31
- bodySerializer?: BodySerializer | null;
32
- /**
33
- * An object containing any HTTP headers that you want to pre-populate your
34
- * `Headers` object with.
35
- *
36
- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
37
- */
38
- headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
39
- /**
40
- * The request method.
41
- *
42
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
43
- */
44
- method?: Uppercase<HttpMethod>;
45
- /**
46
- * A function for serializing request query parameters. By default, arrays
47
- * will be exploded in form style, objects will be exploded in deepObject
48
- * style, and reserved characters are percent-encoded.
49
- *
50
- * This method will have no effect if the native `paramsSerializer()` Axios
51
- * API function is used.
52
- *
53
- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
54
- */
55
- querySerializer?: QuerySerializer | QuerySerializerOptions;
56
- /**
57
- * A function validating request data. This is useful if you want to ensure
58
- * the request conforms to the desired shape, so it can be safely sent to
59
- * the server.
60
- */
61
- requestValidator?: (data: unknown) => Promise<unknown>;
62
- /**
63
- * A function transforming response data before it's returned. This is useful
64
- * for post-processing data, e.g., converting ISO strings into Date objects.
65
- */
66
- responseTransformer?: (data: unknown) => Promise<unknown>;
67
- /**
68
- * A function validating response data. This is useful if you want to ensure
69
- * the response conforms to the desired shape, so it can be safely passed to
70
- * the transformers and returned to the user.
71
- */
72
- responseValidator?: (data: unknown) => Promise<unknown>;
73
- }
74
- type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never] ? true : [T] extends [never | undefined] ? [undefined] extends [T] ? false : true : false;
75
- export type OmitNever<T extends Record<string, unknown>> = {
76
- [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
77
- };
78
- export {};
@@ -1,19 +0,0 @@
1
- import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
2
- export interface PathSerializer {
3
- path: Record<string, unknown>;
4
- url: string;
5
- }
6
- export declare const PATH_PARAM_RE: RegExp;
7
- export declare const defaultPathSerializer: ({ path, url: _url }: PathSerializer) => string;
8
- export declare const getUrl: ({ baseUrl, path, query, querySerializer, url: _url, }: {
9
- baseUrl?: string;
10
- path?: Record<string, unknown>;
11
- query?: Record<string, unknown>;
12
- querySerializer: QuerySerializer;
13
- url: string;
14
- }) => string;
15
- export declare function getValidRequestBody(options: {
16
- body?: unknown;
17
- bodySerializer?: BodySerializer | null;
18
- serializedBody?: unknown;
19
- }): unknown;
@@ -1,2 +0,0 @@
1
- export { Auth, Chat, type Options, Organizations, Training } from './sdk.gen';
2
- export type { AdminKeyDisplay, AdminKeyLoginRequest, AdminKeyStatus, AutoSaveData, AutoSaveError, AutoSaveErrors, AutoSaveRequest, AutoSaveResponses, ChatData, ChatError, ChatErrors, ChatMessage, ChatRequest, ChatResponse, ChatResponse2, ChatResponses, Client, ClientOptions, ClientRegisterRequest, ClientUpdate, ConfirmRequest, ConfirmScreenData, ConfirmScreenError, ConfirmScreenErrors, ConfirmScreenResponses, DeleteClientData, DeleteClientError, DeleteClientErrors, DeleteClientResponses, GenerateAdminKeyData, GenerateAdminKeyError, GenerateAdminKeyErrors, GenerateAdminKeyResponse, GenerateAdminKeyResponses, GetAdminKeyStatusData, GetAdminKeyStatusError, GetAdminKeyStatusErrors, GetAdminKeyStatusResponse, GetAdminKeyStatusResponses, GetMyClientsData, GetMyClientsResponse, GetMyClientsResponses, GetStatusData, GetStatusResponse, GetStatusResponses, HttpValidationError, LoginData, LoginError, LoginErrors, LoginResponses, LogoutData, LogoutResponses, MatchScreenData, MatchScreenError, MatchScreenErrors, MatchScreenRequest, MatchScreenResponse, MatchScreenResponse2, MatchScreenResponses, MeData, MeResponse, MeResponses, RegisterClientData, RegisterClientError, RegisterClientErrors, RegisterClientResponses, RegisterData, RegisterError, RegisterErrors, RegisterResponse, RegisterResponses, SaveScreenContextData, SaveScreenContextError, SaveScreenContextErrors, SaveScreenContextResponses, SaveScreenRequest, SuggestNameData, SuggestNameError, SuggestNameErrors, SuggestNameRequest, SuggestNameResponses, UpdateClientData, UpdateClientError, UpdateClientErrors, UpdateClientResponses, UserCreate, UserLogin, UserRead, ValidationError, VerifyTokenData, VerifyTokenResponse, VerifyTokenResponses, WidgetLoginData, WidgetLoginError, WidgetLoginErrors, WidgetLoginResponses } from './types.gen';
@@ -1,118 +0,0 @@
1
- import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { AutoSaveData, AutoSaveErrors, AutoSaveResponses, ChatData, ChatErrors, ChatResponses, ConfirmScreenData, ConfirmScreenErrors, ConfirmScreenResponses, DeleteClientData, DeleteClientErrors, DeleteClientResponses, GenerateAdminKeyData, GenerateAdminKeyErrors, GenerateAdminKeyResponses, GetAdminKeyStatusData, GetAdminKeyStatusErrors, GetAdminKeyStatusResponses, GetMyClientsData, GetMyClientsResponses, GetStatusData, GetStatusResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutResponses, MatchScreenData, MatchScreenErrors, MatchScreenResponses, MeData, MeResponses, RegisterClientData, RegisterClientErrors, RegisterClientResponses, RegisterData, RegisterErrors, RegisterResponses, SaveScreenContextData, SaveScreenContextErrors, SaveScreenContextResponses, SuggestNameData, SuggestNameErrors, SuggestNameResponses, UpdateClientData, UpdateClientErrors, UpdateClientResponses, VerifyTokenData, VerifyTokenResponses, WidgetLoginData, WidgetLoginErrors, WidgetLoginResponses } from './types.gen';
3
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
- /**
5
- * You can provide a client instance returned by `createClient()` instead of
6
- * individual options. This might be also useful if you want to implement a
7
- * custom client.
8
- */
9
- client?: Client;
10
- /**
11
- * You can pass arbitrary values through the `meta` object. This can be
12
- * used to access values that aren't defined as part of the SDK function.
13
- */
14
- meta?: Record<string, unknown>;
15
- };
16
- export declare class Auth {
17
- /**
18
- * Login
19
- */
20
- static login<ThrowOnError extends boolean = false>(options: Options<LoginData, ThrowOnError>): import("./client").RequestResult<LoginResponses, LoginErrors, ThrowOnError, "fields">;
21
- /**
22
- * Widget Login
23
- *
24
- * Login for the Bariweb Widget using an Admin Key.
25
- * Verifies the key against the organizations admin_key_hash.
26
- */
27
- static widgetLogin<ThrowOnError extends boolean = false>(options: Options<WidgetLoginData, ThrowOnError>): import("./client").RequestResult<WidgetLoginResponses, WidgetLoginErrors, ThrowOnError, "fields">;
28
- /**
29
- * Me
30
- */
31
- static me<ThrowOnError extends boolean = false>(options?: Options<MeData, ThrowOnError>): import("./client").RequestResult<MeResponses, unknown, ThrowOnError, "fields">;
32
- /**
33
- * Register
34
- */
35
- static register<ThrowOnError extends boolean = false>(options: Options<RegisterData, ThrowOnError>): import("./client").RequestResult<RegisterResponses, RegisterErrors, ThrowOnError, "fields">;
36
- /**
37
- * Logout
38
- */
39
- static logout<ThrowOnError extends boolean = false>(options?: Options<LogoutData, ThrowOnError>): import("./client").RequestResult<LogoutResponses, unknown, ThrowOnError, "fields">;
40
- /**
41
- * Verify Token
42
- */
43
- static verifyToken<ThrowOnError extends boolean = false>(options?: Options<VerifyTokenData, ThrowOnError>): import("./client").RequestResult<VerifyTokenResponses, unknown, ThrowOnError, "fields">;
44
- /**
45
- * Get Status
46
- *
47
- * Keep /status for compatibility with SDK calls if needed
48
- */
49
- static getStatus<ThrowOnError extends boolean = false>(options?: Options<GetStatusData, ThrowOnError>): import("./client").RequestResult<GetStatusResponses, unknown, ThrowOnError, "fields">;
50
- }
51
- export declare class Organizations {
52
- /**
53
- * Register Client
54
- */
55
- static registerClient<ThrowOnError extends boolean = false>(options: Options<RegisterClientData, ThrowOnError>): import("./client").RequestResult<RegisterClientResponses, RegisterClientErrors, ThrowOnError, "fields">;
56
- /**
57
- * Get My Clients
58
- */
59
- static getMyClients<ThrowOnError extends boolean = false>(options?: Options<GetMyClientsData, ThrowOnError>): import("./client").RequestResult<GetMyClientsResponses, unknown, ThrowOnError, "fields">;
60
- /**
61
- * Delete Client
62
- */
63
- static deleteClient<ThrowOnError extends boolean = false>(options: Options<DeleteClientData, ThrowOnError>): import("./client").RequestResult<DeleteClientResponses, DeleteClientErrors, ThrowOnError, "fields">;
64
- /**
65
- * Update Client
66
- */
67
- static updateClient<ThrowOnError extends boolean = false>(options: Options<UpdateClientData, ThrowOnError>): import("./client").RequestResult<UpdateClientResponses, UpdateClientErrors, ThrowOnError, "fields">;
68
- /**
69
- * Generate Admin Key
70
- */
71
- static generateAdminKey<ThrowOnError extends boolean = false>(options: Options<GenerateAdminKeyData, ThrowOnError>): import("./client").RequestResult<GenerateAdminKeyResponses, GenerateAdminKeyErrors, ThrowOnError, "fields">;
72
- /**
73
- * Get Admin Key Status
74
- */
75
- static getAdminKeyStatus<ThrowOnError extends boolean = false>(options: Options<GetAdminKeyStatusData, ThrowOnError>): import("./client").RequestResult<GetAdminKeyStatusResponses, GetAdminKeyStatusErrors, ThrowOnError, "fields">;
76
- }
77
- export declare class Chat {
78
- /**
79
- * Chat
80
- *
81
- * Main chat endpoint. Validates widget origin, retrieves context from Milvus,
82
- * calls Qwen3, and returns a structured { text, action } response.
83
- */
84
- static chat<ThrowOnError extends boolean = false>(options: Options<ChatData, ThrowOnError>): import("./client").RequestResult<ChatResponses, ChatErrors, ThrowOnError, "fields">;
85
- }
86
- export declare class Training {
87
- /**
88
- * Match Screen
89
- *
90
- * Called by the SDK Admin UI to check if a screen is already trained.
91
- */
92
- static matchScreen<ThrowOnError extends boolean = false>(options: Options<MatchScreenData, ThrowOnError>): import("./client").RequestResult<MatchScreenResponses, MatchScreenErrors, ThrowOnError, "fields">;
93
- /**
94
- * Save Screen Context
95
- *
96
- * Protected Admin endpoint: Saves/Updates a screen annotation.
97
- * Note: Admin must provide/resolve the client_id they are training for.
98
- */
99
- static saveScreenContext<ThrowOnError extends boolean = false>(options: Options<SaveScreenContextData, ThrowOnError>): import("./client").RequestResult<SaveScreenContextResponses, SaveScreenContextErrors, ThrowOnError, "fields">;
100
- /**
101
- * Auto Save
102
- *
103
- * Experimental: Auto-saves a draft fingerprint while admin navigates.
104
- */
105
- static autoSave<ThrowOnError extends boolean = false>(options: Options<AutoSaveData, ThrowOnError>): import("./client").RequestResult<AutoSaveResponses, AutoSaveErrors, ThrowOnError, "fields">;
106
- /**
107
- * Suggest Name
108
- *
109
- * Uses LLM to suggest a screen name based on button tokens.
110
- */
111
- static suggestName<ThrowOnError extends boolean = false>(options: Options<SuggestNameData, ThrowOnError>): import("./client").RequestResult<SuggestNameResponses, SuggestNameErrors, ThrowOnError, "fields">;
112
- /**
113
- * Confirm Screen
114
- *
115
- * Moderation: Confirms a draft and updates its label/description.
116
- */
117
- static confirmScreen<ThrowOnError extends boolean = false>(options: Options<ConfirmScreenData, ThrowOnError>): import("./client").RequestResult<ConfirmScreenResponses, ConfirmScreenErrors, ThrowOnError, "fields">;
118
- }