@opra/sqb 0.32.6 → 0.33.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.
@@ -152,8 +152,8 @@ class SqbEntityServiceBase extends core_1.ApiService {
152
152
  throw e;
153
153
  }
154
154
  }
155
- for(arg0, attributes) {
156
- return super.for(arg0, attributes);
155
+ for(context, overwriteProperties, overwriteContext) {
156
+ return super.for(context, overwriteProperties, overwriteContext);
157
157
  }
158
158
  async _onError(error) {
159
159
  if (this.onError)
@@ -166,9 +166,5 @@ class SqbEntityServiceBase extends core_1.ApiService {
166
166
  throw new Error(`Database not set!`);
167
167
  return this.db;
168
168
  }
169
- _instanceCompare(service, context, attributes) {
170
- return super._instanceCompare(service, context, attributes) &&
171
- (!attributes?.db || service.db === attributes.db);
172
- }
173
169
  }
174
170
  exports.SqbEntityServiceBase = SqbEntityServiceBase;
@@ -149,8 +149,8 @@ export class SqbEntityServiceBase extends ApiService {
149
149
  throw e;
150
150
  }
151
151
  }
152
- for(arg0, attributes) {
153
- return super.for(arg0, attributes);
152
+ for(context, overwriteProperties, overwriteContext) {
153
+ return super.for(context, overwriteProperties, overwriteContext);
154
154
  }
155
155
  async _onError(error) {
156
156
  if (this.onError)
@@ -163,8 +163,4 @@ export class SqbEntityServiceBase extends ApiService {
163
163
  throw new Error(`Database not set!`);
164
164
  return this.db;
165
165
  }
166
- _instanceCompare(service, context, attributes) {
167
- return super._instanceCompare(service, context, attributes) &&
168
- (!attributes?.db || service.db === attributes.db);
169
- }
170
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/sqb",
3
- "version": "0.32.6",
3
+ "version": "0.33.0",
4
4
  "description": "Opra SQB adapter package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -31,10 +31,10 @@
31
31
  "@sqb/connect": "^4.10.6",
32
32
  "@sqb/postgres": "^4.10.6",
33
33
  "postgresql-client": "^2.10.1",
34
- "ts-gems": "^2.9.3"
34
+ "ts-gems": "^3.1.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@opra/core": "^0.32.6",
37
+ "@opra/core": "^0.33.0",
38
38
  "@sqb/connect": ">= 4.10.6"
39
39
  },
40
40
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { Type } from 'ts-gems';
1
+ import { Nullish, Type } from 'ts-gems';
2
2
  import { DTO, PartialDTO, PatchDTO } from '@opra/common';
3
3
  import { ApiService, RequestContext } from '@opra/core';
4
4
  import { EntityInput, Repository, SqbClient, SqbConnection } from '@sqb/connect';
@@ -17,12 +17,9 @@ export declare class SqbEntityServiceBase<T> extends ApiService {
17
17
  protected _exists(options?: Repository.ExistsOptions): Promise<boolean>;
18
18
  protected _update(keyValue: any, data: EntityInput<T>, options?: Repository.UpdateOptions): Promise<PartialDTO<T> | undefined>;
19
19
  protected _updateMany(data: PatchDTO<T>, options?: Repository.UpdateManyOptions): Promise<number>;
20
- for(context: RequestContext | ApiService): this;
21
- for(context: RequestContext | ApiService, attributes?: SqbEntityServiceBase.ExtendOptions): this;
22
- for<O extends ApiService.ExtendOptions>(attributes: O): this & O;
20
+ for<C extends RequestContext, P extends Partial<this>>(context: C, overwriteProperties?: Nullish<P>, overwriteContext?: Partial<C>): this & Required<P>;
23
21
  protected _onError(error: unknown): Promise<void>;
24
22
  protected getConnection(): SqbConnection | SqbClient | Promise<SqbConnection | SqbClient>;
25
- protected _instanceCompare(service: ApiService, context: RequestContext, attributes?: any): boolean;
26
23
  protected onError?(error: unknown): void | Promise<void>;
27
24
  protected transformData?(row: PartialDTO<T>): PartialDTO<T>;
28
25
  }
@@ -31,7 +28,4 @@ export declare namespace SqbEntityServiceBase {
31
28
  db?: SqbClient | SqbConnection;
32
29
  defaultLimit?: number;
33
30
  }
34
- interface ExtendOptions extends Options, ApiService.ExtendOptions {
35
- db?: SqbClient | SqbConnection;
36
- }
37
31
  }