@getuserfeedback/react-native 5.2.1 → 5.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.
- package/dist/client.d.ts +6 -5
- package/dist/flow-container.d.ts +1 -1
- package/dist/native-provider-client.js +14 -11
- package/dist/native-provider.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppEventExternalId,
|
|
2
|
-
import type { CapabilitiesInput, ConfigureOptions, GraphOperations, InitOptions
|
|
1
|
+
import type { AppEventExternalId, PublicCommandPayload } from "@getuserfeedback/protocol";
|
|
2
|
+
import type { CapabilitiesInput, ConfigureOptions, EventOptions, EventProperties, GraphOperations, InitOptions } from "@getuserfeedback/sdk";
|
|
3
|
+
export type { EventOptions, EventProperties, TrackOptions, } from "@getuserfeedback/sdk";
|
|
3
4
|
type IdentifyTraits = Record<string, unknown>;
|
|
4
|
-
type TrackProperties = Record<string, AppEventJsonValue>;
|
|
5
5
|
type OpenCommand = Extract<PublicCommandPayload, {
|
|
6
6
|
kind: "open";
|
|
7
7
|
}>;
|
|
@@ -56,7 +56,9 @@ export interface Client {
|
|
|
56
56
|
(traits: IdentifyTraits, options?: IdentifyOptions): Promise<void>;
|
|
57
57
|
};
|
|
58
58
|
/** Records a product event for targeting and analysis. */
|
|
59
|
-
track: (eventName: string, properties?:
|
|
59
|
+
track: (eventName: string, properties?: EventProperties, options?: EventOptions) => Promise<void>;
|
|
60
|
+
/** Records a named application screen for targeting and analysis. */
|
|
61
|
+
screen: (name: string, properties?: EventProperties, options?: EventOptions) => Promise<void>;
|
|
60
62
|
/** Records directed relationship observations through the analytics pipeline. */
|
|
61
63
|
graph: GraphOperations;
|
|
62
64
|
/** Returns the controller for one on-demand flow lifecycle. */
|
|
@@ -70,4 +72,3 @@ export interface Client {
|
|
|
70
72
|
/** Emits a named app signal into the widget runtime. */
|
|
71
73
|
emitHostSignal: (name: string, data?: unknown, options?: CommandOptions) => Promise<void>;
|
|
72
74
|
}
|
|
73
|
-
export {};
|
package/dist/flow-container.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type UseFlowContainerReturn = Readonly<{
|
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
/** True when the customer container should be visible. */
|
|
9
9
|
shouldRenderContainer: boolean;
|
|
10
|
-
/** Close every active flow
|
|
10
|
+
/** Close every active flow owned by this provider. */
|
|
11
11
|
close: () => Promise<void>;
|
|
12
12
|
}>;
|
|
13
13
|
export declare function NativeStandardFlowContainer(): ReactElement | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertNoSegmentExternalIdsInValueArgument } from "@getuserfeedback/protocol/host";
|
|
2
|
-
import {
|
|
2
|
+
import { buildCustomerOccurrenceCommand } from "@getuserfeedback/sdk/internal/customer-occurrence-command";
|
|
3
3
|
export const parseRequiredString = (name, value) => {
|
|
4
4
|
const normalized = value === null || value === void 0 ? void 0 : value.trim();
|
|
5
5
|
if (!normalized) {
|
|
@@ -36,22 +36,25 @@ const toIdentifyCommandPayload = (identifyInput, traitsOrOptions, options) => {
|
|
|
36
36
|
};
|
|
37
37
|
export function createNativeProviderClient({ dispatchCommand, flow, instanceId, }) {
|
|
38
38
|
const track = (eventName, properties, options) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
const messageId = parseTrackMessageId(options === null || options === void 0 ? void 0 : options.messageId);
|
|
46
|
-
return dispatchCommand(Object.assign(Object.assign(Object.assign({ kind: "track", origin: "customer", event: parseRequiredString("eventName", eventName) }, (properties === undefined ? {} : { properties })), (messageId === undefined ? {} : { messageId })), ((options === null || options === void 0 ? void 0 : options.externalIds) === undefined
|
|
47
|
-
? {}
|
|
48
|
-
: { context: { externalIds: options.externalIds } })));
|
|
39
|
+
return dispatchCommand(buildCustomerOccurrenceCommand({
|
|
40
|
+
type: "track",
|
|
41
|
+
event: parseRequiredString("eventName", eventName),
|
|
42
|
+
properties,
|
|
43
|
+
options,
|
|
44
|
+
}));
|
|
49
45
|
};
|
|
46
|
+
const screen = (name, properties, options) => dispatchCommand(buildCustomerOccurrenceCommand({
|
|
47
|
+
type: "screen",
|
|
48
|
+
event: parseRequiredString("screenName", name),
|
|
49
|
+
properties,
|
|
50
|
+
options,
|
|
51
|
+
}));
|
|
50
52
|
return {
|
|
51
53
|
instanceId,
|
|
52
54
|
configure: (opts, options) => dispatchCommand({ kind: "configure", opts }, options),
|
|
53
55
|
identify: ((identifyInput, traitsOrOptions, options) => dispatchCommand(toIdentifyCommandPayload(identifyInput, traitsOrOptions, options))),
|
|
54
56
|
track,
|
|
57
|
+
screen,
|
|
55
58
|
graph: {
|
|
56
59
|
connect: (relationship) => track("gx.graph.relationship.connected", relationship),
|
|
57
60
|
disconnect: (relationship) => track("gx.graph.relationship.disconnected", relationship),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentType, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import type { Client, ClientOptions } from "./client.js";
|
|
3
|
-
export type { Client, ClientOptions, FlowRun } from "./client.js";
|
|
3
|
+
export type { Client, ClientOptions, EventOptions, EventProperties, FlowRun, TrackOptions, } from "./client.js";
|
|
4
4
|
export type { UseFlowContainerReturn } from "./flow-container.js";
|
|
5
5
|
export { FlowContent, useFlowContainer } from "./flow-container.js";
|
|
6
6
|
/**
|
package/dist/version.js
CHANGED
|
@@ -3,4 +3,4 @@ const reactNativeSdkVersion = typeof __GX_REACT_NATIVE_SDK_VERSION__ === "string
|
|
|
3
3
|
: "";
|
|
4
4
|
// Build scripts patch this fallback to the package version for published artifacts.
|
|
5
5
|
// Source-linked workspace usage keeps the local fallback.
|
|
6
|
-
export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "5.
|
|
6
|
+
export const REACT_NATIVE_SDK_VERSION = reactNativeSdkVersion.length > 0 ? reactNativeSdkVersion : "5.3.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getuserfeedback/react-native",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"description": "getuserfeedback React Native SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"getuserfeedback",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"lint": "biome check ."
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@getuserfeedback/protocol": "^5.
|
|
48
|
-
"@getuserfeedback/sdk": "^0.
|
|
47
|
+
"@getuserfeedback/protocol": "^5.3.1",
|
|
48
|
+
"@getuserfeedback/sdk": "^0.15.1",
|
|
49
49
|
"robot3": "^1.2.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|