@marketrix.ai/widget 4.0.97 → 4.0.99

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,22 +1,4 @@
1
1
  export declare const widgetContract: {
2
- activityLogCreate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3
- type: import("zod").ZodLiteral<"widget_question">;
4
- metadata: import("zod").ZodObject<{
5
- question: import("zod").ZodString;
6
- mode: import("zod").ZodEnum<{
7
- tell: "tell";
8
- show: "show";
9
- do: "do";
10
- }>;
11
- chat_id: import("zod").ZodString;
12
- timestamp: import("zod").ZodString;
13
- marketrix_id: import("zod").ZodString;
14
- marketrix_key: import("zod").ZodString;
15
- user_id: import("zod").ZodOptional<import("zod").ZodNumber>;
16
- }, import("zod/v4/core").$strict>;
17
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
18
- success: import("zod").ZodLiteral<true>;
19
- }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
20
2
  chatCreate: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodString, Record<never, never>, Record<never, never>>;
21
3
  widgetDefaultGet: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
22
4
  type: import("zod").ZodEnum<{
@@ -162,13 +144,14 @@ export declare const widgetContract: {
162
144
  events: import("zod").ZodArray<import("zod").ZodUnknown>;
163
145
  }, import("zod/v4/core").$strip>], "type">;
164
146
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
165
- ok: import("zod").ZodBoolean;
147
+ success: import("zod").ZodLiteral<true>;
166
148
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
167
149
  widgetStream: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
168
150
  chat_id: import("zod").ZodString;
169
151
  tab_id: import("zod").ZodOptional<import("zod").ZodString>;
170
152
  marketrix_id: import("zod").ZodOptional<import("zod").ZodString>;
171
153
  marketrix_key: import("zod").ZodOptional<import("zod").ZodString>;
