@keimelion/sdk 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,212 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const loginRequestSchema: z.ZodObject<{
4
+ email: z.ZodPipe<z.ZodString, z.ZodEmail>;
5
+ password: z.ZodString;
6
+ }, z.core.$strip>;
7
+ type LoginRequestInput = z.input<typeof loginRequestSchema>;
8
+ type LoginRequestParsed = z.output<typeof loginRequestSchema>;
9
+ declare const loginResponseSchema: z.ZodObject<{
10
+ accessToken: z.ZodString;
11
+ refreshToken: z.ZodString;
12
+ user: z.ZodObject<{
13
+ id: z.ZodGUID;
14
+ email: z.ZodString;
15
+ username: z.ZodNullable<z.ZodString>;
16
+ authProvider: z.ZodEnum<{
17
+ email: "email";
18
+ google: "google";
19
+ }>;
20
+ role: z.ZodEnum<{
21
+ user: "user";
22
+ moderator: "moderator";
23
+ admin: "admin";
24
+ }>;
25
+ avatarImageId: z.ZodNullable<z.ZodGUID>;
26
+ avatar: z.ZodNullable<z.ZodObject<{
27
+ id: z.ZodGUID;
28
+ hash: z.ZodString;
29
+ mime: z.ZodString;
30
+ sizeBytes: z.ZodNumber;
31
+ width: z.ZodNumber;
32
+ height: z.ZodNumber;
33
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
34
+ urls: z.ZodObject<{
35
+ sm: z.ZodURL;
36
+ md: z.ZodURL;
37
+ lg: z.ZodURL;
38
+ }, z.core.$strip>;
39
+ }, z.core.$strip>>;
40
+ isCgvAccepted: z.ZodBoolean;
41
+ cgvAcceptedAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
42
+ isMarketingOptedIn: z.ZodBoolean;
43
+ defaultCurrency: z.ZodEnum<{
44
+ readonly EUR: "EUR";
45
+ readonly USD: "USD";
46
+ readonly GBP: "GBP";
47
+ readonly CHF: "CHF";
48
+ readonly CAD: "CAD";
49
+ readonly AUD: "AUD";
50
+ readonly JPY: "JPY";
51
+ }>;
52
+ emailVerifiedAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
53
+ lastActiveAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
54
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
55
+ updatedAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
56
+ }, z.core.$strip>;
57
+ }, z.core.$strip>;
58
+ type LoginResponseInput = z.input<typeof loginResponseSchema>;
59
+ type LoginResponseParsed = z.output<typeof loginResponseSchema>;
60
+
61
+ declare const refreshRequestSchema: z.ZodObject<{
62
+ refreshToken: z.ZodString;
63
+ }, z.core.$strip>;
64
+ type RefreshRequestInput = z.input<typeof refreshRequestSchema>;
65
+ type RefreshRequestParsed = z.output<typeof refreshRequestSchema>;
66
+ declare const refreshResponseSchema: z.ZodObject<{
67
+ accessToken: z.ZodString;
68
+ refreshToken: z.ZodString;
69
+ }, z.core.$strip>;
70
+ type RefreshResponseInput = z.input<typeof refreshResponseSchema>;
71
+ type RefreshResponseParsed = z.output<typeof refreshResponseSchema>;
72
+
73
+ declare const logoutRequestSchema: z.ZodObject<{
74
+ refreshToken: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strip>;
76
+ type LogoutRequestInput = z.input<typeof logoutRequestSchema>;
77
+ type LogoutRequestParsed = z.output<typeof logoutRequestSchema>;
78
+ declare const logoutResponseSchema: z.ZodObject<{
79
+ message: z.ZodString;
80
+ }, z.core.$strip>;
81
+ type LogoutResponseInput = z.input<typeof logoutResponseSchema>;
82
+ type LogoutResponseParsed = z.output<typeof logoutResponseSchema>;
83
+
84
+ declare const registerRequestSchema: z.ZodObject<{
85
+ email: z.ZodPipe<z.ZodString, z.ZodEmail>;
86
+ password: z.ZodString;
87
+ username: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
88
+ isMarketingOptedIn: z.ZodDefault<z.ZodBoolean>;
89
+ defaultCurrency: z.ZodOptional<z.ZodEnum<{
90
+ readonly EUR: "EUR";
91
+ readonly USD: "USD";
92
+ readonly GBP: "GBP";
93
+ readonly CHF: "CHF";
94
+ readonly CAD: "CAD";
95
+ readonly AUD: "AUD";
96
+ readonly JPY: "JPY";
97
+ }>>;
98
+ }, z.core.$strip>;
99
+ type RegisterRequestInput = z.input<typeof registerRequestSchema>;
100
+ type RegisterRequestParsed = z.output<typeof registerRequestSchema>;
101
+ declare const registerResponseSchema: z.ZodObject<{
102
+ user: z.ZodObject<{
103
+ id: z.ZodGUID;
104
+ email: z.ZodString;
105
+ username: z.ZodNullable<z.ZodString>;
106
+ authProvider: z.ZodEnum<{
107
+ email: "email";
108
+ google: "google";
109
+ }>;
110
+ role: z.ZodEnum<{
111
+ user: "user";
112
+ moderator: "moderator";
113
+ admin: "admin";
114
+ }>;
115
+ avatarImageId: z.ZodNullable<z.ZodGUID>;
116
+ avatar: z.ZodNullable<z.ZodObject<{
117
+ id: z.ZodGUID;
118
+ hash: z.ZodString;
119
+ mime: z.ZodString;
120
+ sizeBytes: z.ZodNumber;
121
+ width: z.ZodNumber;
122
+ height: z.ZodNumber;
123
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
124
+ urls: z.ZodObject<{
125
+ sm: z.ZodURL;
126
+ md: z.ZodURL;
127
+ lg: z.ZodURL;
128
+ }, z.core.$strip>;
129
+ }, z.core.$strip>>;
130
+ isCgvAccepted: z.ZodBoolean;
131
+ cgvAcceptedAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
132
+ isMarketingOptedIn: z.ZodBoolean;
133
+ defaultCurrency: z.ZodEnum<{
134
+ readonly EUR: "EUR";
135
+ readonly USD: "USD";
136
+ readonly GBP: "GBP";
137
+ readonly CHF: "CHF";
138
+ readonly CAD: "CAD";
139
+ readonly AUD: "AUD";
140
+ readonly JPY: "JPY";
141
+ }>;
142
+ emailVerifiedAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
143
+ lastActiveAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
144
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
145
+ updatedAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
146
+ }, z.core.$strip>;
147
+ refreshToken: z.ZodString;
148
+ }, z.core.$strip>;
149
+ type RegisterResponseInput = z.input<typeof registerResponseSchema>;
150
+ type RegisterResponseParsed = z.output<typeof registerResponseSchema>;
151
+
152
+ declare const verifyEmailRequestSchema: z.ZodObject<{
153
+ token: z.ZodGUID;
154
+ }, z.core.$strip>;
155
+ type VerifyEmailRequestInput = z.input<typeof verifyEmailRequestSchema>;
156
+ type VerifyEmailRequestParsed = z.output<typeof verifyEmailRequestSchema>;
157
+ declare const verifyEmailResponseSchema: z.ZodObject<{
158
+ message: z.ZodString;
159
+ }, z.core.$strip>;
160
+ type VerifyEmailResponseInput = z.input<typeof verifyEmailResponseSchema>;
161
+ type VerifyEmailResponseParsed = z.output<typeof verifyEmailResponseSchema>;
162
+
163
+ declare const forgotPasswordRequestSchema: z.ZodObject<{
164
+ email: z.ZodPipe<z.ZodString, z.ZodEmail>;
165
+ }, z.core.$strip>;
166
+ type ForgotPasswordRequestInput = z.input<typeof forgotPasswordRequestSchema>;
167
+ type ForgotPasswordRequestParsed = z.output<typeof forgotPasswordRequestSchema>;
168
+ declare const forgotPasswordResponseSchema: z.ZodObject<{
169
+ message: z.ZodString;
170
+ }, z.core.$strip>;
171
+ type ForgotPasswordResponseInput = z.input<typeof forgotPasswordResponseSchema>;
172
+ type ForgotPasswordResponseParsed = z.output<typeof forgotPasswordResponseSchema>;
173
+
174
+ declare const resetPasswordRequestSchema: z.ZodObject<{
175
+ passwordResetToken: z.ZodString;
176
+ password: z.ZodString;
177
+ }, z.core.$strip>;
178
+ type ResetPasswordRequestInput = z.input<typeof resetPasswordRequestSchema>;
179
+ type ResetPasswordRequestParsed = z.output<typeof resetPasswordRequestSchema>;
180
+ declare const resetPasswordResponseSchema: z.ZodObject<{
181
+ message: z.ZodString;
182
+ }, z.core.$strip>;
183
+ type ResetPasswordResponseInput = z.input<typeof resetPasswordResponseSchema>;
184
+ type ResetPasswordResponseParsed = z.output<typeof resetPasswordResponseSchema>;
185
+
186
+ declare const VALIDATION_ROOT_PATH = "<root>";
187
+ declare const validationIssueSchema: z.ZodObject<{
188
+ path: z.ZodString;
189
+ message: z.ZodString;
190
+ code: z.ZodString;
191
+ }, z.core.$strip>;
192
+ type ValidationIssueInput = z.input<typeof validationIssueSchema>;
193
+ type ValidationIssueParsed = z.output<typeof validationIssueSchema>;
194
+ declare const validationErrorMetadataSchema: z.ZodObject<{
195
+ issues: z.ZodArray<z.ZodObject<{
196
+ path: z.ZodString;
197
+ message: z.ZodString;
198
+ code: z.ZodString;
199
+ }, z.core.$strip>>;
200
+ }, z.core.$strip>;
201
+ type ValidationErrorMetadataInput = z.input<typeof validationErrorMetadataSchema>;
202
+ type ValidationErrorMetadataParsed = z.output<typeof validationErrorMetadataSchema>;
203
+ declare const apiErrorBodySchema: z.ZodObject<{
204
+ message: z.ZodString;
205
+ code: z.ZodString;
206
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
207
+ }, z.core.$strip>;
208
+ type ApiErrorBodyInput = z.input<typeof apiErrorBodySchema>;
209
+ type ApiErrorBodyParsed = z.output<typeof apiErrorBodySchema>;
210
+
211
+ export { apiErrorBodySchema as G, forgotPasswordRequestSchema as H, forgotPasswordResponseSchema as I, loginRequestSchema as J, loginResponseSchema as K, logoutRequestSchema as M, logoutResponseSchema as N, refreshRequestSchema as O, refreshResponseSchema as P, registerRequestSchema as Q, registerResponseSchema as S, resetPasswordRequestSchema as T, resetPasswordResponseSchema as U, validationErrorMetadataSchema as W, validationIssueSchema as X, verifyEmailRequestSchema as Y, verifyEmailResponseSchema as Z, VALIDATION_ROOT_PATH as y };
212
+ export type { ApiErrorBodyInput as A, ValidationErrorMetadataParsed as B, ValidationIssueInput as C, VerifyEmailRequestParsed as D, VerifyEmailResponseInput as E, ForgotPasswordRequestInput as F, LoginRequestInput as L, RegisterRequestInput as R, VerifyEmailRequestInput as V, RegisterResponseParsed as a, VerifyEmailResponseParsed as b, LoginResponseParsed as c, RefreshRequestInput as d, RefreshResponseParsed as e, LogoutRequestInput as f, LogoutResponseParsed as g, ForgotPasswordResponseParsed as h, ResetPasswordRequestInput as i, ResetPasswordResponseParsed as j, ValidationIssueParsed as k, ApiErrorBodyParsed as l, ForgotPasswordRequestParsed as m, ForgotPasswordResponseInput as n, LoginRequestParsed as o, LoginResponseInput as p, LogoutRequestParsed as q, LogoutResponseInput as r, RefreshRequestParsed as s, RefreshResponseInput as t, RegisterRequestParsed as u, RegisterResponseInput as v, ResetPasswordRequestParsed as w, ResetPasswordResponseInput as x, ValidationErrorMetadataInput as z };
@@ -0,0 +1,78 @@
1
+ declare const HttpMethod: {
2
+ readonly GET: "GET";
3
+ readonly POST: "POST";
4
+ readonly PUT: "PUT";
5
+ readonly PATCH: "PATCH";
6
+ readonly DELETE: "DELETE";
7
+ readonly OPTIONS: "OPTIONS";
8
+ };
9
+ type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
10
+ declare const HttpHeader: {
11
+ readonly ACCEPT: "Accept";
12
+ readonly CONTENT_TYPE: "Content-Type";
13
+ readonly AUTHORIZATION: "Authorization";
14
+ };
15
+ type HttpHeader = (typeof HttpHeader)[keyof typeof HttpHeader];
16
+ declare const HttpStatus: {
17
+ readonly OK: 200;
18
+ readonly CREATED: 201;
19
+ readonly NO_CONTENT: 204;
20
+ readonly BAD_REQUEST: 400;
21
+ readonly UNAUTHORIZED: 401;
22
+ readonly FORBIDDEN: 403;
23
+ readonly NOT_FOUND: 404;
24
+ readonly CONFLICT: 409;
25
+ readonly GONE: 410;
26
+ readonly PAYLOAD_TOO_LARGE: 413;
27
+ readonly UNPROCESSABLE_ENTITY: 422;
28
+ readonly TOO_MANY_REQUESTS: 429;
29
+ readonly INTERNAL_SERVER_ERROR: 500;
30
+ };
31
+ type HttpStatus = (typeof HttpStatus)[keyof typeof HttpStatus];
32
+
33
+ declare const ErrorCode: {
34
+ readonly BAD_REQUEST: "BAD_REQUEST";
35
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
36
+ readonly FORBIDDEN: "FORBIDDEN";
37
+ readonly EMAIL_NOT_VERIFIED: "EMAIL_NOT_VERIFIED";
38
+ readonly ACCOUNT_BANNED: "ACCOUNT_BANNED";
39
+ readonly NOT_FOUND: "NOT_FOUND";
40
+ readonly CONFLICT: "CONFLICT";
41
+ readonly DUPLICATE_SHOP_FOR_ITEM: "DUPLICATE_SHOP_FOR_ITEM";
42
+ readonly SLUG_GENERATION_EXHAUSTED: "SLUG_GENERATION_EXHAUSTED";
43
+ readonly CATEGORY_NOT_FOUND: "CATEGORY_NOT_FOUND";
44
+ readonly CATEGORY_MAX_DEPTH_EXCEEDED: "CATEGORY_MAX_DEPTH_EXCEEDED";
45
+ readonly CATEGORY_CYCLE_DETECTED: "CATEGORY_CYCLE_DETECTED";
46
+ readonly TAG_NOT_FOUND: "TAG_NOT_FOUND";
47
+ readonly TAG_INVALID_NAME: "TAG_INVALID_NAME";
48
+ readonly UNPROCESSABLE_ENTITY: "UNPROCESSABLE_ENTITY";
49
+ readonly NO_FIELDS_TO_UPDATE: "NO_FIELDS_TO_UPDATE";
50
+ readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
51
+ readonly USER_CREATION_FAILED: "USER_CREATION_FAILED";
52
+ readonly USER_UPDATE_FAILED: "USER_UPDATE_FAILED";
53
+ readonly ACCOUNT_DELETION_FAILED: "ACCOUNT_DELETION_FAILED";
54
+ readonly LOGOUT_FAILED: "LOGOUT_FAILED";
55
+ readonly INVALID_RESET_TOKEN: "INVALID_RESET_TOKEN";
56
+ readonly INVALID_REFRESH_TOKEN: "INVALID_REFRESH_TOKEN";
57
+ readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
58
+ readonly INVALID_OPERATION: "INVALID_OPERATION";
59
+ readonly FEEDBACK_CREATION_FAILED: "FEEDBACK_CREATION_FAILED";
60
+ readonly FEEDBACK_NOT_FOUND: "FEEDBACK_NOT_FOUND";
61
+ readonly INVALID_IMAGE: "INVALID_IMAGE";
62
+ readonly INVALID_IMAGE_TYPE: "INVALID_IMAGE_TYPE";
63
+ readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
64
+ readonly IMAGE_AND_CLEAR_CONFLICT: "IMAGE_AND_CLEAR_CONFLICT";
65
+ readonly COLLAB_SELF_INVITE: "COLLAB_SELF_INVITE";
66
+ readonly COLLAB_ALREADY_MEMBER: "COLLAB_ALREADY_MEMBER";
67
+ readonly COLLAB_INVITE_NOT_FOUND: "COLLAB_INVITE_NOT_FOUND";
68
+ readonly COLLAB_INVITE_EXPIRED: "COLLAB_INVITE_EXPIRED";
69
+ readonly COLLAB_INVITE_ALREADY_RESOLVED: "COLLAB_INVITE_ALREADY_RESOLVED";
70
+ readonly COLLAB_EMAIL_MISMATCH: "COLLAB_EMAIL_MISMATCH";
71
+ readonly RESERVATION_TOKEN_INVALID: "RESERVATION_TOKEN_INVALID";
72
+ readonly RESERVATION_REQUIRES_RESERVER_NAME: "RESERVATION_REQUIRES_RESERVER_NAME";
73
+ readonly RESERVATION_INCONSISTENT_INTENT: "RESERVATION_INCONSISTENT_INTENT";
74
+ readonly INTERNAL_ERROR: "INTERNAL_ERROR";
75
+ };
76
+ type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
77
+
78
+ export { ErrorCode as E, HttpMethod as H, HttpHeader as a, HttpStatus as b };
@@ -0,0 +1,222 @@
1
+ import { z } from 'zod';
2
+ import { SupportedCurrency } from '../enums/index.js';
3
+ export { A as ApiErrorBodyInput, l as ApiErrorBodyParsed, F as ForgotPasswordRequestInput, m as ForgotPasswordRequestParsed, n as ForgotPasswordResponseInput, h as ForgotPasswordResponseParsed, L as LoginRequestInput, o as LoginRequestParsed, p as LoginResponseInput, c as LoginResponseParsed, f as LogoutRequestInput, q as LogoutRequestParsed, r as LogoutResponseInput, g as LogoutResponseParsed, d as RefreshRequestInput, s as RefreshRequestParsed, t as RefreshResponseInput, e as RefreshResponseParsed, R as RegisterRequestInput, u as RegisterRequestParsed, v as RegisterResponseInput, a as RegisterResponseParsed, i as ResetPasswordRequestInput, w as ResetPasswordRequestParsed, x as ResetPasswordResponseInput, j as ResetPasswordResponseParsed, y as VALIDATION_ROOT_PATH, z as ValidationErrorMetadataInput, B as ValidationErrorMetadataParsed, C as ValidationIssueInput, k as ValidationIssueParsed, V as VerifyEmailRequestInput, D as VerifyEmailRequestParsed, E as VerifyEmailResponseInput, b as VerifyEmailResponseParsed, G as apiErrorBodySchema, H as forgotPasswordRequestSchema, I as forgotPasswordResponseSchema, J as loginRequestSchema, K as loginResponseSchema, M as logoutRequestSchema, N as logoutResponseSchema, O as refreshRequestSchema, P as refreshResponseSchema, Q as registerRequestSchema, S as registerResponseSchema, T as resetPasswordRequestSchema, U as resetPasswordResponseSchema, W as validationErrorMetadataSchema, X as validationIssueSchema, Y as verifyEmailRequestSchema, Z as verifyEmailResponseSchema } from '../error-B-yLf6aF.js';
4
+
5
+ declare const DEFAULT_DISPLAY_CURRENCY: SupportedCurrency;
6
+ declare const supportedCurrencyEnum: z.ZodEnum<{
7
+ readonly EUR: "EUR";
8
+ readonly USD: "USD";
9
+ readonly GBP: "GBP";
10
+ readonly CHF: "CHF";
11
+ readonly CAD: "CAD";
12
+ readonly AUD: "AUD";
13
+ readonly JPY: "JPY";
14
+ }>;
15
+ type SupportedCurrencyInput = z.input<typeof supportedCurrencyEnum>;
16
+ type SupportedCurrencyParsed = z.output<typeof supportedCurrencyEnum>;
17
+ declare const displayCurrencyQuerySchema: z.ZodObject<{
18
+ currency: z.ZodOptional<z.ZodEnum<{
19
+ readonly EUR: "EUR";
20
+ readonly USD: "USD";
21
+ readonly GBP: "GBP";
22
+ readonly CHF: "CHF";
23
+ readonly CAD: "CAD";
24
+ readonly AUD: "AUD";
25
+ readonly JPY: "JPY";
26
+ }>>;
27
+ }, z.core.$strip>;
28
+ type DisplayCurrencyQueryInput = z.input<typeof displayCurrencyQuerySchema>;
29
+ type DisplayCurrencyQueryParsed = z.output<typeof displayCurrencyQuerySchema>;
30
+
31
+ declare const emailSchema: z.ZodPipe<z.ZodString, z.ZodEmail>;
32
+ type EmailInput = z.input<typeof emailSchema>;
33
+ type EmailParsed = z.output<typeof emailSchema>;
34
+
35
+ declare const imageUrlsSchema: z.ZodObject<{
36
+ sm: z.ZodURL;
37
+ md: z.ZodURL;
38
+ lg: z.ZodURL;
39
+ }, z.core.$strip>;
40
+ type ImageUrlsInput = z.input<typeof imageUrlsSchema>;
41
+ type ImageUrlsParsed = z.output<typeof imageUrlsSchema>;
42
+ declare const imageDetailSchema: z.ZodObject<{
43
+ id: z.ZodGUID;
44
+ hash: z.ZodString;
45
+ mime: z.ZodString;
46
+ sizeBytes: z.ZodNumber;
47
+ width: z.ZodNumber;
48
+ height: z.ZodNumber;
49
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
50
+ urls: z.ZodObject<{
51
+ sm: z.ZodURL;
52
+ md: z.ZodURL;
53
+ lg: z.ZodURL;
54
+ }, z.core.$strip>;
55
+ }, z.core.$strip>;
56
+ type ImageDetailInput = z.input<typeof imageDetailSchema>;
57
+ type ImageDetailParsed = z.output<typeof imageDetailSchema>;
58
+
59
+ declare const messageResponseSchema: z.ZodObject<{
60
+ message: z.ZodString;
61
+ }, z.core.$strip>;
62
+ type MessageResponseInput = z.input<typeof messageResponseSchema>;
63
+ type MessageResponseParsed = z.output<typeof messageResponseSchema>;
64
+
65
+ declare const DUPLICATE_SHOP_IN_SOURCES_MESSAGE = "This shop is already used by another source of this item.";
66
+ declare const SLUG_GENERATION_EXHAUSTED_MESSAGE = "Could not generate a unique slug, please retry with a different title.";
67
+ declare const MAX_CATEGORY_DEPTH = 3;
68
+ declare const CATEGORY_NOT_FOUND_MESSAGE = "Category not found";
69
+ declare const CATEGORY_MAX_DEPTH_EXCEEDED_MESSAGE: string;
70
+ declare const CATEGORY_CYCLE_DETECTED_MESSAGE = "Category parent cannot create a cycle in the hierarchy";
71
+ declare const TAG_NOT_FOUND_MESSAGE = "Tag not found";
72
+ declare const TAG_INVALID_NAME_MESSAGE = "Tag name must contain at least one letter or digit after normalization";
73
+ declare const FEEDBACK_NOT_FOUND_MESSAGE = "Feedback not found";
74
+ declare const COLLAB_SELF_INVITE_MESSAGE = "You cannot invite yourself to collaborate on your own list";
75
+ declare const COLLAB_ALREADY_MEMBER_MESSAGE = "This list already has an active editor invitation or collaborator";
76
+ declare const COLLAB_INVITE_NOT_FOUND_MESSAGE = "Invitation not found";
77
+ declare const COLLAB_INVITE_EXPIRED_MESSAGE = "This invitation has expired";
78
+ declare const COLLAB_INVITE_ALREADY_RESOLVED_MESSAGE = "This invitation has already been accepted or revoked";
79
+ declare const COLLAB_EMAIL_MISMATCH_MESSAGE = "This invitation was issued to a different email address";
80
+ declare const RESERVATION_TOKEN_INVALID_MESSAGE = "The reservation token is invalid for this reservation";
81
+ declare const RESERVATION_REQUIRES_RESERVER_NAME_MESSAGE = "reserverName is required when reserving without an account";
82
+ declare const RESERVATION_INCONSISTENT_INTENT_MESSAGE = "Only the list owner may reserve on behalf of someone else (reserverName)";
83
+
84
+ declare const noContentResponseSchema: z.ZodUndefined;
85
+ type NoContentResponseInput = z.input<typeof noContentResponseSchema>;
86
+ type NoContentResponseParsed = z.output<typeof noContentResponseSchema>;
87
+
88
+ declare const PAGINATION_DEFAULT_PAGE = 1;
89
+ declare const PAGINATION_DEFAULT_LIMIT = 20;
90
+ declare const PAGINATION_MAX_LIMIT = 100;
91
+ declare const paginationQuerySchema: z.ZodObject<{
92
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
93
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
94
+ }, z.core.$strip>;
95
+ type PaginationQueryInput = z.input<typeof paginationQuerySchema>;
96
+ type PaginationQueryParsed = z.output<typeof paginationQuerySchema>;
97
+ declare const paginationMetaSchema: z.ZodObject<{
98
+ page: z.ZodNumber;
99
+ limit: z.ZodNumber;
100
+ total: z.ZodNumber;
101
+ totalPages: z.ZodNumber;
102
+ }, z.core.$strip>;
103
+ type PaginationMetaInput = z.input<typeof paginationMetaSchema>;
104
+ type PaginationMetaParsed = z.output<typeof paginationMetaSchema>;
105
+ interface PaginatedResponse<TItem> {
106
+ items: TItem[];
107
+ pagination: PaginationMetaParsed;
108
+ }
109
+ type PaginatedResponseSchema<TItemSchema extends z.ZodType> = z.ZodObject<{
110
+ items: z.ZodArray<TItemSchema>;
111
+ pagination: typeof paginationMetaSchema;
112
+ }>;
113
+ declare function paginatedResponseSchema<TItemSchema extends z.ZodType>(itemSchema: TItemSchema): PaginatedResponseSchema<TItemSchema>;
114
+ type PaginatedResponseInput<TItemSchema extends z.ZodType> = z.input<PaginatedResponseSchema<TItemSchema>>;
115
+ type PaginatedResponseParsed<TItemSchema extends z.ZodType> = z.output<PaginatedResponseSchema<TItemSchema>>;
116
+
117
+ declare const MIN_PASSWORD_LENGTH = 8;
118
+ declare const MAX_PASSWORD_LENGTH = 72;
119
+ declare const passwordSchema: z.ZodString;
120
+ type PasswordInput = z.input<typeof passwordSchema>;
121
+ type PasswordParsed = z.output<typeof passwordSchema>;
122
+
123
+ interface SlugSchemaOptions {
124
+ min: number;
125
+ max: number;
126
+ example: string;
127
+ }
128
+ declare function createSlugSchema({ min, max, example }: SlugSchemaOptions): z.ZodString;
129
+ type SlugInput = z.input<ReturnType<typeof createSlugSchema>>;
130
+ type SlugParsed = z.output<ReturnType<typeof createSlugSchema>>;
131
+
132
+ declare const SORT_DIRECTIONS: readonly ["asc", "desc"];
133
+ type SortDirection = (typeof SORT_DIRECTIONS)[number];
134
+ interface SortInput<TField extends string> {
135
+ field: TField;
136
+ direction: SortDirection;
137
+ }
138
+ declare function sortQuerySchema<TField extends string>(allowedFields: readonly [TField, ...TField[]]): z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<{
139
+ field: string;
140
+ direction: string;
141
+ }, string>>, z.ZodObject<{
142
+ field: z.ZodEnum<{ [k_1 in TField]: k_1; } extends infer T ? { [k in keyof T]: T[k]; } : never>;
143
+ direction: z.ZodEnum<{
144
+ asc: "asc";
145
+ desc: "desc";
146
+ }>;
147
+ }, z.core.$strip>>>;
148
+ type SortQueryInput<TField extends string> = z.input<ReturnType<typeof sortQuerySchema<TField>>>;
149
+ type SortQueryParsed<TField extends string> = z.output<ReturnType<typeof sortQuerySchema<TField>>>;
150
+
151
+ declare const sortOrderSchema: z.ZodNumber;
152
+ type SortOrderInput = z.input<typeof sortOrderSchema>;
153
+ type SortOrderParsed = z.output<typeof sortOrderSchema>;
154
+
155
+ declare const isoDateTimeSchema: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
156
+ type IsoDateTimeInput = z.input<typeof isoDateTimeSchema>;
157
+ type IsoDateTimeParsed = z.output<typeof isoDateTimeSchema>;
158
+
159
+ declare function urlSchema(fieldName: string): z.ZodURL;
160
+ declare function httpsUrlSchema(fieldName: string, maxLength: number): z.ZodURL;
161
+ type UrlInput = z.input<ReturnType<typeof urlSchema>>;
162
+ type UrlParsed = z.output<ReturnType<typeof urlSchema>>;
163
+ type HttpsUrlInput = z.input<ReturnType<typeof httpsUrlSchema>>;
164
+ type HttpsUrlParsed = z.output<ReturnType<typeof httpsUrlSchema>>;
165
+
166
+ declare const USERNAME_MIN_LENGTH = 1;
167
+ declare const USERNAME_MAX_LENGTH = 100;
168
+ declare const USERNAME_REGEX: RegExp;
169
+ declare const usernameSchema: z.ZodString;
170
+ type UsernameInput = z.input<typeof usernameSchema>;
171
+ type UsernameParsed = z.output<typeof usernameSchema>;
172
+
173
+ declare const userDetailSchema: z.ZodObject<{
174
+ id: z.ZodGUID;
175
+ email: z.ZodString;
176
+ username: z.ZodNullable<z.ZodString>;
177
+ authProvider: z.ZodEnum<{
178
+ email: "email";
179
+ google: "google";
180
+ }>;
181
+ role: z.ZodEnum<{
182
+ user: "user";
183
+ moderator: "moderator";
184
+ admin: "admin";
185
+ }>;
186
+ avatarImageId: z.ZodNullable<z.ZodGUID>;
187
+ avatar: z.ZodNullable<z.ZodObject<{
188
+ id: z.ZodGUID;
189
+ hash: z.ZodString;
190
+ mime: z.ZodString;
191
+ sizeBytes: z.ZodNumber;
192
+ width: z.ZodNumber;
193
+ height: z.ZodNumber;
194
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
195
+ urls: z.ZodObject<{
196
+ sm: z.ZodURL;
197
+ md: z.ZodURL;
198
+ lg: z.ZodURL;
199
+ }, z.core.$strip>;
200
+ }, z.core.$strip>>;
201
+ isCgvAccepted: z.ZodBoolean;
202
+ cgvAcceptedAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
203
+ isMarketingOptedIn: z.ZodBoolean;
204
+ defaultCurrency: z.ZodEnum<{
205
+ readonly EUR: "EUR";
206
+ readonly USD: "USD";
207
+ readonly GBP: "GBP";
208
+ readonly CHF: "CHF";
209
+ readonly CAD: "CAD";
210
+ readonly AUD: "AUD";
211
+ readonly JPY: "JPY";
212
+ }>;
213
+ emailVerifiedAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
214
+ lastActiveAt: z.ZodNullable<z.ZodCodec<z.ZodISODateTime, z.ZodDate>>;
215
+ createdAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
216
+ updatedAt: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
217
+ }, z.core.$strip>;
218
+ type UserDetailInput = z.input<typeof userDetailSchema>;
219
+ type UserDetailParsed = z.output<typeof userDetailSchema>;
220
+
221
+ export { CATEGORY_CYCLE_DETECTED_MESSAGE, CATEGORY_MAX_DEPTH_EXCEEDED_MESSAGE, CATEGORY_NOT_FOUND_MESSAGE, COLLAB_ALREADY_MEMBER_MESSAGE, COLLAB_EMAIL_MISMATCH_MESSAGE, COLLAB_INVITE_ALREADY_RESOLVED_MESSAGE, COLLAB_INVITE_EXPIRED_MESSAGE, COLLAB_INVITE_NOT_FOUND_MESSAGE, COLLAB_SELF_INVITE_MESSAGE, DEFAULT_DISPLAY_CURRENCY, DUPLICATE_SHOP_IN_SOURCES_MESSAGE, FEEDBACK_NOT_FOUND_MESSAGE, MAX_CATEGORY_DEPTH, MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH, PAGINATION_DEFAULT_LIMIT, PAGINATION_DEFAULT_PAGE, PAGINATION_MAX_LIMIT, RESERVATION_INCONSISTENT_INTENT_MESSAGE, RESERVATION_REQUIRES_RESERVER_NAME_MESSAGE, RESERVATION_TOKEN_INVALID_MESSAGE, SLUG_GENERATION_EXHAUSTED_MESSAGE, SORT_DIRECTIONS, TAG_INVALID_NAME_MESSAGE, TAG_NOT_FOUND_MESSAGE, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_REGEX, createSlugSchema, displayCurrencyQuerySchema, emailSchema, httpsUrlSchema, imageDetailSchema, imageUrlsSchema, isoDateTimeSchema, messageResponseSchema, noContentResponseSchema, paginatedResponseSchema, paginationMetaSchema, paginationQuerySchema, passwordSchema, sortOrderSchema, sortQuerySchema, supportedCurrencyEnum, urlSchema, userDetailSchema, usernameSchema };
222
+ export type { DisplayCurrencyQueryInput, DisplayCurrencyQueryParsed, EmailInput, EmailParsed, HttpsUrlInput, HttpsUrlParsed, ImageDetailInput, ImageDetailParsed, ImageUrlsInput, ImageUrlsParsed, IsoDateTimeInput, IsoDateTimeParsed, MessageResponseInput, MessageResponseParsed, NoContentResponseInput, NoContentResponseParsed, PaginatedResponse, PaginatedResponseInput, PaginatedResponseParsed, PaginationMetaInput, PaginationMetaParsed, PaginationQueryInput, PaginationQueryParsed, PasswordInput, PasswordParsed, SlugInput, SlugParsed, SlugSchemaOptions, SortDirection, SortInput, SortOrderInput, SortOrderParsed, SortQueryInput, SortQueryParsed, SupportedCurrencyInput, SupportedCurrencyParsed, UrlInput, UrlParsed, UserDetailInput, UserDetailParsed, UsernameInput, UsernameParsed };
@@ -0,0 +1,73 @@
1
+ export { DEFAULT_DISPLAY_CURRENCY, MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_REGEX, VALIDATION_ROOT_PATH, apiErrorBodySchema, displayCurrencyQuerySchema, emailSchema, forgotPasswordRequestSchema, forgotPasswordResponseSchema, imageDetailSchema, imageUrlsSchema, isoDateTimeSchema, loginRequestSchema, loginResponseSchema, logoutRequestSchema, logoutResponseSchema, messageResponseSchema, passwordSchema, refreshRequestSchema, refreshResponseSchema, registerRequestSchema, registerResponseSchema, resetPasswordRequestSchema, resetPasswordResponseSchema, supportedCurrencyEnum, userDetailSchema, usernameSchema, validationErrorMetadataSchema, validationIssueSchema, verifyEmailRequestSchema, verifyEmailResponseSchema } from '../chunk-VT6MXJE5.js';
2
+ import '../chunk-2LLUUBMQ.js';
3
+ import { z } from 'zod';
4
+
5
+ // src/schemas/_shared/messages.ts
6
+ var DUPLICATE_SHOP_IN_SOURCES_MESSAGE = "This shop is already used by another source of this item.";
7
+ var SLUG_GENERATION_EXHAUSTED_MESSAGE = "Could not generate a unique slug, please retry with a different title.";
8
+ var MAX_CATEGORY_DEPTH = 3;
9
+ var CATEGORY_NOT_FOUND_MESSAGE = "Category not found";
10
+ var CATEGORY_MAX_DEPTH_EXCEEDED_MESSAGE = `Category depth cannot exceed ${String(MAX_CATEGORY_DEPTH)} levels`;
11
+ var CATEGORY_CYCLE_DETECTED_MESSAGE = "Category parent cannot create a cycle in the hierarchy";
12
+ var TAG_NOT_FOUND_MESSAGE = "Tag not found";
13
+ var TAG_INVALID_NAME_MESSAGE = "Tag name must contain at least one letter or digit after normalization";
14
+ var FEEDBACK_NOT_FOUND_MESSAGE = "Feedback not found";
15
+ var COLLAB_SELF_INVITE_MESSAGE = "You cannot invite yourself to collaborate on your own list";
16
+ var COLLAB_ALREADY_MEMBER_MESSAGE = "This list already has an active editor invitation or collaborator";
17
+ var COLLAB_INVITE_NOT_FOUND_MESSAGE = "Invitation not found";
18
+ var COLLAB_INVITE_EXPIRED_MESSAGE = "This invitation has expired";
19
+ var COLLAB_INVITE_ALREADY_RESOLVED_MESSAGE = "This invitation has already been accepted or revoked";
20
+ var COLLAB_EMAIL_MISMATCH_MESSAGE = "This invitation was issued to a different email address";
21
+ var RESERVATION_TOKEN_INVALID_MESSAGE = "The reservation token is invalid for this reservation";
22
+ var RESERVATION_REQUIRES_RESERVER_NAME_MESSAGE = "reserverName is required when reserving without an account";
23
+ var RESERVATION_INCONSISTENT_INTENT_MESSAGE = "Only the list owner may reserve on behalf of someone else (reserverName)";
24
+ var noContentResponseSchema = z.undefined();
25
+ var PAGINATION_DEFAULT_PAGE = 1;
26
+ var PAGINATION_DEFAULT_LIMIT = 20;
27
+ var PAGINATION_MAX_LIMIT = 100;
28
+ var paginationQuerySchema = z.object({
29
+ page: z.coerce.number().int().min(1).default(PAGINATION_DEFAULT_PAGE),
30
+ limit: z.coerce.number().int().min(1).max(PAGINATION_MAX_LIMIT).default(PAGINATION_DEFAULT_LIMIT)
31
+ });
32
+ var paginationMetaSchema = z.object({
33
+ page: z.number().int(),
34
+ limit: z.number().int(),
35
+ total: z.number().int(),
36
+ totalPages: z.number().int()
37
+ });
38
+ function paginatedResponseSchema(itemSchema) {
39
+ return z.object({
40
+ items: z.array(itemSchema),
41
+ pagination: paginationMetaSchema
42
+ });
43
+ }
44
+ var SLUG_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
45
+ function createSlugSchema({ min, max, example }) {
46
+ return z.string().trim().min(min).max(max).regex(SLUG_REGEX, `slug must be lowercase letters, digits, and dashes (e.g. ${example})`);
47
+ }
48
+ var SORT_DIRECTIONS = ["asc", "desc"];
49
+ var SORT_FORMAT_REGEX = /^[^:]+:[^:]+$/;
50
+ function sortQuerySchema(allowedFields) {
51
+ return z.string().regex(SORT_FORMAT_REGEX, "sort must be in the format field:direction").transform((value) => {
52
+ const [field, direction] = value.split(":");
53
+ return { field, direction };
54
+ }).pipe(
55
+ z.object({
56
+ field: z.enum(allowedFields),
57
+ direction: z.enum(SORT_DIRECTIONS)
58
+ })
59
+ ).optional();
60
+ }
61
+ var MIN_SORT_ORDER = 0;
62
+ var MAX_SORT_ORDER = 32767;
63
+ var sortOrderSchema = z.number().int("sortOrder must be an integer").min(MIN_SORT_ORDER, `sortOrder must be at least ${String(MIN_SORT_ORDER)}`).max(MAX_SORT_ORDER, `sortOrder must be at most ${String(MAX_SORT_ORDER)}`);
64
+ function urlSchema(fieldName) {
65
+ return z.url(`${fieldName} must be a valid URL`);
66
+ }
67
+ function httpsUrlSchema(fieldName, maxLength) {
68
+ return urlSchema(fieldName).max(maxLength).refine((value) => value.startsWith("https://"), `${fieldName} must use HTTPS`);
69
+ }
70
+
71
+ export { CATEGORY_CYCLE_DETECTED_MESSAGE, CATEGORY_MAX_DEPTH_EXCEEDED_MESSAGE, CATEGORY_NOT_FOUND_MESSAGE, COLLAB_ALREADY_MEMBER_MESSAGE, COLLAB_EMAIL_MISMATCH_MESSAGE, COLLAB_INVITE_ALREADY_RESOLVED_MESSAGE, COLLAB_INVITE_EXPIRED_MESSAGE, COLLAB_INVITE_NOT_FOUND_MESSAGE, COLLAB_SELF_INVITE_MESSAGE, DUPLICATE_SHOP_IN_SOURCES_MESSAGE, FEEDBACK_NOT_FOUND_MESSAGE, MAX_CATEGORY_DEPTH, PAGINATION_DEFAULT_LIMIT, PAGINATION_DEFAULT_PAGE, PAGINATION_MAX_LIMIT, RESERVATION_INCONSISTENT_INTENT_MESSAGE, RESERVATION_REQUIRES_RESERVER_NAME_MESSAGE, RESERVATION_TOKEN_INVALID_MESSAGE, SLUG_GENERATION_EXHAUSTED_MESSAGE, SORT_DIRECTIONS, TAG_INVALID_NAME_MESSAGE, TAG_NOT_FOUND_MESSAGE, createSlugSchema, httpsUrlSchema, noContentResponseSchema, paginatedResponseSchema, paginationMetaSchema, paginationQuerySchema, sortOrderSchema, sortQuerySchema, urlSchema };
72
+ //# sourceMappingURL=index.js.map
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/_shared/messages.ts","../../src/schemas/_shared/no-content.ts","../../src/schemas/_shared/pagination.ts","../../src/schemas/_shared/slug.ts","../../src/schemas/_shared/sort.ts","../../src/schemas/_shared/sort-order.ts","../../src/schemas/_shared/url.ts"],"names":["z"],"mappings":"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","file":"index.js","sourcesContent":["export const DUPLICATE_SHOP_IN_SOURCES_MESSAGE =\n 'This shop is already used by another source of this item.'\n\nexport const SLUG_GENERATION_EXHAUSTED_MESSAGE =\n 'Could not generate a unique slug, please retry with a different title.'\n\nexport const MAX_CATEGORY_DEPTH = 3\n\nexport const CATEGORY_NOT_FOUND_MESSAGE = 'Category not found'\n\nexport const CATEGORY_MAX_DEPTH_EXCEEDED_MESSAGE = `Category depth cannot exceed ${String(MAX_CATEGORY_DEPTH)} levels`\n\nexport const CATEGORY_CYCLE_DETECTED_MESSAGE =\n 'Category parent cannot create a cycle in the hierarchy'\n\nexport const TAG_NOT_FOUND_MESSAGE = 'Tag not found'\n\nexport const TAG_INVALID_NAME_MESSAGE =\n 'Tag name must contain at least one letter or digit after normalization'\n\nexport const FEEDBACK_NOT_FOUND_MESSAGE = 'Feedback not found'\n\nexport const COLLAB_SELF_INVITE_MESSAGE =\n 'You cannot invite yourself to collaborate on your own list'\n\nexport const COLLAB_ALREADY_MEMBER_MESSAGE =\n 'This list already has an active editor invitation or collaborator'\n\nexport const COLLAB_INVITE_NOT_FOUND_MESSAGE = 'Invitation not found'\n\nexport const COLLAB_INVITE_EXPIRED_MESSAGE = 'This invitation has expired'\n\nexport const COLLAB_INVITE_ALREADY_RESOLVED_MESSAGE =\n 'This invitation has already been accepted or revoked'\n\nexport const COLLAB_EMAIL_MISMATCH_MESSAGE =\n 'This invitation was issued to a different email address'\n\nexport const RESERVATION_TOKEN_INVALID_MESSAGE =\n 'The reservation token is invalid for this reservation'\n\nexport const RESERVATION_REQUIRES_RESERVER_NAME_MESSAGE =\n 'reserverName is required when reserving without an account'\n\nexport const RESERVATION_INCONSISTENT_INTENT_MESSAGE =\n 'Only the list owner may reserve on behalf of someone else (reserverName)'\n","import { z } from 'zod'\n\n// Response schema for 204 No Content endpoints: the client resolves them to `undefined`.\nexport const noContentResponseSchema = z.undefined()\n\nexport type NoContentResponseInput = z.input<typeof noContentResponseSchema>\nexport type NoContentResponseParsed = z.output<typeof noContentResponseSchema>\n","import { z } from 'zod'\n\nexport const PAGINATION_DEFAULT_PAGE = 1\nexport const PAGINATION_DEFAULT_LIMIT = 20\nexport const PAGINATION_MAX_LIMIT = 100\n\nexport const paginationQuerySchema = z.object({\n page: z.coerce.number().int().min(1).default(PAGINATION_DEFAULT_PAGE),\n limit: z.coerce.number().int().min(1).max(PAGINATION_MAX_LIMIT).default(PAGINATION_DEFAULT_LIMIT),\n})\n\nexport type PaginationQueryInput = z.input<typeof paginationQuerySchema>\nexport type PaginationQueryParsed = z.output<typeof paginationQuerySchema>\n\nexport const paginationMetaSchema = z.object({\n page: z.number().int(),\n limit: z.number().int(),\n total: z.number().int(),\n totalPages: z.number().int(),\n})\n\nexport type PaginationMetaInput = z.input<typeof paginationMetaSchema>\nexport type PaginationMetaParsed = z.output<typeof paginationMetaSchema>\n\nexport interface PaginatedResponse<TItem> {\n items: TItem[]\n pagination: PaginationMetaParsed\n}\n\ntype PaginatedResponseSchema<TItemSchema extends z.ZodType> = z.ZodObject<{\n items: z.ZodArray<TItemSchema>\n pagination: typeof paginationMetaSchema\n}>\n\nexport function paginatedResponseSchema<TItemSchema extends z.ZodType>(\n itemSchema: TItemSchema,\n): PaginatedResponseSchema<TItemSchema> {\n return z.object({\n items: z.array(itemSchema),\n pagination: paginationMetaSchema,\n })\n}\n\nexport type PaginatedResponseInput<TItemSchema extends z.ZodType> = z.input<\n PaginatedResponseSchema<TItemSchema>\n>\nexport type PaginatedResponseParsed<TItemSchema extends z.ZodType> = z.output<\n PaginatedResponseSchema<TItemSchema>\n>\n","import { z } from 'zod'\n\nconst SLUG_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\n\nexport interface SlugSchemaOptions {\n min: number\n max: number\n example: string\n}\n\nexport function createSlugSchema({ min, max, example }: SlugSchemaOptions): z.ZodString {\n return z\n .string()\n .trim()\n .min(min)\n .max(max)\n .regex(SLUG_REGEX, `slug must be lowercase letters, digits, and dashes (e.g. ${example})`)\n}\n\nexport type SlugInput = z.input<ReturnType<typeof createSlugSchema>>\nexport type SlugParsed = z.output<ReturnType<typeof createSlugSchema>>\n","import { z } from 'zod'\n\nexport const SORT_DIRECTIONS = ['asc', 'desc'] as const\n\nexport type SortDirection = (typeof SORT_DIRECTIONS)[number]\n\nexport interface SortInput<TField extends string> {\n field: TField\n direction: SortDirection\n}\n\nconst SORT_FORMAT_REGEX = /^[^:]+:[^:]+$/\n\nexport function sortQuerySchema<TField extends string>(\n allowedFields: readonly [TField, ...TField[]],\n) {\n return z\n .string()\n .regex(SORT_FORMAT_REGEX, 'sort must be in the format field:direction')\n .transform((value) => {\n const [field, direction] = value.split(':') as [string, string]\n return { field, direction }\n })\n .pipe(\n z.object({\n field: z.enum(allowedFields),\n direction: z.enum(SORT_DIRECTIONS),\n }),\n )\n .optional()\n}\n\nexport type SortQueryInput<TField extends string> = z.input<\n ReturnType<typeof sortQuerySchema<TField>>\n>\nexport type SortQueryParsed<TField extends string> = z.output<\n ReturnType<typeof sortQuerySchema<TField>>\n>\n","import { z } from 'zod'\n\nconst MIN_SORT_ORDER = 0\nconst MAX_SORT_ORDER = 32767\n\nexport const sortOrderSchema = z\n .number()\n .int('sortOrder must be an integer')\n .min(MIN_SORT_ORDER, `sortOrder must be at least ${String(MIN_SORT_ORDER)}`)\n .max(MAX_SORT_ORDER, `sortOrder must be at most ${String(MAX_SORT_ORDER)}`)\n\nexport type SortOrderInput = z.input<typeof sortOrderSchema>\nexport type SortOrderParsed = z.output<typeof sortOrderSchema>\n","import { z } from 'zod'\n\nexport function urlSchema(fieldName: string): z.ZodURL {\n return z.url(`${fieldName} must be a valid URL`)\n}\n\nexport function httpsUrlSchema(fieldName: string, maxLength: number): z.ZodURL {\n return urlSchema(fieldName)\n .max(maxLength)\n .refine((value) => value.startsWith('https://'), `${fieldName} must use HTTPS`)\n}\n\nexport type UrlInput = z.input<ReturnType<typeof urlSchema>>\nexport type UrlParsed = z.output<ReturnType<typeof urlSchema>>\nexport type HttpsUrlInput = z.input<ReturnType<typeof httpsUrlSchema>>\nexport type HttpsUrlParsed = z.output<ReturnType<typeof httpsUrlSchema>>\n"]}