@getuserfeedback/sdk 0.20.0 → 0.21.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.
- package/dist/index.d.ts +43 -22
- package/dist/index.js +2 -2
- package/dist/index.js.map +24 -20
- package/dist/internal/feedback-command.d.ts +7 -0
- package/dist/internal/feedback-command.js +4 -0
- package/dist/internal/feedback-command.js.map +25 -0
- package/dist/internal/inline-flow.d.ts +41 -20
- package/dist/internal/inline-flow.js +2 -2
- package/dist/internal/inline-flow.js.map +15 -15
- package/dist/internal/react-container.d.ts +41 -20
- package/package.json +7 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppEventJsonInputValue,
|
|
1
|
+
import { AppEventJsonInputValue, Answer, FeedbackOptions, FeedbackResult } from '@getuserfeedback/protocol';
|
|
2
2
|
import { TrackOptions, OpenRequestedDetail, ContainerPolicy, FlowRenderState, WidgetLayoutTransitionPolicy, ResponseMetadataInput, ConfigureOptions, IdentifyOptions, AppEventIdentity } from '@getuserfeedback/protocol/host';
|
|
3
3
|
|
|
4
4
|
type EventProperties = Record<string, AppEventJsonInputValue>;
|
|
@@ -19,23 +19,6 @@ type OpenRequestedEvent$1 = {
|
|
|
19
19
|
preventDefault: () => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
/** Feedback captured as an evaluation of the current app or a specific target. */
|
|
23
|
-
type FeedbackInput = CaptureInstanceFeedbackRequest;
|
|
24
|
-
/** Receipt returned after feedback has been accepted. */
|
|
25
|
-
type SubmitFeedbackResult = CaptureInstanceFeedbackResponse;
|
|
26
|
-
/** Selectors used to read the current authenticated user's feedback. */
|
|
27
|
-
type FetchFeedbackInput = ListInstanceFeedbackMineRequest;
|
|
28
|
-
/** Feedback matching each requested selector, in selector order. */
|
|
29
|
-
type FetchFeedbackResult = ListInstanceFeedbackMineResponse;
|
|
30
|
-
/** Operations for submitting and reading feedback through the current SDK client. */
|
|
31
|
-
type FeedbackOperations = {
|
|
32
|
-
/**
|
|
33
|
-
* Read feedback matching each selector for the JWT-authenticated user.
|
|
34
|
-
* Requires `auth.jwt` configuration; `identify()` alone does not authorize readback.
|
|
35
|
-
*/
|
|
36
|
-
fetch: (input: FetchFeedbackInput) => Promise<FetchFeedbackResult>;
|
|
37
|
-
submit: (input: FeedbackInput) => Promise<SubmitFeedbackResult>;
|
|
38
|
-
};
|
|
39
22
|
/** One endpoint in a directed relationship observation. Use `identities` for a user without a stable user ID. */
|
|
40
23
|
type GraphEndpointIdentity = AppEventIdentity | {
|
|
41
24
|
type: `externalId.users.none.${string}`;
|
|
@@ -190,10 +173,48 @@ type Client = {
|
|
|
190
173
|
* failures reject the returned promise.
|
|
191
174
|
*/
|
|
192
175
|
page: (name?: string, properties?: EventProperties, options?: EventOptions) => Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Submit feedback from your own UI.
|
|
178
|
+
*
|
|
179
|
+
* Resolves with `{ ok: true }` after capture; rejects if submission fails.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* Submit one text answer:
|
|
183
|
+
* ```ts
|
|
184
|
+
* await client.feedback("Love the app!");
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* Add question definitions and app-supplied context:
|
|
189
|
+
* ```ts
|
|
190
|
+
* await client.feedback(
|
|
191
|
+
* [
|
|
192
|
+
* {
|
|
193
|
+
* value: "Search",
|
|
194
|
+
* question: { type: "text", text: "What should we improve?" },
|
|
195
|
+
* },
|
|
196
|
+
* {
|
|
197
|
+
* value: 4,
|
|
198
|
+
* question: { type: "scale", text: "How was setup?", min: 1, max: 5 },
|
|
199
|
+
* },
|
|
200
|
+
* ],
|
|
201
|
+
* { properties: { surface: "settings" } },
|
|
202
|
+
* );
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* Associate feedback with a workspace using your configured Group key:
|
|
207
|
+
* ```ts
|
|
208
|
+
* await client.feedback("The workspace switcher was confusing.", {
|
|
209
|
+
* properties: { workspace_id: workspace.id },
|
|
210
|
+
* });
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @see https://getuserfeedback.com/docs/reference/javascript-sdk-reference#feedback
|
|
214
|
+
*/
|
|
215
|
+
feedback: (answers: string | Answer | readonly Answer[], options?: FeedbackOptions) => Promise<FeedbackResult>;
|
|
193
216
|
/** Record directed relationship observations through the analytics pipeline. */
|
|
194
217
|
graph: GraphOperations;
|
|
195
|
-
/** Submit feedback or read the authenticated user's matching feedback. */
|
|
196
|
-
feedback: FeedbackOperations;
|
|
197
218
|
/** Subscribe to explicit SDK and client-side targeting open requests, or suppress them — for example if you know the user should not be interrupted.
|
|
198
219
|
* For example, when the user is filling out a form, or is in the middle of a multi-step flow.
|
|
199
220
|
* Prevention applies only to that presentation attempt; it does not create a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "getuserfeedback Typescript SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"import": "./dist/internal/inline-flow.js",
|
|
41
41
|
"types": "./dist/internal/inline-flow.d.ts"
|
|
42
42
|
},
|
|
43
|
+
"./internal/feedback-command": {
|
|
44
|
+
"import": "./dist/internal/feedback-command.js",
|
|
45
|
+
"types": "./dist/internal/feedback-command.d.ts"
|
|
46
|
+
},
|
|
43
47
|
"./internal/customer-occurrence-command": {
|
|
44
48
|
"import": "./dist/internal/customer-occurrence-command.js",
|
|
45
49
|
"types": "./dist/internal/customer-occurrence-command.d.ts"
|
|
@@ -65,7 +69,7 @@
|
|
|
65
69
|
"dist"
|
|
66
70
|
],
|
|
67
71
|
"dependencies": {
|
|
68
|
-
"@getuserfeedback/protocol": "^7.
|
|
72
|
+
"@getuserfeedback/protocol": "^7.1.0"
|
|
69
73
|
},
|
|
70
74
|
"devDependencies": {
|
|
71
75
|
"@typescript/typescript6": "^6.0.2",
|
|
@@ -79,7 +83,7 @@
|
|
|
79
83
|
"publish:dry-run": "node ../../scripts/publish-package.cjs . --expect-dependency @getuserfeedback/protocol:../protocol/package.json -- --dry-run",
|
|
80
84
|
"publish:npm": "node ../../scripts/publish-package.cjs . --expect-dependency @getuserfeedback/protocol:../protocol/package.json",
|
|
81
85
|
"build": "bun ../../scripts/clean-build-output.ts dist tsconfig.tsbuildinfo && bun run scripts/build.ts && bun x rollup -c rollup.dts.config.mjs && bun run scripts/verify-internal-build.ts",
|
|
82
|
-
"typecheck": "tsc -p tsconfig.json --noEmit --composite false --incremental false",
|
|
86
|
+
"typecheck": "bun ../../scripts/run-native-check.ts tsc -p tsconfig.json --noEmit --composite false --incremental false",
|
|
83
87
|
"test": "bun test --dots src __tests__",
|
|
84
88
|
"lint": "oxlint --threads=2 -c ../../oxlint.config.ts ."
|
|
85
89
|
}
|