issue-sticker 0.2.2 → 0.3.1

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,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { h as Presence, n as Portal$1, w as Arrow, D as DismissableLayer, C as Content, y as Root, j as useComposedRefs, t as createPopperScope, i as createContextScope, z as createSlottable, f as useId, e as useControllableState, v as Root2, A as Anchor, P as Primitive, g as composeEventHandlers, b as usePortalContainer, a as cn, O as OVERLAY_LAYER, s as stopEscapePropagation } from "./createLucideIcon-B457EluY.js";
3
+ import { h as Presence, n as Portal$1, w as Arrow, D as DismissableLayer, C as Content, y as Root, j as useComposedRefs, t as createPopperScope, i as createContextScope, z as createSlottable, f as useId, e as useControllableState, v as Root2, A as Anchor, P as Primitive, g as composeEventHandlers, b as usePortalContainer, a as cn, d as OVERLAY_LAYER, s as stopEscapePropagation } from "./createLucideIcon-CmSNiW63.js";
4
4
  var [createTooltipContext] = createContextScope("Tooltip", [
5
5
  createPopperScope
6
6
  ]);
package/headless.d.ts CHANGED
@@ -1,11 +1,119 @@
1
- import type {
2
- Issue,
3
- IssueFilterGroup,
4
- IssueFilters,
5
- IssuePosition,
6
- IssueStickerSummary,
7
- SessionReplayMeta,
8
- } from '@issue-sticker/shared';
1
+ // 공개 타입은 이 파일 안에서 닫는다. 내부 패키지(@issue-sticker/shared)를 참조하면 배포
2
+ // tarball 에 없는 모듈을 가리켜 소비자 tsc 가 깨지고, 딸려오는 백엔드 계약 전체가 함께
3
+ // 노출된다. 구현과의 정합은 src/headless/publicTypes.conformance.ts 가 컴파일 타임에 지킨다.
4
+
5
+ export interface IssuePosition {
6
+ x: number;
7
+ y: number;
8
+ selector: string;
9
+ xpath: string;
10
+ viewport?: {
11
+ width: number;
12
+ height: number;
13
+ scrollX?: number;
14
+ scrollY?: number;
15
+ };
16
+ elementRect?: {
17
+ left: number;
18
+ top: number;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ }
23
+
24
+ export interface NetworkLog {
25
+ url: string;
26
+ method: string;
27
+ statusCode: number;
28
+ timestamp: number;
29
+ type: string;
30
+ duration?: number | null;
31
+ requestHeaders?: Record<string, string> | null;
32
+ responseHeaders?: Record<string, string> | null;
33
+ requestBody?: string | null;
34
+ requestBodySizeBytes?: number | null;
35
+ requestBodyOmittedReason?: string | null;
36
+ responseBody?: string | null;
37
+ responseBodyEncoding?: string | null;
38
+ responseBodySizeBytes?: number | null;
39
+ responseBodyOmittedReason?: string | null;
40
+ responseMimeType?: string | null;
41
+ }
42
+
43
+ export interface ConsoleLog {
44
+ type: 'log' | 'warning' | 'error' | 'info' | 'debug';
45
+ message: string;
46
+ timestamp: number;
47
+ args?: unknown[] | null;
48
+ url?: string | null;
49
+ lineNumber?: number | null;
50
+ columnNumber?: number | null;
51
+ stackTrace?: string | null;
52
+ }
53
+
54
+ /** 이슈에 연결된 외부 트래커(Jira·Notion) 매핑. 서비스별 메타데이터는 형태가 서비스에 달려 있어 `unknown` 으로 둔다. */
55
+ export interface IssueExternalMapping {
56
+ id: string;
57
+ external_id: string;
58
+ service_type?: 'JIRA' | 'NOTION';
59
+ exposed_fields?: string[];
60
+ jira_issue_metadata?: unknown;
61
+ notion_page_metadata?: unknown;
62
+ }
63
+
64
+ /** 목록용 이슈. 마커를 그리는 데 필요한 필드만 담는다. */
65
+ export interface IssueStickerSummary {
66
+ id: string;
67
+ project_id: string;
68
+ url: string;
69
+ title: string;
70
+ position: IssuePosition;
71
+ external_user_id?: string | null;
72
+ created_at: string;
73
+ updated_at: string;
74
+ }
75
+
76
+ /** 상세 조회한 이슈. */
77
+ export interface Issue extends IssueStickerSummary {
78
+ description: string | null;
79
+ screenshot: string | string[] | null;
80
+ video: string | null;
81
+ user_agent: string | null;
82
+ external_user_name: string | null;
83
+ network_logs: NetworkLog[] | null;
84
+ console_logs: ConsoleLog[] | null;
85
+ comments?: unknown[];
86
+ issue_external_mappings?: IssueExternalMapping[];
87
+ project: { name: string } | null;
88
+ reporter: { display_name: string | null } | null;
89
+ }
90
+
91
+ /** 세션 리플레이 첨부 메타. */
92
+ export interface SessionReplayMeta {
93
+ window_seconds: number;
94
+ event_count: number;
95
+ size_bytes: number;
96
+ rrweb_version: string;
97
+ privacy_config_version: string;
98
+ release?: string;
99
+ release_source?: string;
100
+ }
101
+
102
+ export interface IssueFilterOption {
103
+ label: string;
104
+ value: string;
105
+ }
106
+
107
+ export type IssueFilterGroup =
108
+ | {
109
+ kind: 'custom';
110
+ id: string;
111
+ fieldDefinitionId: string;
112
+ label: string;
113
+ options: IssueFilterOption[];
114
+ }
115
+ | { kind: 'jira'; id: string; fieldName: string; label: string; options: IssueFilterOption[] }
116
+ | { kind: 'notion'; id: string; fieldName: string; label: string; options: IssueFilterOption[] };
9
117
 
10
118
  export type HeadlessPhase =
11
119
  | 'initializing'
@@ -122,7 +230,7 @@ export interface HeadlessSnapshot {
122
230
  readonly phase: HeadlessPhase;
123
231
  readonly auth: HeadlessAuthState;
124
232
  readonly issues: readonly IssueStickerSummary[];
125
- readonly activeIssue: (Issue & { comments?: unknown[] }) | null;
233
+ readonly activeIssue: Issue | null;
126
234
  readonly draft: HeadlessIssueDraft | null;
127
235
  readonly videoCapture: HeadlessVideoCaptureState;
128
236
  readonly sessionReplay: HeadlessSessionReplayState;
@@ -131,8 +239,29 @@ export interface HeadlessSnapshot {
131
239
  readonly error: IssueStickerHeadlessError | null;
132
240
  }
133
241
 
134
- export interface HeadlessIssueFilters extends Omit<IssueFilters, 'projectId' | 'externalUserId'> {
242
+ export interface HeadlessIssueFilters {
243
+ /** 이슈 발생 URL. `'all'` 이면 URL 조건 없이 조회합니다. */
244
+ url?: string[] | string | 'all';
245
+ /** 이 사용자가 만든 이슈만 조회합니다. */
135
246
  externalUserId?: string;
247
+ /** 제목·URL substring 검색. */
248
+ search?: string;
249
+ /** ISO 8601 — 생성일 하한. */
250
+ dateFrom?: string;
251
+ /** ISO 8601 — 생성일 상한. */
252
+ dateTo?: string;
253
+ /** 1-based 페이지 번호. */
254
+ page?: number;
255
+ /** 페이지 크기 (1-500, 기본 100). */
256
+ pageSize?: number;
257
+ /** 커스텀 필드 ID → 선택 값 배열. */
258
+ customFieldValues?: Record<string, string[]>;
259
+ /** Jira 표준 필드 ID(예: `'status'`, `'assignee'`) → 선택 값 배열. */
260
+ jiraFieldValues?: Record<string, string[]>;
261
+ /** Notion 필드 ID → 선택 값 배열. */
262
+ notionFieldValues?: Record<string, string[]>;
263
+ /** 생성일 정렬 순서. 미지정 시 `'desc'`. */
264
+ sortOrder?: 'asc' | 'desc';
136
265
  }
137
266
 
138
267
  export interface SubmitDraftInput {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "issue-sticker",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "IssueSticker SDK - Visual bug tracking widget for web applications",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -23,9 +23,6 @@
23
23
  "require": "./dist/issue-sticker-headless-react.js",
24
24
  "default": "./dist/issue-sticker-headless-react.js"
25
25
  },
26
- "./react.js": "./dist/issue-sticker-react.js",
27
- "./headless.js": "./dist/issue-sticker-headless.js",
28
- "./headless/react.js": "./dist/issue-sticker-headless-react.js",
29
26
  "./package.json": "./package.json"
30
27
  },
31
28
  "files": [
@@ -58,6 +55,10 @@
58
55
  "serve:demo": "vite --host 0.0.0.0 --port 4174 --mode demo",
59
56
  "serve:localdev": "vite --host 0.0.0.0 --port 4173 --mode localdev",
60
57
  "preview": "vite preview",
58
+ "lint": "cd ../.. && eslint packages/sdk --ext .ts,.tsx,.js,.jsx",
59
+ "typecheck": "npm run tsc",
60
+ "format": "cd ../.. && prettier --write packages/sdk --ignore-unknown",
61
+ "format:check": "cd ../.. && prettier --check packages/sdk --ignore-unknown",
61
62
  "test": "vitest --run",
62
63
  "test:watch": "vitest",
63
64
  "test:ui": "vitest --ui",