uidex 0.3.0 → 0.5.0

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 (44) hide show
  1. package/dist/cli/cli.cjs +1116 -112
  2. package/dist/cli/cli.cjs.map +1 -1
  3. package/dist/cloud/index.cjs +395 -72
  4. package/dist/cloud/index.cjs.map +1 -1
  5. package/dist/cloud/index.d.cts +60 -86
  6. package/dist/cloud/index.d.ts +60 -86
  7. package/dist/cloud/index.js +396 -71
  8. package/dist/cloud/index.js.map +1 -1
  9. package/dist/headless/index.cjs +1505 -791
  10. package/dist/headless/index.cjs.map +1 -1
  11. package/dist/headless/index.d.cts +83 -75
  12. package/dist/headless/index.d.ts +83 -75
  13. package/dist/headless/index.js +1514 -791
  14. package/dist/headless/index.js.map +1 -1
  15. package/dist/index.cjs +6281 -3190
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +337 -229
  18. package/dist/index.d.ts +337 -229
  19. package/dist/index.js +6362 -3231
  20. package/dist/index.js.map +1 -1
  21. package/dist/playwright/index.cjs +4 -4
  22. package/dist/playwright/index.cjs.map +1 -1
  23. package/dist/playwright/index.js +3 -3
  24. package/dist/playwright/index.js.map +1 -1
  25. package/dist/playwright/reporter.cjs +3 -3
  26. package/dist/playwright/reporter.cjs.map +1 -1
  27. package/dist/playwright/reporter.js +3 -3
  28. package/dist/playwright/reporter.js.map +1 -1
  29. package/dist/react/index.cjs +6291 -3206
  30. package/dist/react/index.cjs.map +1 -1
  31. package/dist/react/index.d.cts +239 -186
  32. package/dist/react/index.d.ts +239 -186
  33. package/dist/react/index.js +6338 -3208
  34. package/dist/react/index.js.map +1 -1
  35. package/dist/scan/index.cjs +212 -82
  36. package/dist/scan/index.cjs.map +1 -1
  37. package/dist/scan/index.d.cts +31 -0
  38. package/dist/scan/index.d.ts +31 -0
  39. package/dist/scan/index.js +211 -81
  40. package/dist/scan/index.js.map +1 -1
  41. package/package.json +10 -8
  42. package/templates/claude/api.md +110 -0
  43. package/templates/claude/audit.md +8 -2
  44. package/templates/claude/rules.md +15 -0
