@chainpatrol/sdk 0.6.0 → 0.7.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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +34 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7353,6 +7353,17 @@ z.object({
|
|
|
7353
7353
|
organizationLogo: z.string(),
|
|
7354
7354
|
organizationLogos: z.record(z.string(), z.string()),
|
|
7355
7355
|
hiddenLogos: z.record(z.string(), z.boolean()).default({}),
|
|
7356
|
+
logoCustomization: z.object({
|
|
7357
|
+
position: z.object({
|
|
7358
|
+
x: z.number(),
|
|
7359
|
+
y: z.number()
|
|
7360
|
+
}),
|
|
7361
|
+
size: z.object({
|
|
7362
|
+
width: z.number(),
|
|
7363
|
+
height: z.number()
|
|
7364
|
+
}),
|
|
7365
|
+
scale: z.number().min(0.1).max(3).default(1)
|
|
7366
|
+
}).optional(),
|
|
7356
7367
|
executiveSummary: z.string(),
|
|
7357
7368
|
overviewText: z.string(),
|
|
7358
7369
|
overviewDisplayLocation: z.enum(["cover", "separate"]).default("cover"),
|
|
@@ -7366,7 +7377,8 @@ z.object({
|
|
|
7366
7377
|
proposalId: z.number().optional(),
|
|
7367
7378
|
screenshotUrl: z.string().nullable().optional(),
|
|
7368
7379
|
screenshotUrls: z.array(z.string()).optional(),
|
|
7369
|
-
imageUrl: z.string().optional()
|
|
7380
|
+
imageUrl: z.string().optional(),
|
|
7381
|
+
takedownCompletedAt: z.string().nullable().optional()
|
|
7370
7382
|
})
|
|
7371
7383
|
),
|
|
7372
7384
|
productUpdates: z.array(
|
|
@@ -7408,7 +7420,15 @@ z.object({
|
|
|
7408
7420
|
title: z.string(),
|
|
7409
7421
|
content: z.string()
|
|
7410
7422
|
})
|
|
7411
|
-
).default([])
|
|
7423
|
+
).default([]),
|
|
7424
|
+
faqs: z.record(
|
|
7425
|
+
z.string(),
|
|
7426
|
+
z.object({
|
|
7427
|
+
title: z.string(),
|
|
7428
|
+
content: z.string(),
|
|
7429
|
+
enabled: z.boolean().default(true)
|
|
7430
|
+
})
|
|
7431
|
+
).default({})
|
|
7412
7432
|
});
|
|
7413
7433
|
|
|
7414
7434
|
// src/client.ts
|
|
@@ -7428,28 +7448,36 @@ var ChainPatrolClientErrorCodes = /* @__PURE__ */ ((ChainPatrolClientErrorCodes2
|
|
|
7428
7448
|
})(ChainPatrolClientErrorCodes || {});
|
|
7429
7449
|
var ChainPatrolClient = class {
|
|
7430
7450
|
constructor(options) {
|
|
7431
|
-
var _a;
|
|
7451
|
+
var _a, _b;
|
|
7432
7452
|
if (!options.apiKey) {
|
|
7433
7453
|
throw new ChainPatrolClientError(
|
|
7434
7454
|
"Missing API key",
|
|
7435
7455
|
"MISSING_API_KEY" /* MISSING_API_KEY */
|
|
7436
7456
|
);
|
|
7437
7457
|
}
|
|
7438
|
-
this.baseUrl = (
|
|
7458
|
+
this.baseUrl = trimTrailingSlashes(
|
|
7459
|
+
(_a = options.baseUrl) != null ? _a : "https://app.chainpatrol.io/api/"
|
|
7460
|
+
);
|
|
7439
7461
|
this.logger = new Logger({ component: "ChainPatrolClient" });
|
|
7440
7462
|
this.apiKey = options.apiKey;
|
|
7463
|
+
this.fetchOptions = (_b = options.fetchOptions) != null ? _b : {};
|
|
7441
7464
|
}
|
|
7442
7465
|
fetch(req) {
|
|
7443
7466
|
return __async(this, null, function* () {
|
|
7467
|
+
var _a;
|
|
7444
7468
|
const url = `${trimTrailingSlashes(this.baseUrl)}/${req.path.join("/")}`;
|
|
7445
7469
|
this.logger.debug("fetch", { url, req });
|
|
7446
7470
|
const bodyString = JSON.stringify(req.body);
|
|
7447
7471
|
const res = yield fetch(url, {
|
|
7448
7472
|
method: req.method,
|
|
7449
|
-
headers: {
|
|
7473
|
+
headers: __spreadValues({
|
|
7450
7474
|
"Content-Type": "application/json",
|
|
7451
7475
|
"X-Api-Key": this.apiKey
|
|
7452
|
-
},
|
|
7476
|
+
}, (_a = this.fetchOptions.headers) != null ? _a : {}),
|
|
7477
|
+
signal: this.fetchOptions.signal,
|
|
7478
|
+
redirect: this.fetchOptions.redirect,
|
|
7479
|
+
mode: this.fetchOptions.mode,
|
|
7480
|
+
credentials: this.fetchOptions.credentials,
|
|
7453
7481
|
body: bodyString
|
|
7454
7482
|
});
|
|
7455
7483
|
if (!res.ok) {
|