@sidebandai/sideband-core 1.4.1-rc.2 → 1.4.4
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/README.md +86 -72
- package/dist/client/create-sideband-client.d.ts.map +1 -1
- package/dist/core/context.d.ts +2 -2
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/create-sideband-runtime.d.ts.map +1 -1
- package/dist/core/survey-session-store.d.ts +8 -4
- package/dist/core/survey-session-store.d.ts.map +1 -1
- package/dist/core/sync-engine.d.ts +14 -0
- package/dist/core/sync-engine.d.ts.map +1 -1
- package/dist/core/validate-input.d.ts +4 -0
- package/dist/core/validate-input.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +170 -85
- package/dist/types.d.ts +22 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sideband Core SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
delivery, and survey-session state. It does not mount UI or import renderer
|
|
5
|
-
code.
|
|
3
|
+
Sideband event tracking for custom browser integrations without built-in Pulse UI.
|
|
6
4
|
|
|
7
|
-
For
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
Both
|
|
11
|
-
|
|
5
|
+
For built-in Pulse presentation, install the
|
|
6
|
+
[Web SDK](https://www.npmjs.com/package/@sidebandai/sideband-web) or
|
|
7
|
+
[React SDK](https://www.npmjs.com/package/@sidebandai/sideband-react) instead.
|
|
8
|
+
Both include this package automatically.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- A Sideband API key
|
|
13
|
+
- Your application's version
|
|
12
14
|
|
|
13
15
|
## Install
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
npm install @sidebandai/sideband-core
|
|
18
|
+
npm install @sidebandai/sideband-core
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configure
|
|
22
|
+
|
|
23
|
+
Create and start a runtime once when your app starts in the browser:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { createSidebandRuntime } from '@sidebandai/sideband-core'
|
|
27
|
+
|
|
28
|
+
const sideband = createSidebandRuntime({
|
|
29
|
+
apiKey: 'YOUR_API_KEY',
|
|
30
|
+
appVersion: '1.0.0',
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
sideband.start()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Replace `1.0.0` with your application's version, not the SDK version.
|
|
37
|
+
`appVersion` must be a non-empty string of at most 64 characters.
|
|
38
|
+
|
|
39
|
+
## Identify users
|
|
40
|
+
|
|
41
|
+
Tag the signed-in user wherever your app knows who they are: after sign-up and
|
|
42
|
+
sign-in, and when your app restores a signed-in session. Clear the identity at
|
|
43
|
+
sign-out.
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
sideband.tagUser('user-123') // sign-up, sign-in, restored session
|
|
47
|
+
sideband.untagUser() // sign-out
|
|
17
48
|
```
|
|
18
49
|
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
Pass your own stable user ID, not an email address or name. A user ID can have at most 256 characters (Unicode code points). A longer ID is
|
|
51
|
+
rejected without changing the current identity, and `onError` receives the reason. The runtime
|
|
52
|
+
keeps the ID in the browser's localStorage and restores it on the next page
|
|
53
|
+
load.
|
|
54
|
+
|
|
55
|
+
## Track events
|
|
21
56
|
|
|
22
|
-
|
|
23
|
-
are strings, and `appVersion` is optional without a default. Requests use the
|
|
24
|
-
production endpoint by default.
|
|
57
|
+
Call `track` once per user action, after the action succeeds:
|
|
25
58
|
|
|
26
|
-
|
|
59
|
+
```ts
|
|
60
|
+
sideband.track('invoice_sent', { source: 'invoice_list', item_type: 'invoice', count: '3' })
|
|
61
|
+
```
|
|
27
62
|
|
|
28
|
-
Pass metadata
|
|
29
|
-
|
|
63
|
+
Pass metadata as string key-value pairs. Use metadata to describe an event
|
|
64
|
+
without creating a separate event name for each source, item type, or mode.
|
|
30
65
|
Only these six keys support Pulse trigger filters and event-history conditions:
|
|
31
66
|
|
|
32
67
|
| Key | Value format | Example |
|
|
@@ -39,59 +74,38 @@ Only these six keys support Pulse trigger filters and event-history conditions:
|
|
|
39
74
|
| `duration` | Seconds sent as a string; fractions allowed | `'12.5'` |
|
|
40
75
|
|
|
41
76
|
Use the exact lowercase key names. The server trims and lowercases values for
|
|
42
|
-
`source`, `item_type`, `mode`, and `variant
|
|
43
|
-
not-equals
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
runtime.track('content_created', {
|
|
49
|
-
source: 'editor',
|
|
50
|
-
item_type: 'article',
|
|
51
|
-
count: '3',
|
|
52
|
-
duration: '12.5',
|
|
53
|
-
content_id: 'article-123',
|
|
54
|
-
})
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Here, `runtime` is a started instance returned by `createSidebandRuntime()`.
|
|
77
|
+
`source`, `item_type`, `mode`, and `variant`, and compares them with equals and
|
|
78
|
+
not-equals. It compares `count` and `duration` numerically. Send `duration` in
|
|
79
|
+
seconds, not milliseconds. `count: '3.5'` and `count: '3.0'` are invalid; use
|
|
80
|
+
`count: '3'`.
|
|
58
81
|
|
|
59
82
|
Custom keys such as `content_id`, `screen`, or `plan` are stored unchanged, but
|
|
60
|
-
cannot be used in Pulse targeting
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
`
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Web and React automatically queue `system_login`/`system_logout` when the
|
|
90
|
-
tagged identity changes, with the exact affected ID in `metadata.user_id`.
|
|
91
|
-
Switching users queues logout before login with the same invocation-time
|
|
92
|
-
`timestamp`. Duplicate tags, duplicate untags, and persisted restoration emit no
|
|
93
|
-
auth events; configured context alone does not log in. Event IDs, timestamps,
|
|
94
|
-
and auth metadata survive batching and retries, even when batch context advances.
|
|
95
|
-
|
|
96
|
-
Sync errors include documented `invalid_request`, `unauthorized`, `not_found`,
|
|
97
|
-
and retryable `service_unavailable` (HTTP 503) envelopes.
|
|
83
|
+
cannot be used in Pulse targeting. A missing key does not match any filter,
|
|
84
|
+
including not-equals. The server stores at most 20 metadata properties per
|
|
85
|
+
event: valid targeting keys first, then custom keys in sorted key order. It
|
|
86
|
+
drops empty keys and invalid targeting values without rejecting the event.
|
|
87
|
+
|
|
88
|
+
When the page is hidden or unloads, the SDK tries to send queued events with
|
|
89
|
+
`keepalive`. This is best effort: a send already in progress can delay it. For an
|
|
90
|
+
event tracked just before your code navigates away, await `sideband.flush()` first.
|
|
91
|
+
|
|
92
|
+
The SDK sends events in batches, by default about once a second. Set
|
|
93
|
+
`flushIntervalSeconds` in `createSidebandRuntime` (seconds, at least 1) to change it. A pulse can show only
|
|
94
|
+
after the batch that holds its trigger event is sent, so a longer interval delays
|
|
95
|
+
pulses. The server can also ask the SDK to wait before its next send.
|
|
96
|
+
|
|
97
|
+
## Events the SDK sends itself
|
|
98
|
+
|
|
99
|
+
Do not track these yourself:
|
|
100
|
+
|
|
101
|
+
| Event | When |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `system_app_launch` | The SDK starts (`start()`), usually once per page load. |
|
|
104
|
+
| `system_app_background` | The page is hidden or unloaded: another tab, a minimized window, navigation away. |
|
|
105
|
+
| `system_app_foreground` | The page is visible again after `system_app_background`. |
|
|
106
|
+
| `system_login` | `tagUser` sets a new user ID. `metadata.user_id` is the new ID. |
|
|
107
|
+
| `system_logout` | `untagUser` clears the user ID, or `tagUser` replaces it. `metadata.user_id` is the previous ID. |
|
|
108
|
+
|
|
109
|
+
Switching from user A to user B sends `system_logout` for A, then `system_login`
|
|
110
|
+
for B, with the same timestamp. Repeating the same ID, clearing an ID that is
|
|
111
|
+
not set, and restoring the stored ID on a page load send nothing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-sideband-client.d.ts","sourceRoot":"","sources":["../../src/client/create-sideband-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAA;AA2FjB,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAA;gBAGxB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,GAAG,OAAO,EACjC,iBAAiB,CAAC,EAAE,MAAM;CAQ7B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB;oBAMpD,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;QAAE,OAAO,CAAC,EAAE,aAAa,CAAA;KAAE,YACzD,WAAW,KACpB,OAAO,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"create-sideband-client.d.ts","sourceRoot":"","sources":["../../src/client/create-sideband-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAA;AA2FjB,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAA;gBAGxB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,GAAG,OAAO,EACjC,iBAAiB,CAAC,EAAE,MAAM;CAQ7B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB;oBAMpD,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;QAAE,OAAO,CAAC,EAAE,aAAa,CAAA;KAAE,YACzD,WAAW,KACpB,OAAO,CAAC,YAAY,CAAC;uBAmDX,MAAM,aACN,aAAa,YACd,YAAY;EAsBzB;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
package/dist/core/context.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export declare function getStoredUserId(): string | null;
|
|
|
6
6
|
export declare function setStoredUserId(userId: string): void;
|
|
7
7
|
export declare function clearStoredUserId(): void;
|
|
8
8
|
export declare function resetContextMemoForTests(): void;
|
|
9
|
-
export declare function createDefaultContext(appVersion
|
|
10
|
-
export declare function createContextResolver(appVersion
|
|
9
|
+
export declare function createDefaultContext(appVersion: string, libraryVersion?: string): ClientContext;
|
|
10
|
+
export declare function createContextResolver(appVersion: string, overrides?: Partial<ClientContext> | (() => Partial<ClientContext> | Promise<Partial<ClientContext>>), libraryVersion?: string): () => Promise<ClientContext>;
|
|
11
11
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/core/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAS7C,wBAAgB,YAAY,IAAI,MAAM,CAqBrC;AAsCD,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAM/C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,QAM7C;AAED,wBAAgB,iBAAiB,SAMhC;AAED,wBAAgB,wBAAwB,SAGvC;AAED,wBAAgB,oBAAoB,CAClC,UAAU,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/core/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAS7C,wBAAgB,YAAY,IAAI,MAAM,CAqBrC;AAsCD,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAM/C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,QAM7C;AAED,wBAAgB,iBAAiB,SAMhC;AAED,wBAAgB,wBAAwB,SAGvC;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,cAAc,SAA4B,GACzC,aAAa,CAqBf;AAQD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EACR,OAAO,CAAC,aAAa,CAAC,GACpB,CAAC,MAAM,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EACpE,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,OAAO,CAAC,aAAa,CAAC,CAS9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-sideband-runtime.d.ts","sourceRoot":"","sources":["../../src/core/create-sideband-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-sideband-runtime.d.ts","sourceRoot":"","sources":["../../src/core/create-sideband-runtime.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAIV,eAAe,EACf,qBAAqB,EAItB,MAAM,UAAU,CAAA;AAEjB,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CA6EpF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Interaction, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, SidebandCoreConfig,
|
|
1
|
+
import type { Interaction, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, SidebandCoreConfig, SentimentPresentationOptions, BarPosition, BarBehavior, SimulatedPulseDefinition, SurveyAnswerMap, SurveyAnswerValue, SurveyPresentationKind, SyncResponse } from '../types';
|
|
2
2
|
export type FabState = 'hidden' | 'expanded';
|
|
3
3
|
export type SurveyAnswerDraft = {
|
|
4
4
|
answer_key?: string;
|
|
@@ -6,6 +6,9 @@ export type SurveyAnswerDraft = {
|
|
|
6
6
|
};
|
|
7
7
|
export type SurveySessionState = {
|
|
8
8
|
presentationId: number;
|
|
9
|
+
sentimentPresentation: 'sheet' | 'snackbar' | 'bar';
|
|
10
|
+
barPosition: BarPosition;
|
|
11
|
+
barBehavior: BarBehavior;
|
|
9
12
|
isSimulated: boolean;
|
|
10
13
|
snackbar: SnackbarState | null;
|
|
11
14
|
survey: Pulse;
|
|
@@ -28,6 +31,7 @@ export type SnackbarState = {
|
|
|
28
31
|
startedAt: number | null;
|
|
29
32
|
deadline: number | null;
|
|
30
33
|
frozenFraction: number | null;
|
|
34
|
+
pausedRemainingMs: number | null;
|
|
31
35
|
};
|
|
32
36
|
export type SurveyStoreSnapshot = {
|
|
33
37
|
state: SurveySessionState | null;
|
|
@@ -80,9 +84,7 @@ export declare class SurveySessionStore {
|
|
|
80
84
|
canContinue(): boolean;
|
|
81
85
|
handleSyncResponse(response: SyncResponse): Promise<void>;
|
|
82
86
|
/** Synchronously presents a validated canonical pulse without transport. */
|
|
83
|
-
presentPulse(pulse: Pulse, options?:
|
|
84
|
-
sentimentPresentation?: SentimentPresentation;
|
|
85
|
-
}): boolean;
|
|
87
|
+
presentPulse(pulse: Pulse, options?: SentimentPresentationOptions): boolean;
|
|
86
88
|
/** Simulation never reports impressions, responses, or rating requests to the host. */
|
|
87
89
|
presentSimulatedPulse(definition: SimulatedPulseDefinition): boolean;
|
|
88
90
|
private presentLocalPulse;
|
|
@@ -96,6 +98,8 @@ export declare class SurveySessionStore {
|
|
|
96
98
|
confirmPresentation(kind: SurveyPresentationKind, presentationId?: number): void;
|
|
97
99
|
confirmFabEntranceCompleted(presentationId?: number): void;
|
|
98
100
|
answerSnackbar(presentationId: number, choiceId: string): boolean;
|
|
101
|
+
/** Keep the bar's visible countdown and expiry in sync while a mouse hovers it. */
|
|
102
|
+
setBarTimerPaused(presentationId: number, paused: boolean): void;
|
|
99
103
|
/** The visible renderer calls this after expansion and content reveal finish. */
|
|
100
104
|
confirmSnackbarContentReady(presentationId: number): void;
|
|
101
105
|
private resolvePresentationDecision;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-session-store.d.ts","sourceRoot":"","sources":["../../src/core/survey-session-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,kBAAkB,
|
|
1
|
+
{"version":3,"file":"survey-session-store.d.ts","sourceRoot":"","sources":["../../src/core/survey-session-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAElB,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EAEjB,sBAAsB,EACtB,YAAY,EACb,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B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O,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,kBAAkB;IAuC1B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,6BAA6B;IAWrC,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,kBAAkB;CAU3B"}
|
|
@@ -51,9 +51,23 @@ export declare class SyncEngine {
|
|
|
51
51
|
private pendingForcedRetry;
|
|
52
52
|
private manualFlushPromise;
|
|
53
53
|
private lastAttemptAccepted;
|
|
54
|
+
private acceptedEvents;
|
|
55
|
+
private acceptedInteractions;
|
|
56
|
+
private syncAttempts;
|
|
54
57
|
private detachLifecycle;
|
|
55
58
|
constructor(deps: SyncEngineDeps, options?: SyncEngineOptions);
|
|
56
59
|
start(): void;
|
|
60
|
+
/** Read-only acknowledgement and pending-work diagnostics; flush alone is not delivery proof. */
|
|
61
|
+
getDeliveryStatus(): {
|
|
62
|
+
acceptedEvents: number;
|
|
63
|
+
acceptedInteractions: number;
|
|
64
|
+
syncAttempts: number;
|
|
65
|
+
pendingEvents: number;
|
|
66
|
+
pendingInteractions: number;
|
|
67
|
+
hasPendingContext: boolean;
|
|
68
|
+
isSyncing: boolean;
|
|
69
|
+
isTerminal: boolean;
|
|
70
|
+
};
|
|
57
71
|
track(eventName: string, metadata?: EventMetadata, options?: {
|
|
58
72
|
timestamp?: string;
|
|
59
73
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../../src/core/sync-engine.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAA;AAUjB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAA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,GAAG,IAAW,EAAE,SAAS,SAA2B;IAqBhH,iBAAiB,CAAC,WAAW,EAAE,WAAW;IAS1C,cAAc;IAId,gEAAgE;IAC1D,eAAe,CAAC,QAAQ,EAAE,YAAY;IAiB5C,UAAU,CAAC,QAAQ,EAAE,YAAY;IAI3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB5B,OAAO;YAcO,oBAAoB;IAgClC,OAAO,CAAC,gBAAgB;IAUxB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,cAAc;IAmDtB,OAAO,CAAC,YAAY;YAoDN,UAAU;YAkCV,qBAAqB;IAkEnC,OAAO,CAAC,aAAa;IAmCrB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,iBAAiB;YAWX,cAAc;IAY5B,OAAO,CAAC,YAAY;IAuCpB,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,eAAe;IAuCvB,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,CAAC,WAAW;CAWpB"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { EventMetadata } from '../types';
|
|
2
2
|
export declare function validateApiKey(apiKey: string): void;
|
|
3
|
+
export declare function validateAppVersion(appVersion: string, field?: string): void;
|
|
3
4
|
export declare function validateEvent(eventName: string, metadata?: EventMetadata): void;
|
|
5
|
+
export declare const MAX_TAGGED_USER_ID_LENGTH = 256;
|
|
6
|
+
export declare function taggedUserIdLength(userId: string): number;
|
|
7
|
+
export declare function isTaggedUserIdTooLong(userId: string): boolean;
|
|
4
8
|
//# sourceMappingURL=validate-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-input.d.ts","sourceRoot":"","sources":["../../src/core/validate-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,QAI5C;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,QAaxE"}
|
|
1
|
+
{"version":3,"file":"validate-input.d.ts","sourceRoot":"","sources":["../../src/core/validate-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,QAI5C;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAkC,QAI7F;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,QAaxE;AAED,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAI5C,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,UAEhD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,WAEnD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export { SurveySessionStore, buildFabTitle, getChoiceValue, isSystemOtherChoice,
|
|
|
7
7
|
export { SyncEngine } from './core/sync-engine';
|
|
8
8
|
export type { SyncEngineDeps, SyncEngineOptions } from './core/sync-engine';
|
|
9
9
|
export type { FabState, SurveyAnswerDraft, SnackbarState, SurveySessionState, SurveyStoreSnapshot, SurveyStoreUpdateReason, } from './core/survey-session-store';
|
|
10
|
-
export type { AnsweredInteraction, ApiErrorDetail, ClientContext, CompletionActionStyle, CompletionActionType, CompletionIconType, CompletionType, DismissedInteraction, EventMetadata, EventRecord, Fab, FabOffset, FabPlacement, FabPoint, Interaction, Platform, PendingPulse, SyncEndpoint, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, QuestionType, SentimentPresentation, SimulatedPulseDefinition, SidebandClientConfig, SidebandCoreConfig, SidebandRuntime, SidebandRuntimeConfig, SurveyAnswerMap, SurveyAnswerValue, SurveyPresentationDecision, SurveyPresentationKind, SyncErrorResponse, ServiceUnavailableError, SyncOptions, SyncRequest, SyncResponse, TrackedEvent, TrackOptions, Theme, ThemeColor, TimerStyle, } from './types';
|
|
10
|
+
export type { AnsweredInteraction, ApiErrorDetail, ClientContext, CompletionActionStyle, CompletionActionType, CompletionIconType, CompletionType, DismissedInteraction, EventMetadata, EventRecord, Fab, FabOffset, FabPlacement, FabPoint, Interaction, Platform, PendingPulse, SyncEndpoint, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, QuestionType, SentimentPresentation, SentimentPresentationOptions, BarPosition, BarBehavior, SimulatedPulseDefinition, SidebandClientConfig, SidebandCoreConfig, SidebandRuntime, SidebandRuntimeConfig, SurveyAnswerMap, SurveyAnswerValue, SurveyPresentationDecision, SurveyPresentationKind, SyncErrorResponse, ServiceUnavailableError, SyncOptions, SyncRequest, SyncResponse, TrackedEvent, TrackOptions, Theme, ThemeColor, TimerStyle, } from './types';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AACxF,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,yBAAyB,GAC1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,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,6BAA6B,CAAA;AACpC,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,GAAG,EACH,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -52,11 +52,11 @@ function d() {
|
|
|
52
52
|
r("local")?.removeItem(e);
|
|
53
53
|
} catch {}
|
|
54
54
|
}
|
|
55
|
-
function ee(e, t = "1.4.
|
|
55
|
+
function ee(e, t = "1.4.4") {
|
|
56
56
|
let n = {
|
|
57
57
|
device_id: s(),
|
|
58
58
|
platform: "web",
|
|
59
|
-
|
|
59
|
+
app_version: e,
|
|
60
60
|
session_id: c(),
|
|
61
61
|
library_version: t
|
|
62
62
|
};
|
|
@@ -81,55 +81,64 @@ function f(e, t, n) {
|
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region src/core/validate-input.ts
|
|
84
|
-
function
|
|
84
|
+
function p(e) {
|
|
85
85
|
if (typeof e != "string" || !e.trim()) throw TypeError("Sideband.configure apiKey must be a non-empty string.");
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function m(e, t = "Sideband.configure appVersion") {
|
|
88
|
+
if (typeof e != "string" || !e.trim() || Array.from(e).length > 64) throw TypeError(`${t} must be a non-empty string of at most 64 characters.`);
|
|
89
|
+
}
|
|
90
|
+
function h(e, t) {
|
|
88
91
|
if (typeof e != "string" || !e.length) throw TypeError("Sideband.track eventName must be a non-empty string.");
|
|
89
92
|
if (t !== void 0) {
|
|
90
93
|
if (typeof t != "object" || !t || Array.isArray(t)) throw TypeError("Sideband.track metadata must be a string-to-string map.");
|
|
91
94
|
for (let [e, n] of Object.entries(t)) if (typeof n != "string") throw TypeError(`Sideband.track metadata value for "${e}" must be a string.`);
|
|
92
95
|
}
|
|
93
96
|
}
|
|
97
|
+
function ne(e) {
|
|
98
|
+
return Array.from(e).length;
|
|
99
|
+
}
|
|
100
|
+
function g(e) {
|
|
101
|
+
return ne(e) > 256;
|
|
102
|
+
}
|
|
94
103
|
//#endregion
|
|
95
104
|
//#region src/core/sync-attempt.ts
|
|
96
|
-
var
|
|
97
|
-
function
|
|
105
|
+
var _ = Symbol("sideband.syncAttemptMetadata"), v = /* @__PURE__ */ new WeakSet();
|
|
106
|
+
function y(e, t) {
|
|
98
107
|
let n = { ...e };
|
|
99
|
-
return n[
|
|
108
|
+
return n[_] = t, n;
|
|
100
109
|
}
|
|
101
|
-
function
|
|
102
|
-
return e?.[
|
|
110
|
+
function b(e) {
|
|
111
|
+
return e?.[_];
|
|
103
112
|
}
|
|
104
|
-
function
|
|
105
|
-
(typeof e == "object" && e || typeof e == "function") &&
|
|
113
|
+
function x(e) {
|
|
114
|
+
(typeof e == "object" && e || typeof e == "function") && v.add(e);
|
|
106
115
|
}
|
|
107
|
-
function
|
|
108
|
-
return (typeof e == "object" && !!e || typeof e == "function") &&
|
|
116
|
+
function S(e) {
|
|
117
|
+
return (typeof e == "object" && !!e || typeof e == "function") && v.has(e);
|
|
109
118
|
}
|
|
110
119
|
//#endregion
|
|
111
120
|
//#region src/client/create-sideband-client.ts
|
|
112
|
-
var
|
|
121
|
+
var C = "/v1/sync", w = {
|
|
113
122
|
local: "https://api.pancake-betelgeuse.ts.net",
|
|
114
123
|
dev: "https://api.dev-sideband.ai",
|
|
115
124
|
prod: "https://api.sideband.ai"
|
|
116
125
|
};
|
|
117
|
-
function
|
|
126
|
+
function re(e) {
|
|
118
127
|
if (e) return e;
|
|
119
128
|
if (typeof fetch != "function") throw Error("Sideband requires a fetch implementation.");
|
|
120
129
|
return fetch;
|
|
121
130
|
}
|
|
122
|
-
async function
|
|
131
|
+
async function ie(e) {
|
|
123
132
|
return typeof e == "function" ? await e() : e;
|
|
124
133
|
}
|
|
125
|
-
async function
|
|
134
|
+
async function ae(e) {
|
|
126
135
|
let t = typeof e == "function" ? await e() : e;
|
|
127
136
|
return new Headers(t);
|
|
128
137
|
}
|
|
129
|
-
function
|
|
130
|
-
return new URL(
|
|
138
|
+
function oe(e) {
|
|
139
|
+
return new URL(C, e).toString();
|
|
131
140
|
}
|
|
132
|
-
async function
|
|
141
|
+
async function se(e) {
|
|
133
142
|
let t = await e.text();
|
|
134
143
|
if (!t) return null;
|
|
135
144
|
try {
|
|
@@ -138,10 +147,10 @@ async function oe(e) {
|
|
|
138
147
|
return t;
|
|
139
148
|
}
|
|
140
149
|
}
|
|
141
|
-
function
|
|
150
|
+
function ce(e, t) {
|
|
142
151
|
return typeof e == "object" && e && "error" in e && typeof e.error == "object" && e.error !== null && "message" in e.error && typeof e.error.message == "string" ? e.error.message : t;
|
|
143
152
|
}
|
|
144
|
-
function
|
|
153
|
+
function le(e) {
|
|
145
154
|
let t = e.headers.get("retry-after");
|
|
146
155
|
if (!t) return;
|
|
147
156
|
let n = Number(t);
|
|
@@ -149,7 +158,7 @@ function ce(e) {
|
|
|
149
158
|
let r = Date.parse(t);
|
|
150
159
|
if (!Number.isNaN(r)) return Math.max((r - Date.now()) / 1e3, 0);
|
|
151
160
|
}
|
|
152
|
-
var
|
|
161
|
+
var T = class extends Error {
|
|
153
162
|
status;
|
|
154
163
|
body;
|
|
155
164
|
retryAfterSeconds;
|
|
@@ -157,12 +166,14 @@ var C = class extends Error {
|
|
|
157
166
|
super(e), this.name = "SidebandApiError", this.status = t, this.body = n, this.retryAfterSeconds = r;
|
|
158
167
|
}
|
|
159
168
|
};
|
|
160
|
-
function
|
|
161
|
-
if (
|
|
169
|
+
function E(e) {
|
|
170
|
+
if (p(e.apiKey), e.syncEndpoint !== void 0 && !Object.hasOwn(w, e.syncEndpoint)) throw TypeError("Sideband.configure syncEndpoint must be local, dev, or prod.");
|
|
162
171
|
async function t(t, n) {
|
|
163
|
-
let r =
|
|
172
|
+
let r = re(e.fetch), i = t.context ?? await ie(e.context);
|
|
173
|
+
m(i.app_version, "Sideband context.app_version");
|
|
174
|
+
let a = await ae(e.headers), o = b(n);
|
|
164
175
|
a.set("content-type", "application/json"), a.set("x-bc-api-key", e.apiKey), a.set("x-bc-sync-attempt", String(o?.attempt ?? 1)), o?.retryReason ? a.set("x-bc-sync-retry-reason", o.retryReason) : a.delete("x-bc-sync-retry-reason");
|
|
165
|
-
let s =
|
|
176
|
+
let s = oe(e.baseUrl ?? w[e.syncEndpoint ?? "prod"]), c = {
|
|
166
177
|
method: "POST",
|
|
167
178
|
headers: a,
|
|
168
179
|
body: JSON.stringify({
|
|
@@ -175,14 +186,14 @@ function w(e) {
|
|
|
175
186
|
try {
|
|
176
187
|
l = await r(s, c);
|
|
177
188
|
} catch (e) {
|
|
178
|
-
throw
|
|
189
|
+
throw x(e), e;
|
|
179
190
|
}
|
|
180
|
-
let u = await
|
|
181
|
-
if (!l.ok) throw new
|
|
191
|
+
let u = await se(l);
|
|
192
|
+
if (!l.ok) throw new T(ce(u, "Sideband sync request failed."), l.status, u, le(l));
|
|
182
193
|
return u;
|
|
183
194
|
}
|
|
184
195
|
async function r(e, r, i) {
|
|
185
|
-
return
|
|
196
|
+
return h(e, r), t({ events: [{
|
|
186
197
|
event_id: n(),
|
|
187
198
|
event_name: e,
|
|
188
199
|
metadata: r,
|
|
@@ -196,22 +207,22 @@ function w(e) {
|
|
|
196
207
|
}
|
|
197
208
|
//#endregion
|
|
198
209
|
//#region src/core/sync-engine.ts
|
|
199
|
-
var
|
|
200
|
-
function
|
|
210
|
+
var D = 20, O = 50, k = 1, A = 15, j = 1e3, M = 300 * 1e3, N = 2147483647;
|
|
211
|
+
function P(e, t, n) {
|
|
201
212
|
return Math.min(Math.max(e, t), n);
|
|
202
213
|
}
|
|
203
|
-
function
|
|
214
|
+
function F(e) {
|
|
204
215
|
let t = e?.status;
|
|
205
216
|
return typeof t != "number" || t === 408 || t === 425 || t === 429 || t >= 500;
|
|
206
217
|
}
|
|
207
|
-
function
|
|
218
|
+
function I(e) {
|
|
208
219
|
let t = e?.retryAfterSeconds;
|
|
209
220
|
return typeof t == "number" && Number.isFinite(t) ? Math.max(t, 0) * 1e3 : void 0;
|
|
210
221
|
}
|
|
211
|
-
function
|
|
212
|
-
return e?.status === 503 &&
|
|
222
|
+
function L(e) {
|
|
223
|
+
return e?.status === 503 && I(e) !== void 0 ? "server_retry" : S(e) ? "network" : "server_error";
|
|
213
224
|
}
|
|
214
|
-
var
|
|
225
|
+
var R = class {
|
|
215
226
|
deps;
|
|
216
227
|
maxBatchSize;
|
|
217
228
|
flushIntervalMs;
|
|
@@ -241,15 +252,31 @@ var I = class {
|
|
|
241
252
|
pendingForcedRetry = null;
|
|
242
253
|
manualFlushPromise = null;
|
|
243
254
|
lastAttemptAccepted = !1;
|
|
255
|
+
acceptedEvents = 0;
|
|
256
|
+
acceptedInteractions = 0;
|
|
257
|
+
syncAttempts = 0;
|
|
244
258
|
detachLifecycle = null;
|
|
245
259
|
constructor(e, t = {}) {
|
|
246
|
-
this.deps = e, this.maxBatchSize =
|
|
260
|
+
this.deps = e, this.maxBatchSize = P(t.maxBatchSize ?? D, 1, O), this.flushIntervalMs = Math.max(t.flushIntervalSeconds ?? k, 1) * 1e3, this.retryIntervalMs = Math.max(t.retryIntervalSeconds ?? A, 1) * 1e3, this.maxQueuedEvents = Math.max(t.maxQueuedEvents ?? j, this.maxBatchSize);
|
|
247
261
|
}
|
|
248
262
|
start() {
|
|
249
263
|
this.started || this.destroyed || (this.started = !0, this.attachLifecycle(), this.track("system_app_launch"));
|
|
250
264
|
}
|
|
265
|
+
getDeliveryStatus() {
|
|
266
|
+
let e = new Set([...this.queuedEvents, ...this.retrySnapshot?.events ?? []].map((e) => e.record.event_id));
|
|
267
|
+
return {
|
|
268
|
+
acceptedEvents: this.acceptedEvents,
|
|
269
|
+
acceptedInteractions: this.acceptedInteractions,
|
|
270
|
+
syncAttempts: this.syncAttempts,
|
|
271
|
+
pendingEvents: e.size,
|
|
272
|
+
pendingInteractions: this.queuedInteractions.length,
|
|
273
|
+
hasPendingContext: this.contextRevision > this.acknowledgedContextRevision,
|
|
274
|
+
isSyncing: this.inFlight !== null,
|
|
275
|
+
isTerminal: this.destroyed || this.automaticRetrySuspended
|
|
276
|
+
};
|
|
277
|
+
}
|
|
251
278
|
track(e, t, n) {
|
|
252
|
-
if (
|
|
279
|
+
if (h(e, t), this.destroyed) return;
|
|
253
280
|
let r = Date.now();
|
|
254
281
|
if (this.enqueueEvent(e, t, n?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(), r), this.enforceQueueLimit(), e === "system_did_present_pulse") {
|
|
255
282
|
this.requestUrgent();
|
|
@@ -362,12 +389,12 @@ var I = class {
|
|
|
362
389
|
}
|
|
363
390
|
async runAttempt(e, t) {
|
|
364
391
|
try {
|
|
365
|
-
!e.context && this.deps.resolveContext && (e.context = { ...await this.deps.resolveContext() })
|
|
392
|
+
!e.context && this.deps.resolveContext && (e.context = { ...await this.deps.resolveContext() }), this.syncAttempts++;
|
|
366
393
|
let n = await this.deps.sendSync({
|
|
367
394
|
...e.context ? { context: e.context } : {},
|
|
368
395
|
...e.events.length ? { events: e.events.map((e) => e.record) } : {},
|
|
369
396
|
...e.interaction ? { interaction: e.interaction } : {}
|
|
370
|
-
},
|
|
397
|
+
}, y({
|
|
371
398
|
signal: t,
|
|
372
399
|
...e.trigger === "forced-lifecycle" ? { keepalive: !0 } : {}
|
|
373
400
|
}, {
|
|
@@ -382,13 +409,13 @@ var I = class {
|
|
|
382
409
|
}
|
|
383
410
|
async handleDecodedResponse(e, t, n) {
|
|
384
411
|
if (this.lastAttemptAccepted = e.accepted, this.clearRetryState(), this.applyServerPacing(e), e.accepted) {
|
|
385
|
-
this.acknowledgedContextRevision = Math.max(this.acknowledgedContextRevision, t.contextRevision);
|
|
412
|
+
this.acceptedEvents += t.events.length, this.acknowledgedContextRevision = Math.max(this.acknowledgedContextRevision, t.contextRevision);
|
|
386
413
|
let e = new Set(t.events.flatMap((e) => e.record.event_id ? [e.record.event_id] : []));
|
|
387
414
|
this.queuedEvents = this.queuedEvents.filter((t) => !t.record.event_id || !e.has(t.record.event_id));
|
|
388
415
|
}
|
|
389
416
|
if (e.accepted && t.interaction) {
|
|
390
417
|
let e = this.queuedInteractions.indexOf(t.interaction);
|
|
391
|
-
e >= 0 && this.queuedInteractions.splice(e, 1);
|
|
418
|
+
e >= 0 && (this.acceptedInteractions++, this.queuedInteractions.splice(e, 1));
|
|
392
419
|
}
|
|
393
420
|
if (await this.notifyResponse(e, t.events.length ? t.events[t.events.length - 1]?.tagEvent : void 0), !e.accepted) {
|
|
394
421
|
this.regularDueAt = null, this.urgentDueAt = null;
|
|
@@ -405,12 +432,12 @@ var I = class {
|
|
|
405
432
|
this.hasWork() && !this.manualFlushPromise && this.requestRegular();
|
|
406
433
|
}
|
|
407
434
|
handleFailure(e, t) {
|
|
408
|
-
if (this.lastAttemptAccepted = !1, !
|
|
435
|
+
if (this.lastAttemptAccepted = !1, !F(e)) {
|
|
409
436
|
this.retrySnapshot = null, this.automaticRetrySuspended = !0, this.regularDueAt = null, this.reportError(e);
|
|
410
437
|
return;
|
|
411
438
|
}
|
|
412
|
-
this.failureStreak += 1, t.attempt = Math.min(t.attempt + 1, 1e3), t.retryReason =
|
|
413
|
-
let n =
|
|
439
|
+
this.failureStreak += 1, t.attempt = Math.min(t.attempt + 1, 1e3), t.retryReason = L(e), this.retrySnapshot = t;
|
|
440
|
+
let n = I(e), r = Math.min(this.retryIntervalMs * 2 ** (this.failureStreak - 1), M) * (.5 + Math.random() * .5), i = Math.max(r, n ?? 0);
|
|
414
441
|
this.retryUntil = Date.now() + i, this.regularDueAt = this.retryUntil, t.trigger !== "regular" && (this.pendingForcedRetry = t.trigger), this.failureStreak === 1 && this.reportError(e);
|
|
415
442
|
}
|
|
416
443
|
clearRetryState() {
|
|
@@ -471,7 +498,7 @@ var I = class {
|
|
|
471
498
|
}
|
|
472
499
|
this.pendingForcedRetry = null, this.beginAttempt(t);
|
|
473
500
|
}
|
|
474
|
-
}, Math.min(Math.max(e - Date.now(), 0),
|
|
501
|
+
}, Math.min(Math.max(e - Date.now(), 0), N)));
|
|
475
502
|
}
|
|
476
503
|
clearTimer() {
|
|
477
504
|
this.timerId !== null && (clearTimeout(this.timerId), this.timerId = null), this.timerDueAt = null;
|
|
@@ -533,21 +560,22 @@ var I = class {
|
|
|
533
560
|
};
|
|
534
561
|
//#endregion
|
|
535
562
|
//#region src/core/create-sideband-runtime.ts
|
|
536
|
-
function
|
|
537
|
-
|
|
563
|
+
function z(e) {
|
|
564
|
+
m(e.appVersion);
|
|
565
|
+
let t = B(e.onError), n = f(e.appVersion, e.context, e.libraryVersion), r = async () => {
|
|
538
566
|
let e = await n();
|
|
539
567
|
return t === null ? e : {
|
|
540
568
|
...e,
|
|
541
569
|
user_id: t
|
|
542
570
|
};
|
|
543
|
-
}, i =
|
|
571
|
+
}, i = E({
|
|
544
572
|
baseUrl: e.baseUrl,
|
|
545
573
|
syncEndpoint: e.syncEndpoint,
|
|
546
574
|
apiKey: e.apiKey,
|
|
547
575
|
context: r,
|
|
548
576
|
headers: e.headers,
|
|
549
577
|
fetch: e.fetch
|
|
550
|
-
}), a = new
|
|
578
|
+
}), a = new R({
|
|
551
579
|
sendSync: (e, t) => i.sync(e, t),
|
|
552
580
|
resolveContext: r,
|
|
553
581
|
onSyncResponse: e.onSyncResponse,
|
|
@@ -558,11 +586,16 @@ function L(e) {
|
|
|
558
586
|
retryIntervalSeconds: e.retryIntervalSeconds,
|
|
559
587
|
maxQueuedEvents: e.maxQueuedEvents,
|
|
560
588
|
maxServerPacingSeconds: e.maxServerPacingSeconds
|
|
561
|
-
}), o = (
|
|
562
|
-
|
|
563
|
-
|
|
589
|
+
}), o = (n) => {
|
|
590
|
+
if (n !== null && g(n)) {
|
|
591
|
+
e.onError?.(/* @__PURE__ */ Error("Sideband.tagUser rejected a user ID longer than 256 characters."));
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = t;
|
|
595
|
+
t = n, n === null ? d() : u(n), a.tagUser(i, n, r);
|
|
564
596
|
};
|
|
565
597
|
return {
|
|
598
|
+
getDeliveryStatus: () => a.getDeliveryStatus(),
|
|
566
599
|
start: () => a.start(),
|
|
567
600
|
track: (e, t, n) => {
|
|
568
601
|
a.track(e, t, n);
|
|
@@ -579,9 +612,13 @@ function L(e) {
|
|
|
579
612
|
destroy: () => a.destroy()
|
|
580
613
|
};
|
|
581
614
|
}
|
|
615
|
+
function B(e) {
|
|
616
|
+
let t = l();
|
|
617
|
+
return t === null || !g(t) ? t : (d(), e?.(/* @__PURE__ */ Error("Sideband cleared a stored user ID longer than 256 characters.")), null);
|
|
618
|
+
}
|
|
582
619
|
//#endregion
|
|
583
620
|
//#region src/core/snackbar-presentation.ts
|
|
584
|
-
function
|
|
621
|
+
function ue(e) {
|
|
585
622
|
if (!e || typeof e != "object") return !1;
|
|
586
623
|
let t = e;
|
|
587
624
|
return [
|
|
@@ -595,22 +632,22 @@ function R(e) {
|
|
|
595
632
|
return typeof r == "number" && Number.isFinite(r) && typeof i == "number" && Number.isFinite(i) && (e !== "offset" || Number.isInteger(r) && Number.isInteger(i));
|
|
596
633
|
});
|
|
597
634
|
}
|
|
598
|
-
function
|
|
635
|
+
function V(e, t) {
|
|
599
636
|
return {
|
|
600
637
|
imageUrl: e.imageUrl ?? t?.imageUrl,
|
|
601
|
-
placement:
|
|
638
|
+
placement: ue(e.placement) ? e.placement : t?.placement
|
|
602
639
|
};
|
|
603
640
|
}
|
|
604
641
|
//#endregion
|
|
605
642
|
//#region src/core/survey-session-store.ts
|
|
606
|
-
var
|
|
643
|
+
var H = {
|
|
607
644
|
destroyed: !1,
|
|
608
645
|
state: null
|
|
609
|
-
},
|
|
610
|
-
function
|
|
646
|
+
}, U = 0;
|
|
647
|
+
function de(e) {
|
|
611
648
|
return e.fab?.title ?? e.title;
|
|
612
649
|
}
|
|
613
|
-
function
|
|
650
|
+
function fe(e) {
|
|
614
651
|
return e.id;
|
|
615
652
|
}
|
|
616
653
|
function W(e) {
|
|
@@ -672,8 +709,8 @@ function $(e, t) {
|
|
|
672
709
|
}
|
|
673
710
|
return e.next_node_id ?? null;
|
|
674
711
|
}
|
|
675
|
-
var
|
|
676
|
-
snapshot =
|
|
712
|
+
var pe = class {
|
|
713
|
+
snapshot = H;
|
|
677
714
|
listeners = /* @__PURE__ */ new Set();
|
|
678
715
|
deps;
|
|
679
716
|
fabTimeoutId = null;
|
|
@@ -693,7 +730,7 @@ var le = class {
|
|
|
693
730
|
return this.snapshot;
|
|
694
731
|
}
|
|
695
732
|
getServerSnapshot() {
|
|
696
|
-
return
|
|
733
|
+
return H;
|
|
697
734
|
}
|
|
698
735
|
subscribe(e) {
|
|
699
736
|
return this.destroyed ? () => {} : (this.listeners.add(e), () => this.listeners.delete(e));
|
|
@@ -779,16 +816,20 @@ var le = class {
|
|
|
779
816
|
return r ? (this.reportError(Error(r)), !1) : (this.decisionGeneration += 1, this.beginPulse(e, t, n), !0);
|
|
780
817
|
}
|
|
781
818
|
beginPulse(e, t, n) {
|
|
782
|
-
let r = K(e, e.root_node_id), i = q(e, e.root_node_id), a =
|
|
819
|
+
let r = K(e, e.root_node_id), i = q(e, e.root_node_id), a = e.sentimentPresentation === "toolbar", o = e.sentimentPresentation === void 0 ? r?.isSnackBar === !0 || r?.isSnackBar !== !1 && t === "snackbar" && !!e.fab : e.sentimentPresentation === "snackbar", s = (a || o) && r?.type === "yes_no" && r.answers?.length === 2 && !r.answers.some(J);
|
|
783
820
|
this.clearSurveyTransitionTimeouts(), this.publish({
|
|
784
|
-
presentationId: ++
|
|
821
|
+
presentationId: ++U,
|
|
822
|
+
sentimentPresentation: s ? a ? "bar" : "snackbar" : "sheet",
|
|
823
|
+
barPosition: "bottom",
|
|
824
|
+
barBehavior: "dismiss",
|
|
785
825
|
isSimulated: n,
|
|
786
|
-
snackbar:
|
|
826
|
+
snackbar: s ? {
|
|
787
827
|
phase: "question",
|
|
788
828
|
selectedKey: null,
|
|
789
829
|
startedAt: null,
|
|
790
830
|
deadline: null,
|
|
791
|
-
frozenFraction: null
|
|
831
|
+
frozenFraction: null,
|
|
832
|
+
pausedRemainingMs: null
|
|
792
833
|
} : null,
|
|
793
834
|
survey: e,
|
|
794
835
|
answers: {},
|
|
@@ -796,8 +837,8 @@ var le = class {
|
|
|
796
837
|
currentNodeId: r?.node_id ?? null,
|
|
797
838
|
completion: i,
|
|
798
839
|
history: r ? [r.node_id] : [],
|
|
799
|
-
fabState: e.fab ||
|
|
800
|
-
isOpen: !e.fab && !
|
|
840
|
+
fabState: e.fab || s ? "expanded" : "hidden",
|
|
841
|
+
isOpen: !e.fab && !s || !!i,
|
|
801
842
|
isBusy: !1,
|
|
802
843
|
sentimentSelectionLocked: !1,
|
|
803
844
|
isCompleting: !1,
|
|
@@ -815,7 +856,13 @@ var le = class {
|
|
|
815
856
|
}
|
|
816
857
|
async closeSurvey() {
|
|
817
858
|
let e = this.snapshot.state;
|
|
818
|
-
!e || e.isBusy
|
|
859
|
+
if (!(!e || e.isBusy)) {
|
|
860
|
+
if (this.clearSurveyTransitionTimeouts(), e.sentimentPresentation === "bar" && e.barBehavior === "dismiss" && Object.keys(e.answers).length > 0) {
|
|
861
|
+
await this.completeTerminal(e, e.answers);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
await this.dismiss(e);
|
|
865
|
+
}
|
|
819
866
|
}
|
|
820
867
|
async selectChoice(e) {
|
|
821
868
|
let t = this.snapshot.state, n = this.currentQuestion();
|
|
@@ -907,7 +954,7 @@ var le = class {
|
|
|
907
954
|
let s = {
|
|
908
955
|
answer_key: a.id,
|
|
909
956
|
answered_at: new Date(o).toISOString()
|
|
910
|
-
}, c = r.deadline !== null && r.startedAt !== null ? Math.max(0, Math.min(1, (r.deadline - o) / Math.max(1, r.deadline - r.startedAt))) : 1;
|
|
957
|
+
}, c = r.pausedRemainingMs === null ? r.deadline !== null && r.startedAt !== null ? Math.max(0, Math.min(1, (r.deadline - o) / Math.max(1, r.deadline - r.startedAt))) : 1 : r.pausedRemainingMs / Math.max(1, n.survey.fab?.expandedTimeout ?? 1), l = n.sentimentPresentation === "bar" && n.barBehavior === "dismiss";
|
|
911
958
|
return this.publish({
|
|
912
959
|
...n,
|
|
913
960
|
answers: {
|
|
@@ -924,21 +971,59 @@ var le = class {
|
|
|
924
971
|
phase: "feedback",
|
|
925
972
|
selectedKey: a.id,
|
|
926
973
|
deadline: null,
|
|
927
|
-
frozenFraction: c
|
|
974
|
+
frozenFraction: c,
|
|
975
|
+
pausedRemainingMs: null
|
|
928
976
|
}
|
|
929
977
|
}, "transition"), this.sentimentAdvanceTimeoutId = setTimeout(() => {
|
|
930
978
|
this.sentimentAdvanceTimeoutId = null;
|
|
931
979
|
let t = this.snapshot.state;
|
|
932
|
-
t?.presentationId !== e || t.snackbar?.phase !== "feedback"
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
snackbar: {
|
|
937
|
-
...t.snackbar,
|
|
938
|
-
phase: "awaitingReady"
|
|
980
|
+
if (!(t?.presentationId !== e || t.snackbar?.phase !== "feedback")) {
|
|
981
|
+
if (l) {
|
|
982
|
+
this.completeTerminal(t, t.answers);
|
|
983
|
+
return;
|
|
939
984
|
}
|
|
940
|
-
|
|
941
|
-
|
|
985
|
+
this.publish({
|
|
986
|
+
...t,
|
|
987
|
+
isOpen: !0,
|
|
988
|
+
fabState: "hidden",
|
|
989
|
+
snackbar: {
|
|
990
|
+
...t.snackbar,
|
|
991
|
+
phase: "awaitingReady"
|
|
992
|
+
}
|
|
993
|
+
}, "transition");
|
|
994
|
+
}
|
|
995
|
+
}, l ? 3e3 : 500), !0;
|
|
996
|
+
}
|
|
997
|
+
setBarTimerPaused(e, t) {
|
|
998
|
+
let n = this.snapshot.state, r = n?.snackbar, i = n?.survey.fab?.expandedTimeout;
|
|
999
|
+
if (!(!n || n.presentationId !== e || n.sentimentPresentation !== "bar" || !r || r.phase !== "question" || typeof i != "number" || !Number.isFinite(i) || i <= 0)) {
|
|
1000
|
+
if (t && r.deadline !== null) {
|
|
1001
|
+
let e = Math.max(0, r.deadline - Date.now());
|
|
1002
|
+
if (e === 0) {
|
|
1003
|
+
this.closeSurvey();
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
this.publish({
|
|
1007
|
+
...n,
|
|
1008
|
+
snackbar: {
|
|
1009
|
+
...r,
|
|
1010
|
+
deadline: null,
|
|
1011
|
+
pausedRemainingMs: e
|
|
1012
|
+
}
|
|
1013
|
+
}, "transition");
|
|
1014
|
+
} else if (!t && r.pausedRemainingMs !== null) {
|
|
1015
|
+
let e = Date.now() + r.pausedRemainingMs;
|
|
1016
|
+
this.publish({
|
|
1017
|
+
...n,
|
|
1018
|
+
snackbar: {
|
|
1019
|
+
...r,
|
|
1020
|
+
deadline: e,
|
|
1021
|
+
startedAt: e - i,
|
|
1022
|
+
pausedRemainingMs: null
|
|
1023
|
+
}
|
|
1024
|
+
}, "transition");
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
942
1027
|
}
|
|
943
1028
|
confirmSnackbarContentReady(e) {
|
|
944
1029
|
let t = this.snapshot.state, n = this.currentQuestion();
|
|
@@ -1129,7 +1214,7 @@ var le = class {
|
|
|
1129
1214
|
}));
|
|
1130
1215
|
}
|
|
1131
1216
|
scheduleFabTimeout(e) {
|
|
1132
|
-
if (this.clearFabTimeout(), !e || e.fabState !== "expanded" || !e.presentationConfirmed || !e.fabEntranceCompleted || e.snackbar && e.snackbar.phase !== "question") return;
|
|
1217
|
+
if (this.clearFabTimeout(), !e || e.fabState !== "expanded" || !e.presentationConfirmed || !e.fabEntranceCompleted || e.snackbar && e.snackbar.phase !== "question" || e.snackbar?.pausedRemainingMs != null) return;
|
|
1133
1218
|
let t = e.survey.fab?.expandedTimeout;
|
|
1134
1219
|
if (typeof t != "number" || !Number.isFinite(t) || t < 0) return;
|
|
1135
1220
|
let n = W(e.survey);
|
|
@@ -1191,4 +1276,4 @@ var le = class {
|
|
|
1191
1276
|
}
|
|
1192
1277
|
};
|
|
1193
1278
|
//#endregion
|
|
1194
|
-
export {
|
|
1279
|
+
export { T as SidebandApiError, pe as SurveySessionStore, R as SyncEngine, de as buildFabTitle, f as createContextResolver, E as createSidebandClient, z as createSidebandRuntime, fe as getChoiceValue, s as getDeviceId, c as getSessionId, Y as isPositiveSentimentChoice, J as isSystemOtherChoice, V as resolveSnackbarPresentation };
|
package/dist/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type ClientContext = {
|
|
|
11
11
|
device_id: string;
|
|
12
12
|
user_id?: string;
|
|
13
13
|
platform: Platform;
|
|
14
|
-
app_version
|
|
14
|
+
app_version: string;
|
|
15
15
|
locale?: string;
|
|
16
16
|
language?: string;
|
|
17
17
|
session_id?: string;
|
|
@@ -62,6 +62,8 @@ export type Pulse = {
|
|
|
62
62
|
completions: Record<string, PulseCompletion>;
|
|
63
63
|
theme: Theme;
|
|
64
64
|
fab: Fab | null;
|
|
65
|
+
/** Overrides root isSnackBar; absent values preserve existing FAB/sheet behavior. */
|
|
66
|
+
sentimentPresentation?: SentimentPresentation;
|
|
65
67
|
};
|
|
66
68
|
export type PulseQuestion = {
|
|
67
69
|
node_id: string;
|
|
@@ -107,11 +109,15 @@ export type Fab = {
|
|
|
107
109
|
timerStyle: TimerStyle;
|
|
108
110
|
};
|
|
109
111
|
export type TimerStyle = 'none' | 'bar' | 'fill';
|
|
110
|
-
/**
|
|
111
|
-
export type SentimentPresentation = 'sheet' | 'snackbar';
|
|
112
|
-
export type
|
|
112
|
+
/** Initial sentiment presentation from the PendingPulse API. */
|
|
113
|
+
export type SentimentPresentation = 'sheet' | 'snackbar' | 'toolbar';
|
|
114
|
+
export type BarPosition = 'bottom' | 'top';
|
|
115
|
+
export type BarBehavior = 'dismiss' | 'follow-up';
|
|
116
|
+
export type SentimentPresentationOptions = {
|
|
117
|
+
sentimentPresentation?: 'sheet' | 'snackbar';
|
|
118
|
+
};
|
|
119
|
+
export type SimulatedPulseDefinition = SentimentPresentationOptions & {
|
|
113
120
|
pulse: Pulse;
|
|
114
|
-
sentimentPresentation?: SentimentPresentation;
|
|
115
121
|
};
|
|
116
122
|
export type FabPlacement = {
|
|
117
123
|
position: FabPoint;
|
|
@@ -195,7 +201,7 @@ export type SidebandCoreConfig = {
|
|
|
195
201
|
baseUrl?: string;
|
|
196
202
|
syncEndpoint?: SyncEndpoint;
|
|
197
203
|
apiKey: string;
|
|
198
|
-
appVersion
|
|
204
|
+
appVersion: string;
|
|
199
205
|
context?: Partial<ClientContext> | (() => Partial<ClientContext> | Promise<Partial<ClientContext>>);
|
|
200
206
|
headers?: SidebandClientConfig['headers'];
|
|
201
207
|
fetch?: typeof fetch;
|
|
@@ -220,6 +226,16 @@ export type SidebandRuntimeConfig = SidebandCoreConfig & {
|
|
|
220
226
|
onSyncResponse?: (response: SyncResponse, event?: TrackedEvent) => void | Promise<void>;
|
|
221
227
|
};
|
|
222
228
|
export type SidebandRuntime = {
|
|
229
|
+
getDeliveryStatus: () => {
|
|
230
|
+
acceptedEvents: number;
|
|
231
|
+
acceptedInteractions: number;
|
|
232
|
+
syncAttempts: number;
|
|
233
|
+
pendingEvents: number;
|
|
234
|
+
pendingInteractions: number;
|
|
235
|
+
hasPendingContext: boolean;
|
|
236
|
+
isSyncing: boolean;
|
|
237
|
+
isTerminal: boolean;
|
|
238
|
+
};
|
|
223
239
|
start: () => void;
|
|
224
240
|
track: (eventName: string, metadata?: EventMetadata, options?: TrackOptions) => void;
|
|
225
241
|
tagUser: (userId: string) => void;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;AAEnD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,GAAG,CAAA;CACV,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,QAAQ,CAAA;IAClB,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAA;AAEhD,MAAM,MA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