154
+ user_id: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
172
155
  }, import("zod/v4/core").$strip>, import("@orpc/contract").Schema<AsyncIteratorObject<{
173
156
  type: "registered";
174
157
  chat_id: string;
@@ -6,9 +6,9 @@ export declare const EntityStatusSchema: z.ZodEnum<{
6
6
  }>;
7
7
  export type EntityStatus = z.infer<typeof EntityStatusSchema>;
8
8
  export declare const BaseEntitySchema: z.ZodObject<{
9
- id: z.ZodOptional<z.ZodNumber>;
10
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
11
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
9
+ id: z.ZodNumber;
10
+ created_at: z.ZodCoercedDate<unknown>;
11
+ updated_at: z.ZodCoercedDate<unknown>;
12
12
  }, z.core.$strip>;
13
13
  export declare const ByIdSchema: z.ZodObject<{
14
14
  id: z.ZodCoercedNumber<unknown>;
@@ -32,9 +32,9 @@ export declare const WorkspaceMemberRoleSchema: z.ZodEnum<{
32
32
  }>;
33
33
  export type WorkspaceMemberRole = z.infer<typeof WorkspaceMemberRoleSchema>;
34
34
  export declare const UserEntitySchema: z.ZodObject<{
35
- id: z.ZodOptional<z.ZodNumber>;
36
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
37
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
35
+ id: z.ZodNumber;
36
+ created_at: z.ZodCoercedDate<unknown>;
37
+ updated_at: z.ZodCoercedDate<unknown>;
38
38
  is_super: z.ZodBoolean;
39
39
  status: z.ZodEnum<{
40
40
  created: "created";
@@ -58,9 +58,9 @@ export declare const UserEntitySchema: z.ZodObject<{
58
58
  }, z.core.$strip>;
59
59
  export type UserData = z.infer<typeof UserEntitySchema>;
60
60
  export declare const WorkspaceEntitySchema: z.ZodObject<{
61
- id: z.ZodOptional<z.ZodNumber>;
62
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
63
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
61
+ id: z.ZodNumber;
62
+ created_at: z.ZodCoercedDate<unknown>;
63
+ updated_at: z.ZodCoercedDate<unknown>;
64
64
  name: z.ZodString;
65
65
  slug: z.ZodString;
66
66
  status: z.ZodEnum<{
@@ -81,9 +81,9 @@ export declare const WorkspaceEntitySchema: z.ZodObject<{
81
81
  }, z.core.$strip>;
82
82
  export type WorkspaceData = z.infer<typeof WorkspaceEntitySchema>;
83
83
  export declare const ApplicationEntitySchema: z.ZodObject<{
84
- id: z.ZodOptional<z.ZodNumber>;
85
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
86
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
84
+ id: z.ZodNumber;
85
+ created_at: z.ZodCoercedDate<unknown>;
86
+ updated_at: z.ZodCoercedDate<unknown>;
87
87
  workspace_id: z.ZodNumber;
88
88
  name: z.ZodString;
89
89
  slug: z.ZodString;
@@ -99,9 +99,9 @@ export declare const ApplicationEntitySchema: z.ZodObject<{
99
99
  export type ApplicationData = z.infer<typeof ApplicationEntitySchema>;
100
100
  /** Used for all API responses; password is write-only and never returned to clients. */
101
101
  export declare const ApplicationReadSchema: z.ZodObject<{
102
- id: z.ZodOptional<z.ZodNumber>;
103
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
104
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
102
+ id: z.ZodNumber;
103
+ created_at: z.ZodCoercedDate<unknown>;
104
+ updated_at: z.ZodCoercedDate<unknown>;
105
105
  slug: z.ZodString;
106
106
  type: z.ZodEnum<{
107
107
  app: "app";
@@ -203,9 +203,9 @@ export declare const WidgetSettingsWriteSchema: z.ZodObject<{
203
203
  }, z.core.$strip>;
204
204
  export type WidgetSettingsWriteData = z.infer<typeof WidgetSettingsWriteSchema>;
205
205
  export declare const WidgetEntitySchema: z.ZodObject<{
206
- id: z.ZodOptional<z.ZodNumber>;
207
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
208
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
206
+ id: z.ZodNumber;
207
+ created_at: z.ZodCoercedDate<unknown>;
208
+ updated_at: z.ZodCoercedDate<unknown>;
209
209
  application_id: z.ZodNumber;
210
210
  type: z.ZodEnum<{
211
211
  widget: "widget";
@@ -358,9 +358,9 @@ export declare const ActivityLogMetadataSchema: z.ZodObject<{
358
358
  created_by: z.ZodOptional<z.ZodNumber>;
359
359
  }, z.core.$loose>;
360
360
  export declare const ActivityLogEntitySchema: z.ZodObject<{
361
- id: z.ZodOptional<z.ZodNumber>;
362
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
363
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
361
+ id: z.ZodNumber;
362
+ created_at: z.ZodCoercedDate<unknown>;
363
+ updated_at: z.ZodCoercedDate<unknown>;
364
364
  workspace_id: z.ZodNumber;
365
365
  user_id: z.ZodNullable<z.ZodNumber>;
366
366
  type: z.ZodEnum<{
@@ -1,8 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const WidgetCreateSchema: z.ZodObject<{
3
- id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
4
- created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
5
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
6
3
  status: z.ZodOptional<z.ZodEnum<{
7
4
  created: "created";
8
5
  active: "active";
@@ -54,9 +51,6 @@ export declare const WidgetCreateSchema: z.ZodObject<{
54
51
  }, z.core.$strip>;
55
52
  export type WidgetCreateData = z.infer<typeof WidgetCreateSchema>;
56
53
  export declare const WidgetUpdateSchema: z.ZodObject<{
57
- id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
58
- created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
59
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
60
54
  application_id: z.ZodOptional<z.ZodNumber>;
61
55
  type: z.ZodOptional<z.ZodEnum<{
62
56
  widget: "widget";
@@ -189,9 +183,6 @@ export declare const WidgetCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
189
183
  }, z.core.$strip>], "type">;
190
184
  export type WidgetCommand = z.infer<typeof WidgetCommandSchema>;
191
185
  export declare const widgetCreate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
192
- id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
193
- created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
194
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
195
186
  status: z.ZodOptional<z.ZodEnum<{
196
187
  created: "created";
197
188
  active: "active";
@@ -241,9 +232,9 @@ export declare const widgetCreate: import("@orpc/contract").ContractProcedureBui
241
232
  }, z.core.$strip>>;
242
233
  }, z.core.$strip>>;
243
234
  }, z.core.$strip>, z.ZodObject<{
244
- id: z.ZodOptional<z.ZodNumber>;
245
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
246
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
235
+ id: z.ZodNumber;
236
+ created_at: z.ZodCoercedDate<unknown>;
237
+ updated_at: z.ZodCoercedDate<unknown>;
247
238
  application_id: z.ZodNumber;
248
239
  type: z.ZodEnum<{
249
240
  widget: "widget";
@@ -306,9 +297,9 @@ export declare const widgetSearch: import("@orpc/contract").ContractProcedureBui
306
297
  offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
307
298
  }, z.core.$strip>, z.ZodObject<{
308
299
  items: z.ZodArray<z.ZodObject<{
309
- id: z.ZodOptional<z.ZodNumber>;
310
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
311
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
300
+ id: z.ZodNumber;
301
+ created_at: z.ZodCoercedDate<unknown>;
302
+ updated_at: z.ZodCoercedDate<unknown>;
312
303
  application_id: z.ZodNumber;
313
304
  type: z.ZodEnum<{
314
305
  widget: "widget";
@@ -469,9 +460,6 @@ export declare const widgetDefaultGet: import("@orpc/contract").ContractProcedur
469
460
  }, z.core.$strip>>;
470
461
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
471
462
  export declare const widgetUpdate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
472
- id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
473
- created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
474
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
475
463
  application_id: z.ZodOptional<z.ZodNumber>;
476
464
  type: z.ZodOptional<z.ZodEnum<{
477
465
  widget: "widget";
@@ -522,9 +510,9 @@ export declare const widgetUpdate: import("@orpc/contract").ContractProcedureBui
522
510
  }, z.core.$strip>>;
523
511
  widget_id: z.ZodCoercedNumber<unknown>;
524
512
  }, z.core.$strip>, z.ZodObject<{
525
- id: z.ZodOptional<z.ZodNumber>;
526
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
527
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
513
+ id: z.ZodNumber;
514
+ created_at: z.ZodCoercedDate<unknown>;
515
+ updated_at: z.ZodCoercedDate<unknown>;
528
516
  application_id: z.ZodNumber;
529
517
  type: z.ZodEnum<{
530
518
  widget: "widget";
@@ -588,6 +576,7 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
588
576
  tab_id: z.ZodOptional<z.ZodString>;
589
577
  marketrix_id: z.ZodOptional<z.ZodString>;
590
578
  marketrix_key: z.ZodOptional<z.ZodString>;
579
+ user_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
591
580
  }, z.core.$strip>, import("@orpc/contract").Schema<AsyncIteratorObject<{
592
581
  type: "registered";
593
582
  chat_id: string;
@@ -689,13 +678,10 @@ export declare const widgetMessagePost: import("@orpc/contract").ContractProcedu
689
678
  events: z.ZodArray<z.ZodUnknown>;
690
679
  }, z.core.$strip>], "type">;
691
680
  }, z.core.$strip>, z.ZodObject<{
692
- ok: z.ZodBoolean;
681
+ success: z.ZodLiteral<true>;
693
682
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
694
683
  export declare const widgetRoutes: {
695
684
  widgetCreate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
696
- id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
697
- created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
698
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
699
685
  status: z.ZodOptional<z.ZodEnum<{
700
686
  created: "created";
701
687
  active: "active";
@@ -745,9 +731,9 @@ export declare const widgetRoutes: {
745
731
  }, z.core.$strip>>;
746
732
  }, z.core.$strip>>;
747
733
  }, z.core.$strip>, z.ZodObject<{
748
- id: z.ZodOptional<z.ZodNumber>;
749
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
750
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
734
+ id: z.ZodNumber;
735
+ created_at: z.ZodCoercedDate<unknown>;
736
+ updated_at: z.ZodCoercedDate<unknown>;
751
737
  application_id: z.ZodNumber;
752
738
  type: z.ZodEnum<{
753
739
  widget: "widget";
@@ -810,9 +796,9 @@ export declare const widgetRoutes: {
810
796
  offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
811
797
  }, z.core.$strip>, z.ZodObject<{
812
798
  items: z.ZodArray<z.ZodObject<{
813
- id: z.ZodOptional<z.ZodNumber>;
814
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
815
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
799
+ id: z.ZodNumber;
800
+ created_at: z.ZodCoercedDate<unknown>;
801
+ updated_at: z.ZodCoercedDate<unknown>;
816
802
  application_id: z.ZodNumber;
817
803
  type: z.ZodEnum<{
818
804
  widget: "widget";
@@ -973,9 +959,6 @@ export declare const widgetRoutes: {
973
959
  }, z.core.$strip>>;
974
960
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
975
961
  widgetUpdate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
976
- id: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
977
- created_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
978
- updated_at: z.ZodOptional<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
979
962
  application_id: z.ZodOptional<z.ZodNumber>;
980
963
  type: z.ZodOptional<z.ZodEnum<{
981
964
  widget: "widget";
@@ -1026,9 +1009,9 @@ export declare const widgetRoutes: {
1026
1009
  }, z.core.$strip>>;
1027
1010
  widget_id: z.ZodCoercedNumber<unknown>;
1028
1011
  }, z.core.$strip>, z.ZodObject<{
1029
- id: z.ZodOptional<z.ZodNumber>;
1030
- created_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1031
- updated_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1012
+ id: z.ZodNumber;
1013
+ created_at: z.ZodCoercedDate<unknown>;
1014
+ updated_at: z.ZodCoercedDate<unknown>;
1032
1015
  application_id: z.ZodNumber;
1033
1016
  type: z.ZodEnum<{
1034
1017
  widget: "widget";
@@ -1092,6 +1075,7 @@ export declare const widgetRoutes: {
1092
1075
  tab_id: z.ZodOptional<z.ZodString>;
1093
1076
  marketrix_id: z.ZodOptional<z.ZodString>;
1094
1077
  marketrix_key: z.ZodOptional<z.ZodString>;
1078
+ user_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1095
1079
  }, z.core.$strip>, import("@orpc/contract").Schema<AsyncIteratorObject<{
1096
1080
  type: "registered";
1097
1081
  chat_id: string;
@@ -1193,6 +1177,6 @@ export declare const widgetRoutes: {
1193
1177
  events: z.ZodArray<z.ZodUnknown>;
1194
1178
  }, z.core.$strip>], "type">;
1195
1179
  }, z.core.$strip>, z.ZodObject<{
1196
- ok: z.ZodBoolean;
1180
+ success: z.ZodLiteral<true>;
1197
1181
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1198
1182
  };
@@ -1,23 +1,5 @@
1
1
  export declare const configureSdk: (apiUrl: string) => void;
2
2
  export declare const sdk: {
3
- activityLogCreate: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("zod").ZodObject<{
4
- type: import("zod").ZodLiteral<"widget_question">;
5
- metadata: import("zod").ZodObject<{
6
- question: import("zod").ZodString;
7
- mode: import("zod").ZodEnum<{
8
- tell: "tell";
9
- show: "show";
10
- do: "do";
11
- }>;
12
- chat_id: import("zod").ZodString;
13
- timestamp: import("zod").ZodString;
14
- marketrix_id: import("zod").ZodString;
15
- marketrix_key: import("zod").ZodString;
16
- user_id: import("zod").ZodOptional<import("zod").ZodNumber>;
17
- }, import("zod/v4/core").$strict>;
18
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
19
- success: import("zod").ZodLiteral<true>;
20
- }, import("zod/v4/core").$strip>, Record<never, never>>;
21
3
  chatCreate: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodString, Record<never, never>>;
22
4
  widgetDefaultGet: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("zod").ZodObject<{
23
5
  type: import("zod").ZodEnum<{
@@ -163,13 +145,14 @@ export declare const sdk: {
163
145
  events: import("zod").ZodArray<import("zod").ZodUnknown>;
164
146
  }, import("zod/v4/core").$strip>], "type">;
165
147
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
166
- ok: import("zod").ZodBoolean;
148
+ success: import("zod").ZodLiteral<true>;
167
149
  }, import("zod/v4/core").$strip>, Record<never, never>>;
168
150
  widgetStream: import("@orpc/contract").ContractProcedureClient<Record<never, never>, import("zod").ZodObject<{
169
151
  chat_id: import("zod").ZodString;
170
152
  tab_id: import("zod").ZodOptional<import("zod").ZodString>;
171
153
  marketrix_id: import("zod").ZodOptional<import("zod").ZodString>;
172
154
  marketrix_key: import("zod").ZodOptional<import("zod").ZodString>;
155
+ user_id: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
173
156
  }, import("zod/v4/core").$strip>, import("@orpc/contract").Schema<AsyncIteratorObject<{
174
157
  type: "registered";
175
158
  chat_id: string;
@@ -1,18 +1,15 @@
1
1
  /**
2
- * Sends one visitor turn to the api. `chatPost` mints or reuses the chat id, files a `widget_question`
3
- * activity-log row, then POSTs a `chat/${mode}` `WidgetCommand` over the stream.
2
+ * Sends one visitor turn to the api. `chatPost` mints or reuses the chat id, then POSTs a
3
+ * `chat/${mode}` `WidgetCommand` over the stream.
4
4
  *
5
5
  * The reply never comes back from here — it arrives asynchronously on the SSE stream as `chat/delta`
6
6
  * fragments and a final `chat/response`, matched by `request_id` (the caller's placeholder message id).
7
7
  * That is why `StreamClient.ready` must resolve BEFORE the POST: registration is what gives the reply
8
8
  * somewhere to land.
9
9
  *
10
- * The logged `chat_id` is read back from `storageService` rather than passed, so it is only correct
11
- * after `getOrCreateChatId()` has resolved and written it. `user_id` is omitted, never sent null, when
12
- * the host supplied no visitor identity. The activity log is telemetry and is deliberately not awaited:
13
- * it can neither delay nor fail the send, and a rejection warns and stops there — whereas a failed
14
- * `send` propagates to `ChatContext`, which renders the error turn.
10
+ * The `widget_question` activity-log row is no longer filed from here `StreamClient` sends `user_id`
11
+ * once, at `widgetStream` registration, and the api derives the row from `chat_id`'s bound application on
12
+ * every Tell/Show/Do command, so a per-message credential re-send is gone.
15
13
  */
16
- import { type InstructionType } from '../sdk';
17
- import type { CredentialedConfig } from './StorageService';
18
- export declare function chatPost(config: CredentialedConfig, message: string, mode: InstructionType, requestId: string): Promise<void>;
14
+ import type { InstructionType } from '../sdk';
15
+ export declare function chatPost(message: string, mode: InstructionType, requestId: string): Promise<void>;