Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
import test from "node:test";
import assert from "node:assert/strict";
const { createProviderNodeSchema, updateProviderNodeSchema } =
await import("../../src/shared/validation/schemas/provider.ts");
const BASE = {
name: "Moonshot native",
prefix: "mnative",
baseUrl: "https://api.moonshot.cn/v1",
};
test("updateProviderNodeSchema accepts IANA timezone + hour 0", () => {
const result = updateProviderNodeSchema.safeParse({
...BASE,
dailyQuotaResetTimezone: "Asia/Shanghai",
dailyQuotaResetHour: 0,
});
assert.equal(result.success, true);
});
test("updateProviderNodeSchema rejects unknown timezone", () => {
const result = updateProviderNodeSchema.safeParse({
...BASE,
dailyQuotaResetTimezone: "Shanghai",
dailyQuotaResetHour: 0,
});
assert.equal(result.success, false);
});
test("updateProviderNodeSchema rejects hour 24", () => {
const result = updateProviderNodeSchema.safeParse({
...BASE,
dailyQuotaResetTimezone: "Asia/Shanghai",
dailyQuotaResetHour: 24,
});
assert.equal(result.success, false);
});
test("updateProviderNodeSchema accepts omitted reset clock", () => {
const result = updateProviderNodeSchema.safeParse(BASE);
assert.equal(result.success, true);
});
test("createProviderNodeSchema accepts IANA timezone + hour", () => {
const result = createProviderNodeSchema.safeParse({
...BASE,
apiType: "chat",
type: "openai-compatible",
dailyQuotaResetTimezone: "UTC",
dailyQuotaResetHour: 0,
});
assert.equal(result.success, true);
});