@marketrix.ai/widget 4.0.108 → 4.0.110
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/dist/src/components/base/layoutProps.d.ts +4 -4
- package/dist/src/components/blocks/Notifications.d.ts +3 -3
- package/dist/src/context/UIStateContext.d.ts +1 -1
- package/dist/src/hooks/useFocusTrap.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/sdk/contract.d.ts +2 -2
- package/dist/src/sdk/contracts/activityLogMetadata.d.ts +217 -0
- package/dist/src/sdk/contracts/activityLogVocabulary.d.ts +66 -0
- package/dist/src/sdk/contracts/common.d.ts +7 -0
- package/dist/src/sdk/contracts/entities.d.ts +771 -69
- package/dist/src/sdk/contracts/widget.d.ts +5 -5
- package/dist/src/sdk/index.d.ts +2 -2
- package/dist/src/services/StorageService.d.ts +22 -19
- package/dist/src/test/fixtures.d.ts +2 -0
- package/dist/src/types/index.d.ts +5 -5
- package/dist/widget.mjs +64 -64
- package/package.json +2 -2
|
@@ -67,11 +67,11 @@ export interface LayoutProps {
|
|
|
67
67
|
minWidth?: '0';
|
|
68
68
|
minHeight?: '0';
|
|
69
69
|
border?: boolean | keyof typeof BORDER_SIDE;
|
|
70
|
-
rounded?: boolean | RadiusToken;
|
|
71
|
-
animate?: 'spin' | 'ping' | 'pulse' | 'fadeIn' | 'none';
|
|
72
|
-
hidden?: boolean;
|
|
70
|
+
rounded?: boolean | RadiusToken | undefined;
|
|
71
|
+
animate?: 'spin' | 'ping' | 'pulse' | 'fadeIn' | 'none' | undefined;
|
|
72
|
+
hidden?: boolean | undefined;
|
|
73
73
|
as?: ElementType;
|
|
74
|
-
style?: CSSProperties;
|
|
74
|
+
style?: CSSProperties | undefined;
|
|
75
75
|
}
|
|
76
76
|
export declare function resolveLayoutStyle(props: LayoutProps): CSSProperties;
|
|
77
77
|
export declare function stripLayoutProps<T extends LayoutProps>(props: T): Omit<T, keyof LayoutProps>;
|
|
@@ -6,10 +6,10 @@ export interface NotificationProviderProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const NotificationProvider: React.FC<NotificationProviderProps>;
|
|
8
8
|
export interface WidgetNotificationsProps {
|
|
9
|
-
error?: string;
|
|
9
|
+
error?: string | undefined;
|
|
10
10
|
onClearError: () => void;
|
|
11
|
-
onRetry?: () => void;
|
|
12
|
-
greeting?: string;
|
|
11
|
+
onRetry?: (() => void) | undefined;
|
|
12
|
+
greeting?: string | undefined;
|
|
13
13
|
greetingBody?: string;
|
|
14
14
|
onGreetingDismiss: () => void;
|
|
15
15
|
}
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function useFocusTrap(containerRef: React.RefObject<HTMLElement | null>, isActive: boolean, options?: {
|
|
23
23
|
onEscape?: () => void;
|
|
24
|
-
focusTargetRef?: React.RefObject<HTMLElement | null
|
|
24
|
+
focusTargetRef?: React.RefObject<HTMLElement | null> | undefined;
|
|
25
25
|
}): void;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -169,7 +169,7 @@ export declare const widgetContract: {
|
|
|
169
169
|
error: string;
|
|
170
170
|
} | {
|
|
171
171
|
type: "task/status";
|
|
172
|
-
status: "
|
|
172
|
+
status: "completed" | "failed" | "running" | "stopped" | "has_question";
|
|
173
173
|
message?: string | undefined;
|
|
174
174
|
} | {
|
|
175
175
|
type: "tool/call";
|
|
@@ -197,7 +197,7 @@ export declare const widgetContract: {
|
|
|
197
197
|
error: string;
|
|
198
198
|
} | {
|
|
199
199
|
type: "task/status";
|
|
200
|
-
status: "
|
|
200
|
+
status: "completed" | "failed" | "running" | "stopped" | "has_question";
|
|
201
201
|
message?: string | undefined;
|
|
202
202
|
} | {
|
|
203
203
|
type: "tool/call";
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ActivityMetadataByType` — the strict, per-`ActivityLogType` shape of `activity_log.metadata`, the
|
|
3
|
+
* one write-time gate `models/columnSchemas.ts` registers against the column. Moved out of that file
|
|
4
|
+
* so `contracts/entities.ts` can import it to type `ActivityLogEntitySchema.metadata` precisely
|
|
5
|
+
* (a union of every branch) instead of the open `.passthrough()` it carried before — deriving from a
|
|
6
|
+
* registry that lived inside `models/columnSchemas.ts`, which itself imports from `entities.ts`,
|
|
7
|
+
* would have cycled.
|
|
8
|
+
*
|
|
9
|
+
* `slack_command`'s `status` imports `SlackCommandLogStatusSchema` from `./activityLogVocabulary` —
|
|
10
|
+
* the one home `tests/unit/contractEnumHomes.test.ts` requires for that value set — a dependency-free
|
|
11
|
+
* leaf, so this registry (and everything importing it through `entities.ts`) never pulls in
|
|
12
|
+
* `contracts/slack.ts`'s `@orpc/contract` import.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
export declare const ActivityMetadataByType: {
|
|
16
|
+
update_workspace: z.ZodObject<{
|
|
17
|
+
details: z.ZodString;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
update_user: z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
+
target_user_id: z.ZodNumber;
|
|
21
|
+
target_user_email: z.ZodString;
|
|
22
|
+
reason: z.ZodString;
|
|
23
|
+
details: z.ZodString;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
target_user_id: z.ZodNumber;
|
|
26
|
+
details: z.ZodString;
|
|
27
|
+
}, z.core.$strict>]>;
|
|
28
|
+
create_application: z.ZodObject<{
|
|
29
|
+
id: z.ZodNumber;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
type: z.ZodEnum<{
|
|
32
|
+
app: "app";
|
|
33
|
+
website: "website";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
update_application: z.ZodObject<{
|
|
37
|
+
id: z.ZodNumber;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
type: z.ZodEnum<{
|
|
40
|
+
app: "app";
|
|
41
|
+
website: "website";
|
|
42
|
+
}>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
delete_application: z.ZodObject<{
|
|
45
|
+
id: z.ZodNumber;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
type: z.ZodEnum<{
|
|
48
|
+
app: "app";
|
|
49
|
+
website: "website";
|
|
50
|
+
}>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
create_widget: z.ZodObject<{
|
|
53
|
+
application_id: z.ZodNumber;
|
|
54
|
+
widget_type: z.ZodEnum<{
|
|
55
|
+
widget: "widget";
|
|
56
|
+
}>;
|
|
57
|
+
details: z.ZodString;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
update_widget: z.ZodObject<{
|
|
60
|
+
application_id: z.ZodNumber;
|
|
61
|
+
widget_type: z.ZodEnum<{
|
|
62
|
+
widget: "widget";
|
|
63
|
+
}>;
|
|
64
|
+
details: z.ZodString;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
delete_widget: z.ZodObject<{
|
|
67
|
+
application_id: z.ZodNumber;
|
|
68
|
+
widget_type: z.ZodEnum<{
|
|
69
|
+
widget: "widget";
|
|
70
|
+
}>;
|
|
71
|
+
details: z.ZodString;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
create_knowledge: z.ZodObject<{
|
|
74
|
+
application_id: z.ZodNumber;
|
|
75
|
+
file_name: z.ZodString;
|
|
76
|
+
file_size: z.ZodNumber;
|
|
77
|
+
file_type: z.ZodString;
|
|
78
|
+
file_url: z.ZodString;
|
|
79
|
+
source_url: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strict>;
|
|
81
|
+
update_knowledge: z.ZodObject<{
|
|
82
|
+
id: z.ZodNumber;
|
|
83
|
+
file_name: z.ZodString;
|
|
84
|
+
source_url: z.ZodString;
|
|
85
|
+
action: z.ZodLiteral<"refreshed">;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
delete_knowledge: z.ZodObject<{
|
|
88
|
+
id: z.ZodNumber;
|
|
89
|
+
file_name: z.ZodString;
|
|
90
|
+
file_type: z.ZodString;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
request_membership: z.ZodObject<{
|
|
93
|
+
target_user_email: z.ZodString;
|
|
94
|
+
reminder: z.ZodOptional<z.ZodLiteral<true>>;
|
|
95
|
+
details: z.ZodString;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
invite_user: z.ZodObject<{
|
|
98
|
+
target_user_email: z.ZodString;
|
|
99
|
+
details: z.ZodString;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
create_workspace: z.ZodObject<{
|
|
102
|
+
slug: z.ZodString;
|
|
103
|
+
details: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
trial_started: z.ZodObject<{
|
|
106
|
+
subscription_id: z.ZodString;
|
|
107
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
108
|
+
details: z.ZodString;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
trial_ending_soon: z.ZodObject<{
|
|
111
|
+
subscription_id: z.ZodString;
|
|
112
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
113
|
+
details: z.ZodString;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
trial_ended: z.ZodObject<{
|
|
116
|
+
subscription_id: z.ZodString;
|
|
117
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
118
|
+
details: z.ZodString;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
subscription_created: z.ZodObject<{
|
|
121
|
+
subscription_id: z.ZodString;
|
|
122
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
123
|
+
details: z.ZodString;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
subscription_canceled: z.ZodObject<{
|
|
126
|
+
subscription_id: z.ZodString;
|
|
127
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
128
|
+
details: z.ZodString;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
plan_changed: z.ZodObject<{
|
|
131
|
+
session_id: z.ZodString;
|
|
132
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
133
|
+
details: z.ZodString;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
payment_succeeded: z.ZodObject<{
|
|
136
|
+
invoice_id: z.ZodString;
|
|
137
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
138
|
+
details: z.ZodString;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
payment_failed: z.ZodObject<{
|
|
141
|
+
invoice_id: z.ZodString;
|
|
142
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
143
|
+
details: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
widget_question: z.ZodObject<{
|
|
146
|
+
application_id: z.ZodNumber;
|
|
147
|
+
chat_id: z.ZodString;
|
|
148
|
+
mode: z.ZodString;
|
|
149
|
+
question: z.ZodString;
|
|
150
|
+
timestamp: z.ZodString;
|
|
151
|
+
user_id: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
start_simulation: z.ZodObject<{
|
|
154
|
+
application_id: z.ZodNumber;
|
|
155
|
+
simulation_id: z.ZodNumber;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
create_workflow: z.ZodObject<{
|
|
158
|
+
id: z.ZodNumber;
|
|
159
|
+
name: z.ZodString;
|
|
160
|
+
details: z.ZodString;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
update_workflow: z.ZodObject<{
|
|
163
|
+
id: z.ZodNumber;
|
|
164
|
+
name: z.ZodString;
|
|
165
|
+
details: z.ZodString;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
delete_workflow: z.ZodObject<{
|
|
168
|
+
id: z.ZodNumber;
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
details: z.ZodString;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
toggle_workflow: z.ZodObject<{
|
|
173
|
+
enabled: z.ZodBoolean;
|
|
174
|
+
id: z.ZodNumber;
|
|
175
|
+
name: z.ZodString;
|
|
176
|
+
details: z.ZodString;
|
|
177
|
+
}, z.core.$strict>;
|
|
178
|
+
slack_command: z.ZodObject<{
|
|
179
|
+
slack_user_id: z.ZodString;
|
|
180
|
+
slack_channel_id: z.ZodNullable<z.ZodString>;
|
|
181
|
+
raw_text: z.ZodString;
|
|
182
|
+
detected_intent: z.ZodString;
|
|
183
|
+
extracted_params: z.ZodObject<{
|
|
184
|
+
qaFlowId: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
appId: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
187
|
+
query: z.ZodOptional<z.ZodString>;
|
|
188
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
189
|
+
text: z.ZodOptional<z.ZodString>;
|
|
190
|
+
name: z.ZodOptional<z.ZodString>;
|
|
191
|
+
workflowName: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>;
|
|
193
|
+
status: z.ZodEnum<{
|
|
194
|
+
received: "received";
|
|
195
|
+
classifying: "classifying";
|
|
196
|
+
dispatched: "dispatched";
|
|
197
|
+
completed: "completed";
|
|
198
|
+
failed: "failed";
|
|
199
|
+
}>;
|
|
200
|
+
response_text: z.ZodNullable<z.ZodString>;
|
|
201
|
+
error_message: z.ZodNullable<z.ZodString>;
|
|
202
|
+
duration_ms: z.ZodNullable<z.ZodNumber>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
publish_survey: z.ZodObject<{
|
|
205
|
+
survey_id: z.ZodNumber;
|
|
206
|
+
details: z.ZodString;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
unpublish_survey: z.ZodObject<{
|
|
209
|
+
survey_id: z.ZodNumber;
|
|
210
|
+
details: z.ZodString;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
delete_survey_response: z.ZodObject<{
|
|
213
|
+
survey_id: z.ZodNumber;
|
|
214
|
+
details: z.ZodString;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
};
|
|
217
|
+
export type SlackCommandMetadata = z.infer<typeof ActivityMetadataByType.slack_command>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four closed vocabularies an activity-log row's shape is keyed on — `type` (what happened),
|
|
3
|
+
* the two enums that ride INSIDE some per-type metadata shapes (`ApplicationTypeSchema`,
|
|
4
|
+
* `WidgetTypeSchema`), and `SlackCommandLogStatusSchema` (the `slack_command` metadata's `status`,
|
|
5
|
+
* and `contracts/slack.ts`'s command-log entity status — one home per `tests/unit/contractEnumHomes.test.ts`).
|
|
6
|
+
* Split out of `contracts/entities.ts` into this dependency-free leaf — no `@orpc/contract` import —
|
|
7
|
+
* so `contracts/activityLogMetadata.ts`'s per-type registry can import them without cycling back
|
|
8
|
+
* through `entities.ts`, which needs the registry to type `ActivityLogEntitySchema.metadata`
|
|
9
|
+
* precisely instead of `.passthrough()`, and so an audience that never touches oRPC contract routes
|
|
10
|
+
* (the internal/monitor mirror) doesn't pull `@orpc/contract` in through the metadata registry.
|
|
11
|
+
* `entities.ts` re-exports the first three (unchanged); `SlackCommandLogStatusSchema` is new here and
|
|
12
|
+
* has no `entities.ts` re-export since nothing imported it from there before.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
export declare const ApplicationTypeSchema: z.ZodEnum<{
|
|
16
|
+
app: "app";
|
|
17
|
+
website: "website";
|
|
18
|
+
}>;
|
|
19
|
+
export type ApplicationType = z.infer<typeof ApplicationTypeSchema>;
|
|
20
|
+
export declare const WidgetTypeSchema: z.ZodEnum<{
|
|
21
|
+
widget: "widget";
|
|
22
|
+
}>;
|
|
23
|
+
export type WidgetType = z.infer<typeof WidgetTypeSchema>;
|
|
24
|
+
export declare const ActivityLogTypeSchema: z.ZodEnum<{
|
|
25
|
+
update_workspace: "update_workspace";
|
|
26
|
+
update_user: "update_user";
|
|
27
|
+
create_application: "create_application";
|
|
28
|
+
update_application: "update_application";
|
|
29
|
+
delete_application: "delete_application";
|
|
30
|
+
create_widget: "create_widget";
|
|
31
|
+
update_widget: "update_widget";
|
|
32
|
+
delete_widget: "delete_widget";
|
|
33
|
+
create_knowledge: "create_knowledge";
|
|
34
|
+
update_knowledge: "update_knowledge";
|
|
35
|
+
delete_knowledge: "delete_knowledge";
|
|
36
|
+
request_membership: "request_membership";
|
|
37
|
+
invite_user: "invite_user";
|
|
38
|
+
create_workspace: "create_workspace";
|
|
39
|
+
trial_started: "trial_started";
|
|
40
|
+
trial_ending_soon: "trial_ending_soon";
|
|
41
|
+
trial_ended: "trial_ended";
|
|
42
|
+
subscription_created: "subscription_created";
|
|
43
|
+
subscription_canceled: "subscription_canceled";
|
|
44
|
+
plan_changed: "plan_changed";
|
|
45
|
+
payment_succeeded: "payment_succeeded";
|
|
46
|
+
payment_failed: "payment_failed";
|
|
47
|
+
widget_question: "widget_question";
|
|
48
|
+
start_simulation: "start_simulation";
|
|
49
|
+
create_workflow: "create_workflow";
|
|
50
|
+
update_workflow: "update_workflow";
|
|
51
|
+
delete_workflow: "delete_workflow";
|
|
52
|
+
toggle_workflow: "toggle_workflow";
|
|
53
|
+
slack_command: "slack_command";
|
|
54
|
+
publish_survey: "publish_survey";
|
|
55
|
+
unpublish_survey: "unpublish_survey";
|
|
56
|
+
delete_survey_response: "delete_survey_response";
|
|
57
|
+
}>;
|
|
58
|
+
export type ActivityLogType = z.infer<typeof ActivityLogTypeSchema>;
|
|
59
|
+
export declare const SlackCommandLogStatusSchema: z.ZodEnum<{
|
|
60
|
+
received: "received";
|
|
61
|
+
classifying: "classifying";
|
|
62
|
+
dispatched: "dispatched";
|
|
63
|
+
completed: "completed";
|
|
64
|
+
failed: "failed";
|
|
65
|
+
}>;
|
|
66
|
+
export type SlackCommandLogStatus = z.infer<typeof SlackCommandLogStatusSchema>;
|
|
@@ -60,6 +60,13 @@ export declare const ToolCallRecordSchema: z.ZodObject<{
|
|
|
60
60
|
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
61
61
|
result: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
62
|
}, z.core.$strict>;
|
|
63
|
+
export declare const SessionStateSchema: z.ZodObject<{
|
|
64
|
+
cookies: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
|
+
local_storage: z.ZodArray<z.ZodObject<{
|
|
66
|
+
origin: z.ZodString;
|
|
67
|
+
items: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
}, z.core.$strict>;
|
|
63
70
|
export declare const SlackWebhookUrlSchema: z.ZodURL;
|
|
64
71
|
export declare const GraphEdgeSchema: z.ZodObject<{
|
|
65
72
|
start: z.ZodString;
|