@chainpatrol/sdk 0.4.0 → 0.4.1

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.ts CHANGED
@@ -77,9 +77,9 @@ declare class ChainPatrolClient {
77
77
  id: number;
78
78
  createdAt: Date;
79
79
  organization: {
80
- slug: string;
81
- name: string;
82
80
  id: number;
81
+ name: string;
82
+ slug: string;
83
83
  } | null;
84
84
  }>;
85
85
  };
package/dist/index.js CHANGED
@@ -466,6 +466,24 @@ function normalizeUrl(urlString, options) {
466
466
  }
467
467
  return urlString;
468
468
  }
469
+ zod.z.object({
470
+ assetId: zod.z.number()
471
+ });
472
+ zod.z.object({
473
+ id: zod.z.number().optional(),
474
+ assetId: zod.z.number().optional(),
475
+ active: zod.z.boolean()
476
+ });
477
+ zod.z.object({
478
+ // Required
479
+ content: zod.z.string().min(1, {
480
+ message: "Content is required"
481
+ }).max(1e3, {
482
+ message: "Content cannot be longer than 1000 characters"
483
+ }).describe("Asset content"),
484
+ name: zod.z.string().optional().describe("Asset name"),
485
+ description: zod.z.string().nullish().optional().describe("Asset description")
486
+ });
469
487
  zod.z.object({
470
488
  slug: zod.z.string(),
471
489
  assetId: zod.z.number(),
@@ -1951,15 +1969,15 @@ var PolyNumberFormatter = class {
1951
1969
  var PolyDateFormatter = class {
1952
1970
  constructor(dt, intl, opts) {
1953
1971
  this.opts = opts;
1954
- let z9;
1972
+ let z12;
1955
1973
  if (dt.zone.isUniversal) {
1956
1974
  const gmtOffset = -1 * (dt.offset / 60);
1957
1975
  const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
1958
1976
  if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
1959
- z9 = offsetZ;
1977
+ z12 = offsetZ;
1960
1978
  this.dt = dt;
1961
1979
  } else {
1962
- z9 = "UTC";
1980
+ z12 = "UTC";
1963
1981
  if (opts.timeZoneName) {
1964
1982
  this.dt = dt;
1965
1983
  } else {
@@ -1970,11 +1988,11 @@ var PolyDateFormatter = class {
1970
1988
  this.dt = dt;
1971
1989
  } else {
1972
1990
  this.dt = dt;
1973
- z9 = dt.zone.name;
1991
+ z12 = dt.zone.name;
1974
1992
  }
1975
1993
  const intlOpts = __spreadValues({}, this.opts);
1976
- if (z9) {
1977
- intlOpts.timeZone = z9;
1994
+ if (z12) {
1995
+ intlOpts.timeZone = z12;
1978
1996
  }
1979
1997
  this.dtf = getCachedDTF(intl, intlOpts);
1980
1998
  }
@@ -6249,7 +6267,8 @@ var AssetType = {
6249
6267
  EMAIL: "EMAIL",
6250
6268
  PATREON: "PATREON",
6251
6269
  OPENSEA: "OPENSEA",
6252
- FARCASTER: "FARCASTER"
6270
+ FARCASTER: "FARCASTER",
6271
+ IPFS: "IPFS"
6253
6272
  };
6254
6273
  var AssetStatus = {
6255
6274
  UNKNOWN: "UNKNOWN",
@@ -6258,6 +6277,7 @@ var AssetStatus = {
6258
6277
  };
6259
6278
 
6260
6279
  // ../../internal/validation/src/public/asset/changelog.ts
6280
+ var DateString = zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Must be in the format `YYYY-MM-DD`").pipe(zod.z.coerce.date());
6261
6281
  zod.z.object({
6262
6282
  /** The type of asset to retrieve. */
6263
6283
  type: zod.z.nativeEnum(AssetType).optional().describe("Asset type"),
@@ -6272,7 +6292,7 @@ zod.z.object({
6272
6292
  * Transformed into JavaScript Date objects from strings.
6273
6293
  * If the startDate is after the endDate, a validation error will occur.
6274
6294
  */
6275
- startDate: zod.z.string().transform((str) => new Date(str)).optional().describe(
6295
+ startDate: DateString.optional().describe(
6276
6296
  "The start date to list items from. This should be in the format `YYYY-MM-DD` and is inclusive."
6277
6297
  ),
6278
6298
  /**
@@ -6281,7 +6301,7 @@ zod.z.object({
6281
6301
  * Transformed into JavaScript Date objects from strings.
6282
6302
  * If the startDate is after the endDate, a validation error will occur.
6283
6303
  */
6284
- endDate: zod.z.string().transform((str) => new Date(str)).optional().describe(
6304
+ endDate: DateString.optional().describe(
6285
6305
  "The end date to list items from. This should be in the format `YYYY-MM-DD` and is inclusive."
6286
6306
  )
6287
6307
  }).describe(
@@ -6297,15 +6317,13 @@ for parsing the dates.`
6297
6317
  data.endDate = DateTime.now().toJSDate();
6298
6318
  }
6299
6319
  return data;
6300
- }).refine((data) => {
6301
- if (data.startDate && data.endDate && data.startDate > data.endDate) {
6302
- return {
6303
- path: ["startDate"],
6304
- message: "startDate must be before endDate"
6305
- };
6320
+ }).refine(
6321
+ (data) => data.startDate !== void 0 && data.endDate !== void 0 && data.startDate <= data.endDate,
6322
+ {
6323
+ path: ["startDate"],
6324
+ message: "startDate must be before endDate"
6306
6325
  }
6307
- return true;
6308
- });
6326
+ );
6309
6327
  zod.z.object({
6310
6328
  /** An array of asset change with their content, type, status, and update timestamp. */
6311
6329
  changelog: zod.z.array(
@@ -6401,6 +6419,8 @@ var reportCreateInputSchema = zod.z.object({
6401
6419
  organizationSlug: zod.z.string().describe("Organization slug used to identify the organization on ChainPatrol").optional(),
6402
6420
  /** Optional Discord Guild ID associated with the organization. */
6403
6421
  discordGuildId: zod.z.string().describe("Discord Guild (Server) ID linked to the organization on ChainPatrol").optional(),
6422
+ /** Optional Telegram Group ID associated with the organization. */
6423
+ telegramGroupId: zod.z.string().describe("Telegram Group ID linked to the organization on ChainPatrol").optional(),
6404
6424
  /** Title of the report. */
6405
6425
  title: zod.z.string().min(3).describe("Title of the report"),
6406
6426
  /** Description of the report, supporting markdown syntax. */