Skip to content

Commit

Permalink
Remove circular dep
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetso committed Dec 23, 2024
1 parent 05f156d commit 5b1b90b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 1 addition & 21 deletions packages/types/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type { infer as zInfer } from "zod";
import z, { boolean } from "zod";
import {
ApiPathRateLimits,
ProsopoCaptchaCountConfigSchema,
ProviderDefaultRateLimits,
} from "../provider/index.js";
import {
Expand Down Expand Up @@ -115,27 +116,6 @@ export const ProsopoBasicConfigSchema = ProsopoBaseConfigSchema.merge(
export type ProsopoBasicConfigInput = input<typeof ProsopoBasicConfigSchema>;
export type ProsopoBasicConfigOutput = output<typeof ProsopoBasicConfigSchema>;

export const ProsopoCaptchaCountConfigSchema = object({
solved: object({
count: number().positive(),
})
.optional()
.default({ count: 1 }),
unsolved: object({
count: number().nonnegative(),
})
.optional()
.default({ count: 0 }),
});

export type ProsopoCaptchaCountConfigSchemaInput = input<
typeof ProsopoCaptchaCountConfigSchema
>;

export type ProsopoCaptchaCountConfigSchemaOutput = output<
typeof ProsopoCaptchaCountConfigSchema
>;

export const ProsopoImageServerConfigSchema = object({
baseURL: string().url(),
port: number().optional().default(9229),
Expand Down
22 changes: 21 additions & 1 deletion packages/types/src/provider/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
type infer as zInfer,
} from "zod";
import { ApiParams } from "../api/params.js";
import { ProsopoCaptchaCountConfigSchema } from "../config/index.js";
import {
DEFAULT_IMAGE_MAX_VERIFIED_TIME_CACHED,
DEFAULT_POW_CAPTCHA_VERIFIED_TIMEOUT,
Expand Down Expand Up @@ -350,6 +349,27 @@ export const RegisterSitekeyBody = object({
}).optional(),
});

export const ProsopoCaptchaCountConfigSchema = object({
solved: object({
count: number().positive(),
})
.optional()
.default({ count: 1 }),
unsolved: object({
count: number().nonnegative(),
})
.optional()
.default({ count: 0 }),
});

export type ProsopoCaptchaCountConfigSchemaInput = input<
typeof ProsopoCaptchaCountConfigSchema
>;

export type ProsopoCaptchaCountConfigSchemaOutput = output<
typeof ProsopoCaptchaCountConfigSchema
>;

export enum BlockRuleType {
ipAddress = "ipAddress",
userAccount = "userAccount",
Expand Down

0 comments on commit 5b1b90b

Please sign in to comment.