@zenstackhq/orm 3.5.0-beta.1 → 3.5.0-beta.3

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
@@ -2210,7 +2210,7 @@ type ClientContract<Schema extends SchemaDef, Options extends ClientOptions<Sche
2210
2210
  /**
2211
2211
  * Returns diagnostics information such as cache and slow query statistics.
2212
2212
  */
2213
- $diagnostics(): Promise<Diagnostics>;
2213
+ get $diagnostics(): Promise<Diagnostics>;
2214
2214
  } & {
2215
2215
  [Key in GetSlicedModels<Schema, Options> as Uncapitalize<Key>]: ModelOperations<Schema, Key, Options, ExtQueryArgs>;
2216
2216
  } & ProcedureOperations<Schema, Options> & ExtClientMembers;
package/dist/index.d.ts CHANGED
@@ -2210,7 +2210,7 @@ type ClientContract<Schema extends SchemaDef, Options extends ClientOptions<Sche
2210
2210
  /**
2211
2211
  * Returns diagnostics information such as cache and slow query statistics.
2212
2212
  */
2213
- $diagnostics(): Promise<Diagnostics>;
2213
+ get $diagnostics(): Promise<Diagnostics>;
2214
2214
  } & {
2215
2215
  [Key in GetSlicedModels<Schema, Options> as Uncapitalize<Key>]: ModelOperations<Schema, Key, Options, ExtQueryArgs>;
2216
2216
  } & ProcedureOperations<Schema, Options> & ExtClientMembers;
package/dist/index.js CHANGED
@@ -8926,13 +8926,13 @@ var ClientImpl = class _ClientImpl {
8926
8926
  };
8927
8927
  return this.$setOptions(newOptions);
8928
8928
  }
8929
- async $diagnostics() {
8930
- return {
8929
+ get $diagnostics() {
8930
+ return Promise.resolve({
8931
8931
  zodCache: this.inputValidator.zodFactory.cacheStats,
8932
8932
  slowQueries: this.slowQueries.map((q) => ({
8933
8933
  ...q
8934
- }))
8935
- };
8934
+ })).sort((a, b) => b.durationMs - a.durationMs)
8935
+ });
8936
8936
  }
8937
8937
  $executeRaw(query, ...values) {
8938
8938
  return createZenStackPromise(async () => {