proto.io 0.0.226 → 0.0.228

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 (30) hide show
  1. package/dist/adapters/file/aliyun-oss.d.ts +3 -3
  2. package/dist/adapters/file/database.d.ts +2 -2
  3. package/dist/adapters/file/filesystem.d.ts +3 -3
  4. package/dist/adapters/file/google-cloud-storage.d.ts +3 -3
  5. package/dist/adapters/storage/{progres.d.ts → postgres.d.ts} +2 -2
  6. package/dist/adapters/storage/postgres.d.ts.map +1 -0
  7. package/dist/adapters/storage/{progres.js → postgres.js} +1 -1
  8. package/dist/adapters/storage/postgres.js.map +1 -0
  9. package/dist/adapters/storage/{progres.mjs → postgres.mjs} +1 -1
  10. package/dist/adapters/storage/postgres.mjs.map +1 -0
  11. package/dist/client.d.ts +3 -3
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +18 -18
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +18 -18
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/internals/{base-DSo02iAX.d.ts → base-CW4QHAo3.d.ts} +2 -2
  18. package/dist/internals/{base-DSo02iAX.d.ts.map → base-CW4QHAo3.d.ts.map} +1 -1
  19. package/dist/internals/{chunk-BhwfdCdq.d.ts → chunk-DPgxK2_o.d.ts} +3 -3
  20. package/dist/internals/{chunk-BhwfdCdq.d.ts.map → chunk-DPgxK2_o.d.ts.map} +1 -1
  21. package/dist/internals/index-BWZIV3_T.mjs.map +1 -1
  22. package/dist/internals/{index-Cj45GkKv.d.ts → index-CywcwPk-.d.ts} +2 -2
  23. package/dist/internals/{index-Cj45GkKv.d.ts.map → index-CywcwPk-.d.ts.map} +1 -1
  24. package/dist/internals/{index-1ZK5N4yb.d.ts → index-h4KGKuhq.d.ts} +5 -5
  25. package/dist/internals/{index-1ZK5N4yb.d.ts.map → index-h4KGKuhq.d.ts.map} +1 -1
  26. package/dist/internals/index-vOFh8pVc.js.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/adapters/storage/progres.d.ts.map +0 -1
  29. package/dist/adapters/storage/progres.js.map +0 -1
  30. package/dist/adapters/storage/progres.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { h as TExtensions, E as ExtraOptions, S as SerializeOptions, i as ProtoType, j as TQuery, k as TObject, l as PathName, c as TValueWithoutObject, f as TSerializable, m as TObjectType, n as TUser, T as TSchema, o as EventData, p as TQuerySelector } from './index-1ZK5N4yb.js';
1
+ import { h as TExtensions, E as ExtraOptions, S as SerializeOptions, i as ProtoType, j as TQuery, k as TObject, l as PathName, c as TValueWithoutObject, f as TSerializable, m as TObjectType, n as TUser, T as TSchema, o as EventData, p as TQuerySelector } from './index-h4KGKuhq.js';
2
2
  import * as _o2ter_utils_js from '@o2ter/utils-js';
3
3
  import * as socket_io_client from 'socket.io-client';
4
4
  import * as _socket_io_component_emitter from '@socket.io/component-emitter';
@@ -89,4 +89,4 @@ declare class ProtoClient<Ext = any> extends ProtoType<Ext> {
89
89
  }
90
90
 
91
91
  export { ProtoClient as P, classExtends as c };
