proto.io 0.0.197 → 0.0.199

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.
Files changed (50) hide show
  1. package/dist/adapters/file/database.d.ts +2 -2
  2. package/dist/adapters/file/database.js +2 -2
  3. package/dist/adapters/file/database.mjs +2 -2
  4. package/dist/adapters/file/filesystem.d.ts +2 -2
  5. package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
  6. package/dist/adapters/storage/progres.d.ts +96 -70
  7. package/dist/adapters/storage/progres.js +3 -3
  8. package/dist/adapters/storage/progres.js.map +1 -1
  9. package/dist/adapters/storage/progres.mjs +3 -3
  10. package/dist/adapters/storage/progres.mjs.map +1 -1
  11. package/dist/client.d.ts +3 -3
  12. package/dist/client.js +2 -2
  13. package/dist/client.mjs +3 -3
  14. package/dist/index.d.ts +5 -5
  15. package/dist/index.js +10 -10
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +11 -11
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/internals/{index-ClOV7WJp.d.ts → index-B1Zb_MrO.d.ts} +6 -6
  20. package/dist/internals/index-B1Zb_MrO.d.ts.map +1 -0
  21. package/dist/internals/{index-C9eiMOSP.mjs → index-B5NdBL7S.mjs} +2 -2
  22. package/dist/internals/index-B5NdBL7S.mjs.map +1 -0
  23. package/dist/internals/{index-j8PFq8Ci.mjs → index-BbrIkcQ7.mjs} +3 -1
  24. package/dist/internals/index-BbrIkcQ7.mjs.map +1 -0
  25. package/dist/internals/{index-Dej3GgVf.js → index-BtqngPTb.js} +3 -1
  26. package/dist/internals/index-BtqngPTb.js.map +1 -0
  27. package/dist/internals/{index-CqunpmT-.d.ts → index-C8EuFNYa.d.ts} +41 -40
  28. package/dist/internals/index-C8EuFNYa.d.ts.map +1 -0
  29. package/dist/internals/{index-DbXVThGW.js → index-CGO-xORH.js} +2 -2
  30. package/dist/internals/index-CGO-xORH.js.map +1 -0
  31. package/dist/internals/{index-ikHjpb6F.mjs → index-DAtoqvEN.mjs} +2 -2
  32. package/dist/internals/{index-ikHjpb6F.mjs.map → index-DAtoqvEN.mjs.map} +1 -1
  33. package/dist/internals/{index-COOeeeBE.js → index-DIFr-lHN.js} +2 -2
  34. package/dist/internals/{index-COOeeeBE.js.map → index-DIFr-lHN.js.map} +1 -1
  35. package/dist/internals/{index-DjHHDI1M.d.ts → index-DvpJENaG.d.ts} +2 -2
  36. package/dist/internals/index-DvpJENaG.d.ts.map +1 -0
  37. package/dist/internals/{random-CObICDCy.js → random-CM_i1mxR.js} +5 -4
  38. package/dist/internals/random-CM_i1mxR.js.map +1 -0
  39. package/dist/internals/{random-uHM4KXoV.mjs → random-l5S7hC1z.mjs} +5 -4
  40. package/dist/internals/random-l5S7hC1z.mjs.map +1 -0
  41. package/package.json +1 -1
  42. package/dist/internals/index-C9eiMOSP.mjs.map +0 -1
  43. package/dist/internals/index-ClOV7WJp.d.ts.map +0 -1
  44. package/dist/internals/index-CqunpmT-.d.ts.map +0 -1
  45. package/dist/internals/index-DbXVThGW.js.map +0 -1
  46. package/dist/internals/index-Dej3GgVf.js.map +0 -1
  47. package/dist/internals/index-DjHHDI1M.d.ts.map +0 -1
  48. package/dist/internals/index-j8PFq8Ci.mjs.map +0 -1
  49. package/dist/internals/random-CObICDCy.js.map +0 -1
  50. package/dist/internals/random-uHM4KXoV.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BtqngPTb.js","sources":["../../../src/internals/schema.ts","../../../src/internals/object/index.ts"],"sourcesContent":["//\n// schema.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { TValueWithoutObject } from './types';\n\nexport namespace TSchema {\n /**\n * Access Control List represented as an array of strings.\n */\n export type ACL = string[];\n\n /**\n * Access Control Lists for read and update operations.\n */\n export type ACLs = { \n /**\n * ACL for read operation.\n */\n read: TSchema.ACL; \n\n /**\n * ACL for update operation.\n */\n update: TSchema.ACL; \n };\n\n /**\n * Primitive data types.\n */\n export type Primitive = 'boolean' | 'number' | 'decimal' | 'string' | 'string[]' | 'date' | 'object' | 'array';\n\n /**\n * Primitive type with an optional default value.\n */\n export type PrimitiveType = Primitive | { \n /**\n * The type of the primitive.\n */\n type: Primitive; \n\n /**\n * Optional default value.\n */\n default?: TValueWithoutObject; \n };\n\n /**\n * Vector type with a specified dimension and an optional default value.\n */\n export type VectorType = { \n /**\n * The type of the vector.\n */\n type: 'vector'; \n\n /**\n * The dimension of the vector.\n */\n dimension: number; \n\n /**\n * Optional default value.\n */\n default?: number[]; \n };\n\n /**\n * Shape type with a specified shape.\n */\n export type ShapeType = { \n /**\n * The type of the shape.\n */\n type: 'shape'; \n\n /**\n * The shape definition.\n */\n shape: Record<string, DataType>; \n };\n\n /**\n * Pointer type with a target.\n */\n export type PointerType = { \n /**\n * The type of the pointer.\n */\n type: 'pointer'; \n\n /**\n * The target class of the pointer.\n */\n target: string; \n };\n\n /**\n * Relation type with a target and an optional foreign field.\n */\n export type RelationType = { \n /**\n * The type of the relation.\n */\n type: 'relation'; \n\n /**\n * The target class of the relation.\n */\n target: string; \n\n /**\n * Optional foreign field.\n */\n foreignField?: string; \n };\n\n /**\n * Data type which can be a primitive, vector, shape, pointer, or relation type.\n */\n export type DataType = PrimitiveType | VectorType | ShapeType | PointerType | RelationType;\n\n /**\n * Class Level Permissions.\n */\n export type CLPs = {\n /**\n * ACL for get operation.\n */\n get?: TSchema.ACL;\n\n /**\n * ACL for find operation.\n */\n find?: TSchema.ACL;\n\n /**\n * ACL for count operation.\n */\n count?: TSchema.ACL;\n\n /**\n * ACL for create operation.\n */\n create?: TSchema.ACL;\n\n /**\n * ACL for update operation.\n */\n update?: TSchema.ACL;\n\n /**\n * ACL for delete operation.\n */\n delete?: TSchema.ACL;\n };\n\n /**\n * Field Level Permissions.\n */\n export type FLPs = {\n /**\n * ACL for read operation.\n */\n read?: TSchema.ACL;\n\n /**\n * ACL for create operation.\n */\n create?: TSchema.ACL;\n\n /**\n * ACL for update operation.\n */\n update?: TSchema.ACL;\n };\n\n /**\n * Indexes for the schema.\n */\n export type Indexes = {\n /**\n * Type of the index, default is 'basic'.\n */\n type?: 'basic';\n\n /**\n * Keys for the index.\n */\n keys: Record<string, 1 | -1>;\n\n /**\n * Whether the index is unique.\n */\n unique?: boolean;\n } | {\n /**\n * Type of the index, must be 'vector'.\n */\n type: 'vector';\n\n /**\n * Keys for the vector index.\n */\n keys: string | string[];\n\n /**\n * Method for the vector index.\n */\n method?: 'hnsw' | 'ivfflat';\n };\n}\n\nexport const _isTypeof = (x: TSchema.DataType, types: string | string[]) => {\n if (_.isString(x)) return _.includes(_.castArray(types), x);\n return _.includes(_.castArray(types), x.type);\n};\nexport const isPrimitive = (x: TSchema.DataType): x is TSchema.PrimitiveType => _.isString(x) || (x.type !== 'pointer' && x.type !== 'relation' && x.type !== 'shape');\nexport const isVector = (x: TSchema.DataType): x is TSchema.VectorType => !_.isString(x) && x.type === 'vector';\nexport const dimensionOf = (x: TSchema.DataType) => isVector(x) ? x.dimension : 0;\nexport const isShape = (x: TSchema.DataType): x is TSchema.ShapeType => !_.isString(x) && x.type === 'shape';\nexport const isPointer = (x: TSchema.DataType): x is TSchema.PointerType => !_.isString(x) && x.type === 'pointer';\nexport const isRelation = (x: TSchema.DataType): x is TSchema.RelationType => !_.isString(x) && x.type === 'relation';\nexport const _typeof = (x: TSchema.DataType) => _.isString(x) ? x : x.type !== 'pointer' && x.type !== 'relation' ? x.type : x.target;\n\nexport const shapePaths = (x: TSchema.ShapeType): {\n path: string,\n type: Exclude<TSchema.DataType, TSchema.ShapeType>,\n}[] => _.flatMap(x.shape, (v, k) => (\n isShape(v) ? _.map(shapePaths(v), x => ({ path: `${k}.${x.path}`, type: x.type })) : { path: k, type: v }\n));\n\nexport interface TSchema {\n /**\n * Fields of the schema, where each field is a data type.\n */\n fields: Record<string, TSchema.DataType>;\n\n /**\n * Class level permissions for the schema.\n */\n classLevelPermissions?: TSchema.CLPs;\n\n /**\n * Additional object permissions for the schema.\n */\n additionalObjectPermissions?: TSchema.ACLs;\n\n /**\n * Field level permissions for the schema, where each field can have its own permissions.\n */\n fieldLevelPermissions?: Record<string, TSchema.FLPs>;\n\n /**\n * Secure fields in the schema.\n */\n secureFields?: string[];\n\n /**\n * Indexes for the schema.\n */\n indexes?: TSchema.Indexes[];\n}\n\nexport const defaultObjectKeyTypes: Record<string, TSchema.DataType> = {\n _id: 'string',\n __v: 'number',\n __i: 'number',\n _created_at: 'date',\n _updated_at: 'date',\n _expired_at: 'date',\n _rperm: 'string[]',\n _wperm: 'string[]',\n};\n\nexport const defaultObjectReadonlyKeys = ['_id', '__v', '__i', '_created_at', '_updated_at'];\nexport const defaultObjectKeys = [...defaultObjectReadonlyKeys, '_expired_at', '_rperm', '_wperm'];\n","//\n// object.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { PVK } from '../private';\nimport { ExtraOptions } from '../options';\nimport { Decimal } from 'decimal.js';\nimport { TPrimitiveValue, TValue, TValueWithoutObject, TValueWithUndefined } from '../types';\nimport { TSchema, defaultObjectKeys, defaultObjectReadonlyKeys } from '../schema';\nimport { PathName } from '../query/types';\nimport { TUpdateOp, TUpdateOpKeys } from './types';\nimport { TQuery } from '../query';\n\nexport const isPrimitiveValue = (x: any): x is TPrimitiveValue => {\n if (_.isNil(x) || _.isNumber(x) || _.isBoolean(x) || _.isString(x) || _.isDate(x)) return true;\n if (x instanceof Decimal) return true;\n return false;\n}\n\nexport const isValue = (x: any): x is TValue => {\n if (isPrimitiveValue(x) || x instanceof TObject) return true;\n if (_.isArray(x)) return _.every(x, v => isValue(v));\n if (_.isPlainObject(x)) return _.every(x, v => isValue(v));\n return false;\n}\n\nexport const cloneValue = <T extends TValue>(x: T): T => {\n if (isPrimitiveValue(x) || x instanceof TObject) return x;\n if (_.isArray(x)) return x.map(v => cloneValue(v)) as T;\n return _.mapValues(x, v => cloneValue(v)) as T;\n}\n\nexport const _decodeValue = (value: TValueWithoutObject): TValueWithoutObject => {\n if (isPrimitiveValue(value)) return value;\n if (_.isArray(value)) return _.map(value, x => _decodeValue(x));\n if (_.isString(value.$date)) return new Date(value.$date);\n if (_.isString(value.$decimal)) return new Decimal(value.$decimal);\n return _.transform(value, (r, v, k) => {\n r[k.startsWith('$') ? k.substring(1) : k] = _decodeValue(v);\n }, {} as any);\n};\n\nexport const _encodeValue = (value: TValueWithUndefined): TValueWithoutObject => {\n if (_.isNil(value)) return value ?? null;\n if (value instanceof TObject) throw Error('Invalid data type');\n if (_.isDate(value)) return { $date: value.toISOString() };\n if (value instanceof Decimal) return { $decimal: value.toString() };\n if (isPrimitiveValue(value)) return value;\n if (_.isArray(value)) return _.map(value, x => _encodeValue(x));\n return _.transform(value, (r, v, k) => {\n r[k.startsWith('$') ? `$${k}` : k] = _encodeValue(v);\n }, {} as any);\n};\n\nexport const decodeUpdateOp = (update: TUpdateOp) => {\n const pairs = _.toPairs(update);\n if (pairs.length !== 1) throw Error('Invalid update operation');\n return pairs[0] as [typeof TUpdateOpKeys[number], TValue];\n}\n\n/**\n * Interface representing a object.\n */\nexport interface TObject {\n /**\n * Clones the object.\n * @returns A clone of the object.\n */\n clone(): TObject;\n\n /**\n * Gets a relation query for the specified key.\n * @param key - The key of the relation.\n * @returns A query object for the relation.\n */\n relation<T extends string>(key: PathName<T>): TQuery<string, any, boolean>;\n\n /**\n * Fetches the object with the specified keys included.\n * @param keys - The keys to include.\n * @param options - Additional options for the fetch operation.\n * @returns A promise that resolves to the fetched object.\n */\n fetchWithInclude(keys: string[], options?: ExtraOptions<boolean>): PromiseLike<this>;\n\n /**\n * Saves the object.\n * @param options - Additional options for the save operation.\n * @returns A promise that resolves to the saved object.\n */\n save(options?: ExtraOptions<boolean> & { cascadeSave?: boolean }): PromiseLike<this>;\n\n /**\n * Destroys the object.\n * @param options - Additional options for the destroy operation.\n * @returns A promise that resolves to the destroyed object.\n */\n destroy(options?: ExtraOptions<boolean>): PromiseLike<this>;\n}\n\n/**\n * Class representing a object.\n */\nexport class TObject {\n\n static defaultReadonlyKeys = defaultObjectReadonlyKeys;\n static defaultKeys = defaultObjectKeys;\n\n /** @internal */\n [PVK]: {\n className: string;\n attributes: Record<string, TValue>;\n mutated: Record<string, TUpdateOp>;\n extra: Record<string, any>;\n };\n\n constructor(\n className: string,\n attributes?: Record<string, TValue> | ((self: TObject) => Record<string, TValue>),\n ) {\n const _attributes = _.isFunction(attributes) ? attributes(this) : attributes ?? {};\n this[PVK] = {\n className,\n attributes: cloneValue(_attributes),\n mutated: {},\n extra: {},\n }\n }\n\n /**\n * Gets the class name of the object.\n */\n get className(): string {\n return this[PVK].className;\n }\n\n /**\n * Gets the attributes of the object.\n */\n get attributes(): Record<string, TValue> {\n return cloneValue(this[PVK].attributes);\n }\n\n /**\n * Gets the object ID.\n */\n get objectId(): string | undefined {\n return this[PVK].attributes._id as string;\n }\n\n /**\n * Gets the creation date of the object.\n */\n get createdAt(): Date | undefined {\n return this[PVK].attributes._created_at as Date;\n }\n\n /**\n * Gets the last updated date of the object.\n */\n get updatedAt(): Date | undefined {\n return this[PVK].attributes._updated_at as Date;\n }\n\n /**\n * Gets the version number of the object.\n */\n get __v(): number {\n return this[PVK].attributes.__v as number;\n }\n\n /**\n * Gets the sequence number of the object.\n */\n get __i(): number {\n return this[PVK].attributes.__i as number;\n }\n\n /**\n * Gets the expiration date of the object.\n */\n get expiredAt(): Date | undefined {\n return this.get('_expired_at');\n }\n\n /**\n * Sets the expiration date of the object.\n * @param value - The expiration date.\n */\n set expiredAt(value: Date | undefined) {\n this.set('_expired_at', value);\n }\n\n /**\n * Gets the access control list (ACL) of the object.\n * @returns The ACL of the object.\n */\n acl(): TSchema.ACLs {\n return {\n read: this.get('_rperm') ?? ['*'],\n update: this.get('_wperm') ?? ['*'],\n };\n }\n\n /**\n * Sets the access control list (ACL) of the object.\n * @param value - The ACL to set.\n */\n setAcl(value: Partial<TSchema.ACLs>) {\n this.set('_rperm', value.read ?? ['*']);\n this.set('_wperm', value.update ?? ['*']);\n }\n\n /**\n * Sets the read access control list (ACL) of the object.\n * @param value - The read ACL to set.\n */\n setReadAcl(value: TSchema.ACL) {\n this.set('_rperm', value);\n }\n\n /**\n * Sets the write access control list (ACL) of the object.\n * @param value - The write ACL to set.\n */\n setWriteAcl(value: TSchema.ACL) {\n this.set('_wperm', value);\n }\n\n /**\n * Gets the keys of the object's attributes and mutated attributes.\n * @returns An array of keys.\n */\n keys(): string[] {\n return _.uniq([..._.keys(this[PVK].attributes), ..._.compact(_.map(_.keys(this[PVK].mutated), x => _.first(_.toPath(x))))]);\n }\n\n /**\n * Gets an iterator for the entries of the object's attributes.\n * @returns An iterator for the entries.\n */\n *entries() {\n for (const key of this.keys()) {\n yield [key, this.get(key)] as [string, any];\n }\n }\n\n /** @internal */\n *_set_entries() {\n for (const [key, op] of _.entries(this[PVK].mutated)) {\n for (const [_op, value] of _.entries(op)) {\n if (_op === '$set') yield [key, value] as [string, any];\n }\n }\n }\n\n /**\n * Converts the object to a plain object.\n * @param replacer - An optional function to replace values during the conversion.\n * @returns The plain object representation of the object.\n */\n toObject(replacer?: (value: TObject) => any): any {\n const toObject = (value: TValue): any => {\n if (isPrimitiveValue(value)) return value;\n if (value instanceof TObject) return replacer?.(value) ?? value.toObject(replacer);\n if (_.isArray(value)) return _.map(value, toObject);\n return _.mapValues(value, toObject);\n };\n return _.fromPairs(_.map(this.keys(), k => [k, toObject(this.get(k))]));\n }\n\n private _value(key: string): TValue {\n let value: TValue = this[PVK].attributes;\n for (const k of _.toPath(key)) {\n if (isPrimitiveValue(value)) return null;\n if (value instanceof TObject) {\n value = value.get(k);\n } else {\n value = _.get(value, k);\n }\n }\n return cloneValue(value);\n }\n\n /**\n * Get the value of the attribute.\n * @param key - The key of the attribute.\n * @returns The value of the attribute.\n */\n get<T extends string>(key: PathName<T>): any {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (_.isNil(this[PVK].mutated[key])) return this._value(key);\n const [op, value] = decodeUpdateOp(this[PVK].mutated[key]);\n return op === '$set' ? value : this._value(key);\n }\n\n /**\n * Set the value of the attribute.\n * @param key - The key of the attribute.\n * @param value - The value to set.\n */\n set<T extends string>(key: PathName<T>, value: TValueWithUndefined) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $set: value ?? null };\n }\n\n /**\n * Is the object dirty.\n */\n get isDirty(): boolean {\n return !_.isEmpty(this[PVK].mutated);\n }\n\n /**\n * Increment the value of the attribute.\n * @param key - The key to increment.\n * @param value - The value to increment by.\n */\n increment<T extends string>(key: PathName<T>, value: number | Decimal) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $inc: value };\n }\n\n /**\n * Decrement the value of the attribute.\n * @param key - The key to decrement.\n * @param value - The value to decrement by.\n */\n decrement<T extends string>(key: PathName<T>, value: number | Decimal) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $dec: value };\n }\n\n /**\n * Multiplies the value of the specified attribute.\n * @param key - The key of the attribute to multiply.\n * @param value - The multiplier value.\n */\n multiply<T extends string>(key: PathName<T>, value: number | Decimal) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $mul: value };\n }\n\n /**\n * Divides the value of the specified attribute.\n * @param key - The key of the attribute to divide.\n * @param value - The divisor value.\n */\n divide<T extends string>(key: PathName<T>, value: number | Decimal) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $div: value };\n }\n\n /**\n * Sets the value of the specified attribute to the maximum of the current value and the provided value.\n * @param key - The key of the attribute to compare.\n * @param value - The value to compare against.\n */\n max<T extends string>(key: PathName<T>, value: TValue) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $max: value };\n }\n\n /**\n * Sets the value of the specified attribute to the minimum of the current value and the provided value.\n * @param key - The key of the attribute to compare.\n * @param value - The value to compare against.\n */\n min<T extends string>(key: PathName<T>, value: TValue) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $min: value };\n }\n\n /**\n * Adds the specified values to the set of the specified attribute.\n * @param key - The key of the attribute.\n * @param values - The values to add to the set.\n */\n addToSet<T extends string>(key: PathName<T>, values: TValue[]) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $addToSet: values };\n }\n\n /**\n * Adds the values to the array of the attribute.\n * @param key - The key of the attribute.\n * @param values - The values to add.\n */\n push<T extends string>(key: PathName<T>, values: TValue[]) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $push: values };\n }\n\n /**\n * Removes the values from the array of the attribute.\n * @param key - The key of the attribute.\n * @param values - The values to remove.\n */\n removeAll<T extends string>(key: PathName<T>, values: TValue[]) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $removeAll: values };\n }\n\n /**\n * Removes the first elements from the array of the attribute.\n * @param key - The key of the attribute.\n * @param count - The number of elements to remove. Defaults to 1.\n */\n popFirst<T extends string>(key: PathName<T>, count = 1) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $popFirst: count };\n }\n\n /**\n * Removes the last elements from the array of the attribute.\n * @param key - The key of the attribute.\n * @param count - The number of elements to remove. Defaults to 1.\n */\n popLast<T extends string>(key: PathName<T>, count = 1) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $popLast: count };\n }\n\n /**\n * Fetches the object data.\n * @param options - Additional options for the fetch operation.\n * @returns A promise that resolves to the fetched object.\n */\n async fetch(options?: ExtraOptions<boolean>) {\n return this.fetchWithInclude(_.keys(this[PVK].attributes), options);\n }\n\n /**\n * Fetches the object data if needed.\n * @param keys - The keys of the attributes to fetch.\n * @param options - Additional options for the fetch operation.\n * @returns A promise that resolves to the fetched object.\n */\n async fetchIfNeeded(keys: string[], options?: ExtraOptions<boolean>) {\n const current = _.keys(this[PVK].attributes);\n if (_.every(keys, k => _.includes(current, k))) return this;\n return this.fetchWithInclude(_.uniq([...current, ...keys]), options);\n }\n\n}\n"],"names":["Decimal","PVK"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MAoNa,SAAS,GAAG,CAAC,CAAmB,EAAE,KAAwB,KAAI;AACzE,IAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3D,IAAA,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;AAC/C;AACO,MAAM,WAAW,GAAG,CAAC,CAAmB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IAAI,CAAC,IAAI,CAACA,YAAG,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;;AAGrE;;;;;AAKG;AACH,IAAA,MAAM,aAAa,CAAC,IAAc,EAAE,OAA+B,EAAA;AACjE,QAAA,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAACA,YAAG,CAAC,CAAC,UAAU,CAAC;AAC5C,QAAA,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,IAAI;AAC3D,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;"}
