vona-module-a-openapi 5.0.39 → 5.0.41

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,16 @@ 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 ?? 'string';
769
+ const _identityType = ormConfig?.table?.identityType ?? 'bigint';
770
770
  return function (_schema) {
771
- if (_identityType === 'string') {
772
- return z.string();
773
- } else if (_identityType === 'number') {
771
+ if (_identityType === 'number') {
774
772
  return z.number();
773
+ } else if (_identityType === 'bigint') {
774
+ return z.string().regex(/^\d+$/);
775
775
  }
776
776
  throw new Error('not support');
777
777
  };
778
778
  }
779
- function schemaBigNumber() {
780
- return function (_schema) {
781
- return z.union([z.string(), z.number()]);
782
- };
783
- }
784
779
  function schemaCaptcha(options) {
785
780
  return function (schema) {
786
781
  return schema.openapi({
@@ -951,7 +946,6 @@ const v = {
951
946
  uppercase: schemaUppercase,
952
947
  regex: schemaRegex,
953
948
  tableIdentity: schemaTableIdentity,
954
- bigNumber: schemaBigNumber,
955
949
  captcha: schemaCaptcha,
956
950
  serializerExclude: schemaSerializerExclude,
957
951
  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;
@@ -1,4 +1,4 @@
1
- import { schemaBigNumber, schemaCaptcha, schemaEmail, schemaIPv4, schemaIPv6, schemaLowercase, schemaMax, schemaMin, schemaRegex, schemaRequired, schemaSerializerExclude, schemaSerializerGetter, schemaSerializerSensitive, schemaSerializerTransform, schemaTableIdentity, schemaToLowerCase, schemaToUpperCase, schemaTrim, schemaUppercase, schemaUrl, schemaUuid } from './v/helpers.ts';
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-openapi",
3
3
  "type": "module",
4
- "version": "5.0.39",
4
+ "version": "5.0.41",
5
5
  "title": "a-openapi",
6
6
  "vonaModule": {
7
7
  "capabilities": {