From f5f1b6c9911671b23f97210a3e930d9b1ab4713d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:02:31 +0100 Subject: [PATCH] Version Packages (#356) Co-authored-by: github-actions[bot] --- .changeset/hip-files-repair.md | 27 --------------------------- packages/ucast-prisma/CHANGELOG.md | 28 ++++++++++++++++++++++++++++ packages/ucast-prisma/package.json | 2 +- 3 files changed, 29 insertions(+), 28 deletions(-) delete mode 100644 .changeset/hip-files-repair.md diff --git a/.changeset/hip-files-repair.md b/.changeset/hip-files-repair.md deleted file mode 100644 index 9839e320..00000000 --- a/.changeset/hip-files-repair.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"@styra/ucast-prisma": patch ---- - -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. diff --git a/packages/ucast-prisma/CHANGELOG.md b/packages/ucast-prisma/CHANGELOG.md index 1ae37dfd..60afcff1 100644 --- a/packages/ucast-prisma/CHANGELOG.md +++ b/packages/ucast-prisma/CHANGELOG.md @@ -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 diff --git a/packages/ucast-prisma/package.json b/packages/ucast-prisma/package.json index 4034801a..1361a3b7 100644 --- a/packages/ucast-prisma/package.json +++ b/packages/ucast-prisma/package.json @@ -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",