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