Skip to content

Commit c618515

Browse files
committed
update
1 parent c52b1df commit c618515

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

packages/language/res/stdlib.zmodel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,22 +543,22 @@ attribute @upper() @@@targetField([StringField]) @@@validation
543543
/**
544544
* Validates a number field is greater than the given value.
545545
*/
546-
attribute @gt(_ value: Int, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
546+
attribute @gt(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
547547

548548
/**
549549
* Validates a number field is greater than or equal to the given value.
550550
*/
551-
attribute @gte(_ value: Int, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
551+
attribute @gte(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
552552

553553
/**
554554
* Validates a number field is less than the given value.
555555
*/
556-
attribute @lt(_ value: Int, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
556+
attribute @lt(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
557557

558558
/**
559559
* Validates a number field is less than or equal to the given value.
560560
*/
561-
attribute @lte(_ value: Int, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
561+
attribute @lte(_ value: Any, _ message: String?) @@@targetField([IntField, FloatField, DecimalField, BigIntField]) @@@validation
562562

563563
/**
564564
* Validates the entity with a complex condition.

packages/runtime/src/client/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Decimal } from 'decimal.js';
1+
import type Decimal from 'decimal.js';
22
import { type GetModels, type IsDelegateModel, type ProcedureDef, type SchemaDef } from '../schema';
33
import type { AuthType } from '../schema/auth';
44
import type { OrUndefinedIf, Simplify, UnwrapTuplePromises } from '../utils/type-utils';

packages/runtime/src/client/crud/dialects/postgresql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { invariant } from '@zenstackhq/common-helpers';
2-
import { Decimal } from 'decimal.js';
2+
import Decimal from 'decimal.js';
33
import {
44
sql,
55
type Expression,

packages/runtime/src/client/crud/dialects/sqlite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { invariant } from '@zenstackhq/common-helpers';
2-
import { Decimal } from 'decimal.js';
2+
import Decimal from 'decimal.js';
33
import {
44
ExpressionWrapper,
55
sql,

packages/runtime/src/client/crud/validator/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { invariant } from '@zenstackhq/common-helpers';
2-
import { Decimal } from 'decimal.js';
2+
import Decimal from 'decimal.js';
33
import stableStringify from 'json-stable-stringify';
44
import { match, P } from 'ts-pattern';
55
import { z, ZodSchema, ZodType } from 'zod';

packages/runtime/src/client/crud/validator/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
MemberExpression,
99
UnaryExpression,
1010
} from '@zenstackhq/sdk/schema';
11-
import { Decimal } from 'decimal.js';
11+
import Decimal from 'decimal.js';
1212
import { match, P } from 'ts-pattern';
1313
import { z } from 'zod';
1414
import { ExpressionUtils } from '../../../schema';
@@ -275,8 +275,8 @@ function evalBinary(data: any, expr: BinaryExpression) {
275275
return match(expr.op)
276276
.with('&&', () => Boolean(left) && Boolean(right))
277277
.with('||', () => Boolean(left) || Boolean(right))
278-
.with('==', () => left == right) // eslint-disable-line eqeqeq
279-
.with('!=', () => left != right) // eslint-disable-line eqeqeq
278+
.with('==', () => left == right)
279+
.with('!=', () => left != right)
280280
.with('<', () => (left as any) < (right as any))
281281
.with('<=', () => (left as any) <= (right as any))
282282
.with('>', () => (left as any) > (right as any))

packages/runtime/src/client/query-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Decimal } from 'decimal.js';
1+
import type Decimal from 'decimal.js';
22
import type { Generated, Kysely } from 'kysely';
33
import type {
44
FieldHasDefault,

packages/runtime/src/utils/type-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Decimal } from 'decimal.js';
1+
import type Decimal from 'decimal.js';
22

33
export type Optional<T extends object, K extends keyof T = keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
44

packages/sdk/src/schema/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Decimal } from 'decimal.js';
1+
import type Decimal from 'decimal.js';
22
import type { Expression } from './expression';
33

44
export type DataSourceProviderType = 'sqlite' | 'postgresql';

tests/e2e/orm/client-api/type-coverage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createTestClient, getTestDbProvider } from '@zenstackhq/testtools';
2-
import { Decimal } from 'decimal.js';
2+
import Decimal from 'decimal.js';
33
import { describe, expect, it } from 'vitest';
44

55
describe('Zmodel type coverage tests', () => {

0 commit comments

Comments
 (0)