Releases: open-policy-agent/opa-typescript
@styra/[email protected]
Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.376.0 (2.402.5) https://github.com/speakeasy-api/speakeasy
Generated
- [typescript v1.5.0] packages/opa
- NPM 1.5.0
@styra/[email protected]
Minor Changes
- 410b448: update @styra/opa to v1.5.0
@styra/[email protected]
Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.369.0 (2.399.0) https://github.com/speakeasy-api/speakeasy
Generated
- [typescript v1.4.1] packages/opa
- NPM 1.4.1
@styra/[email protected]
Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.361.1 (2.393.4) https://github.com/speakeasy-api/speakeasy
Generated
- [typescript v1.4.0] packages/opa
- NPM 1.4.0"
@styra/[email protected]
Patch Changes
- 76cfb32: include sources in npm package
@styra/[email protected]
Minor Changes
-
d66c52f: Let
useAuthzhandle multiple queries at onceIf you don't know the number of evaluations you need, or if you want to do evaluations in a loop, you cannot do that with the "single-decision"
useAuthzcall.So now, you can provide an array of evaluation queries,
{ path?: string; input?: Input; fromResult?: (_?: Result) => boolean; }[],
instead, and you'll get a
UseAuthzResult<T>[]in return.
@styra/[email protected]
Patch Changes
- 6820c04: Tweak cache key computation and minor performance enhancements
@styra/[email protected]
Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.334.0 (2.369.0) https://github.com/speakeasy-api/speakeasy
Generated
- [typescript v1.3.0] packages/opa
- NPM 1.3.0"
@styra/[email protected]
Minor Changes
-
12f1e98: Support batching requests sent to the backend (optional)
When used with Enterprise OPA's Batch API, this mode allows for sending much
fewer requests to the backend. It's enabled by settingbatch={true}on<AuthzProvider>.Note that the Batch API has no notion of "default query", so it's not possible
to use batching without having eitherdefaultPath(<AuthzProvider>) or
path(useAuthz(),<Authz>) set.Please note that
fromResultis exempt from the cache key, so multiple requests
with the same path and input, but differentfromResultsettings will lead to
unforeseen results.
This is on par with the regular (non-batching) caching, and we'll revisit this
if it becomes a problem for users. Please create an issue on Github if it is
problematic for you.Furthermore, batching queries are not wired up with
AbortControllerlike the
non-batching equivalents are. -
dd082b5: Introduce
@tanstack/react-queryfor policy evaluation request cachingWith this release, multiple uses of
useAuthzand<Authz>with the same inputs no longer unconditionally lead to API requests.
Using@tanstack/react-queryunderneath,useAuthzwill now return cached results when applicable.Furthermore, API requests are retried on transient errors.
You can control the retry count viaAuthzProvider'sretryproperty.NOTE The
fromResultproperty/argument is currently exempt from the cache key -- so two requests with the samepathandinputwill produce the same result even if theirfromResultdiffers.
We believe that this is quite uncommon, please file an issue if it is a problem in your use case.For details on how and when the cache is invalidated, please refer to the docs here: https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults
-
f9d7ac2: change exported interfaces names, and AuthzProvider property
The export iterface
SDKis now calledOPAClientfor consistency with@styra/opa.It is used in
AuthzProviderContextandAuthzProviderProps, and has been renamed fromsdktoopaClient.
@styra/[email protected]
Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.330.0 (2.361.10) https://github.com/speakeasy-api/speakeasy
Generated
- [typescript v1.2.4] packages/opa
- NPM 1.2.4