@@ -198,7 +198,7 @@ type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
198
198
  type TMethods<K, E> = IfAny<E, {}, _TMethods<K, E>>;
199
199
  type TObjectType<K, E> = _TObjectType<K> & TMethods<K, E>;
200
200
  declare const TUpdateOpKeys: readonly ["$set", "$inc", "$dec", "$mul", "$div", "$max", "$min", "$addToSet", "$push", "$removeAll", "$popFirst", "$popLast"];
201
- type TUpdateOp = ExactOneProp<Record<(typeof TUpdateOpKeys)[number], TValue>>;
201
+ type TUpdateOp = ExactOneProp<Record<(typeof TUpdateOpKeys)[number], TValueWithUndefined>>;
202
202
 
203
203
  declare const TComparisonKeys: readonly ["$eq", "$gt", "$gte", "$lt", "$lte", "$ne"];
204
204
  declare const TValueListKeys: readonly ["$in", "$nin"];
@@ -324,42 +324,42 @@ declare class TQueryFilterBase {
324
324
  * @param value - The value to filter.
325
325
  * @returns The current instance for chaining.
326
326
  */
327
- equalTo<T extends string>(key: PathName<T>, value: TValue | undefined): this;
327
+ equalTo<T extends string>(key: PathName<T>, value: TValueWithUndefined): this;
328
328
  /**
329
329
  * Applies a not equal filter to the query.
330
330
  * @param key - The key to filter.
331
331
  * @param value - The value to filter.
332
332
  * @returns The current instance for chaining.
333
333
  */
334
- notEqualTo<T extends string>(key: PathName<T>, value: TValue | undefined): this;
334
+ notEqualTo<T extends string>(key: PathName<T>, value: TValueWithUndefined): this;
335
335
  /**
336
336
  * Applies a less than filter to the query.
337
337
  * @param key - The key to filter.
338
338
  * @param value - The value to filter.
339
339
  * @returns The current instance for chaining.
340
340
  */
341
- lessThan<T extends string>(key: PathName<T>, value: TValue | undefined): this;
341
+ lessThan<T extends string>(key: PathName<T>, value: TValueWithUndefined): this;
342
342
  /**
343
343
  * Applies a greater than filter to the query.
344
344
  * @param key - The key to filter.
345
345
  * @param value - The value to filter.
346
346
  * @returns The current instance for chaining.
347
347
  */
348
- greaterThan<T extends string>(key: PathName<T>, value: TValue | undefined): this;
348
+ greaterThan<T extends string>(key: PathName<T>, value: TValueWithUndefined): this;
349
349
  /**
350
350
  * Applies a less than or equal to filter to the query.
351
351
  * @param key - The key to filter.
352
352
  * @param value - The value to filter.
353
353
  * @returns The current instance for chaining.
354
354
  */
355
- lessThanOrEqualTo<T extends string>(key: PathName<T>, value: TValue | undefined): this;
355
+ lessThanOrEqualTo<T extends string>(key: PathName<T>, value: TValueWithUndefined): this;
356
356
  /**
357
357
  * Applies a greater than or equal to filter to the query.
358
358
  * @param key - The key to filter.
359
359
  * @param value - The value to filter.
360
360
  * @returns The current instance for chaining.
361
361
  */
362
- greaterThanOrEqualTo<T extends string>(key: PathName<T>, value: TValue | undefined): this;
362
+ greaterThanOrEqualTo<T extends string>(key: PathName<T>, value: TValueWithUndefined): this;
363
363
  /**
364
364
  * Applies a pattern filter to the query.
365
365
  * @param key - The key to filter.
@@ -406,42 +406,42 @@ declare class TQueryFilterBase {
406
406
  * @param value - The array of values to check for.
407
407
  * @returns The current instance for chaining.
408
408
  */
409
- containedIn<T extends string>(key: PathName<T>, value: TValue[]): this;
409
+ containedIn<T extends string>(key: PathName<T>, value: TValueWithUndefined[]): this;
410
410
  /**
411
411
  * Filters the query to exclude documents where the specified key contains any of the specified values.
412
412
  * @param key - The key to check for values.
413
413
  * @param value - The array of values to exclude.
414
414
  * @returns The current instance for chaining.
415
415
  */
416
- notContainedIn<T extends string>(key: PathName<T>, value: TValue[]): this;
416
+ notContainedIn<T extends string>(key: PathName<T>, value: TValueWithUndefined[]): this;
417
417
  /**
418
418
  * Filters the query to include only documents where the specified key is a subset of the specified values.
419
419
  * @param key - The key to check for subset.
420
420
  * @param value - The array of values to check against.
421
421
  * @returns The current instance for chaining.
422
422
  */
423
- isSubset<T extends string>(key: PathName<T>, value: TValue[]): this;
423
+ isSubset<T extends string>(key: PathName<T>, value: TValueWithUndefined[]): this;
424
424
  /**
425
425
  * Filters the query to include only documents where the specified key is a superset of the specified values.
426
426
  * @param key - The key to check for superset.
427
427
  * @param value - The array of values to check against.
428
428
  * @returns The current instance for chaining.
429
429
  */
430
- isSuperset<T extends string>(key: PathName<T>, value: TValue[]): this;
430
+ isSuperset<T extends string>(key: PathName<T>, value: TValueWithUndefined[]): this;
431
431
  /**
432
432
  * Filters the query to include only documents where the specified key is disjoint from the specified values.
433
433
  * @param key - The key to check for disjoint.
434
434
  * @param value - The array of values to check against.
435
435
  * @returns The current instance for chaining.
436
436
  */
437
- isDisjoint<T extends string>(key: PathName<T>, value: TValue[]): this;
437
+ isDisjoint<T extends string>(key: PathName<T>, value: TValueWithUndefined[]): this;
438
438
  /**
439
439
  * Filters the query to include only documents where the specified key intersects with the specified values.
440
440
  * @param key - The key to check for intersection.
441
441
  * @param value - The array of values to check against.
442
442
  * @returns The current instance for chaining.
443
443
  */
444
- isIntersect<T extends string>(key: PathName<T>, value: TValue[]): this;
444
+ isIntersect<T extends string>(key: PathName<T>, value: TValueWithUndefined[]): this;
445
445
  /**
446
446
  * Filters the query to include only documents where every element of the specified key matches the provided callback query.
447
447
  * @param key - The key to check for every element.
@@ -575,14 +575,14 @@ declare abstract class TQuery<T extends string, Ext, M extends boolean> extends
575
575
  * @param options - Extra options for the query.
576
576
  * @returns A promise that resolves to the inserted record.
577
577
  */
578
- abstract insert(attrs: Record<string, TValue>, options?: ExtraOptions<M>): PromiseLike<TObjectType<T, Ext>>;
578
+ abstract insert(attrs: Record<string, TValueWithUndefined>, options?: ExtraOptions<M>): PromiseLike<TObjectType<T, Ext>>;
579
579
  /**
580
580
  * Inserts multiple new records.
581
581
  * @param values - The attributes of the new records.
582
582
  * @param options - Extra options for the query.
583
583
  * @returns A promise that resolves to the number of inserted records.
584
584
  */
585
- abstract insertMany(values: Record<string, TValue>[], options?: ExtraOptions<M>): PromiseLike<number>;
585
+ abstract insertMany(values: Record<string, TValueWithUndefined>[], options?: ExtraOptions<M>): PromiseLike<number>;
586
586
  /**
587
587
  * Updates a single record.
588
588
  * @param update - The update operations.
@@ -604,7 +604,7 @@ declare abstract class TQuery<T extends string, Ext, M extends boolean> extends
604
604
  * @param options - Extra options for the query.
605
605
  * @returns A promise that resolves to the upserted record.
606
606
  */
607
- abstract upsertOne(update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValue>, options?: ExtraOptions<M>): PromiseLike<TObjectType<T, Ext>>;
607
+ abstract upsertOne(update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>, options?: ExtraOptions<M>): PromiseLike<TObjectType<T, Ext>>;
608
608
  /**
609
609
  * Upserts multiple records.
610
610
  * @param update - The update operations.
@@ -612,7 +612,7 @@ declare abstract class TQuery<T extends string, Ext, M extends boolean> extends
612
612
  * @param options - Extra options for the query.
613
613
  * @returns A promise that resolves to the number of upserted records.
614
614
  */
615
- abstract upsertMany(update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValue>, options?: ExtraOptions<M>): PromiseLike<{
615
+ abstract upsertMany(update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>, options?: ExtraOptions<M>): PromiseLike<{
616
616
  updated: number;
617
617
  inserted: number;
618
618
  }>;
@@ -711,7 +711,7 @@ type ProtoFunction<E> = Callback<{
711
711
  * @returns An awaitable response.
712
712
  */
713
713
  type ProtoJobFunction<E> = Callback<{
714
- params: _TValue;
714
+ params: TValueWithoutObject;
715
715
  user?: TUser;
716
716
  job: TObject;
717
717
  }, void, E>;
@@ -793,7 +793,7 @@ type TransactionOptions = {
793
793
  /**
794
794
  * Represents event data with additional metadata.
795
795
  */
796
- type EventData = Record<string, _TValue> & {
796
+ type EventData = Record<string, TValueWithoutObject> & {
797
797
  /**
798
798
  * The unique identifier for the event.
799
799
  */
@@ -821,7 +821,7 @@ declare abstract class ProtoType<Ext> {
821
821
  */
822
822
  abstract config(options?: {
823
823
  master?: boolean;
824
- }): Promise<Record<string, _TValue>>;
824
+ }): Promise<Record<string, TValueWithoutObject>>;
825
825
  /**
826
826
  * Retrieves the ACL of configuration.
827
827
  * @param options - Settings for retrieving the ACL of configuration.
@@ -836,7 +836,7 @@ declare abstract class ProtoType<Ext> {
836
836
  * @param options - Settings for setting the configuration.
837
837
  * @returns A promise that resolves when the configuration is set.
838
838
  */
839
- abstract setConfig(values: Record<string, _TValue>, options: {
839
+ abstract setConfig(values: Record<string, TValueWithoutObject>, options: {
840
840
  master: true;
841
841
  acl?: string[];
842
842
  }): Promise<void>;
@@ -855,7 +855,7 @@ declare abstract class ProtoType<Ext> {
855
855
  * @param options - Additional options for scheduling the job.
856
856
  * @returns A promise that resolves when the job is scheduled.
857
857
  */
858
- abstract scheduleJob(name: string, params?: _TValue, options?: ExtraOptions<boolean>): Promise<TJob>;
858
+ abstract scheduleJob(name: string, params?: TValueWithoutObject, options?: ExtraOptions<boolean>): Promise<TJob>;
859
859
  /**
860
860
  * Creates a query.
861
861
  * @param className - The name of the class to query.
@@ -907,7 +907,7 @@ declare abstract class ProtoType<Ext> {
907
907
  * @param data - The data to notify.
908
908
  * @param options - Additional options for notifying the event.
909
909
  */
910
- abstract notify(data: Record<string, _TValue> & {
910
+ abstract notify(data: Record<string, TValueWithoutObject> & {
911
911
  _rperm?: string[];
912
912
  }, options?: ExtraOptions<boolean>): Promise<void>;
913
913
  /**
@@ -1195,7 +1195,7 @@ declare class TObject {
1195
1195
  * @param key - The key of the attribute.
1196
1196
  * @param value - The value to set.
1197
1197
  */
1198
- set<T extends string>(key: PathName<T>, value: TValue | undefined): void;
1198
+ set<T extends string>(key: PathName<T>, value: TValueWithUndefined): void;
1199
1199
  /**
1200
1200
  * Is the object dirty.
1201
1201
  */
@@ -1285,7 +1285,8 @@ type _TContainer<Primitive> = {
1285
1285
  [x: string]: _TContainer<Primitive>;
1286
1286
  } | _TContainer<Primitive>[] | Primitive;
1287
1287
  type TPrimitiveValue = boolean | number | Decimal$1 | string | Date | null;
1288
- type _TValue = _TContainer<TPrimitiveValue>;
1288
+ type TValueWithUndefined = _TContainer<TPrimitiveValue | TObject | undefined>;
1289
+ type TValueWithoutObject = _TContainer<TPrimitiveValue>;
1289
1290
  type TValue = _TContainer<TPrimitiveValue | TObject>;
1290
1291
  type Exact<T, Shape> = T extends Shape ? Exclude<keyof T, keyof Shape> extends never ? T : never : never;
1291
1292
  type ExactOneProp<T> = {
@@ -1327,7 +1328,7 @@ declare namespace TSchema {
1327
1328
  /**
1328
1329
  * Optional default value.
1329
1330
  */
1330
- default?: _TValue;
1331
+ default?: TValueWithoutObject;
1331
1332
  };
1332
1333
  /**
1333
1334
  * Vector type with a specified dimension and an optional default value.
@@ -1613,21 +1614,21 @@ interface TStorage {
1613
1614
  prepare(schema: Record<string, TSchema>): PromiseLike<void>;
1614
1615
  shutdown(): PromiseLike<void>;
1615
1616
  classes(): string[];
1616
- config(acl?: string[]): PromiseLike<Record<string, _TValue>>;
1617
+ config(acl?: string[]): PromiseLike<Record<string, TValueWithoutObject>>;
1617
1618
  configAcl(): PromiseLike<Record<string, string[]>>;
1618
- setConfig(values: Record<string, _TValue>, acl?: string[]): PromiseLike<void>;
1619
+ setConfig(values: Record<string, TValueWithoutObject>, acl?: string[]): PromiseLike<void>;
1619
1620
  explain(query: DecodedQuery<FindOptions & RelationOptions>): PromiseLike<any>;
1620
1621
  count(query: DecodedQuery<FindOptions & RelationOptions>): PromiseLike<number>;
1621
1622
  find(query: DecodedQuery<FindOptions & RelationOptions>): AsyncIterable<TObject>;
1622
1623
  random(query: DecodedQuery<FindOptions & RelationOptions>, opts?: TQueryRandomOptions): AsyncIterable<TObject>;
1623
1624
  refs(object: TObject, classNames: string[], roles?: string[]): AsyncIterable<TObject>;
1624
1625
  nonrefs(query: DecodedQuery<FindOptions>): AsyncIterable<TObject>;
1625
- insert(options: InsertOptions, attrs: Record<string, TValue>): PromiseLike<TObject | undefined>;
1626
- insertMany(options: InsertOptions, values: Record<string, TValue>[]): PromiseLike<number>;
1626
+ insert(options: InsertOptions, attrs: Record<string, TValueWithUndefined>): PromiseLike<TObject | undefined>;
1627
+ insertMany(options: InsertOptions, values: Record<string, TValueWithUndefined>[]): PromiseLike<number>;
1627
1628
  updateOne(query: DecodedQuery<FindOneOptions>, update: Record<string, TUpdateOp>): PromiseLike<TObject | undefined>;
1628
1629
  updateMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>): PromiseLike<number>;
1629
- upsertOne(query: DecodedQuery<FindOneOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValue>): PromiseLike<TObject | undefined>;
1630
- upsertMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValue>): PromiseLike<{
1630
+ upsertOne(query: DecodedQuery<FindOneOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>): PromiseLike<TObject | undefined>;
1631
+ upsertMany(query: DecodedQuery<FindOptions>, update: Record<string, TUpdateOp>, setOnInsert: Record<string, TValueWithUndefined>): PromiseLike<{
1631
1632
  updated: number;
1632
1633
  inserted: number;
1633
1634
  }>;
@@ -1668,14 +1669,14 @@ interface TPubSub {
1668
1669
  * @param callback - The callback function to handle the event data.
1669
1670
  * @returns A function to unsubscribe from the channel.
1670
1671
  */
1671
- subscribe(channel: string, callback: (payload: _TValue) => void): VoidFunction;
1672
+ subscribe(channel: string, callback: (payload: TValueWithoutObject) => void): VoidFunction;
1672
1673
  /**
1673
1674
  * Publishes an event to a channel.
1674
1675
  * @param channel - The name of the channel to publish to.
1675
1676
  * @param payload - The event data to publish.
1676
1677
  * @returns A promise that resolves when the event is published.
1677
1678
  */
1678
- publish(channel: string, payload: _TValue): Awaitable<void>;
1679
+ publish(channel: string, payload: TValueWithoutObject): Awaitable<void>;
1679
1680
  }
1680
1681
 
1681
1682
  type ProtoServiceOptions<Ext> = {
@@ -1838,17 +1839,17 @@ declare class ProtoService<Ext = any> extends ProtoType<Ext> {
1838
1839
  get fileStorage(): ProtoServiceOptions<Ext>['fileStorage'];
1839
1840
  config(options?: {
1840
1841
  master?: boolean;
1841
- }): Promise<Record<string, _TValue>>;
1842
+ }): Promise<Record<string, TValueWithoutObject>>;
1842
1843
  configAcl(options: {
1843
1844
  master: true;
1844
1845
  }): PromiseLike<Record<string, string[]>>;
1845
- setConfig(values: Record<string, _TValue>, options: {
1846
+ setConfig(values: Record<string, TValueWithoutObject>, options: {
1846
1847
  master: true;
1847
1848
  acl?: string[];
1848
1849
  }): Promise<void>;
1849
1850
  run(name: string, params?: TSerializable, options?: ExtraOptions<boolean>): Promise<void | TSerializable>;
1850
1851
  define(name: string, callback: ProtoFunction<Ext>, options?: Omit<ProtoFunctionOptions<Ext>, 'callback'>): void;
1851
- scheduleJob(name: string, params?: _TValue, options?: ExtraOptions<boolean>): Promise<TObjectType<"_Job", Ext>>;
1852
+ scheduleJob(name: string, params?: TValueWithoutObject, options?: ExtraOptions<boolean>): Promise<TObjectType<"_Job", Ext>>;
1852
1853
  defineJob(name: string, callback: ProtoJobFunction<Ext>, options?: Omit<ProtoJobFunctionOptions<Ext>, 'callback'>): void;
1853
1854
  lockTable(className: string | string[], update: boolean): Promise<void>;
1854
1855
  withTransaction<T>(callback: (connection: ProtoService<Ext>) => PromiseLike<T>, options?: TransactionOptions): PromiseLike<T>;
@@ -1859,7 +1860,7 @@ declare class ProtoService<Ext = any> extends ProtoType<Ext> {
1859
1860
  }): string;
1860
1861
  jwtSign(payload: any, options: jwt.SignOptions): string;
1861
1862
  jwtVarify(token: string, options?: jwt.VerifyOptions): jwt.JwtPayload | undefined;
1862
- notify(data: Record<string, _TValue> & {
1863
+ notify(data: Record<string, TValueWithoutObject> & {
1863
1864
  _rperm?: string[];
1864
1865
  }): Promise<void>;
1865
1866
  listen(callback: (data: EventData) => void): {
@@ -1869,5 +1870,5 @@ declare class ProtoService<Ext = any> extends ProtoType<Ext> {
1869
1870
  gc(classNames?: string | string[]): Promise<void>;
1870
1871
  }
1871
1872
 
1872
- export { type TQueryRandomOptions as A, type TPubSub as B, type TFileInfo as C, type DeserializeOptions as D, type ExtraOptions as E, type FindOptions as F, type InsertOptions as I, ProtoService as P, QuerySelector as Q, type RelationOptions as R, type SerializeOptions as S, TSchema as T, type _TValue as _, type ProtoServiceOptions as a, type ProtoServiceKeyOptions as b, type TFileStorage as c, type TSerializable as d, deserialize as e, type TExtensions as f, TQuery as g, TObject as h, TUser as i, TRole as j, TFile as k, TJob as l, ProtoType as m, type PathName as n, type TObjectType as o, type EventData as p, type DecodedQuery as q, type DecodedSortOption as r, serialize as s, type TValue as t, type FindOneOptions as u, type TUpdateOp as v, FieldSelectorExpression as w, QueryExpression as x, type TStorage as y, type TransactionOptions as z };
1873
- //# sourceMappingURL=index-CqunpmT-.d.ts.map
1873
+ export { type TStorage as A, type TransactionOptions as B, type TQueryRandomOptions as C, type DeserializeOptions as D, type ExtraOptions as E, FieldSelectorExpression as F, type TPubSub as G, type TFileInfo as H, type InsertOptions as I, ProtoService as P, QueryExpression as Q, type RelationOptions as R, type SerializeOptions as S, TSchema as T, type TValueWithoutObject as a, type ProtoServiceOptions as b, type ProtoServiceKeyOptions as c, type TFileStorage as d, type TSerializable as e, deserialize as f, type TExtensions as g, TQuery as h, TObject as i, TUser as j, TRole as k, TFile as l, TJob as m, ProtoType as n, type PathName as o, type TObjectType as p, type EventData as q, type TValueWithUndefined as r, serialize as s, type TValue as t, type TUpdateOp as u, QuerySelector as v, type DecodedSortOption as w, type DecodedQuery as x, type FindOptions as y, type FindOneOptions as z };
1874
+ //# sourceMappingURL=index-C8EuFNYa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C8EuFNYa.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -3,7 +3,7 @@
3
3
  var utilsJs = require('@o2ter/utils-js');
4
4
  var _private = require('./private-Ciddhure.js');
5
5
  var _ = require('lodash');
6
- var index = require('./index-Dej3GgVf.js');
6
+ var index = require('./index-BtqngPTb.js');
7
7
  var axios = require('axios');
8
8
  var _const = require('@o2ter/server-js/dist/const');
9
9
  var socket_ioClient = require('socket.io-client');
@@ -1903,4 +1903,4 @@ exports.isQuery = isQuery;
1903
1903
  exports.isRole = isRole;
1904
1904
  exports.isUser = isUser;
1905
1905
  exports.serialize = serialize;
1906
- //# sourceMappingURL=index-DbXVThGW.js.map
1906
+ //# sourceMappingURL=index-CGO-xORH.js.map