Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"pg": "8.20.0",
"picocolors": "^1.1.1",
"posthog-node": "^5.33.5",
"zod": "^4.3.6"
"zod": "^4.4.3"
},
"peerDependencies": {
"@cipherstash/stack": ">=0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"lint": "biome check ."
},
"dependencies": {
"zod": "^3.24.2"
"zod": "^4.4.3"
},
"peerDependencies": {
"@cipherstash/stack": ">=0.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/migrate/src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ManifestColumnSchema = z.object({
const ManifestSchema = z.object({
version: z.literal(1).default(1),
/** Map of table name → array of column intents for that table. */
tables: z.record(z.array(ManifestColumnSchema)),
tables: z.record(z.string(), z.array(ManifestColumnSchema)),
})

export type Manifest = z.infer<typeof ManifestSchema>
Expand Down
2 changes: 1 addition & 1 deletion packages/protect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@cipherstash/schema": "workspace:*",
"@stricli/core": "^1.2.6",
"dotenv": "17.4.2",
"zod": "^3.24.2"
"zod": "^4.4.3"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.60.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"vitest": "catalog:repo"
},
"dependencies": {
"zod": "^3.24.2"
"zod": "^4.4.3"
},
"publishConfig": {
"access": "public"
Expand Down
19 changes: 14 additions & 5 deletions packages/schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,24 @@ const indexesSchema = z
})
.default({})

// `.prefault` (not `.default`) because the default `{}` is an *input* value
// that must be parsed to fill in `cast_as` and `indexes` defaults. In zod 4
// `.default` takes an already-parsed output value and skips parsing.
const columnSchema = z
.object({
cast_as: castAsEnum,
indexes: indexesSchema,
})
.default({})
.prefault({})

const tableSchema = z.record(columnSchema).default({})
const tableSchema = z.record(z.string(), columnSchema).default({})

const tablesSchema = z.record(tableSchema).default({})
const tablesSchema = z.record(z.string(), tableSchema).default({})

export const encryptConfigSchema = z.object({
// Annotated as ZodType<EncryptConfig> so the emitted .d.ts exposes a shallow
// type. The fully-inferred zod 4 type for this triply-nested record is too
// deep for consumers to instantiate, which degrades `tables` to `unknown`.
export const encryptConfigSchema: z.ZodType<EncryptConfig> = z.object({
v: z.number(),
tables: tablesSchema,
})
Expand Down Expand Up @@ -127,7 +133,10 @@ export type ProtectTableColumn = {
}
}
}
export type EncryptConfig = z.infer<typeof encryptConfigSchema>
export type EncryptConfig = {
v: number
tables: Record<string, Record<string, ColumnSchema>>
}

// ------------------------
// Interface definitions
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"@cipherstash/protect-ffi": "0.21.4",
"evlog": "1.9.0",
"uuid": "14.0.0",
"zod": "3.24.2"
"zod": "4.4.3"
},
"peerDependencies": {
"@supabase/supabase-js": ">=2",
Expand Down
19 changes: 14 additions & 5 deletions packages/stack/src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,25 @@ const indexesSchema = z
})
.default({})

// `.prefault` (not `.default`) because the default `{}` is an *input* value
// that must be parsed to fill in `cast_as` and `indexes` defaults. In zod 4
// `.default` takes an already-parsed output value and skips parsing.
const columnSchema = z
.object({
cast_as: castAsEnum,
indexes: indexesSchema,
})
.default({})
.prefault({})

const tableSchema = z.record(columnSchema).default({})
const tableSchema = z.record(z.string(), columnSchema).default({})

const tablesSchema = z.record(tableSchema).default({})
const tablesSchema = z.record(z.string(), tableSchema).default({})

// Annotated as ZodType<EncryptConfig> so the emitted .d.ts exposes a shallow
// type. The fully-inferred zod 4 type for this triply-nested record is too
// deep for consumers to instantiate, which degrades `tables` to `unknown`.
/** @internal */
export const encryptConfigSchema = z.object({
export const encryptConfigSchema: z.ZodType<EncryptConfig> = z.object({
v: z.number(),
tables: tablesSchema,
})
Expand Down Expand Up @@ -183,7 +189,10 @@ export type EncryptedTableColumn = {
}
}
}
export type EncryptConfig = z.infer<typeof encryptConfigSchema>
export type EncryptConfig = {
v: number
tables: Record<string, Record<string, ColumnSchema>>
}

// ------------------------
// Interface definitions
Expand Down
2 changes: 1 addition & 1 deletion packages/wizard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"pg": "8.20.0",
"picocolors": "^1.1.1",
"posthog-node": "^5.33.5",
"zod": "^4.3.6"
"zod": "^4.4.3"
},
"devDependencies": {
"@types/pg": "^8.20.0",
Expand Down
59 changes: 27 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading