agentref 1.0.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/CHANGELOG.md +8 -0
- package/README.md +98 -0
- package/dist/index.cjs +498 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +421 -0
- package/dist/index.d.ts +421 -0
- package/dist/index.mjs +463 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# AgentRef Node SDK
|
|
2
|
+
|
|
3
|
+
Official TypeScript/JavaScript SDK for the AgentRef REST API v1.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install agentref
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quickstart
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { AgentRef } from 'agentref'
|
|
15
|
+
|
|
16
|
+
const client = new AgentRef({ apiKey: 'ak_live_...' })
|
|
17
|
+
const programs = await client.programs.list()
|
|
18
|
+
console.log(programs.meta.requestId)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Authentication
|
|
22
|
+
|
|
23
|
+
- API key is sent as `Authorization: Bearer <key>`.
|
|
24
|
+
- Supported key prefixes: `ak_live_*`, `ak_aff_*`, `ak_onb_*`.
|
|
25
|
+
- You can pass `apiKey` directly or use `AGENTREF_API_KEY`.
|
|
26
|
+
- Default behavior hard-fails in browser contexts to prevent API key exposure.
|
|
27
|
+
|
|
28
|
+
## Resources
|
|
29
|
+
|
|
30
|
+
- `client.programs`
|
|
31
|
+
- `list`, `listAll`, `get`, `create`, `update`, `delete`, `stats`, `listAffiliates`, `listCoupons`, `createCoupon`, `createInvite`
|
|
32
|
+
- `client.affiliates`
|
|
33
|
+
- `list`, `get`, `approve`, `block`, `unblock`
|
|
34
|
+
- `client.conversions`
|
|
35
|
+
- `list`, `stats`, `recent`
|
|
36
|
+
- `client.payouts`
|
|
37
|
+
- `list`, `listPending`, `stats`
|
|
38
|
+
- `client.flags`
|
|
39
|
+
- `list`, `stats`, `resolve`
|
|
40
|
+
- `client.billing`
|
|
41
|
+
- `current`, `tiers`, `subscribe`
|
|
42
|
+
- `client.merchant`
|
|
43
|
+
- `get`, `domainStatus`
|
|
44
|
+
|
|
45
|
+
## Pagination
|
|
46
|
+
|
|
47
|
+
List endpoints return:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
{
|
|
51
|
+
data: T[]
|
|
52
|
+
meta: {
|
|
53
|
+
total: number
|
|
54
|
+
page: number
|
|
55
|
+
pageSize: number
|
|
56
|
+
hasMore: boolean
|
|
57
|
+
nextCursor?: string
|
|
58
|
+
requestId: string
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For auto-pagination use `listAll()`. Stop condition is `meta.hasMore === false`.
|
|
64
|
+
|
|
65
|
+
## Idempotency
|
|
66
|
+
|
|
67
|
+
Only POST mutation methods accept `options?: { idempotencyKey?: string }`.
|
|
68
|
+
|
|
69
|
+
- If set, `Idempotency-Key` is sent.
|
|
70
|
+
- Retries for mutating requests are only enabled for POST + `idempotencyKey`.
|
|
71
|
+
- PATCH/DELETE are never auto-retried.
|
|
72
|
+
|
|
73
|
+
## Error Handling
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { AgentRef, ForbiddenError, NotFoundError, RateLimitError, AgentRefError } from 'agentref'
|
|
77
|
+
|
|
78
|
+
const client = new AgentRef({ apiKey: 'ak_live_...' })
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
await client.programs.get('unknown')
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (error instanceof ForbiddenError) console.log(error.code)
|
|
84
|
+
if (error instanceof NotFoundError) console.log(error.requestId)
|
|
85
|
+
if (error instanceof RateLimitError) console.log(error.retryAfter)
|
|
86
|
+
if (error instanceof AgentRefError) console.log(error.status)
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Configuration
|
|
91
|
+
|
|
92
|
+
| Option | Default | Description |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| `apiKey` | `process.env.AGENTREF_API_KEY` | API key |
|
|
95
|
+
| `baseUrl` | `https://www.agentref.dev/api/v1` | Base API URL |
|
|
96
|
+
| `timeout` | `30000` | Request timeout in ms |
|
|
97
|
+
| `maxRetries` | `2` | Retry count for GET/HEAD and POST+idempotencyKey |
|
|
98
|
+
| `dangerouslyAllowBrowser` | `false` | Allows browser initialization (unsafe) |
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
AgentRef: () => AgentRef,
|
|
24
|
+
AgentRefError: () => AgentRefError,
|
|
25
|
+
AuthError: () => AuthError,
|
|
26
|
+
ConflictError: () => ConflictError,
|
|
27
|
+
ForbiddenError: () => ForbiddenError,
|
|
28
|
+
NotFoundError: () => NotFoundError,
|
|
29
|
+
RateLimitError: () => RateLimitError,
|
|
30
|
+
ServerError: () => ServerError,
|
|
31
|
+
ValidationError: () => ValidationError
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(index_exports);
|
|
34
|
+
|
|
35
|
+
// src/errors.ts
|
|
36
|
+
var AgentRefError = class extends Error {
|
|
37
|
+
constructor(message, code, status, requestId) {
|
|
38
|
+
super(message);
|
|
39
|
+
this.name = "AgentRefError";
|
|
40
|
+
this.code = code;
|
|
41
|
+
this.status = status;
|
|
42
|
+
this.requestId = requestId;
|
|
43
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var AuthError = class extends AgentRefError {
|
|
47
|
+
constructor(message, code, requestId) {
|
|
48
|
+
super(message, code, 401, requestId);
|
|
49
|
+
this.name = "AuthError";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var ForbiddenError = class extends AgentRefError {
|
|
53
|
+
constructor(message, code, requestId) {
|
|
54
|
+
super(message, code, 403, requestId);
|
|
55
|
+
this.name = "ForbiddenError";
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var ValidationError = class extends AgentRefError {
|
|
59
|
+
constructor(message, code, requestId, details) {
|
|
60
|
+
super(message, code, 400, requestId);
|
|
61
|
+
this.name = "ValidationError";
|
|
62
|
+
this.details = details;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var NotFoundError = class extends AgentRefError {
|
|
66
|
+
constructor(message, code, requestId) {
|
|
67
|
+
super(message, code, 404, requestId);
|
|
68
|
+
this.name = "NotFoundError";
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var ConflictError = class extends AgentRefError {
|
|
72
|
+
constructor(message, code, requestId) {
|
|
73
|
+
super(message, code, 409, requestId);
|
|
74
|
+
this.name = "ConflictError";
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var RateLimitError = class extends AgentRefError {
|
|
78
|
+
constructor(message, code, requestId, retryAfter) {
|
|
79
|
+
super(message, code, 429, requestId);
|
|
80
|
+
this.name = "RateLimitError";
|
|
81
|
+
this.retryAfter = retryAfter;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
var ServerError = class extends AgentRefError {
|
|
85
|
+
constructor(message, code, status, requestId) {
|
|
86
|
+
super(message, code, status, requestId);
|
|
87
|
+
this.name = "ServerError";
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/http.ts
|
|
92
|
+
var SAFE_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
93
|
+
var DEFAULT_BASE_URL = "https://www.agentref.dev/api/v1";
|
|
94
|
+
var DEFAULT_TIMEOUT = 3e4;
|
|
95
|
+
var DEFAULT_MAX_RETRIES = 2;
|
|
96
|
+
var VERSION = true ? "1.0.0" : "0.0.0";
|
|
97
|
+
var HttpClient = class {
|
|
98
|
+
constructor(config = {}) {
|
|
99
|
+
if (typeof window !== "undefined" && !config.dangerouslyAllowBrowser) {
|
|
100
|
+
throw new Error(
|
|
101
|
+
"[AgentRef] Refusing to initialize in browser context. API keys must not be exposed client-side. Use a server-side proxy to call the AgentRef API instead. To override: set dangerouslyAllowBrowser: true (understand the security implications first)."
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
const apiKey = config.apiKey ?? process.env["AGENTREF_API_KEY"];
|
|
105
|
+
if (!apiKey) {
|
|
106
|
+
throw new Error(
|
|
107
|
+
"[AgentRef] API key is required. Pass it as apiKey or set the AGENTREF_API_KEY environment variable."
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
this.apiKey = apiKey;
|
|
111
|
+
this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
|
|
112
|
+
this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
|
|
113
|
+
this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
114
|
+
}
|
|
115
|
+
async request(options) {
|
|
116
|
+
const url = this.buildUrl(options.path, options.query);
|
|
117
|
+
const isSafe = SAFE_METHODS.has(options.method);
|
|
118
|
+
const canRetry = isSafe || options.method === "POST" && options.idempotencyKey !== void 0;
|
|
119
|
+
const maxAttempts = canRetry ? this.maxRetries + 1 : 1;
|
|
120
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
121
|
+
let response;
|
|
122
|
+
try {
|
|
123
|
+
const headers = {
|
|
124
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
125
|
+
"Content-Type": "application/json",
|
|
126
|
+
"User-Agent": `agentref-node/${VERSION}`
|
|
127
|
+
};
|
|
128
|
+
if (options.method === "POST" && options.idempotencyKey) {
|
|
129
|
+
headers["Idempotency-Key"] = options.idempotencyKey;
|
|
130
|
+
}
|
|
131
|
+
response = await fetch(url, {
|
|
132
|
+
method: options.method,
|
|
133
|
+
headers,
|
|
134
|
+
body: options.body !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
135
|
+
signal: AbortSignal.timeout(this.timeout)
|
|
136
|
+
});
|
|
137
|
+
} catch (error) {
|
|
138
|
+
if (canRetry && attempt < maxAttempts - 1) {
|
|
139
|
+
await this.wait(this.backoff(attempt));
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
if (!response.ok) {
|
|
145
|
+
const parsedError = await this.parseError(response);
|
|
146
|
+
if (canRetry && this.isRetryable(response.status) && attempt < maxAttempts - 1) {
|
|
147
|
+
const delay = response.status === 429 ? this.retryAfterToMs(response.headers.get("Retry-After")) : this.backoff(attempt);
|
|
148
|
+
await this.wait(delay);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
throw parsedError;
|
|
152
|
+
}
|
|
153
|
+
return response.json();
|
|
154
|
+
}
|
|
155
|
+
throw new ServerError("Request failed after retries", "REQUEST_RETRY_EXHAUSTED", 500, "");
|
|
156
|
+
}
|
|
157
|
+
buildUrl(path, query) {
|
|
158
|
+
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
159
|
+
const url = new URL(`${this.baseUrl}${normalizedPath}`);
|
|
160
|
+
if (query) {
|
|
161
|
+
for (const [key, value] of Object.entries(query)) {
|
|
162
|
+
if (value !== void 0) {
|
|
163
|
+
url.searchParams.set(key, String(value));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return url.toString();
|
|
168
|
+
}
|
|
169
|
+
async parseError(response) {
|
|
170
|
+
const json = await response.json().catch(() => ({}));
|
|
171
|
+
const code = json.error?.code ?? "UNKNOWN_ERROR";
|
|
172
|
+
const message = json.error?.message ?? response.statusText;
|
|
173
|
+
const requestId = json.meta?.requestId ?? "";
|
|
174
|
+
const details = json.error?.details;
|
|
175
|
+
if (response.status === 400) return new ValidationError(message, code, requestId, details);
|
|
176
|
+
if (response.status === 401) return new AuthError(message, code, requestId);
|
|
177
|
+
if (response.status === 403) return new ForbiddenError(message, code, requestId);
|
|
178
|
+
if (response.status === 404) return new NotFoundError(message, code, requestId);
|
|
179
|
+
if (response.status === 409) return new ConflictError(message, code, requestId);
|
|
180
|
+
if (response.status === 429) {
|
|
181
|
+
return new RateLimitError(message, code, requestId, this.retryAfterToSeconds(response.headers.get("Retry-After")));
|
|
182
|
+
}
|
|
183
|
+
return new ServerError(message, code, response.status, requestId);
|
|
184
|
+
}
|
|
185
|
+
isRetryable(status) {
|
|
186
|
+
return status === 429 || status >= 500;
|
|
187
|
+
}
|
|
188
|
+
retryAfterToSeconds(headerValue) {
|
|
189
|
+
if (!headerValue) return 60;
|
|
190
|
+
const numericSeconds = Number(headerValue);
|
|
191
|
+
if (!Number.isNaN(numericSeconds) && numericSeconds >= 0) {
|
|
192
|
+
return Math.ceil(numericSeconds);
|
|
193
|
+
}
|
|
194
|
+
const asDate = Date.parse(headerValue);
|
|
195
|
+
if (!Number.isNaN(asDate)) {
|
|
196
|
+
const deltaMs = asDate - Date.now();
|
|
197
|
+
return Math.max(0, Math.ceil(deltaMs / 1e3));
|
|
198
|
+
}
|
|
199
|
+
return 60;
|
|
200
|
+
}
|
|
201
|
+
retryAfterToMs(headerValue) {
|
|
202
|
+
return this.retryAfterToSeconds(headerValue) * 1e3;
|
|
203
|
+
}
|
|
204
|
+
wait(ms) {
|
|
205
|
+
return new Promise((resolve) => {
|
|
206
|
+
setTimeout(resolve, ms);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
backoff(attempt) {
|
|
210
|
+
return 500 * Math.pow(2, attempt);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// src/resources/affiliates.ts
|
|
215
|
+
var AffiliatesResource = class {
|
|
216
|
+
constructor(http) {
|
|
217
|
+
this.http = http;
|
|
218
|
+
}
|
|
219
|
+
list(params) {
|
|
220
|
+
return this.http.request({ method: "GET", path: "/affiliates", query: params });
|
|
221
|
+
}
|
|
222
|
+
async get(id) {
|
|
223
|
+
const envelope = await this.http.request({
|
|
224
|
+
method: "GET",
|
|
225
|
+
path: `/affiliates/${id}`
|
|
226
|
+
});
|
|
227
|
+
return envelope.data;
|
|
228
|
+
}
|
|
229
|
+
async approve(id, options) {
|
|
230
|
+
const envelope = await this.http.request({
|
|
231
|
+
method: "POST",
|
|
232
|
+
path: `/affiliates/${id}/approve`,
|
|
233
|
+
idempotencyKey: options?.idempotencyKey
|
|
234
|
+
});
|
|
235
|
+
return envelope.data;
|
|
236
|
+
}
|
|
237
|
+
async block(id, data, options) {
|
|
238
|
+
const envelope = await this.http.request({
|
|
239
|
+
method: "POST",
|
|
240
|
+
path: `/affiliates/${id}/block`,
|
|
241
|
+
body: data,
|
|
242
|
+
idempotencyKey: options?.idempotencyKey
|
|
243
|
+
});
|
|
244
|
+
return envelope.data;
|
|
245
|
+
}
|
|
246
|
+
async unblock(id, options) {
|
|
247
|
+
const envelope = await this.http.request({
|
|
248
|
+
method: "POST",
|
|
249
|
+
path: `/affiliates/${id}/unblock`,
|
|
250
|
+
idempotencyKey: options?.idempotencyKey
|
|
251
|
+
});
|
|
252
|
+
return envelope.data;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// src/resources/billing.ts
|
|
257
|
+
var BillingResource = class {
|
|
258
|
+
constructor(http) {
|
|
259
|
+
this.http = http;
|
|
260
|
+
}
|
|
261
|
+
async current() {
|
|
262
|
+
const envelope = await this.http.request({
|
|
263
|
+
method: "GET",
|
|
264
|
+
path: "/billing"
|
|
265
|
+
});
|
|
266
|
+
return envelope.data;
|
|
267
|
+
}
|
|
268
|
+
async tiers() {
|
|
269
|
+
const envelope = await this.http.request({
|
|
270
|
+
method: "GET",
|
|
271
|
+
path: "/billing/tiers"
|
|
272
|
+
});
|
|
273
|
+
return envelope.data;
|
|
274
|
+
}
|
|
275
|
+
async subscribe(data, options) {
|
|
276
|
+
const envelope = await this.http.request({
|
|
277
|
+
method: "POST",
|
|
278
|
+
path: "/billing/subscribe",
|
|
279
|
+
body: data,
|
|
280
|
+
idempotencyKey: options?.idempotencyKey
|
|
281
|
+
});
|
|
282
|
+
return envelope.data;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// src/resources/conversions.ts
|
|
287
|
+
var ConversionsResource = class {
|
|
288
|
+
constructor(http) {
|
|
289
|
+
this.http = http;
|
|
290
|
+
}
|
|
291
|
+
list(params) {
|
|
292
|
+
return this.http.request({ method: "GET", path: "/conversions", query: params });
|
|
293
|
+
}
|
|
294
|
+
async stats(params) {
|
|
295
|
+
const envelope = await this.http.request({
|
|
296
|
+
method: "GET",
|
|
297
|
+
path: "/conversions/stats",
|
|
298
|
+
query: params
|
|
299
|
+
});
|
|
300
|
+
return envelope.data;
|
|
301
|
+
}
|
|
302
|
+
async recent(params) {
|
|
303
|
+
const envelope = await this.http.request({
|
|
304
|
+
method: "GET",
|
|
305
|
+
path: "/conversions/recent",
|
|
306
|
+
query: params
|
|
307
|
+
});
|
|
308
|
+
return envelope.data;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// src/resources/flags.ts
|
|
313
|
+
var FlagsResource = class {
|
|
314
|
+
constructor(http) {
|
|
315
|
+
this.http = http;
|
|
316
|
+
}
|
|
317
|
+
list(params) {
|
|
318
|
+
return this.http.request({ method: "GET", path: "/flags", query: params });
|
|
319
|
+
}
|
|
320
|
+
async stats() {
|
|
321
|
+
const envelope = await this.http.request({
|
|
322
|
+
method: "GET",
|
|
323
|
+
path: "/flags/stats"
|
|
324
|
+
});
|
|
325
|
+
return envelope.data;
|
|
326
|
+
}
|
|
327
|
+
async resolve(id, data, options) {
|
|
328
|
+
const envelope = await this.http.request({
|
|
329
|
+
method: "POST",
|
|
330
|
+
path: `/flags/${id}/resolve`,
|
|
331
|
+
body: data,
|
|
332
|
+
idempotencyKey: options?.idempotencyKey
|
|
333
|
+
});
|
|
334
|
+
return envelope.data;
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// src/resources/merchant.ts
|
|
339
|
+
var MerchantResource = class {
|
|
340
|
+
constructor(http) {
|
|
341
|
+
this.http = http;
|
|
342
|
+
}
|
|
343
|
+
async get() {
|
|
344
|
+
const envelope = await this.http.request({
|
|
345
|
+
method: "GET",
|
|
346
|
+
path: "/merchant"
|
|
347
|
+
});
|
|
348
|
+
return envelope.data;
|
|
349
|
+
}
|
|
350
|
+
async domainStatus() {
|
|
351
|
+
const envelope = await this.http.request({
|
|
352
|
+
method: "GET",
|
|
353
|
+
path: "/merchant/domain-status"
|
|
354
|
+
});
|
|
355
|
+
return envelope.data;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
// src/resources/payouts.ts
|
|
360
|
+
var PayoutsResource = class {
|
|
361
|
+
constructor(http) {
|
|
362
|
+
this.http = http;
|
|
363
|
+
}
|
|
364
|
+
list(params) {
|
|
365
|
+
return this.http.request({ method: "GET", path: "/payouts", query: params });
|
|
366
|
+
}
|
|
367
|
+
listPending(params) {
|
|
368
|
+
return this.http.request({ method: "GET", path: "/payouts/pending", query: params });
|
|
369
|
+
}
|
|
370
|
+
async stats(params) {
|
|
371
|
+
const envelope = await this.http.request({
|
|
372
|
+
method: "GET",
|
|
373
|
+
path: "/payouts/stats",
|
|
374
|
+
query: params
|
|
375
|
+
});
|
|
376
|
+
return envelope.data;
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// src/resources/programs.ts
|
|
381
|
+
var ProgramsResource = class {
|
|
382
|
+
constructor(http) {
|
|
383
|
+
this.http = http;
|
|
384
|
+
}
|
|
385
|
+
list(params) {
|
|
386
|
+
return this.http.request({ method: "GET", path: "/programs", query: params });
|
|
387
|
+
}
|
|
388
|
+
async *listAll(params) {
|
|
389
|
+
let page = 1;
|
|
390
|
+
const pageSize = params?.pageSize ?? 100;
|
|
391
|
+
while (true) {
|
|
392
|
+
const response = await this.list({ page, limit: pageSize });
|
|
393
|
+
yield* response.data;
|
|
394
|
+
if (!response.meta.hasMore) {
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
page += 1;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
async get(id) {
|
|
401
|
+
const envelope = await this.http.request({
|
|
402
|
+
method: "GET",
|
|
403
|
+
path: `/programs/${id}`
|
|
404
|
+
});
|
|
405
|
+
return envelope.data;
|
|
406
|
+
}
|
|
407
|
+
async create(data, options) {
|
|
408
|
+
const envelope = await this.http.request({
|
|
409
|
+
method: "POST",
|
|
410
|
+
path: "/programs",
|
|
411
|
+
body: data,
|
|
412
|
+
idempotencyKey: options?.idempotencyKey
|
|
413
|
+
});
|
|
414
|
+
return envelope.data;
|
|
415
|
+
}
|
|
416
|
+
async update(id, data) {
|
|
417
|
+
const envelope = await this.http.request({
|
|
418
|
+
method: "PATCH",
|
|
419
|
+
path: `/programs/${id}`,
|
|
420
|
+
body: data
|
|
421
|
+
});
|
|
422
|
+
return envelope.data;
|
|
423
|
+
}
|
|
424
|
+
async delete(id) {
|
|
425
|
+
const envelope = await this.http.request({
|
|
426
|
+
method: "DELETE",
|
|
427
|
+
path: `/programs/${id}`
|
|
428
|
+
});
|
|
429
|
+
return envelope.data;
|
|
430
|
+
}
|
|
431
|
+
async stats(id, params) {
|
|
432
|
+
const envelope = await this.http.request({
|
|
433
|
+
method: "GET",
|
|
434
|
+
path: `/programs/${id}/stats`,
|
|
435
|
+
query: params
|
|
436
|
+
});
|
|
437
|
+
return envelope.data;
|
|
438
|
+
}
|
|
439
|
+
listAffiliates(id, params) {
|
|
440
|
+
return this.http.request({
|
|
441
|
+
method: "GET",
|
|
442
|
+
path: `/programs/${id}/affiliates`,
|
|
443
|
+
query: params
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
async listCoupons(id) {
|
|
447
|
+
const envelope = await this.http.request({
|
|
448
|
+
method: "GET",
|
|
449
|
+
path: `/programs/${id}/coupons`
|
|
450
|
+
});
|
|
451
|
+
return envelope.data;
|
|
452
|
+
}
|
|
453
|
+
async createCoupon(id, data, options) {
|
|
454
|
+
const envelope = await this.http.request({
|
|
455
|
+
method: "POST",
|
|
456
|
+
path: `/programs/${id}/coupons`,
|
|
457
|
+
body: data,
|
|
458
|
+
idempotencyKey: options?.idempotencyKey
|
|
459
|
+
});
|
|
460
|
+
return envelope.data;
|
|
461
|
+
}
|
|
462
|
+
async createInvite(id, data, options) {
|
|
463
|
+
const envelope = await this.http.request({
|
|
464
|
+
method: "POST",
|
|
465
|
+
path: `/programs/${id}/invites`,
|
|
466
|
+
body: data,
|
|
467
|
+
idempotencyKey: options?.idempotencyKey
|
|
468
|
+
});
|
|
469
|
+
return envelope.data;
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
// src/client.ts
|
|
474
|
+
var AgentRef = class {
|
|
475
|
+
constructor(config) {
|
|
476
|
+
const http = new HttpClient(config);
|
|
477
|
+
this.programs = new ProgramsResource(http);
|
|
478
|
+
this.affiliates = new AffiliatesResource(http);
|
|
479
|
+
this.conversions = new ConversionsResource(http);
|
|
480
|
+
this.payouts = new PayoutsResource(http);
|
|
481
|
+
this.flags = new FlagsResource(http);
|
|
482
|
+
this.billing = new BillingResource(http);
|
|
483
|
+
this.merchant = new MerchantResource(http);
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
487
|
+
0 && (module.exports = {
|
|
488
|
+
AgentRef,
|
|
489
|
+
AgentRefError,
|
|
490
|
+
AuthError,
|
|
491
|
+
ConflictError,
|
|
492
|
+
ForbiddenError,
|
|
493
|
+
NotFoundError,
|
|
494
|
+
RateLimitError,
|
|
495
|
+
ServerError,
|
|
496
|
+
ValidationError
|
|
497
|
+
});
|
|
498
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/http.ts","../src/resources/affiliates.ts","../src/resources/billing.ts","../src/resources/conversions.ts","../src/resources/flags.ts","../src/resources/merchant.ts","../src/resources/payouts.ts","../src/resources/programs.ts","../src/client.ts"],"sourcesContent":["export { AgentRef } from './client.js'\nexport {\n AgentRefError,\n AuthError,\n ConflictError,\n ForbiddenError,\n NotFoundError,\n RateLimitError,\n ServerError,\n ValidationError,\n} from './errors.js'\nexport type {\n AgentRefConfig,\n Affiliate,\n AffiliateStatus,\n BillingStatus,\n BillingTier,\n BillingTierId,\n CommissionType,\n Conversion,\n ConversionStats,\n ConversionStatus,\n Coupon,\n CreateCouponParams,\n CreateProgramParams,\n Flag,\n FlagStats,\n FlagStatus,\n FlagType,\n Invite,\n Merchant,\n MutationOptions,\n PaginatedResponse,\n PaginationMeta,\n PendingAffiliate,\n Payout,\n PayoutStats,\n PayoutStatus,\n Program,\n ProgramStats,\n ProgramStatus,\n ResolveFlagParams,\n UpdateProgramParams,\n} from './types/index.js'\n","export class AgentRefError extends Error {\n readonly code: string\n readonly status: number\n readonly requestId: string\n\n constructor(message: string, code: string, status: number, requestId: string) {\n super(message)\n this.name = 'AgentRefError'\n this.code = code\n this.status = status\n this.requestId = requestId\n Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\nexport class AuthError extends AgentRefError {\n constructor(message: string, code: string, requestId: string) {\n super(message, code, 401, requestId)\n this.name = 'AuthError'\n }\n}\n\nexport class ForbiddenError extends AgentRefError {\n constructor(message: string, code: string, requestId: string) {\n super(message, code, 403, requestId)\n this.name = 'ForbiddenError'\n }\n}\n\nexport class ValidationError extends AgentRefError {\n readonly details: unknown\n\n constructor(message: string, code: string, requestId: string, details?: unknown) {\n super(message, code, 400, requestId)\n this.name = 'ValidationError'\n this.details = details\n }\n}\n\nexport class NotFoundError extends AgentRefError {\n constructor(message: string, code: string, requestId: string) {\n super(message, code, 404, requestId)\n this.name = 'NotFoundError'\n }\n}\n\nexport class ConflictError extends AgentRefError {\n constructor(message: string, code: string, requestId: string) {\n super(message, code, 409, requestId)\n this.name = 'ConflictError'\n }\n}\n\nexport class RateLimitError extends AgentRefError {\n readonly retryAfter: number\n\n constructor(message: string, code: string, requestId: string, retryAfter: number) {\n super(message, code, 429, requestId)\n this.name = 'RateLimitError'\n this.retryAfter = retryAfter\n }\n}\n\nexport class ServerError extends AgentRefError {\n constructor(message: string, code: string, status: number, requestId: string) {\n super(message, code, status, requestId)\n this.name = 'ServerError'\n }\n}\n","import {\n AgentRefError,\n AuthError,\n ConflictError,\n ForbiddenError,\n NotFoundError,\n RateLimitError,\n ServerError,\n ValidationError,\n} from './errors.js'\nimport type { AgentRefConfig } from './types/index.js'\n\nexport type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PATCH' | 'DELETE'\n\nconst SAFE_METHODS: ReadonlySet<HttpMethod> = new Set(['GET', 'HEAD'])\n\nexport interface RequestOptions {\n method: HttpMethod\n path: string\n body?: unknown\n query?: Record<string, string | number | boolean | undefined>\n idempotencyKey?: string\n}\n\nconst DEFAULT_BASE_URL = 'https://www.agentref.dev/api/v1'\nconst DEFAULT_TIMEOUT = 30_000\nconst DEFAULT_MAX_RETRIES = 2\n\ndeclare const __SDK_VERSION__: string\nconst VERSION = typeof __SDK_VERSION__ === 'string' ? __SDK_VERSION__ : '0.0.0'\n\nexport class HttpClient {\n private readonly apiKey: string\n private readonly baseUrl: string\n private readonly timeout: number\n private readonly maxRetries: number\n\n constructor(config: AgentRefConfig = {}) {\n if (typeof window !== 'undefined' && !config.dangerouslyAllowBrowser) {\n throw new Error(\n '[AgentRef] Refusing to initialize in browser context. API keys must not be exposed client-side. Use a server-side proxy to call the AgentRef API instead. To override: set dangerouslyAllowBrowser: true (understand the security implications first).'\n )\n }\n\n const apiKey = config.apiKey ?? process.env['AGENTREF_API_KEY']\n if (!apiKey) {\n throw new Error(\n '[AgentRef] API key is required. Pass it as apiKey or set the AGENTREF_API_KEY environment variable.'\n )\n }\n\n this.apiKey = apiKey\n this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, '')\n this.timeout = config.timeout ?? DEFAULT_TIMEOUT\n this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES\n }\n\n async request<T>(options: RequestOptions): Promise<T> {\n const url = this.buildUrl(options.path, options.query)\n const isSafe = SAFE_METHODS.has(options.method)\n const canRetry = isSafe || (options.method === 'POST' && options.idempotencyKey !== undefined)\n const maxAttempts = canRetry ? this.maxRetries + 1 : 1\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n let response: Response\n\n try {\n const headers: Record<string, string> = {\n Authorization: `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n 'User-Agent': `agentref-node/${VERSION}`,\n }\n\n if (options.method === 'POST' && options.idempotencyKey) {\n headers['Idempotency-Key'] = options.idempotencyKey\n }\n\n response = await fetch(url, {\n method: options.method,\n headers,\n body: options.body !== undefined ? JSON.stringify(options.body) : undefined,\n signal: AbortSignal.timeout(this.timeout),\n })\n } catch (error) {\n if (canRetry && attempt < maxAttempts - 1) {\n await this.wait(this.backoff(attempt))\n continue\n }\n throw error\n }\n\n if (!response.ok) {\n const parsedError = await this.parseError(response)\n\n if (canRetry && this.isRetryable(response.status) && attempt < maxAttempts - 1) {\n const delay =\n response.status === 429\n ? this.retryAfterToMs(response.headers.get('Retry-After'))\n : this.backoff(attempt)\n await this.wait(delay)\n continue\n }\n\n throw parsedError\n }\n\n return response.json() as Promise<T>\n }\n\n throw new ServerError('Request failed after retries', 'REQUEST_RETRY_EXHAUSTED', 500, '')\n }\n\n private buildUrl(path: string, query?: Record<string, string | number | boolean | undefined>): string {\n const normalizedPath = path.startsWith('/') ? path : `/${path}`\n const url = new URL(`${this.baseUrl}${normalizedPath}`)\n\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value))\n }\n }\n }\n\n return url.toString()\n }\n\n private async parseError(response: Response): Promise<AgentRefError> {\n const json = (await response.json().catch(() => ({}))) as {\n error?: { code?: string; message?: string; details?: unknown }\n meta?: { requestId?: string }\n }\n\n const code = json.error?.code ?? 'UNKNOWN_ERROR'\n const message = json.error?.message ?? response.statusText\n const requestId = json.meta?.requestId ?? ''\n const details = json.error?.details\n\n if (response.status === 400) return new ValidationError(message, code, requestId, details)\n if (response.status === 401) return new AuthError(message, code, requestId)\n if (response.status === 403) return new ForbiddenError(message, code, requestId)\n if (response.status === 404) return new NotFoundError(message, code, requestId)\n if (response.status === 409) return new ConflictError(message, code, requestId)\n if (response.status === 429) {\n return new RateLimitError(message, code, requestId, this.retryAfterToSeconds(response.headers.get('Retry-After')))\n }\n\n return new ServerError(message, code, response.status, requestId)\n }\n\n private isRetryable(status: number): boolean {\n return status === 429 || status >= 500\n }\n\n private retryAfterToSeconds(headerValue: string | null): number {\n if (!headerValue) return 60\n\n const numericSeconds = Number(headerValue)\n if (!Number.isNaN(numericSeconds) && numericSeconds >= 0) {\n return Math.ceil(numericSeconds)\n }\n\n const asDate = Date.parse(headerValue)\n if (!Number.isNaN(asDate)) {\n const deltaMs = asDate - Date.now()\n return Math.max(0, Math.ceil(deltaMs / 1000))\n }\n\n return 60\n }\n\n private retryAfterToMs(headerValue: string | null): number {\n return this.retryAfterToSeconds(headerValue) * 1000\n }\n\n private wait(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms)\n })\n }\n\n private backoff(attempt: number): number {\n return 500 * Math.pow(2, attempt)\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { Affiliate, MutationOptions, PaginatedResponse } from '../types/index.js'\n\nexport class AffiliatesResource {\n constructor(private readonly http: HttpClient) {}\n\n list(params?: {\n programId?: string\n includeBlocked?: boolean\n cursor?: string\n limit?: number\n page?: number\n pageSize?: number\n offset?: number\n }): Promise<PaginatedResponse<Affiliate>> {\n return this.http.request({ method: 'GET', path: '/affiliates', query: params })\n }\n\n async get(id: string): Promise<Affiliate> {\n const envelope = await this.http.request<{ data: Affiliate; meta: unknown }>({\n method: 'GET',\n path: `/affiliates/${id}`,\n })\n return envelope.data\n }\n\n async approve(id: string, options?: MutationOptions): Promise<Affiliate> {\n const envelope = await this.http.request<{ data: Affiliate; meta: unknown }>({\n method: 'POST',\n path: `/affiliates/${id}/approve`,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n\n async block(id: string, data?: { reason?: string }, options?: MutationOptions): Promise<Affiliate> {\n const envelope = await this.http.request<{ data: Affiliate; meta: unknown }>({\n method: 'POST',\n path: `/affiliates/${id}/block`,\n body: data,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n\n async unblock(id: string, options?: MutationOptions): Promise<Affiliate> {\n const envelope = await this.http.request<{ data: Affiliate; meta: unknown }>({\n method: 'POST',\n path: `/affiliates/${id}/unblock`,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { BillingStatus, BillingTier, MutationOptions } from '../types/index.js'\n\nexport class BillingResource {\n constructor(private readonly http: HttpClient) {}\n\n async current(): Promise<BillingStatus> {\n const envelope = await this.http.request<{ data: BillingStatus; meta: unknown }>({\n method: 'GET',\n path: '/billing',\n })\n return envelope.data\n }\n\n async tiers(): Promise<BillingTier[]> {\n const envelope = await this.http.request<{ data: BillingTier[]; meta: unknown }>({\n method: 'GET',\n path: '/billing/tiers',\n })\n return envelope.data\n }\n\n async subscribe(data: { tier: 'starter' | 'growth' | 'pro' | 'scale' }, options?: MutationOptions): Promise<BillingStatus> {\n const envelope = await this.http.request<{ data: BillingStatus; meta: unknown }>({\n method: 'POST',\n path: '/billing/subscribe',\n body: data,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { Conversion, ConversionStats, PaginatedResponse } from '../types/index.js'\n\nexport class ConversionsResource {\n constructor(private readonly http: HttpClient) {}\n\n list(params?: {\n programId?: string\n affiliateId?: string\n status?: string\n startDate?: string\n endDate?: string\n from?: string\n to?: string\n cursor?: string\n limit?: number\n page?: number\n pageSize?: number\n offset?: number\n }): Promise<PaginatedResponse<Conversion>> {\n return this.http.request({ method: 'GET', path: '/conversions', query: params })\n }\n\n async stats(params?: { programId?: string; period?: '7d' | '30d' | '90d' | 'all' }): Promise<ConversionStats> {\n const envelope = await this.http.request<{ data: ConversionStats; meta: unknown }>({\n method: 'GET',\n path: '/conversions/stats',\n query: params,\n })\n return envelope.data\n }\n\n async recent(params?: { limit?: number }): Promise<Conversion[]> {\n const envelope = await this.http.request<{ data: Conversion[]; meta: unknown }>({\n method: 'GET',\n path: '/conversions/recent',\n query: params,\n })\n return envelope.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { Flag, FlagStats, MutationOptions, PaginatedResponse, ResolveFlagParams } from '../types/index.js'\n\nexport class FlagsResource {\n constructor(private readonly http: HttpClient) {}\n\n list(params?: {\n status?: string\n type?: string\n affiliateId?: string\n cursor?: string\n limit?: number\n page?: number\n pageSize?: number\n offset?: number\n }): Promise<PaginatedResponse<Flag>> {\n return this.http.request({ method: 'GET', path: '/flags', query: params })\n }\n\n async stats(): Promise<FlagStats> {\n const envelope = await this.http.request<{ data: FlagStats; meta: unknown }>({\n method: 'GET',\n path: '/flags/stats',\n })\n return envelope.data\n }\n\n async resolve(id: string, data: ResolveFlagParams, options?: MutationOptions): Promise<Flag> {\n const envelope = await this.http.request<{ data: Flag; meta: unknown }>({\n method: 'POST',\n path: `/flags/${id}/resolve`,\n body: data,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { Merchant } from '../types/index.js'\n\nexport interface DomainStatus {\n domain: string | null\n verified: boolean\n txtRecord?: string | null\n [key: string]: unknown\n}\n\nexport class MerchantResource {\n constructor(private readonly http: HttpClient) {}\n\n async get(): Promise<Merchant> {\n const envelope = await this.http.request<{ data: Merchant; meta: unknown }>({\n method: 'GET',\n path: '/merchant',\n })\n return envelope.data\n }\n\n async domainStatus(): Promise<DomainStatus> {\n const envelope = await this.http.request<{ data: DomainStatus; meta: unknown }>({\n method: 'GET',\n path: '/merchant/domain-status',\n })\n return envelope.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type { PaginatedResponse, PendingAffiliate, Payout, PayoutStats, PayoutStatus } from '../types/index.js'\n\nexport class PayoutsResource {\n constructor(private readonly http: HttpClient) {}\n\n list(params?: {\n programId?: string\n affiliateId?: string\n status?: PayoutStatus\n startDate?: string\n endDate?: string\n from?: string\n to?: string\n cursor?: string\n limit?: number\n page?: number\n pageSize?: number\n offset?: number\n }): Promise<PaginatedResponse<Payout>> {\n return this.http.request({ method: 'GET', path: '/payouts', query: params })\n }\n\n listPending(params?: {\n programId?: string\n cursor?: string\n limit?: number\n page?: number\n pageSize?: number\n offset?: number\n }): Promise<PaginatedResponse<PendingAffiliate>> {\n return this.http.request({ method: 'GET', path: '/payouts/pending', query: params })\n }\n\n async stats(params?: { programId?: string; period?: '7d' | '30d' | '90d' | 'all' }): Promise<PayoutStats> {\n const envelope = await this.http.request<{ data: PayoutStats; meta: unknown }>({\n method: 'GET',\n path: '/payouts/stats',\n query: params,\n })\n return envelope.data\n }\n}\n","import type { HttpClient } from '../http.js'\nimport type {\n Affiliate,\n Coupon,\n CreateCouponParams,\n CreateProgramParams,\n Invite,\n MutationOptions,\n PaginatedResponse,\n Program,\n ProgramStats,\n UpdateProgramParams,\n} from '../types/index.js'\n\nexport class ProgramsResource {\n constructor(private readonly http: HttpClient) {}\n\n list(params?: {\n cursor?: string\n limit?: number\n page?: number\n pageSize?: number\n offset?: number\n }): Promise<PaginatedResponse<Program>> {\n return this.http.request({ method: 'GET', path: '/programs', query: params })\n }\n\n async *listAll(params?: {\n pageSize?: number\n }): AsyncGenerator<Program> {\n let page = 1\n const pageSize = params?.pageSize ?? 100\n\n while (true) {\n const response = await this.list({ page, limit: pageSize })\n yield* response.data\n\n if (!response.meta.hasMore) {\n break\n }\n\n page += 1\n }\n }\n\n async get(id: string): Promise<Program> {\n const envelope = await this.http.request<{ data: Program; meta: unknown }>({\n method: 'GET',\n path: `/programs/${id}`,\n })\n return envelope.data\n }\n\n async create(data: CreateProgramParams, options?: MutationOptions): Promise<Program> {\n const envelope = await this.http.request<{ data: Program; meta: unknown }>({\n method: 'POST',\n path: '/programs',\n body: data,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n\n async update(id: string, data: UpdateProgramParams): Promise<Program> {\n const envelope = await this.http.request<{ data: Program; meta: unknown }>({\n method: 'PATCH',\n path: `/programs/${id}`,\n body: data,\n })\n return envelope.data\n }\n\n async delete(id: string): Promise<Program> {\n const envelope = await this.http.request<{ data: Program; meta: unknown }>({\n method: 'DELETE',\n path: `/programs/${id}`,\n })\n return envelope.data\n }\n\n async stats(id: string, params?: { period?: string }): Promise<ProgramStats> {\n const envelope = await this.http.request<{ data: ProgramStats; meta: unknown }>({\n method: 'GET',\n path: `/programs/${id}/stats`,\n query: params,\n })\n return envelope.data\n }\n\n listAffiliates(\n id: string,\n params?: { includeBlocked?: boolean; cursor?: string; limit?: number; page?: number; pageSize?: number; offset?: number }\n ): Promise<PaginatedResponse<Affiliate>> {\n return this.http.request({\n method: 'GET',\n path: `/programs/${id}/affiliates`,\n query: params,\n })\n }\n\n async listCoupons(id: string): Promise<Coupon[]> {\n const envelope = await this.http.request<{ data: Coupon[]; meta: unknown }>({\n method: 'GET',\n path: `/programs/${id}/coupons`,\n })\n return envelope.data\n }\n\n async createCoupon(id: string, data: CreateCouponParams, options?: MutationOptions): Promise<Coupon> {\n const envelope = await this.http.request<{ data: Coupon; meta: unknown }>({\n method: 'POST',\n path: `/programs/${id}/coupons`,\n body: data,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n\n async createInvite(\n id: string,\n data: {\n email?: string\n name?: string\n isPublic?: boolean\n usageLimit?: number\n expiresInDays?: number\n },\n options?: MutationOptions\n ): Promise<Invite> {\n const envelope = await this.http.request<{ data: Invite; meta: unknown }>({\n method: 'POST',\n path: `/programs/${id}/invites`,\n body: data,\n idempotencyKey: options?.idempotencyKey,\n })\n return envelope.data\n }\n}\n","import { HttpClient } from './http.js'\nimport type { AgentRefConfig } from './types/index.js'\nimport { AffiliatesResource } from './resources/affiliates.js'\nimport { BillingResource } from './resources/billing.js'\nimport { ConversionsResource } from './resources/conversions.js'\nimport { FlagsResource } from './resources/flags.js'\nimport { MerchantResource } from './resources/merchant.js'\nimport { PayoutsResource } from './resources/payouts.js'\nimport { ProgramsResource } from './resources/programs.js'\n\nexport class AgentRef {\n readonly programs: ProgramsResource\n readonly affiliates: AffiliatesResource\n readonly conversions: ConversionsResource\n readonly payouts: PayoutsResource\n readonly flags: FlagsResource\n readonly billing: BillingResource\n readonly merchant: MerchantResource\n\n constructor(config?: AgentRefConfig) {\n const http = new HttpClient(config)\n\n this.programs = new ProgramsResource(http)\n this.affiliates = new AffiliatesResource(http)\n this.conversions = new ConversionsResource(http)\n this.payouts = new PayoutsResource(http)\n this.flags = new FlagsResource(http)\n this.billing = new BillingResource(http)\n this.merchant = new MerchantResource(http)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAKvC,YAAY,SAAiB,MAAc,QAAgB,WAAmB;AAC5E,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,YAAY;AACjB,WAAO,eAAe,MAAM,WAAW,SAAS;AAAA,EAClD;AACF;AAEO,IAAM,YAAN,cAAwB,cAAc;AAAA,EAC3C,YAAY,SAAiB,MAAc,WAAmB;AAC5D,UAAM,SAAS,MAAM,KAAK,SAAS;AACnC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD,YAAY,SAAiB,MAAc,WAAmB;AAC5D,UAAM,SAAS,MAAM,KAAK,SAAS;AACnC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,kBAAN,cAA8B,cAAc;AAAA,EAGjD,YAAY,SAAiB,MAAc,WAAmB,SAAmB;AAC/E,UAAM,SAAS,MAAM,KAAK,SAAS;AACnC,SAAK,OAAO;AACZ,SAAK,UAAU;AAAA,EACjB;AACF;AAEO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,YAAY,SAAiB,MAAc,WAAmB;AAC5D,UAAM,SAAS,MAAM,KAAK,SAAS;AACnC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,YAAY,SAAiB,MAAc,WAAmB;AAC5D,UAAM,SAAS,MAAM,KAAK,SAAS;AACnC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAGhD,YAAY,SAAiB,MAAc,WAAmB,YAAoB;AAChF,UA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