Skip to content

Commit

Permalink
refactor: Use ZodString.min(1) instead of deprecated `ZodString.non…
Browse files Browse the repository at this point in the history
…empty()` (#33)

chore: update CHANGELOG
  • Loading branch information
roushou authored Dec 17, 2024
1 parent 5a89384 commit 6b41b13
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions cdp-agentkit-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Refactor

- Use `ZodString.min(1)` instead of deprecated `ZodString.nonempty()`

## [0.0.8] - 2024-12-09

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const AccountMentionsInput = z
.object({
userId: z
.string()
.nonempty("Account ID is required.")
.min(1, "Account ID is required.")
.describe("The Twitter (X) user id to return mentions for"),
})
.strip()
Expand Down
16 changes: 8 additions & 8 deletions cdp-agentkit-core/src/twitter_agentkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ export const TwitterAgentkitOptions = z
.object({
apiKey: z
.string()
.nonempty("The Twitter (X) API key is required")
.min(1, "The Twitter (X) API key is required")
.describe("The Twitter (X) API key"),
apiSecret: z
.string()
.nonempty("The Twitter (X) API secret is required")
.min(1, "The Twitter (X) API secret is required")
.describe("The Twitter (X) API secret"),
accessToken: z
.string()
.nonempty("The Twitter (X) access token is required")
.min(1, "The Twitter (X) access token is required")
.describe("The Twitter (X) access token"),
accessTokenSecret: z
.string()
.nonempty("The Twitter (X) access token secret is required")
.min(1, "The Twitter (X) access token secret is required")
.describe("The Twitter (X) access token secret"),
})
.strip()
Expand All @@ -33,19 +33,19 @@ export const TwitterAgentkitOptions = z
const EnvSchema = z.object({
TWITTER_API_KEY: z
.string()
.nonempty("TWITTER_API_KEY is required")
.min(1, "TWITTER_API_KEY is required")
.describe("The Twitter (X) API key"),
TWITTER_API_SECRET: z
.string()
.nonempty("TWITTER_API_SECRET is required")
.min(1, "TWITTER_API_SECRET is required")
.describe("The Twitter (X) API secret"),
TWITTER_ACCESS_TOKEN: z
.string()
.nonempty("TWITTER_ACCESS_TOKEN is required")
.min(1, "TWITTER_ACCESS_TOKEN is required")
.describe("The Twitter (X) access token"),
TWITTER_ACCESS_TOKEN_SECRET: z
.string()
.nonempty("TWITTER_ACCESS_TOKEN_SECRET is required")
.min(1, "TWITTER_ACCESS_TOKEN_SECRET is required")
.describe("The Twitter (X) access token secret"),
});

Expand Down

0 comments on commit 6b41b13

Please sign in to comment.