Skip to content

Commit

Permalink
Version Packages (#356)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Nov 7, 2024
1 parent 5c7cb33 commit f5f1b6c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
27 changes: 0 additions & 27 deletions .changeset/hip-files-repair.md

This file was deleted.

28 changes: 28 additions & 0 deletions packages/ucast-prisma/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# @styra/ucast-prisma

## 0.0.6

### 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.

```typescript
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 uses `tickets0` and `users0` as table names and `resolved0` and `name0`
as column names respectively.

## 0.0.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ucast-prisma/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@styra/ucast-prisma",
"version": "0.0.5",
"version": "0.0.6",
"repository": {
"type": "git",
"url": "https://github.com/StyraInc/opa-typescript.git",
Expand Down

0 comments on commit f5f1b6c

Please sign in to comment.