@calmlens/sdk 0.12.0 → 0.14.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 (37) hide show
  1. package/README.md +54 -37
  2. package/cjs/CalmLensConnection-Bth5fJyp.js +234 -0
  3. package/cjs/CalmLensUtils-DNdmYeX6.js +699 -0
  4. package/cjs/{CalmLensError-CKwMKV0S.js → CalmLensVersion-Bs0DreBV.js} +114 -1
  5. package/cjs/{CalmLensWebhooks-BTPxKvcD.js → CalmLensWebhooks-6thkvr_F.js} +9 -9
  6. package/cjs/WebhookPayload-vy8HNMaK.d.ts +15834 -0
  7. package/cjs/app.d.ts +3 -3
  8. package/cjs/app.js +10 -10
  9. package/cjs/{index-BgmWj3KL.d.ts → index-Dz340UQ9.d.ts} +29 -1
  10. package/cjs/index.d.ts +3 -3
  11. package/cjs/index.js +4 -5
  12. package/cjs/server.d.ts +16 -7
  13. package/cjs/server.js +35 -21
  14. package/cjs/testing.d.ts +21 -42
  15. package/cjs/testing.js +181 -94
  16. package/esm/CalmLensConnection-DrCOL9h9.js +193 -0
  17. package/esm/{CalmLensUtils-Cx32j2zt.js → CalmLensUtils-BQo79TA1.js} +316 -2
  18. package/esm/{CalmLensError-CihGG26K.js → CalmLensVersion-DPnL_Ebv.js} +91 -2
  19. package/esm/{CalmLensWebhooks-DShmAal4.js → CalmLensWebhooks-CWlD-f_P.js} +2 -2
  20. package/esm/WebhookPayload-vy8HNMaK.d.ts +15834 -0
  21. package/esm/app.d.ts +3 -3
  22. package/esm/app.js +4 -4
  23. package/esm/{index-BgmWj3KL.d.ts → index-Dz340UQ9.d.ts} +29 -1
  24. package/esm/index.d.ts +3 -3
  25. package/esm/index.js +1 -3
  26. package/esm/server.d.ts +16 -7
  27. package/esm/server.js +24 -10
  28. package/esm/testing.d.ts +21 -42
  29. package/esm/testing.js +152 -65
  30. package/package.json +1 -1
  31. package/cjs/CalmLensConnection-CYtBP-vu.js +0 -516
  32. package/cjs/CalmLensUtils-Dg3s4loH.js +0 -367
  33. package/cjs/WebhookPayload-Cgb32aSH.d.ts +0 -10187
  34. package/cjs/src-Dsc8Pn6v.js +0 -45
  35. package/esm/CalmLensConnection-wLNy0OIP.js +0 -475
  36. package/esm/WebhookPayload-Cgb32aSH.d.ts +0 -10187
  37. package/esm/src-CJhrILvM.js +0 -22
@@ -1,22 +0,0 @@
1
- import "./CalmLensError-CihGG26K.js";
2
- //#endregion
3
- //#region src/client/CalmLensVersion.ts
4
- /** This SDK's version, from its package.json. */
5
- const SDK_VERSION = "0.12.0";
6
- const runtimeName = () => {
7
- const runtime = globalThis;
8
- if (isReactNativeRuntime()) return "react-native";
9
- if (runtime.Bun?.version) return `bun/${runtime.Bun.version}`;
10
- if (runtime.Deno?.version?.deno) return `deno/${runtime.Deno.version.deno}`;
11
- if (runtime.navigator?.userAgent === "Cloudflare-Workers") return "workerd";
12
- if (runtime.process?.versions?.node) return `node/${runtime.process.versions.node}`;
13
- return "unknown";
14
- };
15
- /** The `User-Agent` the SDK sends from server runtimes, e.g. `calmlens-js/0.10.0 (node/22.12.0)`. */
16
- const getUserAgent = () => `calmlens-js/${SDK_VERSION} (${runtimeName()})`;
17
- /** True in a web page, where API keys would be visible to every visitor. */
18
- const isBrowserRuntime = () => typeof globalThis.window !== "undefined" && typeof globalThis.document !== "undefined";
19
- /** True in a React Native app, where an API key ships inside the app for anyone to extract. */
20
- const isReactNativeRuntime = () => globalThis.navigator?.product === "ReactNative";
21
- //#endregion
22
- export { isReactNativeRuntime as i, getUserAgent as n, isBrowserRuntime as r, SDK_VERSION as t };