Skip to content
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
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"peerDependencies": {
"luxon": "^3.5.0",
"typescript": "^5.7.3",
"zod": "3.25.76"
"zod": "4.0.14"
},
"dependencies": {
"radashi": "^12.6.0"
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const tierMapSchema = z.object({
better: tierDetailsRawSchema,
best: tierDetailsRawSchema
});
export const tierIds = Object.keys(tierMapSchema.shape) as Array<keyof z.infer<typeof tierMapSchema>>;
export const tierIds = Object.keys(tierMapSchema.shape) as ReadonlyArray<keyof z.infer<typeof tierMapSchema>>;

export const topupMapSchema = z.object({
single: productRawSchema
});
export const topupIds = Object.keys(topupMapSchema.shape) as Array<keyof z.infer<typeof topupMapSchema>>;
export const topupIds = Object.keys(topupMapSchema.shape) as ReadonlyArray<keyof z.infer<typeof topupMapSchema>>;

export const customerPortalFlowTypeSchema = z.enum([
'subscription_cancel',
Expand Down
4 changes: 2 additions & 2 deletions src/types/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import type {
} from '@schemas';
import type z from 'zod';

export type TierId = keyof z.input<typeof tierMapSchema>;
export type TierId = keyof z.infer<typeof tierMapSchema>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por curiosidad, ya no existen z.input/z.output?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

si, diria que si pero no me digas porque ya no funcionaba. A decir verdad tampoco entendia porque utilizaba .input porque tierMapSchema no tenia ningun refinement ni nda que modificase el tipo de salida.

export type Tier = z.infer<typeof tierDetailsRawSchema>;
export type TierMap = {
[K in TierId]: Tier;
};

export type TopupId = keyof z.input<typeof topupMapSchema>;
export type TopupId = keyof z.infer<typeof topupMapSchema>;
export type Topup = z.infer<typeof productRawSchema>;
export type TopupMap = {
[K in TopupId]: Topup;
Expand Down