@reqdesk/widget 0.1.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.
@@ -0,0 +1,72 @@
1
+ //#region src/types.d.ts
2
+ interface ReqdeskWidgetConfig {
3
+ apiKey: string;
4
+ auth?: OidcAuthConfig;
5
+ widget?: 'ticket-form' | 'support-portal';
6
+ position?: 'bottom-right' | 'bottom-left';
7
+ language?: string;
8
+ theme?: ThemeConfig;
9
+ customer?: CustomerConfig;
10
+ defaultCategory?: string;
11
+ translations?: Record<string, string>;
12
+ inline?: boolean;
13
+ container?: string | HTMLElement;
14
+ }
15
+ interface OidcAuthConfig {
16
+ issuerUri: string;
17
+ clientId: string;
18
+ }
19
+ interface ThemeConfig {
20
+ primaryColor?: string;
21
+ mode?: 'light' | 'dark' | 'auto';
22
+ borderRadius?: string;
23
+ fontFamily?: string;
24
+ zIndex?: number;
25
+ logo?: string;
26
+ brandName?: string;
27
+ hideBranding?: boolean;
28
+ }
29
+ interface CustomerConfig {
30
+ email?: string;
31
+ name?: string;
32
+ externalId?: string;
33
+ }
34
+ type WidgetEvent = 'open' | 'close' | 'ticket:created' | 'ticket:tracked' | 'reply:sent' | 'error';
35
+ type EventCallback = (data?: unknown) => void;
36
+ interface TicketResult {
37
+ id: string;
38
+ ticketNumber: string;
39
+ trackingToken?: string;
40
+ status: string;
41
+ }
42
+ interface TrackedTicketResult {
43
+ id: string;
44
+ ticketNumber: string;
45
+ title: string;
46
+ status: string;
47
+ priority: string;
48
+ createdAt: string;
49
+ replies: PublicReply[];
50
+ }
51
+ interface PublicReply {
52
+ id: string;
53
+ body: string;
54
+ authorName: string;
55
+ isStaff: boolean;
56
+ createdAt: string;
57
+ }
58
+ interface WidgetError {
59
+ code: string;
60
+ message: string;
61
+ }
62
+ interface SubmitTicketData {
63
+ title: string;
64
+ description?: string;
65
+ priority?: 'low' | 'medium' | 'high' | 'urgent';
66
+ categoryId?: string;
67
+ email: string;
68
+ }
69
+ //# sourceMappingURL=types.d.ts.map
70
+ //#endregion
71
+ export { ReqdeskWidgetConfig as a, TicketResult as c, WidgetEvent as d, PublicReply as i, TrackedTicketResult as l, EventCallback as n, SubmitTicketData as o, OidcAuthConfig as r, ThemeConfig as s, CustomerConfig as t, WidgetError as u };
72
+ //# sourceMappingURL=types-CRxzGfna.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CRxzGfna.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";UAAiB,mBAAA;EAAA,MAAA,EAAA,MAAA;EAAmB,IAAA,CAAA,EAE3B,cAF2B;QAE3B,CAAA,EAAA,aAAA,GAAA,gBAAA;UAIC,CAAA,EAAA,cAAA,GAAA,aAAA;UACG,CAAA,EAAA,MAAA;OAEI,CAAA,EAHP,WAGO;UAEM,CAAA,EAJV,cAIU;EAAW,eAAA,CAAA,EAAA,MAAA;EAGjB,YAAA,CAAA,EALA,MAKc,CAAA,MAAA,EAAA,MAAA,CAAA;EAKd,MAAA,CAAA,EAAA,OAAW;EAWX,SAAA,CAAA,EAAA,MAAc,GAnBR,WAmBQ;AAM/B;AAQY,UA9BK,cAAA,CA8BQ;EAER,SAAA,EAAA,MAAY;EAOZ,QAAA,EAAA,MAAA;AAUjB;AAQiB,UApDA,WAAA,CAoDW;EAKX,YAAA,CAAA,EAAA,MAAgB;;;;;;;;;UA9ChB,cAAA;;;;;KAML,WAAA;KAQA,aAAA;UAEK,YAAA;;;;;;UAOA,mBAAA;;;;;;;WAON;;UAGM,WAAA;;;;;;;UAQA,WAAA;;;;UAKA,gBAAA"}
@@ -0,0 +1,72 @@
1
+ //#region src/types.d.ts
2
+ interface ReqdeskWidgetConfig {
3
+ apiKey: string;
4
+ auth?: OidcAuthConfig;
5
+ widget?: 'ticket-form' | 'support-portal';
6
+ position?: 'bottom-right' | 'bottom-left';
7
+ language?: string;
8
+ theme?: ThemeConfig;
9
+ customer?: CustomerConfig;
10
+ defaultCategory?: string;
11
+ translations?: Record<string, string>;
12
+ inline?: boolean;
13
+ container?: string | HTMLElement;
14
+ }
15
+ interface OidcAuthConfig {
16
+ issuerUri: string;
17
+ clientId: string;
18
+ }
19
+ interface ThemeConfig {
20
+ primaryColor?: string;
21
+ mode?: 'light' | 'dark' | 'auto';
22
+ borderRadius?: string;
23
+ fontFamily?: string;
24
+ zIndex?: number;
25
+ logo?: string;
26
+ brandName?: string;
27
+ hideBranding?: boolean;
28
+ }
29
+ interface CustomerConfig {
30
+ email?: string;
31
+ name?: string;
32
+ externalId?: string;
33
+ }
34
+ type WidgetEvent = 'open' | 'close' | 'ticket:created' | 'ticket:tracked' | 'reply:sent' | 'error';
35
+ type EventCallback = (data?: unknown) => void;
36
+ interface TicketResult {
37
+ id: string;
38
+ ticketNumber: string;
39
+ trackingToken?: string;
40
+ status: string;
41
+ }
42
+ interface TrackedTicketResult {
43
+ id: string;
44
+ ticketNumber: string;
45
+ title: string;
46
+ status: string;
47
+ priority: string;
48
+ createdAt: string;
49
+ replies: PublicReply[];
50
+ }
51
+ interface PublicReply {
52
+ id: string;
53
+ body: string;
54
+ authorName: string;
55
+ isStaff: boolean;
56
+ createdAt: string;
57
+ }
58
+ interface WidgetError {
59
+ code: string;
60
+ message: string;
61
+ }
62
+ interface SubmitTicketData {
63
+ title: string;
64
+ description?: string;
65
+ priority?: 'low' | 'medium' | 'high' | 'urgent';
66
+ categoryId?: string;
67
+ email: string;
68
+ }
69
+ //# sourceMappingURL=types.d.ts.map
70
+ //#endregion
71
+ export { ReqdeskWidgetConfig as a, TicketResult as c, WidgetEvent as d, PublicReply as i, TrackedTicketResult as l, EventCallback as n, SubmitTicketData as o, OidcAuthConfig as r, ThemeConfig as s, CustomerConfig as t, WidgetError as u };
72
+ //# sourceMappingURL=types-gPfzZQw5.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-gPfzZQw5.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";UAAiB,mBAAA;EAAA,MAAA,EAAA,MAAA;EAAmB,IAAA,CAAA,EAE3B,cAF2B;QAE3B,CAAA,EAAA,aAAA,GAAA,gBAAA;UAIC,CAAA,EAAA,cAAA,GAAA,aAAA;UACG,CAAA,EAAA,MAAA;OAEI,CAAA,EAHP,WAGO;UAEM,CAAA,EAJV,cAIU;EAAW,eAAA,CAAA,EAAA,MAAA;EAGjB,YAAA,CAAA,EALA,MAKc,CAAA,MAAA,EAAA,MAAA,CAAA;EAKd,MAAA,CAAA,EAAA,OAAW;EAWX,SAAA,CAAA,EAAA,MAAc,GAnBR,WAmBQ;AAM/B;AAQY,UA9BK,cAAA,CA8BQ;EAER,SAAA,EAAA,MAAY;EAOZ,QAAA,EAAA,MAAA;AAUjB;AAQiB,UApDA,WAAA,CAoDW;EAKX,YAAA,CAAA,EAAA,MAAgB;;;;;;;;;UA9ChB,cAAA;;;;;KAML,WAAA;KAQA,aAAA;UAEK,YAAA;;;;;;UAOA,mBAAA;;;;;;;WAON;;UAGM,WAAA;;;;;;;UAQA,WAAA;;;;UAKA,gBAAA"}
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@reqdesk/widget",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Embeddable support widget SDK for Reqdesk — ticket submission, tracking, and support portal.",
6
+ "exports": {
7
+ ".": {
8
+ "import": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "require": {
13
+ "types": "./dist/index.d.cts",
14
+ "default": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "./react": {
18
+ "import": {
19
+ "types": "./dist/react.d.ts",
20
+ "default": "./dist/react.js"
21
+ },
22
+ "require": {
23
+ "types": "./dist/react.d.cts",
24
+ "default": "./dist/react.cjs"
25
+ }
26
+ },
27
+ "./iife": "./dist/index.iife.js",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "main": "./dist/index.cjs",
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "sideEffects": false,
34
+ "files": [
35
+ "dist",
36
+ "README.md"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsdown && tsdown --config tsdown.iife.config.ts && node scripts/fix-dts.js",
40
+ "dev": "tsdown --watch",
41
+ "test": "vitest run",
42
+ "test:watch": "vitest",
43
+ "typecheck": "tsc --noEmit",
44
+ "lint": "tsc --noEmit",
45
+ "prepublishOnly": "bun run build"
46
+ },
47
+ "peerDependencies": {
48
+ "react": "^18 || ^19",
49
+ "react-dom": "^18 || ^19",
50
+ "oidc-spa": "^10.0.0",
51
+ "@tanstack/react-query": "^5.0.0"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "react": {
55
+ "optional": true
56
+ },
57
+ "react-dom": {
58
+ "optional": true
59
+ },
60
+ "oidc-spa": {
61
+ "optional": true
62
+ },
63
+ "@tanstack/react-query": {
64
+ "optional": true
65
+ }
66
+ },
67
+ "devDependencies": {
68
+ "@tanstack/react-query": "^5.96.2",
69
+ "@types/react": "^19.2.7",
70
+ "@types/react-dom": "^19.2.3",
71
+ "oidc-spa": "^10.0.8",
72
+ "react": "^19.2.0",
73
+ "react-dom": "^19.2.0",
74
+ "tsdown": "^0.12.9",
75
+ "typescript": "~5.9.3",
76
+ "vitest": "^3.2.1"
77
+ },
78
+ "dependencies": {
79
+ "ofetch": "^1.5.1"
80
+ }
81
+ }