vona-module-a-openapi 5.0.39 → 5.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -766,21 +766,18 @@ function schemaRegex(regex, params) {
|
|
|
766
766
|
function schemaTableIdentity() {
|
|
767
767
|
const app = useApp();
|
|
768
768
|
const ormConfig = app.util.getModuleConfigRaw('a-orm');
|
|
769
|
-
const _identityType = ormConfig?.table?.identityType ?? '
|
|
769
|
+
const _identityType = ormConfig?.table?.identityType ?? 'bigint';
|
|
770
770
|
return function (_schema) {
|
|
771
771
|
if (_identityType === 'string') {
|
|
772
772
|
return z.string();
|
|
773
773
|
} else if (_identityType === 'number') {
|
|
774
774
|
return z.number();
|
|
775
|
+
} else if (_identityType === 'bigint') {
|
|
776
|
+
return z.string().regex(/^\d+$/);
|
|
775
777
|
}
|
|
776
778
|
throw new Error('not support');
|
|
777
779
|
};
|
|
778
780
|
}
|
|
779
|
-
function schemaBigNumber() {
|
|
780
|
-
return function (_schema) {
|
|
781
|
-
return z.union([z.string(), z.number()]);
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
781
|
function schemaCaptcha(options) {
|
|
785
782
|
return function (schema) {
|
|
786
783
|
return schema.openapi({
|
|
@@ -951,7 +948,6 @@ const v = {
|
|
|
951
948
|
uppercase: schemaUppercase,
|
|
952
949
|
regex: schemaRegex,
|
|
953
950
|
tableIdentity: schemaTableIdentity,
|
|
954
|
-
bigNumber: schemaBigNumber,
|
|
955
951
|
captcha: schemaCaptcha,
|
|
956
952
|
serializerExclude: schemaSerializerExclude,
|
|
957
953
|
serializerTransform: schemaSerializerTransform,
|
|
@@ -16,7 +16,6 @@ export declare function schemaLowercase(params?: string | z.core.$ZodCheckLowerC
|
|
|
16
16
|
export declare function schemaUppercase(params?: string | z.core.$ZodCheckUpperCaseParams): (schema: z.ZodString) => z.ZodString;
|
|
17
17
|
export declare function schemaRegex(regex: RegExp, params?: string | z.core.$ZodCheckRegexParams): (schema: z.ZodString) => z.ZodString;
|
|
18
18
|
export declare function schemaTableIdentity(): (_schema?: any) => z.ZodString | z.ZodNumber;
|
|
19
|
-
export declare function schemaBigNumber(): (_schema: any) => z.ZodType;
|
|
20
19
|
export declare function schemaCaptcha(options: ISchemaObjectExtensionFieldCaptcha): (schema: z.ZodType) => z.ZodType;
|
|
21
20
|
export declare function schemaSerializerExclude(): (schema: z.ZodType) => z.ZodType;
|
|
22
21
|
export declare function schemaSerializerTransform<T extends keyof ISerializerTransformRecord>(serializerTransformName: T, options?: Partial<ISerializerTransformRecord[T]>): (schema: z.ZodType) => z.ZodType;
|
package/dist/lib/schema/v.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { schemaCaptcha, schemaEmail, schemaIPv4, schemaIPv6, schemaLowercase, schemaMax, schemaMin, schemaRegex, schemaRequired, schemaSerializerExclude, schemaSerializerGetter, schemaSerializerSensitive, schemaSerializerTransform, schemaTableIdentity, schemaToLowerCase, schemaToUpperCase, schemaTrim, schemaUppercase, schemaUrl, schemaUuid } from './v/helpers.ts';
|
|
2
2
|
import { schemaDescription, schemaExample, schemaOpenapi, schemaTitle } from './v/openapi.ts';
|
|
3
3
|
import { schemaArray, schemaDefault, schemaLazy, schemaLooseObject, schemaObject, schemaOptional, schemaStrictObject } from './v/system.ts';
|
|
4
4
|
import { schemaZodRefine, schemaZodTransform } from './v/zod.ts';
|
|
@@ -25,7 +25,6 @@ export declare const v: {
|
|
|
25
25
|
uppercase: typeof schemaUppercase;
|
|
26
26
|
regex: typeof schemaRegex;
|
|
27
27
|
tableIdentity: typeof schemaTableIdentity;
|
|
28
|
-
bigNumber: typeof schemaBigNumber;
|
|
29
28
|
captcha: typeof schemaCaptcha;
|
|
30
29
|
serializerExclude: typeof schemaSerializerExclude;
|
|
31
30
|
serializerTransform: typeof schemaSerializerTransform;
|