@trimlynk/sdk 1.1.2 → 1.1.3
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 +344 -25
- package/dist/cjs/config.d.ts +2 -2
- package/dist/cjs/config.js +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/config.d.ts +2 -2
- package/dist/esm/config.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +6 -8
package/README.md
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
# TrimLynk Node.js & TypeScript SDK
|
|
1
|
+
# TrimLynk — Official Node.js & TypeScript SDK & CLI
|
|
2
2
|
|
|
3
|
-
Official Node.js / TypeScript
|
|
3
|
+
Official Node.js / TypeScript client library and CLI for the **TrimLynk Developer API v1**.
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- **Node.js `>=22.0.0`** with dual **ESM & CommonJS** exports and full TypeScript declarations
|
|
7
|
-
- **Bundled `trimlynk` CLI** with native OS keychain support (macOS Keychain, Linux Secret Service, Windows DPAPI) + `0600` file fallback
|
|
5
|
+
TrimLynk is a modern, privacy-first URL shortening, link intelligence, and conversion attribution platform. `@trimlynk/sdk` enables developers to programmatically create branded short links, query click and funnel telemetry, track attributed conversions, organize marketing campaigns, export QR codes, and verify real-time webhooks with **zero runtime dependencies**.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@trimlynk/sdk)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
10
|
+
[](https://www.npmjs.com/package/@trimlynk/sdk)
|
|
11
|
+
[](https://trimlynk.com/terms)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
> **Hosted SaaS API:** `@trimlynk/sdk` is the official client library and CLI for the hosted TrimLynk Developer API (`https://api.trimlynk.com/api/v1/developer/*`). Installing this package does not start a local URL shortener server; it connects your applications and automation workflows to your TrimLynk workspace using an API key.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### Official Resources & Documentation
|
|
20
|
+
|
|
21
|
+
[Platform Dashboard](https://trimlynk.com) · [Developer Hub](https://trimlynk.com/developers) · [SDK Documentation](https://trimlynk.com/developers/sdks) · [API Reference](https://trimlynk.com/api-docs) · [Webhooks Guide](https://trimlynk.com/developers/webhooks) · [CLI Guide](https://trimlynk.com/developers/cli) · [Support](https://trimlynk.com/contact)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Key Capabilities
|
|
26
|
+
|
|
27
|
+
* **Programmatic Branded Short Links**: Create, update, search, and deactivate links with custom slugs, expiration dates, tags, and automatic UTM decoration.
|
|
28
|
+
* **Dual ESM & CommonJS + Strict TypeScript**: Native `import` and `require()` support with full `.d.ts` declarations and a dedicated `@trimlynk/sdk/webhooks` subpath export.
|
|
29
|
+
* **Zero Runtime Dependencies**: Built entirely on native Node.js `fetch`, `node:crypto`, `node:util`, and `node:fs` (Node.js `>=22.0.0`).
|
|
30
|
+
* **Auto-Pagination & Bulk Concurrency**: Stream across all pages with `for await ... of client.links.iter()` and batch-create links with bounded concurrency via `createMany()`.
|
|
31
|
+
* **QR Code Generation & Export**: Save PNG or SVG QR codes directly to disk with `link.saveQr()` or `client.links.downloadQr()`.
|
|
32
|
+
* **Audience Analytics & Funnel Attribution**: Retrieve workspace summaries, per-link telemetry, and Click → Lead → Purchase conversion funnels.
|
|
33
|
+
* **Webhook Verification & Replay Protection**: 1-line HMAC-SHA256 verification and typed event parsing via `client.webhooks.constructEvent()` or `@trimlynk/sdk/webhooks`.
|
|
34
|
+
* **Idempotent Mutations**: Safely retry link, campaign, conversion, and webhook creations with `idempotencyKey` and inspect `result.idempotentReplay`.
|
|
35
|
+
* **Bundled `trimlynk` CLI**: Manage links, analytics, campaigns, conversions, and local webhook tunneling from your terminal with OS keychain credential storage.
|
|
36
|
+
|
|
37
|
+
---
|
|
10
38
|
|
|
11
39
|
## Installation
|
|
12
40
|
|
|
@@ -14,17 +42,32 @@ Official Node.js / TypeScript SDK and CLI for the [TrimLynk Developer API v1](ht
|
|
|
14
42
|
npm install @trimlynk/sdk
|
|
15
43
|
```
|
|
16
44
|
|
|
17
|
-
Or install globally
|
|
45
|
+
Or install globally to use the `trimlynk` CLI everywhere:
|
|
18
46
|
|
|
19
47
|
```bash
|
|
20
48
|
npm install -g @trimlynk/sdk
|
|
21
49
|
```
|
|
22
50
|
|
|
23
|
-
|
|
51
|
+
Requires **Node.js `>=22.0.0`**. Both ESM and CommonJS are supported out of the box:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// ESM / TypeScript
|
|
55
|
+
import { TrimLynk } from "@trimlynk/sdk";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
// CommonJS
|
|
60
|
+
const { TrimLynk } = require("@trimlynk/sdk");
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 30-Second Quickstart
|
|
24
66
|
|
|
25
67
|
```ts
|
|
26
68
|
import { TrimLynk } from "@trimlynk/sdk";
|
|
27
69
|
|
|
70
|
+
// Reads process.env.TRIMLYNK_API_KEY automatically if apiKey is omitted
|
|
28
71
|
const client = new TrimLynk({
|
|
29
72
|
apiKey: process.env.TRIMLYNK_API_KEY,
|
|
30
73
|
});
|
|
@@ -33,37 +76,313 @@ const link = await client.links.create({
|
|
|
33
76
|
originalUrl: "https://example.com/pricing",
|
|
34
77
|
customSlug: "pricing-2026",
|
|
35
78
|
title: "Pricing Page",
|
|
36
|
-
tags: ["marketing", "
|
|
79
|
+
tags: ["marketing", "launch"],
|
|
37
80
|
utmSource: "newsletter",
|
|
81
|
+
utmMedium: "email",
|
|
38
82
|
autoDecorateUtm: true,
|
|
39
83
|
});
|
|
40
84
|
|
|
41
|
-
console.log(link.shortUrl);
|
|
85
|
+
console.log(`Short URL: ${link.shortUrl}`);
|
|
86
|
+
console.log(`Link ID: ${link.id}`);
|
|
42
87
|
```
|
|
43
88
|
|
|
44
|
-
|
|
89
|
+
---
|
|
45
90
|
|
|
46
|
-
|
|
47
|
-
|
|
91
|
+
## Authentication & Configuration
|
|
92
|
+
|
|
93
|
+
Generate an API key in your TrimLynk workspace under **Settings → API Keys** ([Developer Hub](https://trimlynk.com/developers)).
|
|
94
|
+
|
|
95
|
+
### Environment Variables (Recommended)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
export TRIMLYNK_API_KEY="tl_live_your_api_key_here"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
import { TrimLynk } from "@trimlynk/sdk";
|
|
103
|
+
|
|
104
|
+
const client = new TrimLynk();
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Explicit Client Options
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { TrimLynk } from "@trimlynk/sdk";
|
|
111
|
+
|
|
112
|
+
const client = new TrimLynk({
|
|
113
|
+
apiKey: process.env.TRIMLYNK_API_KEY,
|
|
114
|
+
environment: "live", // "live" (default) or "test"
|
|
115
|
+
baseUrl: "https://api.trimlynk.com", // Optional override (or TRIMLYNK_BASE_URL)
|
|
116
|
+
timeout: 30_000, // Request timeout in ms (default: 30000)
|
|
117
|
+
maxRetries: 2, // Automatic retries on HTTP 429 (default: 0)
|
|
118
|
+
fetch: globalThis.fetch, // Optional custom fetch for edge/test runtimes
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## SDK Usage Guide
|
|
125
|
+
|
|
126
|
+
### 1. Short Links (`client.links`)
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
// Create with expiration Date and idempotency key
|
|
130
|
+
const link = await client.links.create({
|
|
131
|
+
originalUrl: "https://example.com/launch",
|
|
132
|
+
customSlug: "launch-2026",
|
|
133
|
+
tags: ["campaign", "social"],
|
|
134
|
+
expiresAt: new Date("2026-12-31T23:59:59Z"),
|
|
135
|
+
idempotencyKey: "launch-link-2026-v1",
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Get, update, or delete
|
|
139
|
+
const fetched = await client.links.get(link.id);
|
|
140
|
+
const updated = await client.links.update(link.id, { isActive: true, title: "Launch" });
|
|
141
|
+
|
|
142
|
+
// Save QR code directly to disk (supports data URI, SVG, or image URL)
|
|
143
|
+
await link.saveQr("./launch-qr.png");
|
|
144
|
+
await client.links.downloadQr(link.id, "./launch-qr-copy.png");
|
|
145
|
+
|
|
146
|
+
// Bulk create concurrently while preserving order
|
|
147
|
+
const created = await client.links.createMany(
|
|
148
|
+
[
|
|
149
|
+
{ originalUrl: "https://example.com/a" },
|
|
150
|
+
{ originalUrl: "https://example.com/b" },
|
|
151
|
+
],
|
|
152
|
+
{ concurrency: 5 },
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
// Auto-paginate across all links
|
|
156
|
+
for await (const item of client.links.iter({ tag: "campaign", limit: 50 })) {
|
|
157
|
+
console.log(`${item.shortUrl} -> ${item.clicks} clicks`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Or collect all pages into an array
|
|
161
|
+
const allLinks = await client.links.iter({ search: "launch" }).toArray();
|
|
48
162
|
```
|
|
49
163
|
|
|
50
|
-
|
|
164
|
+
### 2. Analytics & Funnels (`client.analytics`)
|
|
51
165
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
166
|
+
```ts
|
|
167
|
+
// Workspace analytics summary
|
|
168
|
+
const summary = await client.analytics.get({
|
|
169
|
+
startDate: "2026-01-01",
|
|
170
|
+
endDate: "2026-12-31",
|
|
171
|
+
});
|
|
172
|
+
console.log(summary.totalClicks, summary.uniqueVisitors, summary.countries);
|
|
173
|
+
|
|
174
|
+
// Per-link analytics
|
|
175
|
+
const linkStats = await client.analytics.getLink("lnk_123");
|
|
60
176
|
|
|
61
|
-
|
|
177
|
+
// Conversion funnel metrics (Click -> Lead -> Sale)
|
|
178
|
+
const funnel = await client.analytics.conversions({ urlId: "lnk_123" });
|
|
179
|
+
console.log(funnel);
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 3. Conversions (`client.conversions`)
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
const conversion = await client.conversions.create({
|
|
186
|
+
linkId: "lnk_123",
|
|
187
|
+
eventName: "purchase",
|
|
188
|
+
revenue: 99.0,
|
|
189
|
+
currency: "USD",
|
|
190
|
+
orderId: "ord_10492",
|
|
191
|
+
clickId: "tlclid_abc123",
|
|
192
|
+
idempotencyKey: "conv-ord_10492",
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
for await (const item of client.conversions.iter({ eventName: "purchase" })) {
|
|
196
|
+
console.log(item.id, item.eventValue, item.currency);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 4. Campaigns (`client.campaigns`)
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
const campaign = await client.campaigns.create({
|
|
204
|
+
name: "Q4 Product Launch",
|
|
205
|
+
utmSource: "newsletter",
|
|
206
|
+
utmMedium: "email",
|
|
207
|
+
utmCampaign: "q4-launch",
|
|
208
|
+
goal: 10_000,
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
const campaignsPage = await client.campaigns.list({ page: 1, limit: 20 });
|
|
212
|
+
await client.campaigns.update(campaign.id, { status: "active" });
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 5. Webhooks & Signature Verification (`client.webhooks` & `@trimlynk/sdk/webhooks`)
|
|
216
|
+
|
|
217
|
+
Register and manage endpoints:
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
const webhook = await client.webhooks.create({
|
|
221
|
+
url: "https://example.com/webhooks/trimlynk",
|
|
222
|
+
events: ["click.created", "conversion.created"],
|
|
223
|
+
description: "Production billing & analytics listener",
|
|
224
|
+
});
|
|
225
|
+
// Store webhook.secret securely — it is only returned on creation
|
|
226
|
+
|
|
227
|
+
await client.webhooks.test(webhook.id);
|
|
228
|
+
const deliveries = await client.webhooks.deliveries(webhook.id);
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Verify incoming webhook payloads without even instantiating a full API client using the lightweight `@trimlynk/sdk/webhooks` subpath export (or `TrimLynk.constructWebhookEvent` / `client.webhooks.constructEvent`):
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
import express from "express";
|
|
235
|
+
import { TrimLynk, SignatureVerificationError } from "@trimlynk/sdk";
|
|
236
|
+
// Or import standalone verification helpers:
|
|
237
|
+
// import { verifyWebhookSignature, validateWebhookSignature } from "@trimlynk/sdk/webhooks";
|
|
238
|
+
|
|
239
|
+
const app = express();
|
|
240
|
+
|
|
241
|
+
app.post(
|
|
242
|
+
"/webhooks/trimlynk",
|
|
243
|
+
express.raw({ type: "application/json" }),
|
|
244
|
+
(req, res) => {
|
|
245
|
+
try {
|
|
246
|
+
const event = TrimLynk.constructWebhookEvent({
|
|
247
|
+
rawPayload: req.body,
|
|
248
|
+
signatureHeader: String(req.headers["x-trimlynk-signature"] ?? ""),
|
|
249
|
+
secret: process.env.TRIMLYNK_WEBHOOK_SECRET!,
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
if (event.isConversion) {
|
|
253
|
+
console.log(`Conversion: ${event.eventName} (${event.eventValue})`);
|
|
254
|
+
} else if (event.isClick) {
|
|
255
|
+
console.log(`Click on ${event.shortCode}`);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
res.status(200).json({ received: true });
|
|
259
|
+
} catch (err) {
|
|
260
|
+
if (err instanceof SignatureVerificationError) {
|
|
261
|
+
res.status(400).send(`Invalid signature: ${err.message}`);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
throw err;
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
);
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### 6. UTM Builder (`buildUtmUrl`)
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
import { buildUtmUrl } from "@trimlynk/sdk";
|
|
274
|
+
|
|
275
|
+
const taggedUrl = buildUtmUrl("https://example.com/pro?ref=home#pricing", {
|
|
276
|
+
source: "twitter",
|
|
277
|
+
medium: "social",
|
|
278
|
+
campaign: "spring-2026",
|
|
279
|
+
});
|
|
280
|
+
// -> "https://example.com/pro?ref=home&utm_source=twitter&utm_medium=social&utm_campaign=spring-2026#pricing"
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Error Handling
|
|
286
|
+
|
|
287
|
+
All SDK errors extend `TrimLynkError`, making error handling predictable and type-safe:
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
import {
|
|
291
|
+
TrimLynk,
|
|
292
|
+
AuthenticationError,
|
|
293
|
+
InvalidRequestError,
|
|
294
|
+
NotFoundError,
|
|
295
|
+
RateLimitError,
|
|
296
|
+
IdempotencyConflictError,
|
|
297
|
+
TimeoutError,
|
|
298
|
+
NetworkError,
|
|
299
|
+
} from "@trimlynk/sdk";
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
await client.links.get("lnk_missing");
|
|
303
|
+
} catch (err) {
|
|
304
|
+
if (err instanceof RateLimitError) {
|
|
305
|
+
console.error(`Rate limited. Retry after ${err.retryAfter}s [request_id=${err.requestId}]`);
|
|
306
|
+
} else if (err instanceof NotFoundError) {
|
|
307
|
+
console.error(`Not found: ${err.message}`);
|
|
308
|
+
} else if (err instanceof AuthenticationError) {
|
|
309
|
+
console.error("Invalid or missing API key");
|
|
310
|
+
} else if (err instanceof InvalidRequestError) {
|
|
311
|
+
console.error("Validation error:", err.details);
|
|
312
|
+
} else if (err instanceof IdempotencyConflictError) {
|
|
313
|
+
console.error("Idempotency key reused with different payload");
|
|
314
|
+
} else if (err instanceof TimeoutError || err instanceof NetworkError) {
|
|
315
|
+
console.error("Network failure:", err.message);
|
|
316
|
+
} else {
|
|
317
|
+
throw err;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## CLI Usage (`trimlynk`)
|
|
325
|
+
|
|
326
|
+
The package installs the `trimlynk` CLI binary with native OS keychain credential storage (macOS Keychain, Windows DPAPI, Linux Secret Service) plus `0600` file fallback in `~/.trimlynk`.
|
|
62
327
|
|
|
63
328
|
```bash
|
|
329
|
+
# Authenticate interactively or check status
|
|
64
330
|
trimlynk auth login
|
|
65
|
-
trimlynk
|
|
331
|
+
trimlynk auth status --check
|
|
332
|
+
|
|
333
|
+
# Create, list, update, or delete links
|
|
334
|
+
trimlynk links create https://example.com --slug demo --tag launch --quiet
|
|
66
335
|
trimlynk links list --all --json
|
|
336
|
+
trimlynk links get <linkId>
|
|
337
|
+
|
|
338
|
+
# Analytics, campaigns, and conversions
|
|
67
339
|
trimlynk analytics summary
|
|
68
|
-
trimlynk
|
|
340
|
+
trimlynk analytics link <linkId>
|
|
341
|
+
trimlynk campaigns list --json
|
|
342
|
+
trimlynk conversions list --json
|
|
343
|
+
|
|
344
|
+
# Webhooks & local tunnel forwarding
|
|
345
|
+
trimlynk webhooks list
|
|
346
|
+
trimlynk webhooks listen --tunnel-url https://your-tunnel.example.com
|
|
347
|
+
|
|
348
|
+
# Persistent CLI defaults
|
|
349
|
+
trimlynk config set environment live
|
|
350
|
+
trimlynk config get environment
|
|
69
351
|
```
|
|
352
|
+
|
|
353
|
+
### Global CLI Flags & Exit Codes
|
|
354
|
+
|
|
355
|
+
* `--json` — Raw machine-readable JSON output
|
|
356
|
+
* `-q`, `--quiet` — Minimal output (primary IDs / short URLs only)
|
|
357
|
+
* `--api-key <KEY>` — Override API key for one command
|
|
358
|
+
* `--environment <ENV>` — `live` or `test`
|
|
359
|
+
* `--base-url <URL>` — Override API base URL
|
|
360
|
+
* `--version` / `-h, --help`
|
|
361
|
+
|
|
362
|
+
| Exit Code | Meaning |
|
|
363
|
+
| :--- | :--- |
|
|
364
|
+
| `0` | Success |
|
|
365
|
+
| `1` | General error |
|
|
366
|
+
| `2` | Invalid arguments / validation error |
|
|
367
|
+
| `3` | Authentication error |
|
|
368
|
+
| `4` | Permission error |
|
|
369
|
+
| `5` | Resource not found |
|
|
370
|
+
| `6` | Rate limited |
|
|
371
|
+
| `7` | API / server error |
|
|
372
|
+
| `8` | Network / timeout error |
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Documentation, Support & License
|
|
377
|
+
|
|
378
|
+
| Resource | Link |
|
|
379
|
+
| :--- | :--- |
|
|
380
|
+
| **Developer Hub** | [https://trimlynk.com/developers](https://trimlynk.com/developers) |
|
|
381
|
+
| **SDK Documentation** | [https://trimlynk.com/developers/sdks](https://trimlynk.com/developers/sdks) |
|
|
382
|
+
| **API Reference** | [https://trimlynk.com/api-docs](https://trimlynk.com/api-docs) |
|
|
383
|
+
| **Webhooks Guide** | [https://trimlynk.com/developers/webhooks](https://trimlynk.com/developers/webhooks) |
|
|
384
|
+
| **CLI Guide** | [https://trimlynk.com/developers/cli](https://trimlynk.com/developers/cli) |
|
|
385
|
+
| **Support & Bug Reports** | [https://trimlynk.com/contact](https://trimlynk.com/contact) · `support@trimlynk.com` |
|
|
386
|
+
| **Terms & Privacy** | [Terms of Service](https://trimlynk.com/terms) · [Privacy Policy](https://trimlynk.com/privacy) |
|
|
387
|
+
|
|
388
|
+
Licensed under the TrimLynk Software Development Kit (SDK) End-User License Agreement — see the `LICENSE` file included in this package and [Terms of Service](https://trimlynk.com/terms).
|
package/dist/cjs/config.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { inspect } from "node:util";
|
|
|
2
2
|
export declare const DEFAULT_BASE_URL = "https://api.trimlynk.com";
|
|
3
3
|
export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
4
4
|
export declare const DEFAULT_API_VERSION = "1";
|
|
5
|
-
export declare const SDK_VERSION = "1.1.
|
|
6
|
-
export declare const USER_AGENT = "trimlynk-node/1.1.
|
|
5
|
+
export declare const SDK_VERSION = "1.1.3";
|
|
6
|
+
export declare const USER_AGENT = "trimlynk-node/1.1.3";
|
|
7
7
|
/** Target TrimLynk API environment. */
|
|
8
8
|
export type TrimLynkEnvironment = "live" | "test";
|
|
9
9
|
/** Standard Fetch API function signature (allows custom fetch injection for testing or edge runtimes). */
|
package/dist/cjs/config.js
CHANGED
|
@@ -5,7 +5,7 @@ const node_util_1 = require("node:util");
|
|
|
5
5
|
exports.DEFAULT_BASE_URL = "https://api.trimlynk.com";
|
|
6
6
|
exports.DEFAULT_TIMEOUT_MS = 30_000;
|
|
7
7
|
exports.DEFAULT_API_VERSION = "1";
|
|
8
|
-
exports.SDK_VERSION = "1.1.
|
|
8
|
+
exports.SDK_VERSION = "1.1.3";
|
|
9
9
|
exports.USER_AGENT = `trimlynk-node/${exports.SDK_VERSION}`;
|
|
10
10
|
/**
|
|
11
11
|
* Holds configuration parameters for TrimLynk client network communications.
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export { LinksResource } from "./resources/links.js";
|
|
|
25
25
|
export type { CreateLinkParams, CreateManyLinksOptions, ListLinksParams, UpdateLinkParams, } from "./resources/links.js";
|
|
26
26
|
export { WebhooksResource } from "./resources/webhooks.js";
|
|
27
27
|
export type { ConstructWebhookEventOptions, CreateWebhookParams, ListWebhooksParams, UpdateWebhookParams, } from "./resources/webhooks.js";
|
|
28
|
-
export declare const VERSION = "1.1.
|
|
28
|
+
export declare const VERSION = "1.1.3";
|
package/dist/cjs/index.js
CHANGED
|
@@ -55,4 +55,4 @@ var links_js_1 = require("./resources/links.js");
|
|
|
55
55
|
Object.defineProperty(exports, "LinksResource", { enumerable: true, get: function () { return links_js_1.LinksResource; } });
|
|
56
56
|
var webhooks_js_1 = require("./resources/webhooks.js");
|
|
57
57
|
Object.defineProperty(exports, "WebhooksResource", { enumerable: true, get: function () { return webhooks_js_1.WebhooksResource; } });
|
|
58
|
-
exports.VERSION = "1.1.
|
|
58
|
+
exports.VERSION = "1.1.3";
|
package/dist/esm/config.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { inspect } from "node:util";
|
|
|
2
2
|
export declare const DEFAULT_BASE_URL = "https://api.trimlynk.com";
|
|
3
3
|
export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
4
4
|
export declare const DEFAULT_API_VERSION = "1";
|
|
5
|
-
export declare const SDK_VERSION = "1.1.
|
|
6
|
-
export declare const USER_AGENT = "trimlynk-node/1.1.
|
|
5
|
+
export declare const SDK_VERSION = "1.1.3";
|
|
6
|
+
export declare const USER_AGENT = "trimlynk-node/1.1.3";
|
|
7
7
|
/** Target TrimLynk API environment. */
|
|
8
8
|
export type TrimLynkEnvironment = "live" | "test";
|
|
9
9
|
/** Standard Fetch API function signature (allows custom fetch injection for testing or edge runtimes). */
|
package/dist/esm/config.js
CHANGED
|
@@ -2,7 +2,7 @@ import { inspect } from "node:util";
|
|
|
2
2
|
export const DEFAULT_BASE_URL = "https://api.trimlynk.com";
|
|
3
3
|
export const DEFAULT_TIMEOUT_MS = 30_000;
|
|
4
4
|
export const DEFAULT_API_VERSION = "1";
|
|
5
|
-
export const SDK_VERSION = "1.1.
|
|
5
|
+
export const SDK_VERSION = "1.1.3";
|
|
6
6
|
export const USER_AGENT = `trimlynk-node/${SDK_VERSION}`;
|
|
7
7
|
/**
|
|
8
8
|
* Holds configuration parameters for TrimLynk client network communications.
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ export { LinksResource } from "./resources/links.js";
|
|
|
25
25
|
export type { CreateLinkParams, CreateManyLinksOptions, ListLinksParams, UpdateLinkParams, } from "./resources/links.js";
|
|
26
26
|
export { WebhooksResource } from "./resources/webhooks.js";
|
|
27
27
|
export type { ConstructWebhookEventOptions, CreateWebhookParams, ListWebhooksParams, UpdateWebhookParams, } from "./resources/webhooks.js";
|
|
28
|
-
export declare const VERSION = "1.1.
|
|
28
|
+
export declare const VERSION = "1.1.3";
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.js
CHANGED
|
@@ -12,5 +12,5 @@ export { CampaignsResource } from "./resources/campaigns.js";
|
|
|
12
12
|
export { ConversionsResource } from "./resources/conversions.js";
|
|
13
13
|
export { LinksResource } from "./resources/links.js";
|
|
14
14
|
export { WebhooksResource } from "./resources/webhooks.js";
|
|
15
|
-
export const VERSION = "1.1.
|
|
15
|
+
export const VERSION = "1.1.3";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trimlynk/sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Official Node.js & TypeScript SDK and CLI for the TrimLynk Developer API v1",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"attribution",
|
|
54
54
|
"developer-api",
|
|
55
55
|
"typescript",
|
|
56
|
+
"nodejs",
|
|
57
|
+
"sdk",
|
|
56
58
|
"cli"
|
|
57
59
|
],
|
|
58
60
|
"author": "TrimLynk <support@trimlynk.com>",
|
|
@@ -60,14 +62,10 @@
|
|
|
60
62
|
"Vivek Gaur <ankygaur9972@gmail.com>",
|
|
61
63
|
"Ashish Kumar Dwivedi <adpassward709@gmail.com>"
|
|
62
64
|
],
|
|
63
|
-
"homepage": "https://trimlynk.com",
|
|
64
|
-
"repository": {
|
|
65
|
-
"type": "git",
|
|
66
|
-
"url": "https://github.com/trimlynk/trimlynk.git",
|
|
67
|
-
"directory": "sdk/node"
|
|
68
|
-
},
|
|
65
|
+
"homepage": "https://trimlynk.com/developers/sdks",
|
|
69
66
|
"bugs": {
|
|
70
|
-
"url": "https://trimlynk.com/contact"
|
|
67
|
+
"url": "https://trimlynk.com/contact",
|
|
68
|
+
"email": "support@trimlynk.com"
|
|
71
69
|
},
|
|
72
70
|
"scripts": {
|
|
73
71
|
"clean": "node -e \"const fs=require('node:fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('.test-build', { recursive: true, force: true })\"",
|