@zenstackhq/orm 3.5.0-beta.5 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2265,11 +2265,12 @@ type ClientContract<Schema extends SchemaDef, Options extends ClientOptions<Sche
2265
2265
  */
2266
2266
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): ZenStackPromise<Schema, T>;
2267
2267
  /**
2268
- * The current user identity.
2268
+ * The current user identity. If the client is not bound to any user context, returns `undefined`.
2269
2269
  */
2270
2270
  get $auth(): AuthType<Schema> | undefined;
2271
2271
  /**
2272
2272
  * Returns a new client bound to the specified user identity. The original client remains unchanged.
2273
+ * Pass `undefined` to return a client without any user context.
2273
2274
  *
2274
2275
  * @example
2275
2276
  * ```
package/dist/index.d.ts CHANGED
@@ -2265,11 +2265,12 @@ type ClientContract<Schema extends SchemaDef, Options extends ClientOptions<Sche
2265
2265
  */
2266
2266
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): ZenStackPromise<Schema, T>;
2267
2267
  /**
2268
- * The current user identity.
2268
+ * The current user identity. If the client is not bound to any user context, returns `undefined`.
2269
2269
  */
2270
2270
  get $auth(): AuthType<Schema> | undefined;
2271
2271
  /**
2272
2272
  * Returns a new client bound to the specified user identity. The original client remains unchanged.
2273
+ * Pass `undefined` to return a client without any user context.
2273
2274
  *
2274
2275
  * @example
2275
2276
  * ```
package/dist/index.js CHANGED
@@ -9145,7 +9145,7 @@ var ClientImpl = class _ClientImpl {
9145
9145
  return newClient;
9146
9146
  }
9147
9147
  $setAuth(auth) {
9148
- if (auth !== void 0 && typeof auth !== "object") {
9148
+ if (auth !== void 0 && (typeof auth !== "object" || auth === null || Array.isArray(auth))) {
9149
9149
  throw new Error("Invalid auth object");
9150
9150
  }
9151
9151
  const newClient = new _ClientImpl(this.schema, this.$options, this);