@@ -1,89 +1,10 @@
1
- interface ConsoleLogEntry {
2
- level: "log" | "warn" | "error" | "info";
3
- message: string;
4
- timestamp: string;
5
- }
6
- interface NetworkErrorEntry {
7
- url: string;
8
- method: string;
9
- status: number | null;
10
- statusText: string | null;
11
- timestamp: string;
12
- }
13
- interface Viewport {
14
- width: number;
15
- height: number;
16
- }
17
- interface SourceRef {
18
- filePath: string;
19
- line: number;
20
- }
21
- interface FeedbackSuggestedTarget {
22
- integrationId: string;
23
- targetConfig: Record<string, unknown>;
24
- }
25
- interface FeedbackPayload {
26
- type: "bug" | "feature" | "improvement" | "question";
27
- severity: "low" | "medium" | "high" | "critical";
28
- title?: string;
29
- description: string;
30
- componentId: string;
31
- element?: string | null;
32
- sources?: SourceRef[];
33
- url: string;
34
- path: string;
35
- route?: string | null;
36
- pageTitle?: string;
37
- sessionId?: string;
38
- reporterEmail?: string;
39
- reporterName?: string;
40
- timestamp: string;
41
- viewport: Viewport;
42
- screen: Viewport;
43
- userAgent: string;
44
- locale?: string;
45
- environment?: string;
46
- appVersion?: string;
47
- consoleLogs?: ConsoleLogEntry[];
48
- networkErrors?: NetworkErrorEntry[];
49
- metadata?: Record<string, string>;
50
- screenshot?: string;
51
- suggestedTarget?: FeedbackSuggestedTarget;
52
- }
53
- interface FeedbackExternalLink {
54
- ok: boolean;
55
- url?: string;
56
- key?: string;
57
- error?: string;
58
- }
59
- interface FeedbackResult {
1
+ import { ReportPayload, ReportResult, IngestConfig, ReportListResponse, PinRecord, ArchiveReason } from '@uidex/api-client';
2
+ export { ArchiveReason, IngestConfig, PinRecord, ReportListRecord, ReportListResponse, ReportPayload, ReportResult } from '@uidex/api-client';
3
+
4
+ interface UserIdentity {
60
5
  id: string;
61
- sequenceNumber: number;
62
- externalLink?: FeedbackExternalLink;
63
- }
64
- interface IngestConfigEpic {
65
- key: string;
66
- summary: string;
67
- status: string;
68
- }
69
- interface IngestConfig {
70
- hasJira: boolean;
71
- integrationId?: string;
72
- epics?: IngestConfigEpic[];
73
- }
74
- /**
75
- * Generic so third-party adapters (e.g. `uidex-cloud`) can plug in their own
76
- * payload/result/integration shapes. SDK-bundled `cloud()` returns the
77
- * defaulted form. `ViewContext.cloud` uses the fully-open variant; consumers
78
- * that need the SDK shape narrow with `as CloudAdapter`.
79
- */
80
- interface CloudAdapter<TPayload = FeedbackPayload, TResult = FeedbackResult, TIntegrations = {
81
- getConfig(): Promise<IngestConfig>;
82
- }> {
83
- readonly feedback: {
84
- submit(payload: TPayload): Promise<TResult>;
85
- };
86
- readonly integrations: TIntegrations;
6
+ name?: string;
7
+ avatar?: string;
87
8
  }
88
9
 
89
10
  declare const DEFAULT_CLOUD_ENDPOINT = "https://app.uidex.dev";
@@ -91,6 +12,10 @@ interface CloudOptions {
91
12
  projectKey: string;
92
13
  endpoint?: string;
93
14
  fetch?: typeof fetch;
15
+ git?: {
16
+ branch?: string;
17
+ commit?: string;
18
+ };
94
19
  }
95
20
  declare class CloudError extends Error {
96
21
  readonly status: number;
@@ -102,7 +27,56 @@ declare class CloudError extends Error {
102
27
  details?: unknown;
103
28
  });
104
29
  }
30
+ type RealtimePresenceUser = {
31
+ userId: string;
32
+ name: string;
33
+ avatar: string | null;
34
+ };
35
+ type RealtimeChannelState = "connecting" | "connected" | "disconnected";
36
+ interface RealtimeConnectOpts {
37
+ user: UserIdentity;
38
+ route: string;
39
+ }
40
+ interface RealtimeChannel {
41
+ readonly state: RealtimeChannelState;
42
+ connect(): void;
43
+ disconnect(): void;
44
+ joinRoute(route: string): void;
45
+ onPresence(cb: (users: RealtimePresenceUser[]) => void): () => void;
46
+ onPin(cb: (pin: PinRecord) => void): () => void;
47
+ }
48
+ interface CloudAdapter<TPayload = ReportPayload, TResult = ReportResult, TIntegrations = {
49
+ getConfig(): Promise<IngestConfig>;
50
+ getCachedConfig(): IngestConfig | null;
51
+ }> {
52
+ readonly reports: {
53
+ submit(payload: TPayload): Promise<TResult>;
54
+ list?(opts?: {
55
+ page?: number;
56
+ limit?: number;
57
+ }): Promise<ReportListResponse>;
58
+ };
59
+ readonly integrations: TIntegrations;
60
+ readonly realtime: {
61
+ connect(opts: RealtimeConnectOpts): RealtimeChannel;
62
+ };
63
+ readonly pins: {
64
+ list(params: {
65
+ route?: string;
66
+ entities?: string;
67
+ }): Promise<PinRecord[]>;
68
+ archive(reportId: string, reason?: ArchiveReason): Promise<void>;
69
+ };
70
+ }
105
71
 
