Releases: StyraInc/opa-typescript
@styra/[email protected]
Patch Changes
-
5c7cb33: support translating table and column names via extra options
An extra options object can be passed to
ucastToPrisma
to translate table and column names.
This is useful when the Prisma schema uses different names than the OPA policy used to generate
the conditions.const p = ucastToPrisma( { or: [{ "tickets.resolved": false }, { "users.name": "ceasar" }] }, "tickets0", { translations: { tickets: { $self: "tickets0", resolved: "resolved0" }, users: { $self: "users0", name: "name0" }, }, } );
In this example, the conditions
{ or: [{ "tickets.resolved": false }, { "users.name": "ceasar" }] }
will be rewritten to{ OR: [{ tickets0: { resolved0: false } }, { users0: { name0: "ceasar" } }] }
,
assuming that the Prisma schema usestickets0
andusers0
as table names andresolved0
andname0
as column names respectively.
@styra/[email protected]
Patch Changes
- f717e3e: handle 'or' correctly when including compound disjuncts
@styra/[email protected]
Patch Changes
-
3920db7: Introduce laxer handling of empty compound conditions
This aligns better with common Rego patterns, like using multi-value
rules for generating conditions:conditions.or contains {"tickets.resolved": false} if { ... }
If the RHS is not satisfied, the conditions would yield
{ "conditions": { "or": [] } }
and with this change, this will be valid. The condition itself is
going to be dropped.
@styra/[email protected]
Patch Changes
-
73b18d1: ucastToPrisma takes primary table to project conditions
Previously, the conversion logic for OR conditions was faulty.
It's not possible to properly translate OR conditions to Prisma
query filters without knowing the primary table of the query.That table is now passed as an argument to ucastToPrisma.
@styra/[email protected]
Patch Changes
- 0f2a82a: add minimal README and keywords
@styra/[email protected]
Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.396.10 (2.415.7) https://github.com/speakeasy-api/speakeasy
Generated
- [typescript v1.6.0] packages/opa
- NPM 1.6.0
@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"