92
- //# sourceMappingURL=index-Cj45GkKv.d.ts.map
92
+ //# sourceMappingURL=index-CywcwPk-.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-Cj45GkKv.d.ts","sources":["../../src/internals/utils.ts","../../src/client/options.ts","../../src/client/proto/types.ts","../../src/client/proto/index.ts"],"sourcesContent":["//\n// index.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 { TObject } from './object';\nimport { TFile } from './object/file';\nimport { TJob } from './object/job';\nimport { TRole } from './object/role';\nimport { TExtensions } from './object/types';\nimport { TUser } from './object/user';\nimport { TQuery } from './query';\n\nexport const isObjKey = <T extends object>(key: PropertyKey, obj: T): key is keyof T => key in obj;\n\nexport const classExtends = <E = {}>(x: TExtensions<E>) => x;\n\nexport const isQuery = (x: any): x is TQuery<any, any, any> => {\n return x instanceof TQuery;\n}\n\nexport const isObject = (x: any): x is TObject => {\n return x instanceof TObject;\n}\n\nexport const isUser = (x: any): x is TUser => {\n return x instanceof TUser;\n}\n\nexport const isRole = (x: any): x is TRole => {\n return x instanceof TRole;\n}\n\nexport const isFile = (x: any): x is TFile => {\n return x instanceof TFile;\n}\n\nexport const isJob = (x: any): x is TJob => {\n return x instanceof TJob;\n}\n","//\n// options.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 { SerializeOptions } from '../internals/codec';\nimport { ExtraOptions } from '../internals/options';\n\nexport type RequestOptions<M extends boolean> = ExtraOptions<M> & {\n serializeOpts?: SerializeOptions;\n};\n","//\n// types.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 { TExtensions } from '../../internals/object/types';\n\n/**\n * Options for configuring Axios requests.\n */\nexport type AxiosOptions = {\n /**\n * The name of the XSRF cookie.\n */\n xsrfCookieName?: string;\n\n /**\n * The name of the XSRF header.\n */\n xsrfHeaderName?: string;\n\n /**\n * The limit for retry attempts.\n */\n retryLimit?: number;\n\n /**\n * The key for storing cookies.\n */\n cookieKey?: string;\n};\n\n/**\n * Options for configuring the Proto client.\n */\nexport type ProtoOptions<Ext> = {\n /**\n * The endpoint URL for the Proto client.\n */\n endpoint: string;\n\n /**\n * The socket endpoint URL for the Proto client.\n */\n socketEndpoint?: string;\n\n /**\n * The master user credentials.\n */\n masterUser?: { user: string; pass: string; };\n\n /**\n * The class extensions.\n */\n classExtends?: TExtensions<Ext>;\n\n /**\n * The Axios configuration options.\n */\n axiosOptions?: AxiosOptions;\n};\n","//\n// index.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 { ProtoClientQuery, ProtoClientRelationQuery } from '../query';\nimport { RequestOptions } from '../options';\nimport { ProtoClientInternal } from './internal';\nimport { ProtoOptions } from './types';\nimport { TSerializable } from '../../internals/codec';\nimport { EventData, ProtoType } from '../../internals/proto';\nimport { TQuery } from '../../internals/query';\nimport { PVK } from '../../internals/private';\nimport { TValueWithoutObject } from '../../internals/types';\nimport { TUser } from '../../internals/object/user';\nimport { TObject } from '../../internals/object';\nimport { PathName } from '../../internals/query/types';\nimport { TQuerySelector } from '../../internals/query/types/selectors';\n\nexport class ProtoClient<Ext = any> extends ProtoType<Ext> {\n\n /** @internal */\n [PVK]: ProtoClientInternal<Ext, this>;\n\n constructor(options: ProtoOptions<Ext>) {\n super();\n this[PVK] = new ProtoClientInternal({ ...options });\n }\n\n Query<T extends string>(className: T): TQuery<T, Ext, boolean> {\n return new ProtoClientQuery<T, Ext>(className, this, {});\n }\n\n Relation<T extends string>(object: TObject, key: PathName<T>): TQuery<string, Ext, boolean> {\n const id = object.id;\n if (!id) throw Error('Invalid object');\n return new ProtoClientRelationQuery<Ext>(this, {\n relatedBy: {\n className: object.className,\n id,\n key,\n },\n });\n }\n\n config(options?: RequestOptions<boolean>): Promise<Record<string, TValueWithoutObject>> {\n return this[PVK].config(options);\n }\n configAcl(options: RequestOptions<true>) {\n if (options.master !== true) throw Error('No permission');\n return this[PVK].configAcl(options);\n }\n async setConfig(values: Record<string, TValueWithoutObject>, options: RequestOptions<true> & { acl?: string[]; }) {\n if (options.master !== true) throw Error('No permission');\n await this[PVK].setConfig(values, options);\n }\n\n run<R extends TSerializable | void = any>(\n name: string,\n data?: TSerializable,\n options?: RequestOptions<boolean>\n ) {\n return this[PVK].request(this, data, {\n method: 'post',\n url: `functions/${encodeURIComponent(name)}`,\n ...(options ?? {})\n }) as Promise<R>;\n }\n\n scheduleJob(\n name: string,\n data?: TValueWithoutObject,\n options?: RequestOptions<boolean>\n ) {\n return this[PVK].request(this, data, {\n method: 'post',\n url: `jobs/${encodeURIComponent(name)}`,\n ...(options ?? {})\n }) as any;\n }\n\n refreshSocketSession() {\n this[PVK].refreshSocketSession();\n }\n\n setSessionToken(token?: string) {\n this[PVK].setSessionToken(this, token);\n }\n\n sessionInfo(options?: RequestOptions<boolean>) {\n return this[PVK].sessionInfo(this, options);\n }\n\n currentUser(options?: RequestOptions<boolean>) {\n return this[PVK].currentUser(this, options);\n }\n\n logout(options?: RequestOptions<boolean>) {\n return this[PVK].logout(options);\n }\n\n setPassword(user: TUser, password: string, options: RequestOptions<true>) {\n return this[PVK].setPassword(user, password, options);\n }\n\n unsetPassword(user: TUser, options: RequestOptions<true>) {\n return this[PVK].unsetPassword(user, options);\n }\n\n schema(options: RequestOptions<true>) {\n return this[PVK].schema(options);\n }\n\n notify(data: Record<string, TValueWithoutObject> & { _rperm?: string[]; }, options?: RequestOptions<boolean>) {\n return this[PVK].notify(this, data, options);\n }\n\n listen(\n callback: (data: EventData) => void,\n selector?: TQuerySelector\n ) {\n return this[PVK].listen(this, callback, selector);\n }\n\n refs(object: TObject, options?: RequestOptions<boolean>) {\n return this[PVK].refs(this, object, options);\n }\n}\n"],"names":[],"mappings":";;;;;AAQO;;ACNA;AACP;AACA;;ACHA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;"}
1
+ {"version":3,"file":"index-CywcwPk-.d.ts","sources":["../../src/internals/utils.ts","../../src/client/options.ts","../../src/client/proto/types.ts","../../src/client/proto/index.ts"],"sourcesContent":["//\n// index.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 { TObject } from './object';\nimport { TFile } from './object/file';\nimport { TJob } from './object/job';\nimport { TRole } from './object/role';\nimport { TExtensions } from './object/types';\nimport { TUser } from './object/user';\nimport { TQuery } from './query';\n\nexport const isObjKey = <T extends object>(key: PropertyKey, obj: T): key is keyof T => key in obj;\n\nexport const classExtends = <E = {}>(x: TExtensions<E>) => x;\n\nexport const isQuery = (x: any): x is TQuery<any, any, any> => {\n return x instanceof TQuery;\n}\n\nexport const isObject = (x: any): x is TObject => {\n return x instanceof TObject;\n}\n\nexport const isUser = (x: any): x is TUser => {\n return x instanceof TUser;\n}\n\nexport const isRole = (x: any): x is TRole => {\n return x instanceof TRole;\n}\n\nexport const isFile = (x: any): x is TFile => {\n return x instanceof TFile;\n}\n\nexport const isJob = (x: any): x is TJob => {\n return x instanceof TJob;\n}\n","//\n// options.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 { SerializeOptions } from '../internals/codec';\nimport { ExtraOptions } from '../internals/options';\n\nexport type RequestOptions<M extends boolean> = ExtraOptions<M> & {\n serializeOpts?: SerializeOptions;\n};\n","//\n// types.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 { TExtensions } from '../../internals/object/types';\n\n/**\n * Options for configuring Axios requests.\n */\nexport type AxiosOptions = {\n /**\n * The name of the XSRF cookie.\n */\n xsrfCookieName?: string;\n\n /**\n * The name of the XSRF header.\n */\n xsrfHeaderName?: string;\n\n /**\n * The limit for retry attempts.\n */\n retryLimit?: number;\n\n /**\n * The key for storing cookies.\n */\n cookieKey?: string;\n};\n\n/**\n * Options for configuring the Proto client.\n */\nexport type ProtoOptions<Ext> = {\n /**\n * The endpoint URL for the Proto client.\n */\n endpoint: string;\n\n /**\n * The socket endpoint URL for the Proto client.\n */\n socketEndpoint?: string;\n\n /**\n * The master user credentials.\n */\n masterUser?: { user: string; pass: string; };\n\n /**\n * The class extensions.\n */\n classExtends?: TExtensions<Ext>;\n\n /**\n * The Axios configuration options.\n */\n axiosOptions?: AxiosOptions;\n};\n","//\n// index.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 { ProtoClientQuery, ProtoClientRelationQuery } from '../query';\nimport { RequestOptions } from '../options';\nimport { ProtoClientInternal } from './internal';\nimport { ProtoOptions } from './types';\nimport { TSerializable } from '../../internals/codec';\nimport { EventData, ProtoType } from '../../internals/proto';\nimport { TQuery } from '../../internals/query';\nimport { PVK } from '../../internals/private';\nimport { TValueWithoutObject } from '../../internals/types';\nimport { TUser } from '../../internals/object/user';\nimport { TObject } from '../../internals/object';\nimport { PathName } from '../../internals/query/types';\nimport { TQuerySelector } from '../../internals/query/types/selectors';\n\nexport class ProtoClient<Ext = any> extends ProtoType<Ext> {\n\n /** @internal */\n [PVK]: ProtoClientInternal<Ext, this>;\n\n constructor(options: ProtoOptions<Ext>) {\n super();\n this[PVK] = new ProtoClientInternal({ ...options });\n }\n\n Query<T extends string>(className: T): TQuery<T, Ext, boolean> {\n return new ProtoClientQuery<T, Ext>(className, this, {});\n }\n\n Relation<T extends string>(object: TObject, key: PathName<T>): TQuery<string, Ext, boolean> {\n const id = object.id;\n if (!id) throw Error('Invalid object');\n return new ProtoClientRelationQuery<Ext>(this, {\n relatedBy: {\n className: object.className,\n id,\n key,\n },\n });\n }\n\n config(options?: RequestOptions<boolean>): Promise<Record<string, TValueWithoutObject>> {\n return this[PVK].config(options);\n }\n configAcl(options: RequestOptions<true>) {\n if (options.master !== true) throw Error('No permission');\n return this[PVK].configAcl(options);\n }\n async setConfig(values: Record<string, TValueWithoutObject>, options: RequestOptions<true> & { acl?: string[]; }) {\n if (options.master !== true) throw Error('No permission');\n await this[PVK].setConfig(values, options);\n }\n\n run<R extends TSerializable | void = any>(\n name: string,\n data?: TSerializable,\n options?: RequestOptions<boolean>\n ) {\n return this[PVK].request(this, data, {\n method: 'post',\n url: `functions/${encodeURIComponent(name)}`,\n ...(options ?? {})\n }) as Promise<R>;\n }\n\n scheduleJob(\n name: string,\n data?: TValueWithoutObject,\n options?: RequestOptions<boolean>\n ) {\n return this[PVK].request(this, data, {\n method: 'post',\n url: `jobs/${encodeURIComponent(name)}`,\n ...(options ?? {})\n }) as any;\n }\n\n refreshSocketSession() {\n this[PVK].refreshSocketSession();\n }\n\n setSessionToken(token?: string) {\n this[PVK].setSessionToken(this, token);\n }\n\n sessionInfo(options?: RequestOptions<boolean>) {\n return this[PVK].sessionInfo(this, options);\n }\n\n currentUser(options?: RequestOptions<boolean>) {\n return this[PVK].currentUser(this, options);\n }\n\n logout(options?: RequestOptions<boolean>) {\n return this[PVK].logout(options);\n }\n\n setPassword(user: TUser, password: string, options: RequestOptions<true>) {\n return this[PVK].setPassword(user, password, options);\n }\n\n unsetPassword(user: TUser, options: RequestOptions<true>) {\n return this[PVK].unsetPassword(user, options);\n }\n\n schema(options: RequestOptions<true>) {\n return this[PVK].schema(options);\n }\n\n notify(data: Record<string, TValueWithoutObject> & { _rperm?: string[]; }, options?: RequestOptions<boolean>) {\n return this[PVK].notify(this, data, options);\n }\n\n listen(\n callback: (data: EventData) => void,\n selector?: TQuerySelector\n ) {\n return this[PVK].listen(this, callback, selector);\n }\n\n refs(object: TObject, options?: RequestOptions<boolean>) {\n return this[PVK].refs(this, object, options);\n }\n}\n"],"names":[],"mappings":";;;;;AAQO;;ACNA;AACP;AACA;;ACHA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;"}
@@ -1102,7 +1102,7 @@ interface ProtoType<Ext> {
1102
1102
  * @param options - Extra options.
1103
1103
  * @returns A promise resolving to a boolean indicating if the password is correct.
1104
1104
  */
1105
- varifyPassword(user: TUser, password: string, options: ExtraOptions<true>): Promise<boolean>;
1105
+ verifyPassword(user: TUser, password: string, options: ExtraOptions<true>): Promise<boolean>;
1106
1106
  /**
1107
1107
  * Sets a user's password.
1108
1108
  * @param user - The user whose password is to be set.
@@ -1183,7 +1183,7 @@ interface ProtoType<Ext> {
1183
1183
  * @param options - Options for verifying the JWT.
1184
1184
  * @returns The decoded JWT payload or undefined if verification fails.
1185
1185
  */
1186
- jwtVarify(token: string, options?: jwt.VerifyOptions): jwt.JwtPayload | undefined;
1186
+ jwtVerify(token: string, options?: jwt.VerifyOptions): jwt.JwtPayload | undefined;
1187
1187
  }
