File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export {
14
14
parseListQuery ,
15
15
relationship ,
16
16
resourceIdentifierSchema ,
17
+ clientResourceIdentifierSchema ,
17
18
type Sort ,
18
19
ZodValidationError ,
19
20
} from "./request.js" ;
Original file line number Diff line number Diff line change @@ -129,10 +129,26 @@ export const resourceIdentifierSchema = <TType extends string>(
129
129
id : z . string ( ) ,
130
130
} ) ;
131
131
132
+ type ClientResourceIdentifierSchema < TType extends string > = z . ZodObject < {
133
+ type : z . ZodType < TType > ;
134
+ lid : z . ZodString ;
135
+ } > ;
136
+
137
+ export const clientResourceIdentifierSchema = < TType extends string > (
138
+ type : TType ,
139
+ ) : ClientResourceIdentifierSchema < TType > =>
140
+ z . object ( {
141
+ type : fixedTypeSchema ( type ) ,
142
+ lid : z . string ( ) ,
143
+ } ) ;
144
+
132
145
type RelationshipDataSchema =
133
146
| ResourceIdentifierSchema < string >
134
147
| z . ZodArray < ResourceIdentifierSchema < string > >
135
- | z . ZodNullable < ResourceIdentifierSchema < string > > ;
148
+ | z . ZodNullable < ResourceIdentifierSchema < string > >
149
+ | ClientResourceIdentifierSchema < string >
150
+ | z . ZodArray < ClientResourceIdentifierSchema < string > >
151
+ | z . ZodNullable < ClientResourceIdentifierSchema < string > > ;
136
152
137
153
type RelationshipSchema < TData extends RelationshipDataSchema > = z . ZodObject < {
138
154
data : TData ;
You can’t perform that action at this time.
0 commit comments