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