1188
1188
 
1189
1189
  /**
@@ -2018,7 +2018,7 @@ declare class ProtoService<Ext = any> extends ProtoType<Ext> {
2018
2018
  cookieOptions?: CookieOptions | undefined;
2019
2019
  jwtSignOptions?: jwt.SignOptions | undefined;
2020
2020
  }): Promise<void>;
2021
- varifyPassword(user: TUser, password: string, options: ExtraOptions<true>): Promise<boolean>;
2021
+ verifyPassword(user: TUser, password: string, options: ExtraOptions<true>): Promise<boolean>;
2022
2022
  setPassword(user: TUser, password: string, options: ExtraOptions<true>): Promise<void>;
2023
2023
  unsetPassword(user: TUser, options: ExtraOptions<true>): Promise<void>;
2024
2024
  get schema(): ProtoServiceOptions<Ext>['schema'];
@@ -2049,7 +2049,7 @@ declare class ProtoService<Ext = any> extends ProtoType<Ext> {
2049
2049
  jwtSignOptions?: jwt.SignOptions;
2050
2050
  }): string;
2051
2051
  jwtSign(payload: any, options: jwt.SignOptions): string;
2052
- jwtVarify(token: string, options?: jwt.VerifyOptions): jwt.JwtPayload | undefined;
2052
+ jwtVerify(token: string, options?: jwt.VerifyOptions): jwt.JwtPayload | undefined;
2053
2053
  notify(data: Record<string, TValueWithoutObject> & {
2054
2054
  _rperm?: string[];
2055
2055
  }): Promise<void>;
@@ -2062,4 +2062,4 @@ declare class ProtoService<Ext = any> extends ProtoType<Ext> {
2062
2062
 
2063
2063
  export { FieldSelectorExpression as F, ProtoService as P, QueryExpression as Q, TSchema as T, deserialize as g, ProtoType as i, TQuery as j, TObject as k, TUser as n, serialize as s, QuerySelector as u, QueryAccumulator as y };
2064
2064
  export type { TransactionOptions as A, QueryRandomOptions as B, TPubSub as C, DeserializeOptions as D, ExtraOptions as E, TFileInfo as G, InsertOptions as I, RelationOptions as R, SerializeOptions as S, ProtoServiceOptions as a, ProtoServiceKeyOptions as b, TValueWithoutObject as c, TFileStorage as d, TNumber as e, TSerializable as f, TExtensions as h, PathName as l, TObjectType as m, EventData as o, TQuerySelector as p, TValueWithUndefined as q, TValue as r, TUpdateOp as t, DecodedQuery as v, FindOptions as w, DecodedSortOption as x, TStorage as z };
2065
- //# sourceMappingURL=index-1ZK5N4yb.d.ts.map
2065
+ //# sourceMappingURL=index-h4KGKuhq.d.ts.map