Type Errors when copying the example
I've copied & pasted the example from the example folder but got some type errors from typescript from both the WriteRelationshipsRequest and checkPermissionRequest
However, if I add "as any" to the parameters just to get it to compile, the functions work as expected, so it appears to be just something wrong with the type defs.
The CheckPermissionRequest error

And the WriteRelationshipsRequest

@MarceloPeresToi can you provide the version of typescript you're using? I haven't been able to repro the errors using the latest released version (4.9.4)
Of course! My bad! I'm using 4.5.2
Thanks! I tested again with 4.5.2 and still can't repro.
What's odd is that the error for the CheckPermissionRequest line in the original report shows Type: '{ oneofKind: undefined; }' is not assignable... but the line itself has oneofKind: 'fullyConsistent',.
To rule out IDE setup, can you try running tsc from the command line and see if you get the same errors?
Just checked again and I'm using version 4.5.5. Running tsc got me the same errors. I'm using v0.10.0 of authzed-node
It's weird because I'm explicitly passing 'fullyConsistent' as value and for some reason it is treated as undefined...
consistency: v1.Consistency.create({
requirement: {
oneofKind: 'fullyConsistent',
fullyConsistent: true,
},
}),
Type '{ oneofKind: undefined; }' is not assignable to type '{ oneofKind: "minimizeLatency"; minimizeLatency: boolean; } | { oneofKind: "atLeastAsFresh"; atLeastAsFresh: ZedToken; } | { oneofKind: "atExactSnapshot"; atExactSnapshot: ZedToken; } | { ...; }'.
Property 'fullyConsistent' is missing in type '{ oneofKind: undefined; }' but required in type '{ oneofKind: "fullyConsistent"; fullyConsistent: boolean; }'.```
I've tried with typescript 4.5.5 and am also using authzed-node v0.10.0 but still no repro. I'm not seeing anything obvious to try next. Perhaps try deleting your node_modules directory and re-installing?