reflet-sdk 0.3.4 → 0.3.5
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/CHANGELOG.md +7 -0
- package/dist/feedback.d.ts +6 -6
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +2 -2
- package/dist/feedback.js.map +1 -1
- package/dist/react.d.ts +19 -19
- package/dist/react.d.ts.map +1 -1
- package/dist/server.d.ts +5 -5
- package/dist/server.d.ts.map +1 -1
- package/package.json +44 -44
package/dist/react.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare global {
|
|
|
43
43
|
* }
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
|
-
declare function ChangelogWidget({ publicKey, mode, position, theme, primaryColor, maxEntries, triggerSelector, autoOpenForNew, locale, onOpen, onClose, onEntryClick }: ChangelogWidgetProps): null;
|
|
46
|
+
export declare function ChangelogWidget({ publicKey, mode, position, theme, primaryColor, maxEntries, triggerSelector, autoOpenForNew, locale, onOpen, onClose, onEntryClick }: ChangelogWidgetProps): null;
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/react-context.d.ts
|
|
49
49
|
interface RefletContextValue {
|
|
@@ -55,7 +55,7 @@ interface RefletContextValue {
|
|
|
55
55
|
user: RefletUser | undefined;
|
|
56
56
|
userToken: string | undefined;
|
|
57
57
|
}
|
|
58
|
-
declare const RefletContext: import("react").Context<RefletContextValue | null>;
|
|
58
|
+
export declare const RefletContext: import("react").Context<RefletContextValue | null>;
|
|
59
59
|
interface RefletProviderProps {
|
|
60
60
|
/** API base URL (optional, defaults to Reflet production API) */
|
|
61
61
|
baseUrl?: string;
|
|
@@ -87,9 +87,9 @@ interface RefletProviderProps {
|
|
|
87
87
|
* }
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
|
-
declare function RefletProvider({ publicKey, baseUrl, user: initialUser, userToken, children }: RefletProviderProps): import("react").JSX.Element;
|
|
91
|
-
declare function useRefletContext(): RefletContextValue;
|
|
92
|
-
declare function useRefletClient(): Reflet;
|
|
90
|
+
export declare function RefletProvider({ publicKey, baseUrl, user: initialUser, userToken, children }: RefletProviderProps): import("react").JSX.Element;
|
|
91
|
+
export declare function useRefletContext(): RefletContextValue;
|
|
92
|
+
export declare function useRefletClient(): Reflet;
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/react-feedback-dialog-types.d.ts
|
|
95
95
|
type FeedbackCategory = "feature" | "bug" | "question";
|
|
@@ -140,7 +140,7 @@ interface FeedbackDialogProps {
|
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region src/react-feedback-dialog.d.ts
|
|
143
|
-
declare function FeedbackDialog({ open, onOpenChange, publicKey, baseUrl, user, userToken, theme, primaryColor, defaultCategory, categories, labels: labelsProp, onSubmit, onOpen, onClose }: FeedbackDialogProps): import("react").JSX.Element | null;
|
|
143
|
+
export declare function FeedbackDialog({ open, onOpenChange, publicKey, baseUrl, user, userToken, theme, primaryColor, defaultCategory, categories, labels: labelsProp, onSubmit, onOpen, onClose }: FeedbackDialogProps): import("react").JSX.Element | null;
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/react-feedback-button.d.ts
|
|
146
146
|
interface FeedbackButtonProps {
|
|
@@ -180,7 +180,7 @@ interface FeedbackButtonProps {
|
|
|
180
180
|
/** Pre-signed user token */
|
|
181
181
|
userToken?: string;
|
|
182
182
|
}
|
|
183
|
-
declare function FeedbackButton({ publicKey, baseUrl, user, userToken, theme, primaryColor, defaultCategory, categories, labels, onSubmit, onOpen, onClose, className, asChild, children }: FeedbackButtonProps): import("react").JSX.Element;
|
|
183
|
+
export declare function FeedbackButton({ publicKey, baseUrl, user, userToken, theme, primaryColor, defaultCategory, categories, labels, onSubmit, onOpen, onClose, className, asChild, children }: FeedbackButtonProps): import("react").JSX.Element;
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region src/react-hooks-types.d.ts
|
|
186
186
|
interface UseQueryResult<T> {
|
|
@@ -211,7 +211,7 @@ interface UseMutationResult<TData, TVariables> {
|
|
|
211
211
|
* };
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
|
-
declare function useCreateFeedback(): UseMutationResult<{
|
|
214
|
+
export declare function useCreateFeedback(): UseMutationResult<{
|
|
215
215
|
feedbackId: string;
|
|
216
216
|
isApproved: boolean;
|
|
217
217
|
}, CreateFeedbackParams>;
|
|
@@ -227,7 +227,7 @@ declare function useCreateFeedback(): UseMutationResult<{
|
|
|
227
227
|
* </button>
|
|
228
228
|
* ```
|
|
229
229
|
*/
|
|
230
|
-
declare function useVote(): UseMutationResult<{
|
|
230
|
+
export declare function useVote(): UseMutationResult<{
|
|
231
231
|
voted: boolean;
|
|
232
232
|
voteCount: number;
|
|
233
233
|
}, {
|
|
@@ -237,13 +237,13 @@ declare function useVote(): UseMutationResult<{
|
|
|
237
237
|
/**
|
|
238
238
|
* Hook to add a comment
|
|
239
239
|
*/
|
|
240
|
-
declare function useAddComment(): UseMutationResult<{
|
|
240
|
+
export declare function useAddComment(): UseMutationResult<{
|
|
241
241
|
commentId: string;
|
|
242
242
|
}, AddCommentParams>;
|
|
243
243
|
/**
|
|
244
244
|
* Hook to subscribe/unsubscribe to feedback
|
|
245
245
|
*/
|
|
246
|
-
declare function useSubscription(): {
|
|
246
|
+
export declare function useSubscription(): {
|
|
247
247
|
subscribe: (feedbackId: string) => Promise<{
|
|
248
248
|
subscribed: boolean;
|
|
249
249
|
}>;
|
|
@@ -255,23 +255,23 @@ declare function useSubscription(): {
|
|
|
255
255
|
};
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/react-query-hooks.d.ts
|
|
258
|
-
declare function useOrganizationConfig(): UseQueryResult<OrganizationConfig>;
|
|
258
|
+
export declare function useOrganizationConfig(): UseQueryResult<OrganizationConfig>;
|
|
259
259
|
interface UseFeedbackListOptions extends FeedbackListParams {
|
|
260
260
|
enabled?: boolean;
|
|
261
261
|
}
|
|
262
|
-
declare function useFeedbackList(options?: UseFeedbackListOptions): UseQueryResult<{
|
|
262
|
+
export declare function useFeedbackList(options?: UseFeedbackListOptions): UseQueryResult<{
|
|
263
263
|
items: FeedbackItem[];
|
|
264
264
|
total: number;
|
|
265
265
|
hasMore: boolean;
|
|
266
266
|
}>;
|
|
267
|
-
declare function useFeedback(feedbackId: string | undefined): UseQueryResult<FeedbackDetail>;
|
|
268
|
-
declare function useComments(feedbackId: string | undefined, sortBy?: "newest" | "oldest"): UseQueryResult<Comment[]>;
|
|
269
|
-
declare function useRoadmap(): UseQueryResult<Roadmap>;
|
|
270
|
-
declare function useChangelog(limit?: number): UseQueryResult<ChangelogEntry[]>;
|
|
271
|
-
declare function useUnreadChangelogCount(publicKey: string): {
|
|
267
|
+
export declare function useFeedback(feedbackId: string | undefined): UseQueryResult<FeedbackDetail>;
|
|
268
|
+
export declare function useComments(feedbackId: string | undefined, sortBy?: "newest" | "oldest"): UseQueryResult<Comment[]>;
|
|
269
|
+
export declare function useRoadmap(): UseQueryResult<Roadmap>;
|
|
270
|
+
export declare function useChangelog(limit?: number): UseQueryResult<ChangelogEntry[]>;
|
|
271
|
+
export declare function useUnreadChangelogCount(publicKey: string): {
|
|
272
272
|
unreadCount: number;
|
|
273
273
|
markAsRead: () => void;
|
|
274
274
|
};
|
|
275
275
|
//#endregion
|
|
276
|
-
export { type AddCommentParams, type ChangelogEntry,
|
|
276
|
+
export { type AddCommentParams, type ChangelogEntry, type Comment, type CreateFeedbackParams, type FeedbackButtonProps, type FeedbackCategory, type FeedbackDetail, type FeedbackDialogLabels, type FeedbackDialogProps, type FeedbackItem, type FeedbackListParams, type FeedbackStatus, type FeedbackTag, type OrganizationConfig, type OrganizationSettings, type OrganizationStatus, Reflet, type RefletConfig, type RefletContextValue, type RefletProviderProps, type RefletUser, type Roadmap, type RoadmapItem, type RoadmapLane, type UseFeedbackListOptions };
|
|
277
277
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","names":[],"sources":["../src/react-changelog-widget.tsx","../src/react-context.tsx","../src/react-feedback-dialog-types.ts","../src/react-feedback-dialog.tsx","../src/react-feedback-button.tsx","../src/react-hooks-types.ts","../src/react-mutation-hooks.ts","../src/react-query-hooks.ts"],"mappings":";;;;UAGU;EACR;EACA;EACA;EACA;EACA;EACA,gBAAgB,OAAO;EACvB;EACA;EACA;EACA;EACA;EACA;;UAGQ;EACR;EACA;EACA;EACA,YAAY;EACZ;EACA;;QAGM;YACI;IACR,6BACE,QAAQ,yBACL;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"react.d.ts","names":[],"sources":["../src/react-changelog-widget.tsx","../src/react-context.tsx","../src/react-feedback-dialog-types.ts","../src/react-feedback-dialog.tsx","../src/react-feedback-button.tsx","../src/react-hooks-types.ts","../src/react-mutation-hooks.ts","../src/react-query-hooks.ts"],"mappings":";;;;UAGU;EACR;EACA;EACA;EACA;EACA;EACA,gBAAgB,OAAO;EACvB;EACA;EACA;EACA;EACA;EACA;;UAGQ;EACR;EACA;EACA;EACA,YAAY;EACZ;EACA;;QAGM;YACI;IACR,6BACE,QAAQ,yBACL;;;;;;;;;;;;;;;;;wBAkBO,kBACd,WACA,MACA,UACA,OACA,cACA,YACA,iBACA,gBACA,QACA,QACA,SACA,gBACC;;;UC/Cc;EACf;EACA,QAAQ;EACR;EACA;EACA,UAAU,MAAM;EAChB,MAAM;EACN;;qBAOW,+BAAa,QAAA;UAMT;;EAEf;;EAEA,UAAU;;EAEV;;EAEA,OAAO;;EAEP;;;;;;;;;;;;;;;;;;;;;wBAsBc,iBACd,WACA,SACA,MAAM,aACN,WACA,YACC,sCAAmB,IAAA;wBAkDN,oBAAoB;wBAQpB,mBAAmB;;;KCjIvB;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA,aAAa;;EAEb,kBAAkB;;EAElB,SAAS;;EAET;;EAEA;;EAEA,eAAe;;EAEf,YAAY,QAAQ;;EAEpB;;EAEA;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;;;wBCnCc,iBACd,MACA,cACA,WACA,SACA,MACA,WACA,OACA,cACA,iBACA,YACA,QAAQ,YACR,UACA,QACA,WACC,sCAAmB,IAAA;;;UCRL;;;;;EAKf;;EAEA;;EAEA,aAAa;;EAEb,WAAW;;EAEX;;EAEA,kBAAkB;;EAElB,SAAS;IAAyB;;;EAElC;;EAEA;;EAEA,YAAY,QAAQ;;EAEpB;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;wBA6Bc,iBACd,WACA,SACA,MACA,WACA,OACA,cACA,iBACA,YACA,QACA,UACA,QACA,SACA,WACA,SACA,YACC,sCAAmB,IAAA;;;UClGL,eAAe;EAC9B,MAAM;EACN,OAAO;EACP;EACA,eAAe;;UAGA,kBAAkB,OAAO;EACxC,MAAM;EACN,OAAO;EACP;EACA,SAAS,WAAW,eAAe,QAAQ;EAC3C;;;;;;;;;;;;;;;;;wBCiDc,qBAAqB;EACjC;EAAoB;GACtB;;;;;;;;;;;;;wBA0Bc,WAAW;EACvB;EAAgB;;EAChB;EAAoB;;;;;wBAuBR,iBAAiB;EAC7B;GACF;;;;wBAiBc;EACd,YAAY,uBAAuB;IAAU;;EAC7C,cAAc,uBAAuB;IAAU;;EAC/C;EACA,OAAO;;;;wBCtFO,yBAAyB,eAAe;UAUvC,+BAA+B;EAC9C;;wBAGc,gBACd,UAAS,yBACR;EAAiB,OAAO;EAAgB;EAAe;;wBAyB1C,YACd,iCACC,eAAe;wBAiBF,YACd,gCACA,+BACC,eAAe;wBAiBF,cAAc,eAAe;wBAU7B,aAAa,iBAAiB,eAAe;wBAe7C,wBAAwB;EACtC;EACA"}
|
package/dist/server.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* );
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
interface SignUserOptions {
|
|
16
|
+
export interface SignUserOptions {
|
|
17
17
|
/** URL to user's avatar image */
|
|
18
18
|
avatar?: string;
|
|
19
19
|
/** User's email address */
|
|
@@ -25,7 +25,7 @@ interface SignUserOptions {
|
|
|
25
25
|
/** User's display name */
|
|
26
26
|
name?: string;
|
|
27
27
|
}
|
|
28
|
-
interface SignedUserToken {
|
|
28
|
+
export interface SignedUserToken {
|
|
29
29
|
/** Token expiration timestamp (ms) */
|
|
30
30
|
expiresAt: number;
|
|
31
31
|
/** The signed JWT token */
|
|
@@ -35,12 +35,12 @@ interface SignedUserToken {
|
|
|
35
35
|
* Sign a user token for secure client-side identification
|
|
36
36
|
* Uses HMAC-SHA256 via Web Crypto API (works in all runtimes)
|
|
37
37
|
*/
|
|
38
|
-
declare function signUser(user: SignUserOptions, secretKey: string, expiresInSeconds?: number): Promise<SignedUserToken>;
|
|
38
|
+
export declare function signUser(user: SignUserOptions, secretKey: string, expiresInSeconds?: number): Promise<SignedUserToken>;
|
|
39
39
|
/**
|
|
40
40
|
* Verify a user token
|
|
41
41
|
* Returns the user data if valid, null otherwise
|
|
42
42
|
*/
|
|
43
|
-
declare function verifyUser(token: string, secretKey: string): Promise<SignUserOptions | null>;
|
|
43
|
+
export declare function verifyUser(token: string, secretKey: string): Promise<SignUserOptions | null>;
|
|
44
44
|
//#endregion
|
|
45
|
-
export {
|
|
45
|
+
export type { SignUserOptions as RefletServerUser };
|
|
46
46
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"server.d.ts","names":[],"sources":["../src/server.ts"],"mappings":";;;;;;;;;;;;;;;iBAsBiB;;EAEf;;EAEA;;EAEA;;EAEA,WAAW;;EAEX;;iBAGe;;EAEf;;EAEA;;;;;;wBAOoB,SACpB,MAAM,iBACN,mBACA,4BACC,QAAQ;;;;;wBA2CW,WACpB,eACA,oBACC,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reflet-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Official Reflet SDK - Collect user feedback, feature requests, and bug reports from your app",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Reflet <hello@reflet.app>",
|
|
7
|
-
"homepage": "https://reflet.app",
|
|
8
|
-
"bugs": {
|
|
9
|
-
"url": "https://github.com/reflet-app/reflet/issues"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/reflet-app/reflet.git",
|
|
14
|
-
"directory": "packages/sdk"
|
|
15
|
-
},
|
|
16
5
|
"keywords": [
|
|
17
6
|
"feedback",
|
|
18
7
|
"feature-requests",
|
|
@@ -28,24 +17,35 @@
|
|
|
28
17
|
"roadmap",
|
|
29
18
|
"changelog"
|
|
30
19
|
],
|
|
31
|
-
"
|
|
20
|
+
"homepage": "https://reflet.app",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/reflet-app/reflet/issues"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/reflet-app/reflet.git",
|
|
27
|
+
"directory": "packages/sdk"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"author": "Reflet <hello@reflet.app>",
|
|
32
31
|
"sideEffects": false,
|
|
32
|
+
"type": "module",
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
37
|
},
|
|
38
38
|
"./react": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
39
|
+
"types": "./dist/react.d.ts",
|
|
40
|
+
"import": "./dist/react.js"
|
|
41
41
|
},
|
|
42
42
|
"./feedback": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"types": "./dist/feedback.d.ts",
|
|
44
|
+
"import": "./dist/feedback.js"
|
|
45
45
|
},
|
|
46
46
|
"./server": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
47
|
+
"types": "./dist/server.d.ts",
|
|
48
|
+
"import": "./dist/server.js"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"main": "./dist/index.js",
|
|
@@ -58,15 +58,33 @@
|
|
|
58
58
|
],
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsdown",
|
|
61
|
-
"dev": "tsdown --watch",
|
|
62
61
|
"check-types": "tsc --noEmit",
|
|
63
|
-
"
|
|
62
|
+
"dev": "tsdown --watch",
|
|
64
63
|
"lint": "cd ../.. && bun x ultracite check packages/sdk",
|
|
65
64
|
"prepublishOnly": "npm run build",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
65
|
+
"release": "npm run build && npm publish",
|
|
66
|
+
"test:unit": "vitest run",
|
|
68
67
|
"version:major": "npm version major && npm run release",
|
|
69
|
-
"
|
|
68
|
+
"version:minor": "npm version minor && npm run release",
|
|
69
|
+
"version:patch": "npm version patch && npm run release"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@base-ui/react": "^1.8.0",
|
|
73
|
+
"@zumer/snapdom": "^3.0.0"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@testing-library/dom": "^10.4.2",
|
|
77
|
+
"@testing-library/react": "^16.3.3",
|
|
78
|
+
"@testing-library/user-event": "^14.6.7",
|
|
79
|
+
"@types/react": "^19.3.0",
|
|
80
|
+
"@types/react-dom": "19.3.0",
|
|
81
|
+
"jsdom": "^30.1.0",
|
|
82
|
+
"react": "^19.3.0",
|
|
83
|
+
"react-dom": "^19.3.0",
|
|
84
|
+
"tsdown": "catalog:",
|
|
85
|
+
"typescript": "catalog:",
|
|
86
|
+
"vite": "catalog:",
|
|
87
|
+
"vitest": "catalog:"
|
|
70
88
|
},
|
|
71
89
|
"peerDependencies": {
|
|
72
90
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -80,24 +98,6 @@
|
|
|
80
98
|
"optional": true
|
|
81
99
|
}
|
|
82
100
|
},
|
|
83
|
-
"dependencies": {
|
|
84
|
-
"@base-ui/react": "^1.8.0",
|
|
85
|
-
"@zumer/snapdom": "^2.23.1"
|
|
86
|
-
},
|
|
87
|
-
"devDependencies": {
|
|
88
|
-
"@testing-library/dom": "^10.4.1",
|
|
89
|
-
"@testing-library/react": "^16.3.2",
|
|
90
|
-
"@testing-library/user-event": "^14.6.1",
|
|
91
|
-
"@types/react": "^19.2.17",
|
|
92
|
-
"jsdom": "^30.0.1",
|
|
93
|
-
"react": "^19.2.8",
|
|
94
|
-
"react-dom": "^19.2.8",
|
|
95
|
-
"tsdown": "catalog:",
|
|
96
|
-
"typescript": "catalog:",
|
|
97
|
-
"vite": "catalog:",
|
|
98
|
-
"vitest": "catalog:",
|
|
99
|
-
"@types/react-dom": "19.2.3"
|
|
100
|
-
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": ">=18.0.0"
|
|
103
103
|
},
|