Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use ZodString.min(1) instead of deprecated ZodString.nonempty() #33

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading