/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import * as zod from 'zod'; /** * @summary Lookup data types registry. */ export const searchTypesQuerySortItemDefault = `*`; export const searchTypesQuerySortItemRegExp = /^[+|-|!]?\w+$/; export const searchTypesQueryFieldsItemDefault = `*`; export const SearchTypesQueryParams = zod.object({ q: zod .string() .optional() .describe( 'Search term:\n`?` - matches any character\n`*` - matches 0 or more characters\ne.g.: name,emails{type},labels etc...', ), id: zod.string().optional().describe('`types.id`'), name: zod.string().optional().describe('`types.name`'), repo: zod.string().optional().describe('`types.repo`'), path: zod.string().optional().describe('`types.path`'), readonly: zod .boolean() .optional() .describe('[NOT] [ system / custom ] types only'), extendable: zod .boolean() .optional() .describe('[NOT] Extend[able] types only.'), extensions: zod .boolean() .optional() .describe('[NOT] include extensions/* types.'), extended: zod.boolean().optional().describe('[NOT] Extend[ed] types only.'), administered: zod .boolean() .optional() .describe('[NOT] Administer access control only'), size: zod .number() .optional() .describe('Number of result records (per page).\nDefault: 16.'), page: zod .number() .optional() .describe('Page number of result set of records.\nDefault: 1.'), sort: zod .array( zod .string() .regex(searchTypesQuerySortItemRegExp) .default(searchTypesQuerySortItemDefault), ) .optional() .describe( 'Sort result dataset of records by fields.\n```\nsort ::= *( ORDER name )\n\nORDER = ASC / DESC\nDESC = "-" / "!"\nASC = [ "+" ] ; Default\n```\n\nFields available\n\n- `id`(seq)\n- `domain`{name}\n- `created_at`\n- `created_by`{name}\n- `updated_at`\n- `updated_by`{name}\n\nUse ?fields=`field.sort()` option to sort Edge fields.', ), fields: zod .array(zod.string().default(searchTypesQueryFieldsItemDefault)) .optional() .describe( 'Fields [Q]uery to build result dataset record.\n```\nfields ::= field [ *( "," field ) ]\nfield ::= name [ *( func ) ] [ inner ]\ninner ::= "{" fields "}"\nfuncs ::= *( func )\nfunc ::= "." name "(" [ args ] ")"\nname ::= ALPHA / DIGIT / USCORE\n\nALPHA = %x41-5A / %x61-7A ; "A"-"Z" / "a"-"z"\nDIGIT = %x30-39 ; "0"-"9"\nUSCORE = %x5F ; underscore ; "_"\n```', ), }); export const searchTypesResponseDataItemFieldsItemKindDefault = `none`; export const SearchTypesResponse = zod .object({ data: zod .array( zod .object({ about: zod .string() .optional() .describe('Optional. Short description.'), administered: zod.boolean().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod .string() .optional() .describe('Required. Unique Identifier.'), name: zod .string() .optional() .describe('Readonly. Display name.'), type: zod .string() .optional() .describe('Optional. Reference type.'), }) .optional(), display: zod .string() .optional() .describe( 'Required. Display [fields.id] key.\nUsed as [lookup].name setting for this [struct] type.', ), extendable: zod .boolean() .optional() .describe( '// Extension fields type.\n Extension extension = 23;', ), fields: zod .array( zod .object({ always: zod .unknown() .optional() .describe( 'Always signifies that the field value will be computed on any write (INSERT OR UPDATE) operations.\nThe field cannot be written to, and when read the result of the last generated expression will be returned.\n\nThe generation expression can refer to other columns in the table, but not other generated columns. Any functions and operators used must be immutable. References to other tables are not allowed.', ), binary: zod .object({ maxBytes: zod.number().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), bool: zod.looseObject({}).optional(), datetime: zod .object({ epoch: zod .number() .optional() .describe( 'Epoch timestamp.\nIf zero - UNIX epoch (1970-01-01 00:00:00) will be used.', ), format: zod.string().optional(), zone: zod .string() .optional() .describe('Timezone associated.\nDefault: `UTC`.'), }) .optional() .describe( 'Datetime type settings.\n\nenum Part {\n full = 0; // date & time\n date = 1; // date only ; YYYY-MM-DD\n time = 2; // time only ; HH:mm:ss[.pres]\n }\n Part part = 1; // part of: [ date &| time ]\n enum Stamp {\n s = 0; // seconds\n ms = 1; // [milli]seconds ; E+3\n mc = 2; // [micro]seconds ; E+6\n ns = 3; // [nano]seconds ; E+9\n m = -1; // minutes\n h = -2; // hours\n }\n Stamp time = 2; // time precision\n string zone = 3; // ??? [ Europe/Kyiv | +03:00 ]', ), default: zod .unknown() .optional() .describe( 'The `default` expression will be used in `INSERT` operation\nthat does not specify a value for the field.\n\nIf there is no default for a field, then the default is null.', ), disabled: zod.boolean().optional(), duration: zod .object({ format: zod.string().optional(), max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), float: zod .object({ frac: zod.number().optional(), max: zod.number().optional(), min: zod.number().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), float32: zod .object({ frac: zod.number().optional(), max: zod.number().optional(), min: zod.number().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), float64: zod .object({ frac: zod.number().optional(), max: zod.number().optional(), min: zod.number().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), hidden: zod.boolean().optional(), hint: zod .string() .optional() .describe('Short description. Default: {name}.'), id: zod .string() .optional() .describe('Field [code] name.\n\ncode'), int: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), int32: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), int64: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), kind: zod .enum([ 'none', 'list', 'bool', 'int', 'int32', 'int64', 'uint', 'uint32', 'uint64', 'float', 'float32', 'float64', 'binary', 'lookup', 'string', 'richtext', 'datetime', 'duration', ]) .default(searchTypesResponseDataItemFieldsItemKindDefault) .describe('Required. The field type.'), lookup: zod .object({ display: zod .string() .optional() .describe( '[Readonly]. Display dataset field.\n(lookup).{`name`} value relation.', ), name: zod .string() .optional() .describe('[Readonly]. Dataset title.'), path: zod .string() .optional() .describe( '[Required]. Reference dataset relative path\ne.g.: "contacts", "dictionaries/cities".\n(lookup).{`type`} value relation.', ), primary: zod .string() .optional() .describe( '[Readonly]. Primary dataset field.\n(lookup).{`id`} value relation.', ), query: zod .record(zod.string(), zod.string()) .optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional() .describe( 'Lookup ( REFERENCE ) type descriptor.\nSimplified [webitel.custom.Struct] options.', ), name: zod .string() .optional() .describe('Title of the field. Lang specific.\n\ntitle'), readonly: zod .boolean() .optional() .describe( 'Optional. Disable any write (INSERT OR UPDATE) operations.\nREADONLY signifies that the field value will be always computed on any write (INSERT OR UPDATE) operations.\nIf selected, the `default` value MUST be specified.\n\nFIXME: Is base field ? [ id, created_, updated_ ]', ), required: zod.boolean().optional(), richtext: zod .object({ maxBytes: zod.number().optional(), maxChars: zod.number().optional(), multiline: zod.boolean().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), string: zod .object({ maxBytes: zod.number().optional(), maxChars: zod.number().optional(), multiline: zod.boolean().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), uint: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), uint32: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), uint64: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod .record(zod.string(), zod.string()) .optional(), }) .optional(), }) .describe('Field of the struct.'), ) .optional() .describe('Fields of the struct type.'), id: zod .string() .optional() .describe( 'Deprecated. Use `repo` instead. The [type] name (singular form), e.g.: `country`.', ), indexes: zod .record( zod.string(), zod .object({ fields: zod .array(zod.string()) .optional() .describe( 'A set of [struct.fields.id] to INDEX within [type] dataset.', ), include: zod .array(zod.string()) .optional() .describe( 'A set of [struct.fields.id] to INCLUDE beside the [fields] index.', ), unique: zod .boolean() .optional() .describe( 'Indicates whether set of [fields] MUST be UNIQUE within [type].', ), }) .describe('INDEX [struct.fields].'), ) .optional() .describe('INDEX fields.\n\nExtension extension = 15;'), name: zod .string() .optional() .describe('A User-friendly [id] name ; lang: specific.'), objclass: zod .string() .optional() .describe('Readonly. RbAC objclass identity.'), path: zod .string() .optional() .describe( 'Readonly. Relative path to access the dataset APIs, e.g.: `dictionaries/countries`.', ), primary: zod .string() .optional() .describe( 'Required. Primary [fields.id] key.\nUsed as [lookup].id setting for this [struct] type.', ), readonly: zod.boolean().optional(), repo: zod .string() .optional() .describe( 'Repository (dataset) name (plural form), e.g.: `countries`.', ), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod .string() .optional() .describe('Required. Unique Identifier.'), name: zod .string() .optional() .describe('Readonly. Display name.'), type: zod .string() .optional() .describe('Optional. Reference type.'), }) .optional(), }) .describe('Type of the Structure.\n\nint64 dc = 0;'), ) .optional() .describe('List of `Struct` types.'), next: zod.boolean().optional(), page: zod.number().optional().describe('Page number of results.'), }) .describe('Dataset of structured types.'); /** * @summary Structured data type details. */ export const LocateParams = zod.object({ path: zod.string().describe('`types.path`'), }); export const locateResponseFieldsItemKindDefault = `none`; export const LocateResponse = zod .object({ about: zod.string().optional().describe('Optional. Short description.'), administered: zod.boolean().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional().describe('Required. Unique Identifier.'), name: zod.string().optional().describe('Readonly. Display name.'), type: zod.string().optional().describe('Optional. Reference type.'), }) .optional(), display: zod .string() .optional() .describe( 'Required. Display [fields.id] key.\nUsed as [lookup].name setting for this [struct] type.', ), extendable: zod .boolean() .optional() .describe('// Extension fields type.\n Extension extension = 23;'), fields: zod .array( zod .object({ always: zod .unknown() .optional() .describe( 'Always signifies that the field value will be computed on any write (INSERT OR UPDATE) operations.\nThe field cannot be written to, and when read the result of the last generated expression will be returned.\n\nThe generation expression can refer to other columns in the table, but not other generated columns. Any functions and operators used must be immutable. References to other tables are not allowed.', ), binary: zod .object({ maxBytes: zod.number().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), bool: zod.looseObject({}).optional(), datetime: zod .object({ epoch: zod .number() .optional() .describe( 'Epoch timestamp.\nIf zero - UNIX epoch (1970-01-01 00:00:00) will be used.', ), format: zod.string().optional(), zone: zod .string() .optional() .describe('Timezone associated.\nDefault: `UTC`.'), }) .optional() .describe( 'Datetime type settings.\n\nenum Part {\n full = 0; // date & time\n date = 1; // date only ; YYYY-MM-DD\n time = 2; // time only ; HH:mm:ss[.pres]\n }\n Part part = 1; // part of: [ date &| time ]\n enum Stamp {\n s = 0; // seconds\n ms = 1; // [milli]seconds ; E+3\n mc = 2; // [micro]seconds ; E+6\n ns = 3; // [nano]seconds ; E+9\n m = -1; // minutes\n h = -2; // hours\n }\n Stamp time = 2; // time precision\n string zone = 3; // ??? [ Europe/Kyiv | +03:00 ]', ), default: zod .unknown() .optional() .describe( 'The `default` expression will be used in `INSERT` operation\nthat does not specify a value for the field.\n\nIf there is no default for a field, then the default is null.', ), disabled: zod.boolean().optional(), duration: zod .object({ format: zod.string().optional(), max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), float: zod .object({ frac: zod.number().optional(), max: zod.number().optional(), min: zod.number().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), float32: zod .object({ frac: zod.number().optional(), max: zod.number().optional(), min: zod.number().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), float64: zod .object({ frac: zod.number().optional(), max: zod.number().optional(), min: zod.number().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), hidden: zod.boolean().optional(), hint: zod .string() .optional() .describe('Short description. Default: {name}.'), id: zod.string().optional().describe('Field [code] name.\n\ncode'), int: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), int32: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), int64: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), kind: zod .enum([ 'none', 'list', 'bool', 'int', 'int32', 'int64', 'uint', 'uint32', 'uint64', 'float', 'float32', 'float64', 'binary', 'lookup', 'string', 'richtext', 'datetime', 'duration', ]) .default(locateResponseFieldsItemKindDefault) .describe('Required. The field type.'), lookup: zod .object({ display: zod .string() .optional() .describe( '[Readonly]. Display dataset field.\n(lookup).{`name`} value relation.', ), name: zod .string() .optional() .describe('[Readonly]. Dataset title.'), path: zod .string() .optional() .describe( '[Required]. Reference dataset relative path\ne.g.: "contacts", "dictionaries/cities".\n(lookup).{`type`} value relation.', ), primary: zod .string() .optional() .describe( '[Readonly]. Primary dataset field.\n(lookup).{`id`} value relation.', ), query: zod.record(zod.string(), zod.string()).optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional() .describe( 'Lookup ( REFERENCE ) type descriptor.\nSimplified [webitel.custom.Struct] options.', ), name: zod .string() .optional() .describe('Title of the field. Lang specific.\n\ntitle'), readonly: zod .boolean() .optional() .describe( 'Optional. Disable any write (INSERT OR UPDATE) operations.\nREADONLY signifies that the field value will be always computed on any write (INSERT OR UPDATE) operations.\nIf selected, the `default` value MUST be specified.\n\nFIXME: Is base field ? [ id, created_, updated_ ]', ), required: zod.boolean().optional(), richtext: zod .object({ maxBytes: zod.number().optional(), maxChars: zod.number().optional(), multiline: zod.boolean().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), string: zod .object({ maxBytes: zod.number().optional(), maxChars: zod.number().optional(), multiline: zod.boolean().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), uint: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), uint32: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), uint64: zod .object({ max: zod.string().optional(), min: zod.string().optional(), violation: zod.record(zod.string(), zod.string()).optional(), }) .optional(), }) .describe('Field of the struct.'), ) .optional() .describe('Fields of the struct type.'), id: zod .string() .optional() .describe( 'Deprecated. Use `repo` instead. The [type] name (singular form), e.g.: `country`.', ), indexes: zod .record( zod.string(), zod .object({ fields: zod .array(zod.string()) .optional() .describe( 'A set of [struct.fields.id] to INDEX within [type] dataset.', ), include: zod .array(zod.string()) .optional() .describe( 'A set of [struct.fields.id] to INCLUDE beside the [fields] index.', ), unique: zod .boolean() .optional() .describe( 'Indicates whether set of [fields] MUST be UNIQUE within [type].', ), }) .describe('INDEX [struct.fields].'), ) .optional() .describe('INDEX fields.\n\nExtension extension = 15;'), name: zod .string() .optional() .describe('A User-friendly [id] name ; lang: specific.'), objclass: zod .string() .optional() .describe('Readonly. RbAC objclass identity.'), path: zod .string() .optional() .describe( 'Readonly. Relative path to access the dataset APIs, e.g.: `dictionaries/countries`.', ), primary: zod .string() .optional() .describe( 'Required. Primary [fields.id] key.\nUsed as [lookup].id setting for this [struct] type.', ), readonly: zod.boolean().optional(), repo: zod .string() .optional() .describe('Repository (dataset) name (plural form), e.g.: `countries`.'), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional().describe('Required. Unique Identifier.'), name: zod.string().optional().describe('Readonly. Display name.'), type: zod.string().optional().describe('Optional. Reference type.'), }) .optional(), }) .describe('Type of the Structure.\n\nint64 dc = 0;');