106
72
  declare function cloud(options: CloudOptions): CloudAdapter;
107
73
 
108
- export { type CloudAdapter, CloudError, type CloudOptions, DEFAULT_CLOUD_ENDPOINT, type FeedbackExternalLink, type FeedbackPayload, type FeedbackResult, type FeedbackSuggestedTarget, type IngestConfig, type IngestConfigEpic, type SourceRef, cloud };
74
+ type RealtimeChannelOptions = {
75
+ /** Builds the WebSocket URL on each (re)connect attempt. Allows the caller to refresh `route` query params. */
76
+ buildUrl: () => string;
77
+ /** Optional WebSocket constructor override (testing). Defaults to `globalThis.WebSocket`. */
78
+ WebSocketImpl?: typeof WebSocket;
79
+ };
80
+ declare function createRealtimeChannel(options: RealtimeChannelOptions): RealtimeChannel;
81
+
82
+ export { type CloudAdapter, CloudError, type CloudOptions, DEFAULT_CLOUD_ENDPOINT, type RealtimeChannel, type RealtimeChannelState, type RealtimeConnectOpts, type RealtimePresenceUser, cloud, createRealtimeChannel };
@@ -1,89 +1,10 @@
1
- interface ConsoleLogEntry {
2
- level: "log" | "warn" | "error" | "info";
3
- message: string;
4
- timestamp: string;
5
- }
6
- interface NetworkErrorEntry {
7
- url: string;
8
- method: string;
9
- status: number | null;
10
- statusText: string | null;
11
- timestamp: string;
12
- }
13
- interface Viewport {
14
- width: number;
15
- height: number;
16
- }
17
- interface SourceRef {
18
- filePath: string;
19
- line: number;
20
- }
21
- interface FeedbackSuggestedTarget {
22
- integrationId: string;
23
- targetConfig: Record<string, unknown>;
24
- }
25
- interface FeedbackPayload {
26
- type: "bug" | "feature" | "improvement" | "question";
27
- severity: "low" | "medium" | "high" | "critical";
28
- title?: string;
29
- description: string;
30
- componentId: string;
31
- element?: string | null;
32
- sources?: SourceRef[];
33
- url: string;
34
- path: string;
35
- route?: string | null;
36
- pageTitle?: string;
37
- sessionId?: string;
38
- reporterEmail?: string;
39
- reporterName?: string;
40
- timestamp: string;
41
- viewport: Viewport;
42
- screen: Viewport;
43
- userAgent: string;
44
- locale?: string;
45
- environment?: string;
46
- appVersion?: string;
47
- consoleLogs?: ConsoleLogEntry[];
48
- networkErrors?: NetworkErrorEntry[];
49
- metadata?: Record<string, string>;
50
- screenshot?: string;
51
- suggestedTarget?: FeedbackSuggestedTarget;
52
- }
53
- interface FeedbackExternalLink {
54
- ok: boolean;
55
- url?: string;
56
- key?: string;
57
- error?: string;
58
- }
59
- interface FeedbackResult {
1
+ import { ReportPayload, ReportResult, IngestConfig, ReportListResponse, PinRecord, ArchiveReason } from '@uidex/api-client';
2
+ export { ArchiveReason, IngestConfig, PinRecord, ReportListRecord, ReportListResponse, ReportPayload, ReportResult } from '@uidex/api-client';
3
+
4
+ interface UserIdentity {
60
5
  id: string;
61
- sequenceNumber: number;
62
- externalLink?: FeedbackExternalLink;
63
- }
64
- interface IngestConfigEpic {
65
- key: string;
66
- summary: string;
67
- status: string;
68
- }
69
- interface IngestConfig {
70
- hasJira: boolean;
71
- integrationId?: string;
72
- epics?: IngestConfigEpic[];
73
- }
74
- /**
75
- * Generic so third-party adapters (e.g. `uidex-cloud`) can plug in their own
76
- * payload/result/integration shapes. SDK-bundled `cloud()` returns the
77
- * defaulted form. `ViewContext.cloud` uses the fully-open variant; consumers
78
- * that need the SDK shape narrow with `as CloudAdapter`.
79
- */
80
- interface CloudAdapter<TPayload = FeedbackPayload, TResult = FeedbackResult, TIntegrations = {
81
- getConfig(): Promise<IngestConfig>;
82
- }> {
83
- readonly feedback: {
84
- submit(payload: TPayload): Promise<TResult>;
85
- };
86
- readonly integrations: TIntegrations;
6
+ name?: string;
7
+ avatar?: string;
87
8
  }
88
9
 
89
10
  declare const DEFAULT_CLOUD_ENDPOINT = "https://app.uidex.dev";
@@ -91,6 +12,10 @@ interface CloudOptions {
91
12
  projectKey: string;
92
13
  endpoint?: string;
93
14
  fetch?: typeof fetch;
15
+ git?: {
16
+ branch?: string;
17
+ commit?: string;
18
+ };
94
19
  }
95
20
  declare class CloudError extends Error {
96
21
  readonly status: number;
@@ -102,7 +27,56 @@ declare class CloudError extends Error {
102
27
  details?: unknown;
103
28
  });
104
29
  }
