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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "zenstack-v3",
"displayName": "ZenStack",
"description": "ZenStack",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-adapters/better-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/better-auth",
"displayName": "ZenStack Better Auth Adapter",
"description": "ZenStack Better Auth Adapter. This adapter is modified from better-auth's Prisma adapter.",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/cli",
"displayName": "ZenStack CLI",
"description": "FullStack database toolkit with built-in access control and automatic API generation.",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/client-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/client-helpers",
"displayName": "ZenStack Client Helpers",
"description": "Helpers for implementing clients that consume ZenStack's CRUD service",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/client-helpers/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExtQueryArgsMarker, ExtResultMarker, type QueryOptions } from '@zenstackhq/orm';
import type { ExtQueryArgsMarker, ExtResultMarker, QueryOptions } from '@zenstackhq/orm';
import type { SchemaDef } from '@zenstackhq/schema';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/fetch-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/fetch-client",
"displayName": "ZenStack Fetch Client",
"description": "Simple fetch-based client for consuming ZenStack's RPC-style CRUD API",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/tanstack-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/tanstack-query",
"displayName": "ZenStack TanStack Query Integration",
"description": "TanStack Query Client for consuming ZenStack v3's CRUD service",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/tanstack-query/src/common/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Logger } from '@zenstackhq/client-helpers';
import { createInvalidator, TRANSACTION_ROUTE_PREFIX, type InvalidateFunc } from '@zenstackhq/client-helpers';
import { fetcher, marshal, type FetchFn } from '@zenstackhq/client-helpers/fetch';
import type { TransactionOperation } from '@zenstackhq/client-helpers';
import { CoreReadOperations } from '@zenstackhq/orm';
import { CoreReadOperations } from '@zenstackhq/orm/constants';
import type { SchemaDef } from '@zenstackhq/schema';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/common-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/common-helpers",
"displayName": "ZenStack Common Helpers",
"description": "ZenStack Common Helpers",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/eslint-config",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"private": true,
"license": "MIT"
Expand Down
2 changes: 1 addition & 1 deletion packages/config/tsdown-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/tsdown-config",
"version": "3.9.7",
"version": "3.9.8",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/typescript-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenstackhq/typescript-config",
"version": "3.9.7",
"version": "3.9.8",
"private": true,
"license": "MIT"
}
2 changes: 1 addition & 1 deletion packages/config/vitest-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/vitest-config",
"type": "module",
"version": "3.9.7",
"version": "3.9.8",
"private": true,
"license": "MIT",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-zenstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "create-zenstack",
"displayName": "Create ZenStack",
"description": "Create a new ZenStack project",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/ide/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zenstack-v3",
"publisher": "zenstack",
"version": "3.9.7",
"version": "3.9.8",
"displayName": "ZenStack V3 Language Tools",
"description": "VSCode extension for ZenStack (v3) ZModel language",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/language",
"displayName": "ZenStack Language Tooling",
"description": "ZenStack ZModel language specification",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down
12 changes: 11 additions & 1 deletion packages/orm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zenstackhq/orm",
"displayName": "ZenStack ORM",
"description": "ZenStack ORM",
"version": "3.9.7",
"version": "3.9.8",
"type": "module",
"author": {
"name": "ZenStack Team",
Expand Down Expand Up @@ -106,6 +106,16 @@
"default": "./dist/common-types.cjs"
}
},
"./constants": {
"import": {
"types": "./dist/constants.d.mts",
"default": "./dist/constants.mjs"
},
"require": {
"types": "./dist/constants.d.cts",
"default": "./dist/constants.cjs"
}
},
"./package.json": {
"import": "./package.json",
"require": "./package.json"
Expand Down
125 changes: 125 additions & 0 deletions packages/orm/src/client/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,128 @@ export const FILTER_PROPERTY_TO_KIND = {
* Mapping of filter operators to their corresponding filter kind categories.
*/
export type FilterPropertyToKind = typeof FILTER_PROPERTY_TO_KIND;

/**
* List of core CRUD operations. It excludes the 'orThrow' variants.
*/
export const CoreCrudOperations = [
'findMany',
'findUnique',
'findFirst',
'create',
'createMany',
'createManyAndReturn',
'update',
'updateMany',
'updateManyAndReturn',
'upsert',
'delete',
'deleteMany',
'count',
'aggregate',
'groupBy',
'exists',
] as const;

/**
* List of core CRUD operations. It excludes the 'orThrow' variants.
*/
export type CoreCrudOperations = (typeof CoreCrudOperations)[number];

/**
* List of core read operations. It excludes the 'orThrow' variants.
*/
export const CoreReadOperations = [
'findMany',
'findUnique',
'findFirst',
'count',
'aggregate',
'groupBy',
'exists',
] as const;

/**
* List of core read operations. It excludes the 'orThrow' variants.
*/
export type CoreReadOperations = (typeof CoreReadOperations)[number];

/**
* List of core write operations.
*/
export const CoreWriteOperations = [
'create',
'createMany',
'createManyAndReturn',
'update',
'updateMany',
'updateManyAndReturn',
'upsert',
'delete',
'deleteMany',
] as const;

/**
* List of core write operations.
*/
export type CoreWriteOperations = (typeof CoreWriteOperations)[number];

/**
* List of core create operations.
*/
export const CoreCreateOperations = ['create', 'createMany', 'createManyAndReturn', 'upsert'] as const;

/**
* List of core create operations.
*/
export type CoreCreateOperations = (typeof CoreCreateOperations)[number];

/**
* List of core update operations.
*/
export const CoreUpdateOperations = ['update', 'updateMany', 'updateManyAndReturn', 'upsert'] as const;

/**
* List of core update operations.
*/
export type CoreUpdateOperations = (typeof CoreUpdateOperations)[number];

/**
* List of core delete operations.
*/
export const CoreDeleteOperations = ['delete', 'deleteMany'] as const;

/**
* List of core delete operations.
*/
export type CoreDeleteOperations = (typeof CoreDeleteOperations)[number];

/**
* List of all CRUD operations, including 'orThrow' variants.
*/
export const AllCrudOperations = [...CoreCrudOperations, 'findUniqueOrThrow', 'findFirstOrThrow'] as const;

/**
* List of all CRUD operations, including 'orThrow' variants.
*/
export type AllCrudOperations = (typeof AllCrudOperations)[number];

/**
* List of all read operations, including 'orThrow' variants.
*/
export const AllReadOperations = [...CoreReadOperations, 'findUniqueOrThrow', 'findFirstOrThrow'] as const;

/**
* List of all read operations, including 'orThrow' variants.
*/
export type AllReadOperations = (typeof AllReadOperations)[number];

/**
* List of all write operations - simply an alias of CoreWriteOperations.
*/
export const AllWriteOperations = CoreWriteOperations;

/**
* List of all write operations - simply an alias of CoreWriteOperations.
*/
export type AllWriteOperations = CoreWriteOperations;
Loading
Loading