@dads-framework/client 0.0.0-stage → 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.
Files changed (144) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +69 -2
  3. package/dist/client.tsbuildinfo +1 -0
  4. package/dist/index.d.ts +15 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +14 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/lib/access-refusal.d.ts +8 -0
  9. package/dist/lib/access-refusal.d.ts.map +1 -0
  10. package/dist/lib/access-refusal.js +11 -0
  11. package/dist/lib/access-refusal.js.map +1 -0
  12. package/dist/lib/api-error.d.ts +86 -0
  13. package/dist/lib/api-error.d.ts.map +1 -0
  14. package/dist/lib/api-error.js +124 -0
  15. package/dist/lib/api-error.js.map +1 -0
  16. package/dist/lib/api-exchange-channel.d.ts +47 -0
  17. package/dist/lib/api-exchange-channel.d.ts.map +1 -0
  18. package/dist/lib/api-exchange-channel.js +43 -0
  19. package/dist/lib/api-exchange-channel.js.map +1 -0
  20. package/dist/lib/api-verbs.d.ts +115 -0
  21. package/dist/lib/api-verbs.d.ts.map +1 -0
  22. package/dist/lib/api-verbs.js +150 -0
  23. package/dist/lib/api-verbs.js.map +1 -0
  24. package/dist/lib/build-client-context.d.ts +44 -0
  25. package/dist/lib/build-client-context.d.ts.map +1 -0
  26. package/dist/lib/build-client-context.js +74 -0
  27. package/dist/lib/build-client-context.js.map +1 -0
  28. package/dist/lib/client-context.d.ts +32 -0
  29. package/dist/lib/client-context.d.ts.map +1 -0
  30. package/dist/lib/client-context.js +33 -0
  31. package/dist/lib/client-context.js.map +1 -0
  32. package/dist/lib/create-request-id.d.ts +14 -0
  33. package/dist/lib/create-request-id.d.ts.map +1 -0
  34. package/dist/lib/create-request-id.js +31 -0
  35. package/dist/lib/create-request-id.js.map +1 -0
  36. package/dist/lib/failure-presentation.d.ts +21 -0
  37. package/dist/lib/failure-presentation.d.ts.map +1 -0
  38. package/dist/lib/failure-presentation.js +12 -0
  39. package/dist/lib/failure-presentation.js.map +1 -0
  40. package/dist/lib/optimistic-cache.d.ts +84 -0
  41. package/dist/lib/optimistic-cache.d.ts.map +1 -0
  42. package/dist/lib/optimistic-cache.js +119 -0
  43. package/dist/lib/optimistic-cache.js.map +1 -0
  44. package/dist/lib/read-client-environment.d.ts +67 -0
  45. package/dist/lib/read-client-environment.d.ts.map +1 -0
  46. package/dist/lib/read-client-environment.js +85 -0
  47. package/dist/lib/read-client-environment.js.map +1 -0
  48. package/dist/lib/request-locale.d.ts +6 -0
  49. package/dist/lib/request-locale.d.ts.map +1 -0
  50. package/dist/lib/request-locale.js +31 -0
  51. package/dist/lib/request-locale.js.map +1 -0
  52. package/dist/lib/request-metadata.d.ts +22 -0
  53. package/dist/lib/request-metadata.d.ts.map +1 -0
  54. package/dist/lib/request-metadata.js +26 -0
  55. package/dist/lib/request-metadata.js.map +1 -0
  56. package/dist/lib/save-with-refresh.d.ts +13 -0
  57. package/dist/lib/save-with-refresh.d.ts.map +1 -0
  58. package/dist/lib/save-with-refresh.js +18 -0
  59. package/dist/lib/save-with-refresh.js.map +1 -0
  60. package/dist/lib/search-params.d.ts +11 -0
  61. package/dist/lib/search-params.d.ts.map +1 -0
  62. package/dist/lib/search-params.js +41 -0
  63. package/dist/lib/search-params.js.map +1 -0
  64. package/dist/lib/send-api-request.d.ts +24 -0
  65. package/dist/lib/send-api-request.d.ts.map +1 -0
  66. package/dist/lib/send-api-request.js +100 -0
  67. package/dist/lib/send-api-request.js.map +1 -0
  68. package/dist/lib/signed-url-upload.d.ts +18 -0
  69. package/dist/lib/signed-url-upload.d.ts.map +1 -0
  70. package/dist/lib/signed-url-upload.js +26 -0
  71. package/dist/lib/signed-url-upload.js.map +1 -0
  72. package/dist/lib/unauthorized-response-channel.d.ts +30 -0
  73. package/dist/lib/unauthorized-response-channel.d.ts.map +1 -0
  74. package/dist/lib/unauthorized-response-channel.js +38 -0
  75. package/dist/lib/unauthorized-response-channel.js.map +1 -0
  76. package/dist/telemetry/core/index.d.ts +3 -0
  77. package/dist/telemetry/core/index.d.ts.map +1 -0
  78. package/dist/telemetry/core/index.js +3 -0
  79. package/dist/telemetry/core/index.js.map +1 -0
  80. package/dist/telemetry/core/lib/client-telemetry-conformance.d.ts +13 -0
  81. package/dist/telemetry/core/lib/client-telemetry-conformance.d.ts.map +1 -0
  82. package/dist/telemetry/core/lib/client-telemetry-conformance.js +38 -0
  83. package/dist/telemetry/core/lib/client-telemetry-conformance.js.map +1 -0
  84. package/dist/telemetry/core/lib/client-telemetry.d.ts +48 -0
  85. package/dist/telemetry/core/lib/client-telemetry.d.ts.map +1 -0
  86. package/dist/telemetry/core/lib/client-telemetry.js +26 -0
  87. package/dist/telemetry/core/lib/client-telemetry.js.map +1 -0
  88. package/dist/telemetry/core/lib/in-memory-client-telemetry.d.ts +20 -0
  89. package/dist/telemetry/core/lib/in-memory-client-telemetry.d.ts.map +1 -0
  90. package/dist/telemetry/core/lib/in-memory-client-telemetry.js +23 -0
  91. package/dist/telemetry/core/lib/in-memory-client-telemetry.js.map +1 -0
  92. package/dist/telemetry/core/lib/none-client-telemetry.d.ts +16 -0
  93. package/dist/telemetry/core/lib/none-client-telemetry.d.ts.map +1 -0
  94. package/dist/telemetry/core/lib/none-client-telemetry.js +22 -0
  95. package/dist/telemetry/core/lib/none-client-telemetry.js.map +1 -0
  96. package/dist/telemetry/index.d.ts +19 -0
  97. package/dist/telemetry/index.d.ts.map +1 -0
  98. package/dist/telemetry/index.js +19 -0
  99. package/dist/telemetry/index.js.map +1 -0
  100. package/dist/telemetry/lib/create-client-telemetry.d.ts +38 -0
  101. package/dist/telemetry/lib/create-client-telemetry.d.ts.map +1 -0
  102. package/dist/telemetry/lib/create-client-telemetry.js +65 -0
  103. package/dist/telemetry/lib/create-client-telemetry.js.map +1 -0
  104. package/dist/telemetry/lib/fan-out-client-telemetry.d.ts +24 -0
  105. package/dist/telemetry/lib/fan-out-client-telemetry.d.ts.map +1 -0
  106. package/dist/telemetry/lib/fan-out-client-telemetry.js +56 -0
  107. package/dist/telemetry/lib/fan-out-client-telemetry.js.map +1 -0
  108. package/dist/telemetry/lib/install-global-error-reporting.d.ts +27 -0
  109. package/dist/telemetry/lib/install-global-error-reporting.d.ts.map +1 -0
  110. package/dist/telemetry/lib/install-global-error-reporting.js +43 -0
  111. package/dist/telemetry/lib/install-global-error-reporting.js.map +1 -0
  112. package/dist/telemetry/lib/local-client-telemetry.d.ts +44 -0
  113. package/dist/telemetry/lib/local-client-telemetry.d.ts.map +1 -0
  114. package/dist/telemetry/lib/local-client-telemetry.js +122 -0
  115. package/dist/telemetry/lib/local-client-telemetry.js.map +1 -0
  116. package/dist/telemetry/lib/logic/describe-client-error.d.ts +24 -0
  117. package/dist/telemetry/lib/logic/describe-client-error.d.ts.map +1 -0
  118. package/dist/telemetry/lib/logic/describe-client-error.js +124 -0
  119. package/dist/telemetry/lib/logic/describe-client-error.js.map +1 -0
  120. package/dist/telemetry/lib/logic/is-chunk-load-failure.d.ts +16 -0
  121. package/dist/telemetry/lib/logic/is-chunk-load-failure.d.ts.map +1 -0
  122. package/dist/telemetry/lib/logic/is-chunk-load-failure.js +34 -0
  123. package/dist/telemetry/lib/logic/is-chunk-load-failure.js.map +1 -0
  124. package/dist/telemetry/lib/logic/refused-read.d.ts +24 -0
  125. package/dist/telemetry/lib/logic/refused-read.d.ts.map +1 -0
  126. package/dist/telemetry/lib/logic/refused-read.js +33 -0
  127. package/dist/telemetry/lib/logic/refused-read.js.map +1 -0
  128. package/dist/telemetry/lib/logic/sentry-configuration.d.ts +67 -0
  129. package/dist/telemetry/lib/logic/sentry-configuration.d.ts.map +1 -0
  130. package/dist/telemetry/lib/logic/sentry-configuration.js +74 -0
  131. package/dist/telemetry/lib/logic/sentry-configuration.js.map +1 -0
  132. package/dist/telemetry/lib/logic/should-report-failure.d.ts +19 -0
  133. package/dist/telemetry/lib/logic/should-report-failure.d.ts.map +1 -0
  134. package/dist/telemetry/lib/logic/should-report-failure.js +41 -0
  135. package/dist/telemetry/lib/logic/should-report-failure.js.map +1 -0
  136. package/dist/telemetry/lib/sentry-client-telemetry.d.ts +64 -0
  137. package/dist/telemetry/lib/sentry-client-telemetry.d.ts.map +1 -0
  138. package/dist/telemetry/lib/sentry-client-telemetry.js +187 -0
  139. package/dist/telemetry/lib/sentry-client-telemetry.js.map +1 -0
  140. package/dist/telemetry/testing.d.ts +3 -0
  141. package/dist/telemetry/testing.d.ts.map +1 -0
  142. package/dist/telemetry/testing.js +3 -0
  143. package/dist/telemetry/testing.js.map +1 -0
  144. package/package.json +58 -4
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Every promise the vendor integration makes, as one value you can read.
3
+ *
4
+ * Session Replay records what was on the user's screen. That is the most
5
+ * useful thing this initiative can produce and the most dangerous thing it
6
+ * can leak, and the difference is entirely in these defaults. So they are
7
+ * computed by a pure function with their own tests rather than typed into an
8
+ * `init` call, where a wrong one is invisible until somebody watches a replay
9
+ * of a customer's order and reads their prices back.
10
+ *
11
+ * The masking is deliberately not per-call overridable. There is no options
12
+ * argument that can loosen it — a caller can choose whether to record at all,
13
+ * never what gets recorded (INV-CLIENT-TELEMETRY-4).
14
+ *
15
+ * The shape is Sentry's, but nothing here imports Sentry: it is a plain
16
+ * object, so the test that guards these promises runs without the SDK and
17
+ * keeps running if the SDK is swapped for something that accepts the same
18
+ * envelope protocol.
19
+ */
20
+ /** What the app knows that the configuration cannot work out for itself. */
21
+ export type SentryConfigurationInput = {
22
+ readonly dsn: string;
23
+ /** The build stamp. Without it a stack trace cannot find its source map. */
24
+ readonly release: string;
25
+ /** `production`, `staging`, a developer's machine. */
26
+ readonly environment: string;
27
+ /** Same-origin path the API tunnels envelopes through. */
28
+ readonly tunnel: string;
29
+ };
30
+ export type SentryReplayMasking = {
31
+ readonly maskAllText: true;
32
+ readonly maskAllInputs: true;
33
+ readonly blockAllMedia: true;
34
+ readonly networkDetailAllowUrls: readonly [];
35
+ readonly networkCaptureBodies: false;
36
+ };
37
+ /**
38
+ * What the SDK is allowed to collect, category by category.
39
+ *
40
+ * Spelled out rather than left to defaults because the defaults are the wrong
41
+ * way round for us: the SDK collects cookies, request and response headers,
42
+ * every body type and query parameters unless told otherwise. Each `false`
43
+ * below is a category of somebody's data that does not leave the tab.
44
+ */
45
+ export type SentryDataCollection = {
46
+ readonly userInfo: false;
47
+ readonly cookies: false;
48
+ readonly httpHeaders: {
49
+ readonly request: false;
50
+ readonly response: false;
51
+ };
52
+ readonly httpBodies: readonly [];
53
+ readonly urlQueryParams: false;
54
+ };
55
+ export type SentryConfiguration = {
56
+ readonly dsn: string;
57
+ readonly release: string;
58
+ readonly environment: string;
59
+ readonly tunnel: string;
60
+ readonly dataCollection: SentryDataCollection;
61
+ readonly replaysSessionSampleRate: 0;
62
+ readonly replaysOnErrorSampleRate: 1;
63
+ readonly tracesSampleRate: 0;
64
+ readonly replayMasking: SentryReplayMasking;
65
+ };
66
+ export declare function sentryConfiguration(input: SentryConfigurationInput): SentryConfiguration;
67
+ //# sourceMappingURL=sentry-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-configuration.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/lib/logic/sentry-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,QAAQ,CAAC,sBAAsB,EAAE,SAAS,EAAE,CAAC;IAC7C,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAA;KAAE,CAAC;IAC5E,QAAQ,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;CAC7C,CAAC;AA8BF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,mBAAmB,CA2BrB"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Every promise the vendor integration makes, as one value you can read.
3
+ *
4
+ * Session Replay records what was on the user's screen. That is the most
5
+ * useful thing this initiative can produce and the most dangerous thing it
6
+ * can leak, and the difference is entirely in these defaults. So they are
7
+ * computed by a pure function with their own tests rather than typed into an
8
+ * `init` call, where a wrong one is invisible until somebody watches a replay
9
+ * of a customer's order and reads their prices back.
10
+ *
11
+ * The masking is deliberately not per-call overridable. There is no options
12
+ * argument that can loosen it — a caller can choose whether to record at all,
13
+ * never what gets recorded (INV-CLIENT-TELEMETRY-4).
14
+ *
15
+ * The shape is Sentry's, but nothing here imports Sentry: it is a plain
16
+ * object, so the test that guards these promises runs without the SDK and
17
+ * keeps running if the SDK is swapped for something that accepts the same
18
+ * envelope protocol.
19
+ */
20
+ /**
21
+ * Masking that cannot be turned down.
22
+ *
23
+ * Every text node, every input, every image and video is replaced before the
24
+ * recording leaves the tab, and no request or response body is captured at
25
+ * all. What survives is layout, timing, and where the pointer went — enough
26
+ * to see the shape of what somebody did, which is the question a replay is
27
+ * for. Reading their data back is not.
28
+ */
29
+ const REPLAY_MASKING = {
30
+ maskAllText: true,
31
+ maskAllInputs: true,
32
+ blockAllMedia: true,
33
+ // Empty, not absent: the allow-list exists and names nothing, so a URL is
34
+ // never detailed by default the way it would be if this were omitted.
35
+ networkDetailAllowUrls: [],
36
+ networkCaptureBodies: false,
37
+ };
38
+ /** No user, no cookies, no headers, no bodies, no query strings. */
39
+ const DATA_COLLECTION = {
40
+ userInfo: false,
41
+ cookies: false,
42
+ httpHeaders: { request: false, response: false },
43
+ httpBodies: [],
44
+ urlQueryParams: false,
45
+ };
46
+ export function sentryConfiguration(input) {
47
+ return {
48
+ dsn: input.dsn,
49
+ release: input.release,
50
+ environment: input.environment,
51
+ // Same-origin, so there is no CORS preflight and nothing for an ad
52
+ // blocker to recognise. A third of real users block the vendor's own
53
+ // ingest host, and a fault channel that silently loses a third of its
54
+ // reports is worse than one you know is off.
55
+ tunnel: input.tunnel,
56
+ // Who the user is comes from the session the server already resolved.
57
+ // The browser never asserts an identity, so the vendor never stores one
58
+ // it was handed rather than one that was verified — and nothing else the
59
+ // SDK would collect by default leaves the tab either.
60
+ dataCollection: DATA_COLLECTION,
61
+ // Never record a session just because it happened. Only the ones that
62
+ // broke, and all of those — a replay you did not keep is a bug you cannot
63
+ // see, and a replay of a session that went fine is a recording of
64
+ // somebody's work for no reason.
65
+ replaysSessionSampleRate: 0,
66
+ replaysOnErrorSampleRate: 1,
67
+ // Tracing is OpenTelemetry's job, exported over OTLP from the
68
+ // API. Turning it on here too would bill for and duplicate a span tree we
69
+ // already own, and would tie the swap point to this vendor.
70
+ tracesSampleRate: 0,
71
+ replayMasking: REPLAY_MASKING,
72
+ };
73
+ }
74
+ //# sourceMappingURL=sentry-configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-configuration.js","sourceRoot":"","sources":["../../../../src/telemetry/lib/logic/sentry-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAiDH;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAwB;IAC1C,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,0EAA0E;IAC1E,sEAAsE;IACtE,sBAAsB,EAAE,EAAE;IAC1B,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,oEAAoE;AACpE,MAAM,eAAe,GAAyB;IAC5C,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;IAChD,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF,MAAM,UAAU,mBAAmB,CACjC,KAA+B;IAE/B,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,mEAAmE;QACnE,qEAAqE;QACrE,sEAAsE;QACtE,6CAA6C;QAC7C,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,sEAAsE;QACtE,wEAAwE;QACxE,yEAAyE;QACzE,sDAAsD;QACtD,cAAc,EAAE,eAAe;QAC/B,sEAAsE;QACtE,0EAA0E;QAC1E,kEAAkE;QAClE,iCAAiC;QACjC,wBAAwB,EAAE,CAAC;QAC3B,wBAAwB,EAAE,CAAC;QAC3B,8DAA8D;QAC9D,0EAA0E;QAC1E,4DAA4D;QAC5D,gBAAgB,EAAE,CAAC;QACnB,aAAa,EAAE,cAAc;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What is worth waking someone for.
3
+ *
4
+ * The judgement that keeps this system from becoming noise, and the reason it
5
+ * is a pure function with its own tests rather than a condition buried in a
6
+ * handler.
7
+ *
8
+ * The rule underneath every row below: **report faults, not refusals.** A
9
+ * server saying "no" is the product working. A client that cannot reach the
10
+ * network is the world working. Neither is a defect, and a telemetry stream
11
+ * full of them is a stream nobody reads — which costs more than having none.
12
+ */
13
+ /**
14
+ * `report` becomes an event. `breadcrumb` is remembered but never sent on its
15
+ * own — it gives the next real fault its context. `ignore` is dropped.
16
+ */
17
+ export type FailureVerdict = "report" | "breadcrumb" | "ignore";
18
+ export declare function shouldReportFailure(error: unknown): FailureVerdict;
19
+ //# sourceMappingURL=should-report-failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-report-failure.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/lib/logic/should-report-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC;AAIhE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAqBlE"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * What is worth waking someone for.
3
+ *
4
+ * The judgement that keeps this system from becoming noise, and the reason it
5
+ * is a pure function with its own tests rather than a condition buried in a
6
+ * handler.
7
+ *
8
+ * The rule underneath every row below: **report faults, not refusals.** A
9
+ * server saying "no" is the product working. A client that cannot reach the
10
+ * network is the world working. Neither is a defect, and a telemetry stream
11
+ * full of them is a stream nobody reads — which costs more than having none.
12
+ */
13
+ import { ApiError, UnauthorizedError, NetworkError } from "../../../index.js";
14
+ const SERVER_FAULT_STATUS = 500;
15
+ export function shouldReportFailure(error) {
16
+ // An expired session is the most common "failure" in any authenticated app
17
+ // and is already handled end to end by returning the user to login.
18
+ if (error instanceof UnauthorizedError)
19
+ return "ignore";
20
+ if (error instanceof ApiError) {
21
+ // 4xx is the API working: the request was wrong, or not allowed, or the
22
+ // thing was not there. The server already recorded the decision in
23
+ // `request_log`; reporting it again from the browser adds nothing.
24
+ return error.status >= SERVER_FAULT_STATUS ? "report" : "ignore";
25
+ }
26
+ // Offline is a first-class state here — kiosks and plant-local deployments
27
+ // are disconnected by design — so a network failure is context for whatever
28
+ // comes next, not an event of its own.
29
+ if (error instanceof NetworkError)
30
+ return "breadcrumb";
31
+ // An aborted request is a navigation or a cancelled query, not a fault.
32
+ if (isAbort(error))
33
+ return "ignore";
34
+ return "report";
35
+ }
36
+ function isAbort(error) {
37
+ if (error instanceof DOMException)
38
+ return error.name === "AbortError";
39
+ return error instanceof Error && error.name === "AbortError";
40
+ }
41
+ //# sourceMappingURL=should-report-failure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-report-failure.js","sourceRoot":"","sources":["../../../../src/telemetry/lib/logic/should-report-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQ9E,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,2EAA2E;IAC3E,oEAAoE;IACpE,IAAI,KAAK,YAAY,iBAAiB;QAAE,OAAO,QAAQ,CAAC;IAExD,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QAC9B,wEAAwE;QACxE,mEAAmE;QACnE,mEAAmE;QACnE,OAAO,KAAK,CAAC,MAAM,IAAI,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnE,CAAC;IAED,2EAA2E;IAC3E,4EAA4E;IAC5E,uCAAuC;IACvC,IAAI,KAAK,YAAY,YAAY;QAAE,OAAO,YAAY,CAAC;IAEvD,wEAAwE;IACxE,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAEpC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,KAAK,YAAY,YAAY;QAAE,OAAO,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;IACtE,OAAO,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The rented half. Everything that knows the vendor's name lives here.
3
+ *
4
+ * It is one driver behind the same seam as `LocalClientTelemetry`, and it is
5
+ * meant to run **beside** it rather than instead of it: our own API keeps the
6
+ * unsampled ground truth, and this adds grouping, release health and the one
7
+ * thing we cannot build — a recording of what the user was looking at. Leaving
8
+ * the vendor is deleting this file and one union member.
9
+ *
10
+ * **Loaded lazily, on purpose.** The SDK and its replay recorder together are
11
+ * the largest dependency the app would have, and most sessions never report
12
+ * anything. So the import starts when the driver is constructed and reports
13
+ * queue until it lands — which also means that with no DSN configured the
14
+ * driver is never constructed and the chunk is never fetched. The integration
15
+ * is **inert**, not merely disabled: nothing is downloaded, nothing runs, and
16
+ * setting one environment variable is the whole of turning it on.
17
+ *
18
+ * **It cannot make the page worse.** Every path is wrapped, the queue is
19
+ * bounded, and a failed load is permanent rather than retried: a browser that
20
+ * could not fetch this chunk is usually a browser that is blocking it, and
21
+ * retrying would be a request loop against an extension that will keep saying
22
+ * no. The local driver is unaffected either way.
23
+ */
24
+ import { ClientTelemetry, type TelemetryBreadcrumb, type TelemetryContext } from "../core/index.js";
25
+ import { type SentryConfiguration, type SentryConfigurationInput } from "./logic/sentry-configuration.js";
26
+ /** Where a fault happened, in terms the vendor indexes. */
27
+ export type VendorCaptureHint = {
28
+ readonly tags: Readonly<Record<string, string>>;
29
+ readonly level?: string;
30
+ };
31
+ /**
32
+ * The slice of a vendor SDK this driver uses, once it is already started.
33
+ *
34
+ * Structural rather than imported, and deliberately does **not** include
35
+ * `init`: starting the SDK is the loader's job, so the only code that has to
36
+ * know a vendor's option names is the one adapter at the bottom of this file.
37
+ * A second vendor speaking the same envelope protocol needs a loader and
38
+ * nothing else.
39
+ */
40
+ export type VendorErrorReporter = {
41
+ captureException: (error: unknown, hint: VendorCaptureHint) => void;
42
+ addBreadcrumb: (crumb: TelemetryBreadcrumb) => void;
43
+ flush: (timeoutMs: number) => Promise<boolean>;
44
+ };
45
+ /** Starts the SDK with the configuration it must not be able to loosen. */
46
+ export type LoadVendorReporter = (configuration: SentryConfiguration) => Promise<VendorErrorReporter>;
47
+ export type SentryClientTelemetryOptions = SentryConfigurationInput & {
48
+ /**
49
+ * How the reporter arrives. Defaults to a dynamic import of
50
+ * `@sentry/react`, so the vendor is a lazy chunk in the app and a stub in a
51
+ * test.
52
+ */
53
+ readonly load?: LoadVendorReporter;
54
+ };
55
+ export declare class SentryClientTelemetry extends ClientTelemetry {
56
+ #private;
57
+ constructor(options: SentryClientTelemetryOptions);
58
+ reportError(error: unknown, context: TelemetryContext): void;
59
+ addBreadcrumb(crumb: TelemetryBreadcrumb): void;
60
+ flush(timeoutMs: number): Promise<boolean>;
61
+ /** Whether the vendor is actually running — for tests and for a status line. */
62
+ get isReporting(): boolean;
63
+ }
64
+ //# sourceMappingURL=sentry-client-telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-client-telemetry.d.ts","sourceRoot":"","sources":["../../../src/telemetry/lib/sentry-client-telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,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,CAEzB;CAgCF"}
@@ -0,0 +1,187 @@
1
+ /**
2
+ * The rented half. Everything that knows the vendor's name lives here.
3
+ *
4
+ * It is one driver behind the same seam as `LocalClientTelemetry`, and it is
5
+ * meant to run **beside** it rather than instead of it: our own API keeps the
6
+ * unsampled ground truth, and this adds grouping, release health and the one
7
+ * thing we cannot build — a recording of what the user was looking at. Leaving
8
+ * the vendor is deleting this file and one union member.
9
+ *
10
+ * **Loaded lazily, on purpose.** The SDK and its replay recorder together are
11
+ * the largest dependency the app would have, and most sessions never report
12
+ * anything. So the import starts when the driver is constructed and reports
13
+ * queue until it lands — which also means that with no DSN configured the
14
+ * driver is never constructed and the chunk is never fetched. The integration
15
+ * is **inert**, not merely disabled: nothing is downloaded, nothing runs, and
16
+ * setting one environment variable is the whole of turning it on.
17
+ *
18
+ * **It cannot make the page worse.** Every path is wrapped, the queue is
19
+ * bounded, and a failed load is permanent rather than retried: a browser that
20
+ * could not fetch this chunk is usually a browser that is blocking it, and
21
+ * retrying would be a request loop against an extension that will keep saying
22
+ * no. The local driver is unaffected either way.
23
+ */
24
+ import { ClientTelemetry, } from "../core/index.js";
25
+ import { sentryConfiguration, } from "./logic/sentry-configuration.js";
26
+ /**
27
+ * Reports raised before the SDK lands are kept, not dropped — the faults
28
+ * worth most are the early ones. Bounded because a page failing in a loop
29
+ * while offline must not grow an array without end; past the cap the OLDEST
30
+ * goes, since the first fault usually explains the rest.
31
+ */
32
+ const MAX_QUEUED_REPORTS = 50;
33
+ export class SentryClientTelemetry extends ClientTelemetry {
34
+ #options;
35
+ #queued = [];
36
+ #loading;
37
+ #reporter = undefined;
38
+ #unavailable = false;
39
+ constructor(options) {
40
+ super();
41
+ this.#options = options;
42
+ this.#loading = this.#load();
43
+ }
44
+ reportError(error, context) {
45
+ try {
46
+ const reporter = this.#reporter;
47
+ if (reporter === undefined) {
48
+ this.#queue({ error, context });
49
+ return;
50
+ }
51
+ reporter.captureException(error, hintFor(context));
52
+ }
53
+ catch {
54
+ // A reporter that throws inside an error handler replaces a diagnosable
55
+ // fault with an undiagnosable one.
56
+ }
57
+ }
58
+ addBreadcrumb(crumb) {
59
+ try {
60
+ // Not queued. A breadcrumb is only worth anything next to the fault it
61
+ // preceded, and the local driver is keeping the same trail regardless.
62
+ this.#reporter?.addBreadcrumb(crumb);
63
+ }
64
+ catch {
65
+ // As above.
66
+ }
67
+ }
68
+ async flush(timeoutMs) {
69
+ try {
70
+ await this.#loading;
71
+ const reporter = this.#reporter;
72
+ if (reporter === undefined)
73
+ return false;
74
+ this.#drain(reporter);
75
+ return await reporter.flush(timeoutMs);
76
+ }
77
+ catch {
78
+ // A failed flush is information, not an error to handle.
79
+ return false;
80
+ }
81
+ }
82
+ /** Whether the vendor is actually running — for tests and for a status line. */
83
+ get isReporting() {
84
+ return this.#reporter !== undefined;
85
+ }
86
+ async #load() {
87
+ try {
88
+ const load = this.#options.load ?? loadSentryReact;
89
+ const reporter = await load(sentryConfiguration(this.#options));
90
+ this.#reporter = reporter;
91
+ this.#drain(reporter);
92
+ }
93
+ catch {
94
+ // Permanent, and the queue goes with it: holding reports for a load
95
+ // that will not happen is a leak, not a retry.
96
+ this.#unavailable = true;
97
+ this.#queued.splice(0, this.#queued.length);
98
+ }
99
+ }
100
+ #queue(report) {
101
+ if (this.#unavailable)
102
+ return;
103
+ this.#queued.push(report);
104
+ if (this.#queued.length > MAX_QUEUED_REPORTS)
105
+ this.#queued.shift();
106
+ }
107
+ #drain(reporter) {
108
+ const pending = this.#queued.splice(0, this.#queued.length);
109
+ for (const report of pending) {
110
+ try {
111
+ reporter.captureException(report.error, hintFor(report.context));
112
+ }
113
+ catch {
114
+ // One bad report must not strand the rest of the queue.
115
+ }
116
+ }
117
+ }
118
+ }
119
+ function hintFor(context) {
120
+ return {
121
+ tags: {
122
+ kind: context.kind,
123
+ ...(context.requestId === undefined
124
+ ? {}
125
+ : { request_id: context.requestId }),
126
+ },
127
+ ...(context.severity === undefined ? {} : { level: context.severity }),
128
+ };
129
+ }
130
+ /**
131
+ * The only function in the repository that names the package.
132
+ *
133
+ * The specifier is a literal so the bundler can see it, split it into its own
134
+ * chunk, and serve it from our own origin rather than a CDN. Masking reaches
135
+ * the recorder from `sentryConfiguration` and from nowhere else — there is no
136
+ * argument here a caller could pass to loosen it.
137
+ */
138
+ async function loadSentryReact(configuration) {
139
+ const sentry = await import("@sentry/react");
140
+ const { replayMasking } = configuration;
141
+ sentry.init({
142
+ dsn: configuration.dsn,
143
+ release: configuration.release,
144
+ environment: configuration.environment,
145
+ tunnel: configuration.tunnel,
146
+ dataCollection: {
147
+ userInfo: configuration.dataCollection.userInfo,
148
+ cookies: configuration.dataCollection.cookies,
149
+ httpHeaders: { ...configuration.dataCollection.httpHeaders },
150
+ httpBodies: [...configuration.dataCollection.httpBodies],
151
+ urlQueryParams: configuration.dataCollection.urlQueryParams,
152
+ },
153
+ replaysSessionSampleRate: configuration.replaysSessionSampleRate,
154
+ replaysOnErrorSampleRate: configuration.replaysOnErrorSampleRate,
155
+ tracesSampleRate: configuration.tracesSampleRate,
156
+ integrations: [
157
+ sentry.replayIntegration({
158
+ maskAllText: replayMasking.maskAllText,
159
+ maskAllInputs: replayMasking.maskAllInputs,
160
+ blockAllMedia: replayMasking.blockAllMedia,
161
+ networkDetailAllowUrls: [...replayMasking.networkDetailAllowUrls],
162
+ networkCaptureBodies: replayMasking.networkCaptureBodies,
163
+ }),
164
+ ],
165
+ });
166
+ return {
167
+ captureException: (error, hint) => {
168
+ sentry.captureException(error, {
169
+ tags: { ...hint.tags },
170
+ ...(hint.level === undefined ? {} : { level: sentryLevel(hint.level) }),
171
+ });
172
+ },
173
+ addBreadcrumb: (crumb) => {
174
+ sentry.addBreadcrumb({ ...crumb });
175
+ },
176
+ flush: (timeoutMs) => sentry.flush(timeoutMs),
177
+ };
178
+ }
179
+ /** Our severities are a subset of the vendor's; anything else is an error. */
180
+ function sentryLevel(severity) {
181
+ if (severity === "warning")
182
+ return "warning";
183
+ if (severity === "fatal")
184
+ return "fatal";
185
+ return "error";
186
+ }
187
+ //# sourceMappingURL=sentry-client-telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-client-telemetry.js","sourceRoot":"","sources":["../../../src/telemetry/lib/sentry-client-telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,eAAe,GAGhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,GAGpB,MAAM,iCAAiC,CAAC;AAqCzC;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAO9B,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAC/C,QAAQ,CAA+B;IACvC,OAAO,GAAmB,EAAE,CAAC;IAC7B,QAAQ,CAAgB;IACjC,SAAS,GAAoC,SAAS,CAAC;IACvD,YAAY,GAAG,KAAK,CAAC;IAErB,YAAY,OAAqC;QAC/C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAEQ,WAAW,CAAC,KAAc,EAAE,OAAyB;QAC5D,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;gBAChC,OAAO;YACT,CAAC;YACD,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,wEAAwE;YACxE,mCAAmC;QACrC,CAAC;IACH,CAAC;IAEQ,aAAa,CAAC,KAA0B;QAC/C,IAAI,CAAC;YACH,uEAAuE;YACvE,uEAAuE;YACvE,IAAI,CAAC,SAAS,EAAE,aAAa,C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,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,SAAS,WAAW,CAAC,QAAgB;IACnC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC7C,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC;IACzC,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { FakeClientTelemetry, type ReportedFault, } from "./core/lib/in-memory-client-telemetry.js";
2
+ export { clientTelemetryConformance } from "./core/lib/client-telemetry-conformance.js";
3
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/telemetry/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,GACnB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { FakeClientTelemetry, } from "./core/lib/in-memory-client-telemetry.js";
2
+ export { clientTelemetryConformance } from "./core/lib/client-telemetry-conformance.js";
3
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/telemetry/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAEpB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@dads-framework/client",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0",
4
+ "type": "module",
5
+ "engines": {
6
+ "node": ">=22"
7
+ },
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./telemetry": {
14
+ "types": "./dist/telemetry/index.d.ts",
15
+ "default": "./dist/telemetry/index.js"
16
+ },
17
+ "./telemetry/core": {
18
+ "types": "./dist/telemetry/core/index.d.ts",
19
+ "default": "./dist/telemetry/core/index.js"
20
+ },
21
+ "./telemetry/testing": {
22
+ "types": "./dist/telemetry/testing.d.ts",
23
+ "default": "./dist/telemetry/testing.js"
24
+ }
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "README.md"
29
+ ],
30
+ "dependencies": {
31
+ "@dads-framework/core": "0.3.0",
32
+ "zod": "^4.4.3"
33
+ },
34
+ "peerDependencies": {
35
+ "@sentry/react": "^10.48.0"
36
+ },
37
+ "peerDependenciesMeta": {
38
+ "@sentry/react": {
39
+ "optional": true
40
+ }
41
+ },
42
+ "devDependencies": {
43
+ "@sentry/react": "^10.48.0",
44
+ "@tanstack/react-query": "^5.90.0",
45
+ "vitest": "~4.1.0"
46
+ },
47
+ "scripts": {
48
+ "prepublishOnly": "node ../../scripts/verify-prepublish.mjs",
49
+ "build": "tsc -b",
50
+ "test": "vitest run",
51
+ "typecheck": "tsc -b --pretty false"
52
+ },
53
+ "license": "MIT",
54
+ "author": "Bryton Cooper",
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/brytoncooper/dads-framework.git",
58
+ "directory": "packages/client"
59
+ }
60
+ }