@fixback/expo 0.1.0 → 0.3.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.
- package/README.md +72 -8
- package/dist/FeedbackModal.d.ts +10 -2
- package/dist/FeedbackModal.js +84 -36
- package/dist/FeedbackModal.js.map +1 -0
- package/dist/FixbackProvider.d.ts +12 -0
- package/dist/FixbackProvider.js +46 -23
- package/dist/FixbackProvider.js.map +1 -0
- package/dist/adapters.js +73 -23
- package/dist/adapters.js.map +1 -0
- package/dist/breadcrumbs.d.ts +21 -222
- package/dist/breadcrumbs.js +45 -605
- package/dist/breadcrumbs.js.map +1 -0
- package/dist/client.d.ts +65 -67
- package/dist/client.js +288 -151
- package/dist/client.js.map +1 -0
- package/dist/connect.d.ts +60 -0
- package/dist/connect.js +63 -0
- package/dist/connect.js.map +1 -0
- package/dist/error-capture.d.ts +29 -79
- package/dist/error-capture.js +77 -295
- package/dist/error-capture.js.map +1 -0
- package/dist/http.d.ts +10 -25
- package/dist/http.js +15 -12
- package/dist/http.js.map +1 -0
- package/dist/identity.d.ts +11 -11
- package/dist/identity.js +23 -28
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -0
- package/dist/origin.d.ts +21 -0
- package/dist/origin.js +45 -0
- package/dist/origin.js.map +1 -0
- package/dist/package.json +3 -0
- package/dist/report.d.ts +28 -63
- package/dist/report.js +33 -25
- package/dist/report.js.map +1 -0
- package/dist/reporter-session-store.d.ts +27 -0
- package/dist/reporter-session-store.js +53 -0
- package/dist/reporter-session-store.js.map +1 -0
- package/dist/shake.d.ts +26 -0
- package/dist/shake.js +32 -7
- package/dist/shake.js.map +1 -0
- package/dist/submit.d.ts +24 -15
- package/dist/submit.js +30 -47
- package/dist/submit.js.map +1 -0
- package/dist/tokens.js +5 -1
- package/dist/tokens.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +5 -1
- package/dist/version.js.map +1 -0
- package/package.json +14 -7
- package/dist/auto-report-backoff.d.ts +0 -42
- package/dist/auto-report-backoff.js +0 -67
- package/dist/boot.d.ts +0 -65
- package/dist/boot.js +0 -60
- package/dist/scrub.d.ts +0 -55
- package/dist/scrub.js +0 -184
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../src/breadcrumbs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;AAyBH,sCAGC;AAoBD,8BAGC;AAkCD,sCAmFC;AAuBD,sDA+BC;AA5ND,gDAc2B;AAI3B,SAAS,IAAI;IACX,uBAAuB;AACzB,CAAC;AAED,qDAAqD;AACrD,SAAgB,aAAa;IAC3B,MAAM,CAAC,GAAG,UAAuC,CAAC;IAClD,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5E,CAAC;AAmBD,4DAA4D;AAC5D,SAAgB,SAAS;IACvB,MAAM,CAAC,GAAG,UAAiD,CAAC;IAC5D,OAAO,OAAO,CAAC,CAAC,cAAc,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC;AAMD,0FAA0F;AAC1F,SAAS,aAAa,CAAC,GAAgB,EAAE,IAAY;IACnD,IAAI,CAAC;QACH,OAAO,OAAO,GAAG,CAAC,iBAAiB,KAAK,UAAU;YAChD,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAC7B,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,uFAAuF;AACvF,SAAS,iBAAiB,CAAC,GAAgB;IACzC,IAAI,CAAC;QACH,OAAO,GAAG,C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AAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAO,CAAC;IACrC,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,KAAK,KAAK,CAAC;IACxD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,KAAK,KAAK,CAAC;IAExD,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,IAAI,UAAU,IAAI,cAAc,EAAE,CAAC;QACjC,SAAS,CAAC,IAAI,CAAC,IAAA,4BAAiB,EAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,cAAc,EAAE,CAAC;QACnB,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,QAAQ,EAAE,CAAC;YACb,CAAC;YAAC,MAAM,CAAC;gBACP,6BAA6B;YAC/B,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -8,39 +8,35 @@
|
|
|
8
8
|
* (`FixbackProvider`) is a thin shell over this: it feeds accelerometer
|
|
9
9
|
* samples, listens for `present` events, and renders the composer.
|
|
10
10
|
*
|
|
11
|
+
* `start()` is deliberately three named steps — {@link FixbackOptions} validation,
|
|
12
|
+
* `resolveIdentity`, then `armCapture` — rather than one long procedure, so the
|
|
13
|
+
* lifecycle reads as what it is and each step is testable on its own.
|
|
14
|
+
*
|
|
11
15
|
* Every platform touchpoint is an injected adapter (`FixbackAdapters`), so the
|
|
12
16
|
* whole orchestration is unit-tested without React Native. Every path is
|
|
13
17
|
* defensive: a Fixback problem leaves the host app untouched — `start` resolves
|
|
14
18
|
* to a `disabled` client instead of throwing.
|
|
15
19
|
*/
|
|
16
|
-
import { type BootAnswer } from "
|
|
17
|
-
import { type
|
|
20
|
+
import { type BootAnswer, type CaptureToggles, type CommonCaptureInitOptions, DEFAULT_API_URL, type FetchLike, type IdentityInputs, type ReporterIdentity } from "@fixback/sdk-core";
|
|
21
|
+
import { type ConsoleLike, type XhrConstructor } from "./breadcrumbs";
|
|
22
|
+
import { type OpenAuthSession } from "./connect";
|
|
23
|
+
import { type SecureStorageLike } from "./reporter-session-store";
|
|
18
24
|
import { type AppStateLike, type ErrorUtilsLike } from "./error-capture";
|
|
19
|
-
import type {
|
|
25
|
+
import type { FormDataFactory } from "./http";
|
|
20
26
|
import { type StorageLike } from "./identity";
|
|
27
|
+
import { canonicalizeOrigin } from "./origin";
|
|
21
28
|
import { type EnvironmentInputs } from "./report";
|
|
22
|
-
import { type
|
|
23
|
-
import { type ShakeTuning } from "./shake";
|
|
29
|
+
import { type ResolvedShakeConfig, type ShakeOptions } from "./shake";
|
|
24
30
|
import { type ScreenshotFile, type SubmitResult } from "./submit";
|
|
25
|
-
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* The accelerometer update interval to request, in ms. Defaults to
|
|
35
|
-
* {@link DEFAULT_SHAKE_SAMPLE_INTERVAL_MS}. The interval is global to the
|
|
36
|
-
* sensor in `expo-sensors` — the SDK only sets it when no other listener is
|
|
37
|
-
* registered, and apps that drive the accelerometer themselves should align
|
|
38
|
-
* this with their own setting.
|
|
39
|
-
*/
|
|
40
|
-
readonly sampleIntervalMs?: number;
|
|
41
|
-
}
|
|
42
|
-
/** Everything `FixbackProvider` / `createFixbackClient` accepts. */
|
|
43
|
-
export interface FixbackOptions {
|
|
31
|
+
export { DEFAULT_API_URL };
|
|
32
|
+
export { canonicalizeOrigin };
|
|
33
|
+
export { DEFAULT_SHAKE_SAMPLE_INTERVAL_MS, type ResolvedShakeConfig, type ShakeOptions, } from "./shake";
|
|
34
|
+
/**
|
|
35
|
+
* Everything `FixbackProvider` / `createFixbackClient` accepts: the shared init
|
|
36
|
+
* vocabulary (`apiUrl`, `release`, `environment`, `enabled`, `scrub`, `beforeSend`,
|
|
37
|
+
* `beforeBreadcrumb`, `capture`) plus what only a React Native app has.
|
|
38
|
+
*/
|
|
39
|
+
export interface FixbackOptions extends CommonCaptureInitOptions, IdentityInputs {
|
|
44
40
|
/** The Project's publishable key. Required. */
|
|
45
41
|
readonly key: string;
|
|
46
42
|
/**
|
|
@@ -49,32 +45,29 @@ export interface FixbackOptions {
|
|
|
49
45
|
* Project — e.g. `https://com.acme.myapp` or the product's web origin.
|
|
50
46
|
*/
|
|
51
47
|
readonly origin: string;
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
readonly
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
/** Automatic error capture. Defaults to `true` (ADR-0011). */
|
|
48
|
+
/**
|
|
49
|
+
* Where the platform's connect page returns after a Connect (ADR-0032; ticket #251)
|
|
50
|
+
* — a scheme (`myapp://fixback-connect`) or universal link the app handles, declared
|
|
51
|
+
* once here and passed to the in-app auth session. Its origin must be allowlisted on
|
|
52
|
+
* the Project (the server validates the return URL). Without it, `signIn` stays a
|
|
53
|
+
* no-op — a report still files anonymously where the Gate allows.
|
|
54
|
+
*/
|
|
55
|
+
readonly returnUrl?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Automatic error capture — the SDK files uncaught JS errors as `source: error`
|
|
58
|
+
* Feedback with no prompt (spec 0004 §E, ADR-0011). Defaults to `true`; set
|
|
59
|
+
* `false` for the per-project toggle that turns it off. It is gated by boot's
|
|
60
|
+
* `canSubmit` either way, so an auto-error is never filed where a manual report
|
|
61
|
+
* would be refused.
|
|
62
|
+
*/
|
|
69
63
|
readonly autoCapture?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Per-stream capture toggles; unset streams follow the boot answer. Session
|
|
66
|
+
* replay is web-only, so only the two mobile streams are accepted here.
|
|
67
|
+
*/
|
|
68
|
+
readonly capture?: Omit<CaptureToggles, "replay">;
|
|
70
69
|
/** Capture a screenshot when the composer opens. Defaults to `true`. */
|
|
71
70
|
readonly screenshots?: boolean;
|
|
72
|
-
/** The per-project client scrub hook (spec 0003 §C). */
|
|
73
|
-
readonly beforeSend?: BeforeSend;
|
|
74
|
-
/** Run the built-in default scrubbers. Defaults to `true`. */
|
|
75
|
-
readonly scrub?: boolean;
|
|
76
|
-
/** A per-crumb filter for the trace buffer. */
|
|
77
|
-
readonly beforeBreadcrumb?: BeforeBreadcrumb | null;
|
|
78
71
|
/** Shake gesture tuning / off switch. */
|
|
79
72
|
readonly shake?: ShakeOptions;
|
|
80
73
|
}
|
|
@@ -85,6 +78,17 @@ export interface FixbackOptions {
|
|
|
85
78
|
export interface FixbackAdapters {
|
|
86
79
|
/** Anonymous-id persistence (AsyncStorage). Absent ⇒ ephemeral ids. */
|
|
87
80
|
readonly storage?: StorageLike | null;
|
|
81
|
+
/**
|
|
82
|
+
* Secure persistence for the Reporter session token after a Connect (SecureStore).
|
|
83
|
+
* Absent ⇒ no persisted session (Connect still works for this launch).
|
|
84
|
+
*/
|
|
85
|
+
readonly secureStore?: SecureStorageLike | null;
|
|
86
|
+
/**
|
|
87
|
+
* Opens the platform's connect page in an in-app auth session and resolves when it
|
|
88
|
+
* returns via the app's `returnUrl` (`expo-web-browser`). Absent ⇒ `signIn` is a
|
|
89
|
+
* no-op.
|
|
90
|
+
*/
|
|
91
|
+
readonly openAuthSession?: OpenAuthSession | null;
|
|
88
92
|
/** Reads the device environment (window size, OS description). */
|
|
89
93
|
readonly environment?: () => EnvironmentInputs;
|
|
90
94
|
/** Captures the current screen as a file reference; `null` on failure. */
|
|
@@ -100,7 +104,7 @@ export interface FixbackAdapters {
|
|
|
100
104
|
/** The `AppState` seam for occurrence flushes. */
|
|
101
105
|
readonly appState?: AppStateLike | null;
|
|
102
106
|
/** The transport seams. */
|
|
103
|
-
readonly
|
|
107
|
+
readonly fetch?: FetchLike;
|
|
104
108
|
readonly formData?: FormDataFactory;
|
|
105
109
|
/** A development-only warning sink (silent in production builds). */
|
|
106
110
|
readonly warn?: (message: string) => void;
|
|
@@ -119,11 +123,6 @@ export interface ComposerDraft {
|
|
|
119
123
|
/** The screenshot to attach (the presented one, unless removed). */
|
|
120
124
|
readonly screenshot?: ScreenshotFile | null;
|
|
121
125
|
}
|
|
122
|
-
/** The resolved shake configuration the provider arms the gesture with. */
|
|
123
|
-
export interface ResolvedShakeConfig extends ShakeTuning {
|
|
124
|
-
readonly enabled: boolean;
|
|
125
|
-
readonly sampleIntervalMs: number;
|
|
126
|
-
}
|
|
127
126
|
/** The headless client `FixbackProvider` drives. */
|
|
128
127
|
export interface FixbackClient {
|
|
129
128
|
/** Boot and arm capture. Idempotent; never throws. */
|
|
@@ -153,22 +152,21 @@ export interface FixbackClient {
|
|
|
153
152
|
discardScreenshot(screenshot: ScreenshotFile | null | undefined): void;
|
|
154
153
|
/** The resolved shake tuning for the provider to arm. */
|
|
155
154
|
shakeConfig(): ResolvedShakeConfig;
|
|
155
|
+
/**
|
|
156
|
+
* Start a **Connect** (ADR-0032): open the platform's connect page in an in-app auth
|
|
157
|
+
* session, bind the signed-in Account to this app as a Reporter session (stored in
|
|
158
|
+
* SecureStore), and re-boot — so a gated Project's shake gesture arms once the Account
|
|
159
|
+
* is eligible. Resolves to the resulting identity. Never throws.
|
|
160
|
+
*/
|
|
161
|
+
signIn(): Promise<ReporterIdentity>;
|
|
162
|
+
/** Clear the Reporter session — revoke it server-side, forget the token, re-boot. */
|
|
163
|
+
signOut(): Promise<void>;
|
|
164
|
+
/** The current Reporter identity — anonymous, or a connected Account with its tier. */
|
|
165
|
+
identity(): ReporterIdentity;
|
|
166
|
+
/** Subscribe to identity changes (boot, sign in, sign out). Returns an unsubscribe. */
|
|
167
|
+
onIdentity(listener: (identity: ReporterIdentity) => void): () => void;
|
|
156
168
|
/** Tear down every hook. Safe to call repeatedly. */
|
|
157
169
|
destroy(): void;
|
|
158
170
|
}
|
|
159
|
-
/**
|
|
160
|
-
* Canonicalize the configured origin exactly as the server's `normalizeOrigin`
|
|
161
|
-
* does when an allowlist entry is stored (`apps/api/src/projects/origin.ts`):
|
|
162
|
-
* lowercase the scheme and host, elide default ports, and drop any userinfo,
|
|
163
|
-
* path, query, or fragment. The server compares the `Origin` header by exact
|
|
164
|
-
* string equality against those canonical rows — on the web the browser
|
|
165
|
-
* serializes the header, but here the SDK is the serializer, so without this a
|
|
166
|
-
* pasted `https://com.acme.MyApp` (bundle ids legally carry uppercase) would
|
|
167
|
-
* silently never match its own allowlist entry. Implemented without `URL`
|
|
168
|
-
* (React Native's polyfill is partial); a value that doesn't parse as an
|
|
169
|
-
* http(s) origin is kept trimmed — boot will simply refuse it. IDN hosts are
|
|
170
|
-
* not punycoded (the one divergence from the server; use the encoded form).
|
|
171
|
-
*/
|
|
172
|
-
export declare function canonicalizeOrigin(value: string): string;
|
|
173
171
|
/** Create the headless client. See the module doc. */
|
|
174
172
|
export declare function createFixbackClient(options: FixbackOptions, adapters?: FixbackAdapters): FixbackClient;
|