@punchline-analytics/sdk 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @punchline-analytics/sdk
|
|
2
2
|
|
|
3
|
-
A typed client for the [Punchline Analytics](https://
|
|
3
|
+
A typed client for the [Punchline Analytics](https://punchlineanalytics.com) API. Its methods and types are generated from the same OpenAPI spec the API is tested against, so they always match. Works in Node.js 18+, Deno, Bun and edge runtimes: anywhere with `fetch`. No dependencies.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install @punchline-analytics/sdk
|
|
@@ -19,6 +19,6 @@ const { results } = await punchline.query({
|
|
|
19
19
|
});
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Keep the key server-side. Full guide: [TypeScript SDK](https://
|
|
22
|
+
Keep the key server-side. Full guide: [TypeScript SDK](https://punchlineanalytics.com/docs/sdk).
|
|
23
23
|
|
|
24
24
|
MIT licensed.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface Transport {
|
|
|
8
8
|
interface ClientOptions {
|
|
9
9
|
/** A key from Site settings → API and AI access: pk_live_… */
|
|
10
10
|
apiKey: string;
|
|
11
|
-
/** Default: https://
|
|
11
|
+
/** Default: https://app.punchlineanalytics.com */
|
|
12
12
|
baseUrl?: string;
|
|
13
13
|
/** Custom fetch (tests, proxies). Default: global fetch. */
|
|
14
14
|
fetch?: typeof fetch;
|
|
@@ -24,7 +24,7 @@ declare class PunchlineError extends Error {
|
|
|
24
24
|
readonly docsUrl: string | null;
|
|
25
25
|
constructor(status: number, type: string, code: string, message: string, param: string | null, docsUrl: string | null);
|
|
26
26
|
}
|
|
27
|
-
declare const DEFAULT_BASE_URL = "https://
|
|
27
|
+
declare const DEFAULT_BASE_URL = "https://app.punchlineanalytics.com";
|
|
28
28
|
|
|
29
29
|
type Alert = {
|
|
30
30
|
id?: string;
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var PunchlineError = class extends Error {
|
|
|
15
15
|
param;
|
|
16
16
|
docsUrl;
|
|
17
17
|
};
|
|
18
|
-
var DEFAULT_BASE_URL = "https://
|
|
18
|
+
var DEFAULT_BASE_URL = "https://app.punchlineanalytics.com";
|
|
19
19
|
function createTransport(opts) {
|
|
20
20
|
if (!/^pk_(live|test)_[A-Za-z0-9]{32}$/.test(opts.apiKey)) throw new Error("apiKey should look like pk_live_ followed by 32 characters");
|
|
21
21
|
const base = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@punchline-analytics/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Typed client for the Punchline Analytics API, generated from its OpenAPI spec.",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://punchlineanalytics.com/docs/sdk",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"analytics",
|
|
10
10
|
"ai-agents",
|