Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.4.0
version: 9.15.9

- name: Use Node.js ${{ matrix.node-version }}
uses: buildjet/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.4.0
version: 9.15.9

- name: Use Node.js ${{ matrix.node-version }}
uses: buildjet/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.4.0
version: 9.15.9

- name: Use Node.js ${{ matrix.node-version }}
uses: buildjet/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ I want to think you first for considering contributing to ZenStack 🙏🏻. It'
## Prerequisites

- [Node.js](https://nodejs.org/): v20 or above
- [pnpm](https://pnpm.io/): v9.4.0
- [pnpm](https://pnpm.io/): v9.15.9

If you want to run the tests, you should be aware that some of the integration tests run against postgres. These tests will attempt to set up and subsequently their own database, so you'll need to provide a connection details for a postgres user with at least those permissions. To provide connection details, you can configure the following environment variables or provide them when executing `pnpm test` commands.

Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zenstack-monorepo",
"version": "2.17.2",
"version": "2.18.0",
"description": "",
"scripts": {
"build": "pnpm -r --filter=\"!./packages/ide/*\" build",
Expand All @@ -22,11 +22,10 @@
"keywords": [],
"author": "",
"license": "MIT",
"packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
"packageManager": "pnpm@9.15.9",
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.2",
"@types/node": "^20.14.9",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"concurrently": "^7.4.0",
Expand All @@ -38,6 +37,6 @@
"ts-jest": "^29.1.1",
"tsup": "^8.0.1",
"tsx": "^4.7.1",
"typescript": "^5.4.4"
"typescript": "catalog:"
}
}
2 changes: 1 addition & 1 deletion packages/ide/jetbrains/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "dev.zenstack"
version = "2.17.2"
version = "2.18.0"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion packages/ide/jetbrains/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jetbrains",
"version": "2.17.2",
"version": "2.18.0",
"displayName": "ZenStack JetBrains IDE Plugin",
"description": "ZenStack JetBrains IDE plugin",
"homepage": "https://zenstack.dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/language/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/language",
"version": "2.17.2",
"version": "2.18.0",
"displayName": "ZenStack modeling language compiler",
"description": "ZenStack modeling language compiler",
"homepage": "https://zenstack.dev",
Expand Down
4 changes: 2 additions & 2 deletions packages/misc/redwood/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/redwood",
"displayName": "ZenStack RedwoodJS Integration",
"version": "2.17.2",
"version": "2.18.0",
"description": "CLI and runtime for integrating ZenStack with RedwoodJS projects.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,7 +46,7 @@
"listr2": "^6.0.0",
"semver": "^7.5.2",
"terminal-link": "^2.0.0",
"ts-morph": "^16.0.0",
"ts-morph": "catalog:",
"yargs": "^17.7.2"
},
"devDependencies": {
Expand Down
8 changes: 5 additions & 3 deletions packages/plugins/openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/openapi",
"displayName": "ZenStack Plugin and Runtime for OpenAPI",
"version": "2.17.2",
"version": "2.18.0",
"description": "ZenStack plugin and runtime supporting OpenAPI",
"main": "index.js",
"repository": {
Expand Down Expand Up @@ -32,8 +32,10 @@
"semver": "^7.5.2",
"ts-pattern": "^4.3.0",
"yaml": "^2.2.2",
"zod": "^3.22.4",
"zod-validation-error": "^1.5.0"
"zod-validation-error": "catalog:"
},
"peerDependencies": {
"zod": "catalog:"
},
"devDependencies": {
"@readme/openapi-parser": "^2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/openapi/src/generator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Model } from '@zenstackhq/sdk/ast';
import type { DMMF } from '@zenstackhq/sdk/prisma';
import type { OpenAPIV3_1 as OAPI } from 'openapi-types';
import semver from 'semver';
import { fromZodError } from 'zod-validation-error';
import { fromZodError } from 'zod-validation-error/v3';
import { name } from '.';
import { SecuritySchemesSchema } from './schema';

Expand Down
21 changes: 14 additions & 7 deletions packages/plugins/openapi/src/rpc-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase {
// analyze access policies to determine default security
const { create, read, update, delete: del } = analyzePolicies(zmodel);

// OrderByWithRelationInput's name is different when "fullTextSearch" is enabled
const orderByWithRelationInput = this.inputObjectTypes
.map((o) => upperCaseFirst(o.name))
.includes(`${modelName}OrderByWithRelationInput`)
? `${modelName}OrderByWithRelationInput`
: `${modelName}OrderByWithRelationAndSearchRelevanceInput`;

if (ops['createOne']) {
definitions.push({
method: 'post',
Expand Down Expand Up @@ -269,6 +276,13 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase {
select: this.omittableRef(`${modelName}Select`),
include: hasRelation ? this.omittableRef(`${modelName}Include`) : undefined,
where: this.omittableRef(`${modelName}WhereInput`),
orderBy: this.oneOf(
this.omittableRef(orderByWithRelationInput),
this.array(this.omittableRef(orderByWithRelationInput))
),
cursor: this.omittableRef(`${modelName}WhereUniqueInput`),
take: { type: 'integer' },
skip: { type: 'integer' },
meta: this.ref('_Meta'),
},
},
Expand Down Expand Up @@ -422,13 +436,6 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase {
security: read === true ? [] : undefined,
});

// OrderByWithRelationInput's name is different when "fullTextSearch" is enabled
const orderByWithRelationInput = this.inputObjectTypes
.map((o) => upperCaseFirst(o.name))
.includes(`${modelName}OrderByWithRelationInput`)
? `${modelName}OrderByWithRelationInput`
: `${modelName}OrderByWithRelationAndSearchRelevanceInput`;

if (ops['aggregate']) {
definitions.push({
method: 'get',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,18 @@ components:
$ref: '#/components/schemas/_AnyObject'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/_AnyObject'
- type: array
items:
$ref: '#/components/schemas/_AnyObject'
cursor:
$ref: '#/components/schemas/_AnyObject'
take:
type: integer
skip:
type: integer
UserUpdateArgs:
type: object
required:
Expand Down Expand Up @@ -760,6 +772,18 @@ components:
$ref: '#/components/schemas/_AnyObject'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/_AnyObject'
- type: array
items:
$ref: '#/components/schemas/_AnyObject'
cursor:
$ref: '#/components/schemas/_AnyObject'
take:
type: integer
skip:
type: integer
ProfileUpdateArgs:
type: object
required:
Expand Down
36 changes: 36 additions & 0 deletions packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3318,6 +3318,18 @@ components:
$ref: '#/components/schemas/UserWhereInput'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- type: array
items:
$ref: '#/components/schemas/UserOrderByWithRelationInput'
cursor:
$ref: '#/components/schemas/UserWhereUniqueInput'
take:
type: integer
skip:
type: integer
UserUpdateArgs:
type: object
required:
Expand Down Expand Up @@ -3506,6 +3518,18 @@ components:
$ref: '#/components/schemas/ProfileWhereInput'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- type: array
items:
$ref: '#/components/schemas/ProfileOrderByWithRelationInput'
cursor:
$ref: '#/components/schemas/ProfileWhereUniqueInput'
take:
type: integer
skip:
type: integer
ProfileUpdateArgs:
type: object
required:
Expand Down Expand Up @@ -3694,6 +3718,18 @@ components:
$ref: '#/components/schemas/Post_ItemWhereInput'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- type: array
items:
$ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
cursor:
$ref: '#/components/schemas/Post_ItemWhereUniqueInput'
take:
type: integer
skip:
type: integer
Post_ItemUpdateArgs:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,18 @@ components:
$ref: '#/components/schemas/_AnyObject'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/_AnyObject'
- type: array
items:
$ref: '#/components/schemas/_AnyObject'
cursor:
$ref: '#/components/schemas/_AnyObject'
take:
type: integer
skip:
type: integer
UserUpdateArgs:
type: object
required:
Expand Down Expand Up @@ -798,6 +810,18 @@ components:
$ref: '#/components/schemas/_AnyObject'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/_AnyObject'
- type: array
items:
$ref: '#/components/schemas/_AnyObject'
cursor:
$ref: '#/components/schemas/_AnyObject'
take:
type: integer
skip:
type: integer
ProfileUpdateArgs:
type: object
required:
Expand Down
36 changes: 36 additions & 0 deletions packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3382,6 +3382,18 @@ components:
$ref: '#/components/schemas/UserWhereInput'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/UserOrderByWithRelationInput'
- type: array
items:
$ref: '#/components/schemas/UserOrderByWithRelationInput'
cursor:
$ref: '#/components/schemas/UserWhereUniqueInput'
take:
type: integer
skip:
type: integer
UserUpdateArgs:
type: object
required:
Expand Down Expand Up @@ -3570,6 +3582,18 @@ components:
$ref: '#/components/schemas/ProfileWhereInput'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/ProfileOrderByWithRelationInput'
- type: array
items:
$ref: '#/components/schemas/ProfileOrderByWithRelationInput'
cursor:
$ref: '#/components/schemas/ProfileWhereUniqueInput'
take:
type: integer
skip:
type: integer
ProfileUpdateArgs:
type: object
required:
Expand Down Expand Up @@ -3758,6 +3782,18 @@ components:
$ref: '#/components/schemas/Post_ItemWhereInput'
meta:
$ref: '#/components/schemas/_Meta'
orderBy:
oneOf:
- $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
- type: array
items:
$ref: '#/components/schemas/Post_ItemOrderByWithRelationInput'
cursor:
$ref: '#/components/schemas/Post_ItemWhereUniqueInput'
take:
type: integer
skip:
type: integer
Post_ItemUpdateArgs:
type: object
required:
Expand Down
Loading
Loading