@agg-build/sdk 4.26.0 → 4.27.2
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/dist/agg-websocket-CK2iXfti.mjs +1427 -0
- package/dist/agg-websocket-CK2iXfti.mjs.map +1 -0
- package/dist/agg-websocket-DJbIfxKb.js +1478 -0
- package/dist/agg-websocket-DoUDmsvW.d.mts +6009 -0
- package/dist/agg-websocket-DoUDmsvW.d.mts.map +1 -0
- package/dist/agg-websocket-DoUDmsvW.d.ts +6009 -0
- package/dist/agg-websocket-DoUDmsvW.d.ts.map +1 -0
- package/dist/browser.d.mts +67 -66
- package/dist/browser.d.mts.map +1 -0
- package/dist/browser.d.ts +67 -66
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +720 -2173
- package/dist/browser.mjs +423 -799
- package/dist/browser.mjs.map +1 -0
- package/dist/candle-builder-BNewIe9K.mjs +148 -0
- package/dist/candle-builder-BNewIe9K.mjs.map +1 -0
- package/dist/candle-builder-BULYdxB4.js +151 -0
- package/dist/index.d.mts +2 -1349
- package/dist/index.d.ts +2 -1349
- package/dist/index.js +2794 -4808
- package/dist/index.mjs +2788 -2512
- package/dist/index.mjs.map +1 -0
- package/dist/market-data.d.mts +6 -6
- package/dist/market-data.d.mts.map +1 -0
- package/dist/market-data.d.ts +6 -6
- package/dist/market-data.d.ts.map +1 -0
- package/dist/market-data.js +314 -1900
- package/dist/market-data.mjs +314 -350
- package/dist/market-data.mjs.map +1 -0
- package/dist/server.d.mts +235 -234
- package/dist/server.d.mts.map +1 -0
- package/dist/server.d.ts +235 -234
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +168 -296
- package/dist/server.mjs +163 -234
- package/dist/server.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/agg-websocket-x_U4-orL.d.mts +0 -4598
- package/dist/agg-websocket-x_U4-orL.d.ts +0 -4598
- package/dist/chunk-CPMSVNBO.mjs +0 -2199
- package/dist/chunk-VD5UTAVD.mjs +0 -158
- package/dist/chunk-WNQUEZJF.mjs +0 -58
package/dist/server.js
CHANGED
|
@@ -1,313 +1,185 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
-
var __export = (target, all) => {
|
|
24
|
-
for (var name in all)
|
|
25
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
-
};
|
|
27
|
-
var __copyProps = (to, from, except, desc) => {
|
|
28
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
-
for (let key of __getOwnPropNames(from))
|
|
30
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
-
}
|
|
33
|
-
return to;
|
|
34
|
-
};
|
|
35
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
-
var __async = (__this, __arguments, generator) => {
|
|
37
|
-
return new Promise((resolve, reject) => {
|
|
38
|
-
var fulfilled = (value) => {
|
|
39
|
-
try {
|
|
40
|
-
step(generator.next(value));
|
|
41
|
-
} catch (e) {
|
|
42
|
-
reject(e);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var rejected = (value) => {
|
|
46
|
-
try {
|
|
47
|
-
step(generator.throw(value));
|
|
48
|
-
} catch (e) {
|
|
49
|
-
reject(e);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// src/server.ts
|
|
58
|
-
var server_exports = {};
|
|
59
|
-
__export(server_exports, {
|
|
60
|
-
AggAdminClient: () => AggAdminClient,
|
|
61
|
-
WebhookVerificationError: () => WebhookVerificationError,
|
|
62
|
-
parseWebhookEvent: () => parseWebhookEvent,
|
|
63
|
-
parseWebhookEventAsync: () => parseWebhookEventAsync,
|
|
64
|
-
signExternalId: () => signExternalId,
|
|
65
|
-
verifyWebhook: () => verifyWebhook,
|
|
66
|
-
verifyWebhookAsync: () => verifyWebhookAsync
|
|
67
|
-
});
|
|
68
|
-
module.exports = __toCommonJS(server_exports);
|
|
69
|
-
var import_node_crypto = require("crypto");
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let node_crypto = require("node:crypto");
|
|
3
|
+
//#region src/server.ts
|
|
70
4
|
function signExternalId(appSecret, externalId) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
};
|
|
5
|
+
const timestamp = Date.now();
|
|
6
|
+
return {
|
|
7
|
+
externalId,
|
|
8
|
+
timestamp,
|
|
9
|
+
hmac: (0, node_crypto.createHmac)("sha256", Buffer.from(appSecret, "hex")).update(`${externalId}:${timestamp}`).digest("hex")
|
|
10
|
+
};
|
|
78
11
|
}
|
|
79
|
-
|
|
12
|
+
const textEncoder = new TextEncoder();
|
|
80
13
|
function base64Decode(s) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
14
|
+
const bin = atob(s);
|
|
15
|
+
const out = new Uint8Array(bin.length);
|
|
16
|
+
for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);
|
|
17
|
+
return out;
|
|
85
18
|
}
|
|
86
|
-
function importHmacKey(secret) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
]);
|
|
93
|
-
});
|
|
19
|
+
async function importHmacKey(secret) {
|
|
20
|
+
const keyBytes = base64Decode(secret.replace(/^whsec_/, ""));
|
|
21
|
+
return crypto.subtle.importKey("raw", keyBytes, {
|
|
22
|
+
name: "HMAC",
|
|
23
|
+
hash: "SHA-256"
|
|
24
|
+
}, false, ["sign", "verify"]);
|
|
94
25
|
}
|
|
95
26
|
var WebhookVerificationError = class extends Error {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
27
|
+
constructor(message) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = "WebhookVerificationError";
|
|
30
|
+
}
|
|
100
31
|
};
|
|
101
32
|
function verifyWebhook(payload, headers, secret, options) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const matched = signatures.split(" ").some((sig) => {
|
|
122
|
-
const sigBuf = Buffer.from(sig);
|
|
123
|
-
return sigBuf.length === expectedBuf.length && (0, import_node_crypto.timingSafeEqual)(sigBuf, expectedBuf);
|
|
124
|
-
});
|
|
125
|
-
if (!matched) {
|
|
126
|
-
throw new WebhookVerificationError("Invalid webhook signature");
|
|
127
|
-
}
|
|
33
|
+
const tolerance = options?.toleranceSeconds ?? 300;
|
|
34
|
+
const msgId = getHeader(headers, "webhook-id");
|
|
35
|
+
const timestamp = getHeader(headers, "webhook-timestamp");
|
|
36
|
+
const signatures = getHeader(headers, "webhook-signature");
|
|
37
|
+
if (!msgId) throw new WebhookVerificationError("Missing Webhook-Id header");
|
|
38
|
+
if (!timestamp) throw new WebhookVerificationError("Missing Webhook-Timestamp header");
|
|
39
|
+
if (!signatures) throw new WebhookVerificationError("Missing Webhook-Signature header");
|
|
40
|
+
const ts = parseInt(timestamp, 10);
|
|
41
|
+
if (isNaN(ts)) throw new WebhookVerificationError("Invalid Webhook-Timestamp");
|
|
42
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
43
|
+
if (Math.abs(now - ts) > tolerance) throw new WebhookVerificationError("Webhook timestamp outside tolerance window");
|
|
44
|
+
const secretBytes = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
|
|
45
|
+
const signedContent = `${msgId}.${timestamp}.${payload}`;
|
|
46
|
+
const expectedSig = `v1,${(0, node_crypto.createHmac)("sha256", secretBytes).update(signedContent).digest("base64")}`;
|
|
47
|
+
const expectedBuf = Buffer.from(expectedSig);
|
|
48
|
+
if (!signatures.split(" ").some((sig) => {
|
|
49
|
+
const sigBuf = Buffer.from(sig);
|
|
50
|
+
return sigBuf.length === expectedBuf.length && (0, node_crypto.timingSafeEqual)(sigBuf, expectedBuf);
|
|
51
|
+
})) throw new WebhookVerificationError("Invalid webhook signature");
|
|
128
52
|
}
|
|
129
53
|
function parseWebhookEvent(payload, headers, secret, options) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return parsed;
|
|
54
|
+
verifyWebhook(payload, headers, secret, options);
|
|
55
|
+
return JSON.parse(payload);
|
|
133
56
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
});
|
|
57
|
+
/**
|
|
58
|
+
* Async, edge-runtime-friendly variant of {@link verifyWebhook}. Same
|
|
59
|
+
* Svix v1 signing scheme. Use this in Cloudflare Workers / Vercel Edge /
|
|
60
|
+
* Deno / Bun. The sync variant remains available for Node.js consumers.
|
|
61
|
+
*/
|
|
62
|
+
async function verifyWebhookAsync(payload, headers, secret, options) {
|
|
63
|
+
const tolerance = options?.toleranceSeconds ?? 300;
|
|
64
|
+
const msgId = getHeader(headers, "webhook-id");
|
|
65
|
+
const timestamp = getHeader(headers, "webhook-timestamp");
|
|
66
|
+
const signatures = getHeader(headers, "webhook-signature");
|
|
67
|
+
if (!msgId) throw new WebhookVerificationError("Missing Webhook-Id header");
|
|
68
|
+
if (!timestamp) throw new WebhookVerificationError("Missing Webhook-Timestamp header");
|
|
69
|
+
if (!signatures) throw new WebhookVerificationError("Missing Webhook-Signature header");
|
|
70
|
+
const ts = parseInt(timestamp, 10);
|
|
71
|
+
if (isNaN(ts)) throw new WebhookVerificationError("Invalid Webhook-Timestamp");
|
|
72
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
73
|
+
if (Math.abs(now - ts) > tolerance) throw new WebhookVerificationError("Webhook timestamp outside tolerance window");
|
|
74
|
+
const key = await importHmacKey(secret);
|
|
75
|
+
const signed = textEncoder.encode(`${msgId}.${timestamp}.${payload}`);
|
|
76
|
+
for (const sig of signatures.split(" ")) {
|
|
77
|
+
if (!sig.startsWith("v1,")) continue;
|
|
78
|
+
let sigBytes;
|
|
79
|
+
try {
|
|
80
|
+
sigBytes = base64Decode(sig.slice(3));
|
|
81
|
+
} catch {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (await crypto.subtle.verify("HMAC", key, sigBytes, signed)) return;
|
|
85
|
+
}
|
|
86
|
+
throw new WebhookVerificationError("Invalid webhook signature");
|
|
165
87
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Async, edge-runtime-friendly variant of {@link parseWebhookEvent}.
|
|
90
|
+
*/
|
|
91
|
+
async function parseWebhookEventAsync(payload, headers, secret, options) {
|
|
92
|
+
await verifyWebhookAsync(payload, headers, secret, options);
|
|
93
|
+
return JSON.parse(payload);
|
|
172
94
|
}
|
|
173
95
|
var AggAdminClient = class {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return this.request(`/apps/${appId}/analytics`);
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
listOrders(appId, query) {
|
|
250
|
-
return __async(this, null, function* () {
|
|
251
|
-
var _a;
|
|
252
|
-
return this.request(`/apps/${appId}/orders`, {
|
|
253
|
-
query: {
|
|
254
|
-
limit: (_a = query == null ? void 0 : query.limit) == null ? void 0 : _a.toString(),
|
|
255
|
-
cursor: query == null ? void 0 : query.cursor,
|
|
256
|
-
venue: query == null ? void 0 : query.venue,
|
|
257
|
-
status: query == null ? void 0 : query.status
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
// ── Webhooks ─────────────────────────────────────────────────────────
|
|
263
|
-
rotateWebhookSecret(appId, webhookId) {
|
|
264
|
-
return __async(this, null, function* () {
|
|
265
|
-
return this.request(`/apps/${appId}/webhooks/${webhookId}/rotate-secret`, {
|
|
266
|
-
method: "POST"
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
replayWebhookDeliveries(appId, webhookId) {
|
|
271
|
-
return __async(this, null, function* () {
|
|
272
|
-
return this.request(`/apps/${appId}/webhooks/${webhookId}/replay`, {
|
|
273
|
-
method: "POST"
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
// ── Market Resolutions ───────────────────────────────────────────────
|
|
278
|
-
listMarketResolutionUsers(appId, venueMarketId, query) {
|
|
279
|
-
return __async(this, null, function* () {
|
|
280
|
-
var _a;
|
|
281
|
-
return this.request(`/apps/${appId}/market-resolutions/${venueMarketId}/users`, {
|
|
282
|
-
query: {
|
|
283
|
-
limit: (_a = query == null ? void 0 : query.limit) == null ? void 0 : _a.toString(),
|
|
284
|
-
cursor: query == null ? void 0 : query.cursor,
|
|
285
|
-
includeEmails: (query == null ? void 0 : query.includeEmails) ? "true" : void 0
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
}
|
|
96
|
+
constructor(options) {
|
|
97
|
+
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
98
|
+
this.apiKey = options.apiKey;
|
|
99
|
+
}
|
|
100
|
+
async request(path, init) {
|
|
101
|
+
const response = await this.rawFetch(path, init);
|
|
102
|
+
if (!response.ok) return this.throwResponseError(response);
|
|
103
|
+
return response.json();
|
|
104
|
+
}
|
|
105
|
+
async rawFetch(path, init) {
|
|
106
|
+
const headers = {
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
|
+
"x-app-api-key": this.apiKey
|
|
109
|
+
};
|
|
110
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
111
|
+
if (init?.query) for (const [key, value] of Object.entries(init.query)) {
|
|
112
|
+
if (value === void 0) continue;
|
|
113
|
+
if (Array.isArray(value)) for (const v of value) url.searchParams.append(key, v);
|
|
114
|
+
else url.searchParams.set(key, value);
|
|
115
|
+
}
|
|
116
|
+
return fetch(url, {
|
|
117
|
+
...init,
|
|
118
|
+
headers: {
|
|
119
|
+
...headers,
|
|
120
|
+
...init?.headers
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async throwResponseError(response) {
|
|
125
|
+
let message = `AGG API error: ${response.status} ${response.statusText}`;
|
|
126
|
+
try {
|
|
127
|
+
const body = await response.json();
|
|
128
|
+
if (typeof body.message === "string" && body.message.length > 0) message = body.message;
|
|
129
|
+
} catch {}
|
|
130
|
+
const error = new Error(message);
|
|
131
|
+
error.status = response.status;
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
async listUsers(appId, query) {
|
|
135
|
+
return this.request(`/apps/${appId}/users`, { query: {
|
|
136
|
+
limit: query?.limit?.toString(),
|
|
137
|
+
cursor: query?.cursor,
|
|
138
|
+
search: query?.search
|
|
139
|
+
} });
|
|
140
|
+
}
|
|
141
|
+
async getUser(appId, userId) {
|
|
142
|
+
return this.request(`/apps/${appId}/users/${userId}`);
|
|
143
|
+
}
|
|
144
|
+
async getAnalytics(appId) {
|
|
145
|
+
return this.request(`/apps/${appId}/analytics`);
|
|
146
|
+
}
|
|
147
|
+
async listOrders(appId, query) {
|
|
148
|
+
return this.request(`/apps/${appId}/orders`, { query: {
|
|
149
|
+
limit: query?.limit?.toString(),
|
|
150
|
+
cursor: query?.cursor,
|
|
151
|
+
venue: query?.venue,
|
|
152
|
+
status: query?.status
|
|
153
|
+
} });
|
|
154
|
+
}
|
|
155
|
+
async rotateWebhookSecret(appId, webhookId) {
|
|
156
|
+
return this.request(`/apps/${appId}/webhooks/${webhookId}/rotate-secret`, { method: "POST" });
|
|
157
|
+
}
|
|
158
|
+
async replayWebhookDeliveries(appId, webhookId) {
|
|
159
|
+
return this.request(`/apps/${appId}/webhooks/${webhookId}/replay`, { method: "POST" });
|
|
160
|
+
}
|
|
161
|
+
async listMarketResolutionUsers(appId, venueMarketId, query) {
|
|
162
|
+
return this.request(`/apps/${appId}/market-resolutions/${venueMarketId}/users`, { query: {
|
|
163
|
+
limit: query?.limit?.toString(),
|
|
164
|
+
cursor: query?.cursor,
|
|
165
|
+
includeEmails: query?.includeEmails ? "true" : void 0
|
|
166
|
+
} });
|
|
167
|
+
}
|
|
290
168
|
};
|
|
291
169
|
function getHeader(headers, name) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return Array.isArray(v) ? v[0] : v;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
return void 0;
|
|
170
|
+
const val = headers[name] ?? headers[name.toLowerCase()];
|
|
171
|
+
if (val !== void 0) return Array.isArray(val) ? val[0] : val;
|
|
172
|
+
const lower = name.toLowerCase();
|
|
173
|
+
for (const key of Object.keys(headers)) if (key.toLowerCase() === lower) {
|
|
174
|
+
const v = headers[key];
|
|
175
|
+
return Array.isArray(v) ? v[0] : v;
|
|
176
|
+
}
|
|
303
177
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
verifyWebhookAsync
|
|
313
|
-
});
|
|
178
|
+
//#endregion
|
|
179
|
+
exports.AggAdminClient = AggAdminClient;
|
|
180
|
+
exports.WebhookVerificationError = WebhookVerificationError;
|
|
181
|
+
exports.parseWebhookEvent = parseWebhookEvent;
|
|
182
|
+
exports.parseWebhookEventAsync = parseWebhookEventAsync;
|
|
183
|
+
exports.signExternalId = signExternalId;
|
|
184
|
+
exports.verifyWebhook = verifyWebhook;
|
|
185
|
+
exports.verifyWebhookAsync = verifyWebhookAsync;
|