@chainpatrol/sdk 0.7.0 → 0.8.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 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +31 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1275,17 +1275,17 @@ var PolyDateFormatter = class {
|
|
|
1275
1275
|
constructor(dt, intl, opts) {
|
|
1276
1276
|
this.opts = opts;
|
|
1277
1277
|
this.originalZone = void 0;
|
|
1278
|
-
let
|
|
1278
|
+
let z16 = void 0;
|
|
1279
1279
|
if (this.opts.timeZone) {
|
|
1280
1280
|
this.dt = dt;
|
|
1281
1281
|
} else if (dt.zone.type === "fixed") {
|
|
1282
1282
|
const gmtOffset = -1 * (dt.offset / 60);
|
|
1283
1283
|
const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
|
|
1284
1284
|
if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
|
|
1285
|
-
|
|
1285
|
+
z16 = offsetZ;
|
|
1286
1286
|
this.dt = dt;
|
|
1287
1287
|
} else {
|
|
1288
|
-
|
|
1288
|
+
z16 = "UTC";
|
|
1289
1289
|
this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ minutes: dt.offset });
|
|
1290
1290
|
this.originalZone = dt.zone;
|
|
1291
1291
|
}
|
|
@@ -1293,14 +1293,14 @@ var PolyDateFormatter = class {
|
|
|
1293
1293
|
this.dt = dt;
|
|
1294
1294
|
} else if (dt.zone.type === "iana") {
|
|
1295
1295
|
this.dt = dt;
|
|
1296
|
-
|
|
1296
|
+
z16 = dt.zone.name;
|
|
1297
1297
|
} else {
|
|
1298
|
-
|
|
1298
|
+
z16 = "UTC";
|
|
1299
1299
|
this.dt = dt.setZone("UTC").plus({ minutes: dt.offset });
|
|
1300
1300
|
this.originalZone = dt.zone;
|
|
1301
1301
|
}
|
|
1302
1302
|
const intlOpts = __spreadValues({}, this.opts);
|
|
1303
|
-
intlOpts.timeZone = intlOpts.timeZone ||
|
|
1303
|
+
intlOpts.timeZone = intlOpts.timeZone || z16;
|
|
1304
1304
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
1305
1305
|
}
|
|
1306
1306
|
format() {
|
|
@@ -7239,6 +7239,23 @@ z.object({
|
|
|
7239
7239
|
*/
|
|
7240
7240
|
next_page: z.string().nullable().optional().describe("Cursor for fetching the next page of results")
|
|
7241
7241
|
}).describe("Successful operation");
|
|
7242
|
+
var assetSubmitInputSchema = z.object({
|
|
7243
|
+
assets: z.array(z.string()).max(100).describe(
|
|
7244
|
+
"List of assets to classify, such as domains, social profiles, or blockchain addresses."
|
|
7245
|
+
),
|
|
7246
|
+
organizationSlug: z.string().optional().describe(
|
|
7247
|
+
"Organization slug to classify assets for. If not provided, the classification will be done for all organizations."
|
|
7248
|
+
)
|
|
7249
|
+
});
|
|
7250
|
+
z.object({
|
|
7251
|
+
submittedAssets: z.array(
|
|
7252
|
+
z.object({
|
|
7253
|
+
asset: z.string().describe("The original asset content submitted"),
|
|
7254
|
+
assetId: z.number().describe("The ID of the created or existing asset"),
|
|
7255
|
+
scanId: z.number().optional().describe("The ID of the asset scan created (if immediately created)")
|
|
7256
|
+
})
|
|
7257
|
+
).describe("Array of submitted assets with their corresponding IDs")
|
|
7258
|
+
});
|
|
7242
7259
|
var BASE_64_PATTERN = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
7243
7260
|
var reportCreateInputSchema = z.object({
|
|
7244
7261
|
/** Optional slug for identifying the organization within ChainPatrol. */
|
|
@@ -7505,6 +7522,14 @@ var ChainPatrolClient = class {
|
|
|
7505
7522
|
method: "POST",
|
|
7506
7523
|
body
|
|
7507
7524
|
});
|
|
7525
|
+
}),
|
|
7526
|
+
submit: (req) => __async(this, null, function* () {
|
|
7527
|
+
const body = assetSubmitInputSchema.parse(req);
|
|
7528
|
+
return yield this.fetch({
|
|
7529
|
+
path: ["v2", "asset", "submit"],
|
|
7530
|
+
method: "POST",
|
|
7531
|
+
body
|
|
7532
|
+
});
|
|
7508
7533
|
})
|
|
7509
7534
|
};
|
|
7510
7535
|
}
|