30
+ type RealtimePresenceUser = {
31
+ userId: string;
32
+ name: string;
33
+ avatar: string | null;
34
+ };
35
+ type RealtimeChannelState = "connecting" | "connected" | "disconnected";
36
+ interface RealtimeConnectOpts {
37
+ user: UserIdentity;
38
+ route: string;
39
+ }
40
+ interface RealtimeChannel {
41
+ readonly state: RealtimeChannelState;
42
+ connect(): void;
43
+ disconnect(): void;
44
+ joinRoute(route: string): void;
45
+ onPresence(cb: (users: RealtimePresenceUser[]) => void): () => void;
46
+ onPin(cb: (pin: PinRecord) => void): () => void;
47
+ }
48
+ interface CloudAdapter<TPayload = ReportPayload, TResult = ReportResult, TIntegrations = {
49
+ getConfig(): Promise<IngestConfig>;
50
+ getCachedConfig(): IngestConfig | null;
51
+ }> {
52
+ readonly reports: {
53
+ submit(payload: TPayload): Promise<TResult>;
54
+ list?(opts?: {
55
+ page?: number;
56
+ limit?: number;
57
+ }): Promise<ReportListResponse>;
58
+ };
59
+ readonly integrations: TIntegrations;
60
+ readonly realtime: {
61
+ connect(opts: RealtimeConnectOpts): RealtimeChannel;
62
+ };
63
+ readonly pins: {
64
+ list(params: {
65
+ route?: string;
66
+ entities?: string;
67
+ }): Promise<PinRecord[]>;
68
+ archive(reportId: string, reason?: ArchiveReason): Promise<void>;
69
+ };
70
+ }
105
71
 
106
72
  declare function cloud(options: CloudOptions): CloudAdapter;
107
73
 
108
- export { type CloudAdapter, CloudError, type CloudOptions, DEFAULT_CLOUD_ENDPOINT, type FeedbackExternalLink, type FeedbackPayload, type FeedbackResult, type FeedbackSuggestedTarget, type IngestConfig, type IngestConfigEpic, type SourceRef, cloud };
74
+ type RealtimeChannelOptions = {
75
+ /** Builds the WebSocket URL on each (re)connect attempt. Allows the caller to refresh `route` query params. */
76
+ buildUrl: () => string;
77
+ /** Optional WebSocket constructor override (testing). Defaults to `globalThis.WebSocket`. */
78
+ WebSocketImpl?: typeof WebSocket;
79
+ };
80
+ declare function createRealtimeChannel(options: RealtimeChannelOptions): RealtimeChannel;
81
+
82
+ export { type CloudAdapter, CloudError, type CloudOptions, DEFAULT_CLOUD_ENDPOINT, type RealtimeChannel, type RealtimeChannelState, type RealtimeConnectOpts, type RealtimePresenceUser, cloud, createRealtimeChannel };