@opra/sqb 1.26.3 → 1.27.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/README.md +24 -1
- package/adapter-utils/prepare-filter.d.ts +3 -4
- package/adapter-utils/prepare-filter.js +16 -31
- package/augmentation/datatype-factory.augmentation.js +1 -1
- package/package.json +3 -3
- package/sqb-adapter.d.ts +41 -1
- package/sqb-adapter.js +21 -6
- package/sqb-collection-service.d.ts +141 -159
- package/sqb-collection-service.js +52 -99
- package/sqb-entity-service.d.ts +133 -154
- package/sqb-entity-service.js +129 -132
- package/sqb-service-base.d.ts +17 -13
- package/sqb-service-base.js +15 -17
- package/sqb-singleton-service.d.ts +78 -88
- package/sqb-singleton-service.js +26 -26
package/sqb-entity-service.d.ts
CHANGED
|
@@ -6,17 +6,41 @@ import { type vg } from 'valgen';
|
|
|
6
6
|
import { SQBAdapter } from './sqb-adapter.js';
|
|
7
7
|
import { SqbServiceBase } from './sqb-service-base.js';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Namespace containing types and options for SqbEntityService.
|
|
10
10
|
*/
|
|
11
11
|
export declare namespace SqbEntityService {
|
|
12
|
+
/**
|
|
13
|
+
* Configuration options for SqbEntityService.
|
|
14
|
+
*/
|
|
12
15
|
interface Options extends SqbServiceBase.Options {
|
|
16
|
+
/**
|
|
17
|
+
* The name of the resource managed by this service.
|
|
18
|
+
*/
|
|
13
19
|
resourceName?: SqbEntityService<any>['resourceName'];
|
|
20
|
+
/**
|
|
21
|
+
* Optional error handler.
|
|
22
|
+
*/
|
|
14
23
|
onError?: SqbEntityService<any>['onError'];
|
|
24
|
+
/**
|
|
25
|
+
* Optional common filter applied to all read/write operations.
|
|
26
|
+
*/
|
|
15
27
|
commonFilter?: SqbEntityService<any>['commonFilter'];
|
|
28
|
+
/**
|
|
29
|
+
* Optional interceptor for the service operations.
|
|
30
|
+
*/
|
|
16
31
|
interceptor?: SqbEntityService<any>['interceptor'];
|
|
32
|
+
/**
|
|
33
|
+
* Optional scope for the service.
|
|
34
|
+
*/
|
|
17
35
|
scope?: SqbEntityService<any>['scope'];
|
|
18
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Represents the CRUD operation types.
|
|
39
|
+
*/
|
|
19
40
|
type CrudOp = 'create' | 'read' | 'update' | 'delete';
|
|
41
|
+
/**
|
|
42
|
+
* Information about the command being executed.
|
|
43
|
+
*/
|
|
20
44
|
interface CommandInfo {
|
|
21
45
|
crud: SqbEntityService.CrudOp;
|
|
22
46
|
method: string;
|
|
@@ -25,77 +49,35 @@ export declare namespace SqbEntityService {
|
|
|
25
49
|
input?: Record<string, any>;
|
|
26
50
|
options?: Record<string, any>;
|
|
27
51
|
}
|
|
28
|
-
type CommonFilter = SQBAdapter.FilterInput | ((args: SqbEntityService.CommandInfo, _this: SqbEntityService<any>) => SQBAdapter.FilterInput | Promise<SQBAdapter.FilterInput> | undefined);
|
|
29
52
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @interface
|
|
53
|
+
* Type definition for a common filter.
|
|
33
54
|
*/
|
|
55
|
+
type CommonFilter = SQBAdapter.FilterInput | ((args: SqbEntityService.CommandInfo, _this: SqbEntityService<any>) => SQBAdapter.FilterInput | Promise<SQBAdapter.FilterInput> | undefined);
|
|
34
56
|
interface CreateOptions extends Repository.CreateOptions {
|
|
35
57
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Represents options for "count" operation
|
|
38
|
-
*
|
|
39
|
-
* @interface
|
|
40
|
-
*/
|
|
41
58
|
interface CountOptions extends StrictOmit<Repository.CountOptions, 'filter'> {
|
|
42
59
|
filter?: Repository.CountOptions['filter'] | string;
|
|
43
60
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Represents options for "delete" operation
|
|
46
|
-
*
|
|
47
|
-
* @interface
|
|
48
|
-
*/
|
|
49
61
|
interface DeleteOptions extends StrictOmit<Repository.DeleteOptions, 'filter'> {
|
|
50
62
|
filter?: Repository.DeleteOptions['filter'] | string;
|
|
51
63
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Represents options for "deleteMany" operation
|
|
54
|
-
*
|
|
55
|
-
* @interface
|
|
56
|
-
*/
|
|
57
64
|
interface DeleteManyOptions extends StrictOmit<Repository.DeleteManyOptions, 'filter'> {
|
|
58
65
|
filter?: Repository.DeleteManyOptions['filter'] | string;
|
|
59
66
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Represents options for "exists" operation
|
|
62
|
-
*
|
|
63
|
-
* @interface
|
|
64
|
-
*/
|
|
65
67
|
interface ExistsOptions extends StrictOmit<Repository.ExistsOptions, 'filter'> {
|
|
66
68
|
filter?: Repository.ExistsOptions['filter'] | string;
|
|
67
69
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Represents options for "findOne" operation
|
|
70
|
-
*
|
|
71
|
-
* @interface
|
|
72
|
-
*/
|
|
73
70
|
interface FindOneOptions extends StrictOmit<Repository.FindOneOptions, 'filter' | 'offset'> {
|
|
74
71
|
filter?: Repository.FindOneOptions['filter'] | string;
|
|
75
72
|
skip?: number;
|
|
76
73
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Represents options for "findMany" operation
|
|
79
|
-
*
|
|
80
|
-
* @interface
|
|
81
|
-
*/
|
|
82
74
|
interface FindManyOptions extends StrictOmit<Repository.FindManyOptions, 'filter' | 'offset'> {
|
|
83
75
|
filter?: Repository.FindManyOptions['filter'] | string;
|
|
84
76
|
skip?: number;
|
|
85
77
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Represents options for "update" operation
|
|
88
|
-
*
|
|
89
|
-
* @interface
|
|
90
|
-
*/
|
|
91
78
|
interface UpdateOneOptions extends StrictOmit<Repository.UpdateOptions, 'filter'> {
|
|
92
79
|
filter?: Repository.UpdateOptions['filter'] | string;
|
|
93
80
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Represents options for "updateMany" operation
|
|
96
|
-
*
|
|
97
|
-
* @interface
|
|
98
|
-
*/
|
|
99
81
|
interface UpdateManyOptions extends StrictOmit<Repository.UpdateManyOptions, 'filter'> {
|
|
100
82
|
filter?: Repository.UpdateManyOptions['filter'] | string;
|
|
101
83
|
}
|
|
@@ -141,18 +123,19 @@ export declare namespace SqbEntityService {
|
|
|
141
123
|
}
|
|
142
124
|
export interface SqbEntityService {
|
|
143
125
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* @param next -
|
|
147
|
-
* @param
|
|
148
|
-
* @param _this -
|
|
149
|
-
* @returns
|
|
126
|
+
* Optional interceptor that wraps every command execution.
|
|
127
|
+
*
|
|
128
|
+
* @param next - Calls the next interceptor or the actual command handler.
|
|
129
|
+
* @param command - Metadata describing the current operation.
|
|
130
|
+
* @param _this - Reference to the service instance.
|
|
131
|
+
* @returns The result of the command execution.
|
|
150
132
|
*/
|
|
151
133
|
interceptor?(next: () => any, command: SqbEntityService.CommandInfo, _this: any): Promise<any>;
|
|
152
134
|
}
|
|
153
135
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
136
|
+
* Base service providing CRUD operations over an SQB entity.
|
|
137
|
+
*
|
|
138
|
+
* @typeParam T - The entity type managed by this service
|
|
156
139
|
*/
|
|
157
140
|
export declare class SqbEntityService<T extends object = object> extends SqbServiceBase {
|
|
158
141
|
protected _dataTypeScope?: string;
|
|
@@ -163,278 +146,274 @@ export declare class SqbEntityService<T extends object = object> extends SqbServ
|
|
|
163
146
|
protected _inputCodecs: Record<string, vg.isObject.Validator<T>>;
|
|
164
147
|
protected _outputCodecs: Record<string, vg.isObject.Validator<T>>;
|
|
165
148
|
/**
|
|
166
|
-
*
|
|
149
|
+
* Comma-delimited scopes used to filter the API document.
|
|
167
150
|
*/
|
|
168
151
|
scope?: string;
|
|
169
152
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
153
|
+
* Override for the resource name exposed in error messages and API metadata.
|
|
154
|
+
* Accepts a static string or a function that returns one.
|
|
172
155
|
*/
|
|
173
156
|
resourceName?: string | ((_this: this) => string);
|
|
174
157
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* @type {SqbEntityService.Filter | Function}
|
|
158
|
+
* Filter(s) automatically applied to every query for this service.
|
|
159
|
+
* Useful for multi-tenant isolation or other cross-cutting constraints.
|
|
178
160
|
*/
|
|
179
161
|
commonFilter?: SqbEntityService.CommonFilter | SqbEntityService.CommonFilter[];
|
|
180
162
|
/**
|
|
181
|
-
*
|
|
163
|
+
* Called whenever a command throws. Useful for logging or transforming errors.
|
|
182
164
|
*
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
165
|
+
* @param error - The thrown error.
|
|
166
|
+
* @param command - The service command during which the error was thrown.
|
|
167
|
+
* @param _this - The service instance.
|
|
185
168
|
*/
|
|
186
|
-
onError?: (error: unknown, _this: any) => void | Promise<void>;
|
|
169
|
+
onError?: (error: unknown, command: SqbEntityService.CommandInfo, _this: any) => void | Promise<void>;
|
|
187
170
|
/**
|
|
188
|
-
* Constructs a new instance
|
|
171
|
+
* Constructs a new instance.
|
|
189
172
|
*
|
|
190
|
-
* @param dataType - The
|
|
191
|
-
* @param
|
|
192
|
-
* @constructor
|
|
173
|
+
* @param dataType - The entity class or its registered name.
|
|
174
|
+
* @param options - Options for the service.
|
|
193
175
|
*/
|
|
194
176
|
constructor(dataType: Type<T> | string, options?: SqbEntityService.Options);
|
|
195
177
|
/**
|
|
196
|
-
*
|
|
178
|
+
* Returns the resolved OPRA `ComplexType` for this service's entity.
|
|
197
179
|
*
|
|
198
|
-
* @throws
|
|
180
|
+
* @throws If the data type is not registered as a `ComplexType`.
|
|
199
181
|
*/
|
|
200
182
|
get dataType(): ComplexType;
|
|
201
183
|
/**
|
|
202
|
-
*
|
|
184
|
+
* Returns the constructor class of the entity data type.
|
|
203
185
|
*
|
|
204
|
-
* @throws
|
|
186
|
+
* @throws If the data type is not registered as a `ComplexType`.
|
|
205
187
|
*/
|
|
206
188
|
get dataTypeClass(): Type;
|
|
207
189
|
/**
|
|
208
|
-
*
|
|
190
|
+
* Returns the SQB `EntityMetadata` for the entity class.
|
|
209
191
|
*
|
|
210
|
-
* @throws
|
|
192
|
+
* @throws If the class is not decorated with `@Entity()`.
|
|
211
193
|
*/
|
|
212
194
|
get entityMetadata(): EntityMetadata;
|
|
213
195
|
for<C extends ExecutionContext, P extends Partial<this>>(context: C | ServiceBase, overwriteProperties?: Nullish<P>, overwriteContext?: Partial<C>): this & Required<P>;
|
|
214
196
|
/**
|
|
215
|
-
*
|
|
197
|
+
* Returns the resource name used in error messages and API metadata.
|
|
216
198
|
*
|
|
217
|
-
* @
|
|
218
|
-
* @throws {Error} If the collection name is not defined.
|
|
199
|
+
* @throws If neither `resourceName` nor the data type name is available.
|
|
219
200
|
*/
|
|
220
201
|
getResourceName(): string;
|
|
221
202
|
/**
|
|
222
|
-
*
|
|
203
|
+
* Returns the input codec for the given operation (e.g. `'create'`, `'update'`).
|
|
223
204
|
*
|
|
224
|
-
* @param operation - The operation
|
|
205
|
+
* @param operation - The operation name.
|
|
225
206
|
*/
|
|
226
207
|
getInputCodec(operation: string): vg.isObject.Validator<T>;
|
|
227
208
|
/**
|
|
228
|
-
*
|
|
209
|
+
* Returns the output codec for the given operation.
|
|
210
|
+
*
|
|
211
|
+
* @param operation - The operation name.
|
|
229
212
|
*/
|
|
230
213
|
getOutputCodec(operation: string): vg.isObject.Validator<T>;
|
|
231
214
|
/**
|
|
232
|
-
*
|
|
215
|
+
* Inserts a new record into the database and returns the created document.
|
|
233
216
|
*
|
|
234
|
-
* @param command
|
|
235
|
-
* @returns
|
|
217
|
+
* @param command - The create command.
|
|
218
|
+
* @returns The created document.
|
|
236
219
|
* @protected
|
|
237
220
|
*/
|
|
238
221
|
protected _create(command: SqbEntityService.CreateCommand<T>): Promise<PartialDTO<T>>;
|
|
239
222
|
/**
|
|
240
|
-
*
|
|
223
|
+
* Inserts a new record into the database without returning it.
|
|
241
224
|
*
|
|
242
|
-
* @param command
|
|
243
|
-
* @returns - A promise that resolves to the created resource
|
|
225
|
+
* @param command - The create command.
|
|
244
226
|
* @protected
|
|
245
227
|
*/
|
|
246
228
|
protected _createOnly(command: SqbEntityService.CreateCommand<T>): Promise<any>;
|
|
247
229
|
/**
|
|
248
|
-
* Returns the count of records
|
|
230
|
+
* Returns the count of records matching the command options.
|
|
249
231
|
*
|
|
250
|
-
* @param command
|
|
251
|
-
* @return - A promise that resolves to the count of records
|
|
232
|
+
* @param command - The count command.
|
|
252
233
|
* @protected
|
|
253
234
|
*/
|
|
254
235
|
protected _count(command: SqbEntityService.CountCommand): Promise<number>;
|
|
255
236
|
/**
|
|
256
|
-
* Deletes
|
|
237
|
+
* Deletes the record identified by `command.documentId`.
|
|
257
238
|
*
|
|
258
|
-
* @param command
|
|
259
|
-
* @
|
|
239
|
+
* @param command - The delete command.
|
|
240
|
+
* @returns The number of records deleted.
|
|
260
241
|
* @protected
|
|
261
242
|
*/
|
|
262
243
|
protected _delete(command: SqbEntityService.DeleteOneCommand): Promise<number>;
|
|
263
244
|
/**
|
|
264
|
-
* Deletes
|
|
245
|
+
* Deletes all records matching the command filter.
|
|
265
246
|
*
|
|
266
|
-
* @param command
|
|
267
|
-
* @
|
|
247
|
+
* @param command - The deleteMany command.
|
|
248
|
+
* @returns The number of records deleted.
|
|
268
249
|
* @protected
|
|
269
250
|
*/
|
|
270
251
|
protected _deleteMany(command: SqbEntityService.DeleteManyCommand): Promise<number>;
|
|
271
252
|
/**
|
|
272
|
-
* Checks
|
|
253
|
+
* Checks whether the record identified by `command.documentId` exists.
|
|
273
254
|
*
|
|
274
|
-
* @param command
|
|
255
|
+
* @param command - The exists command.
|
|
275
256
|
* @protected
|
|
276
257
|
*/
|
|
277
258
|
protected _exists(command: SqbEntityService.ExistsCommand): Promise<boolean>;
|
|
278
259
|
/**
|
|
279
|
-
* Checks
|
|
260
|
+
* Checks whether any record matching the command filter exists.
|
|
280
261
|
*
|
|
281
|
-
* @param command
|
|
282
|
-
* @return - A Promise that resolves to a boolean indicating whether the record exists or not.
|
|
262
|
+
* @param command - The existsOne command.
|
|
283
263
|
* @protected
|
|
284
264
|
*/
|
|
285
265
|
protected _existsOne(command: SqbEntityService.ExistsCommand): Promise<boolean>;
|
|
286
266
|
/**
|
|
287
|
-
* Finds
|
|
267
|
+
* Finds the record identified by `command.documentId`.
|
|
288
268
|
*
|
|
289
|
-
* @param command
|
|
290
|
-
* @
|
|
269
|
+
* @param command - The findById command.
|
|
270
|
+
* @returns The found record, or `undefined` if not found.
|
|
291
271
|
* @protected
|
|
292
272
|
*/
|
|
293
273
|
protected _findById(command: SqbEntityService.FindOneCommand): Promise<PartialDTO<T> | undefined>;
|
|
294
274
|
/**
|
|
295
|
-
* Finds
|
|
275
|
+
* Finds the first record matching the command filter.
|
|
296
276
|
*
|
|
297
|
-
* @param command
|
|
298
|
-
* @
|
|
277
|
+
* @param command - The findOne command.
|
|
278
|
+
* @returns The found record, or `undefined` if not found.
|
|
299
279
|
* @protected
|
|
300
280
|
*/
|
|
301
281
|
protected _findOne(command: SqbEntityService.FindOneCommand): Promise<PartialDTO<T> | undefined>;
|
|
302
282
|
/**
|
|
303
|
-
* Finds
|
|
283
|
+
* Finds all records matching the command filter.
|
|
304
284
|
*
|
|
305
|
-
* @param command
|
|
306
|
-
* @
|
|
285
|
+
* @param command - The findMany command.
|
|
286
|
+
* @returns An array of matching records.
|
|
307
287
|
* @protected
|
|
308
288
|
*/
|
|
309
289
|
protected _findMany(command: SqbEntityService.FindManyCommand): Promise<PartialDTO<T>[]>;
|
|
310
290
|
/**
|
|
311
|
-
* Updates
|
|
291
|
+
* Updates the record identified by `command.documentId` and returns it.
|
|
312
292
|
*
|
|
313
|
-
* @param command
|
|
314
|
-
* @returns
|
|
293
|
+
* @param command - The update command.
|
|
294
|
+
* @returns The updated record, or `undefined` if not found.
|
|
315
295
|
* @protected
|
|
316
296
|
*/
|
|
317
297
|
protected _update(command: SqbEntityService.UpdateOneCommand<T>): Promise<PartialDTO<T> | undefined>;
|
|
318
298
|
/**
|
|
319
|
-
* Updates
|
|
299
|
+
* Updates the record identified by `command.documentId` without returning it.
|
|
320
300
|
*
|
|
321
|
-
* @param command
|
|
322
|
-
* @returns
|
|
301
|
+
* @param command - The updateOnly command.
|
|
302
|
+
* @returns The number of records modified.
|
|
323
303
|
* @protected
|
|
324
304
|
*/
|
|
325
305
|
protected _updateOnly(command: SqbEntityService.UpdateOneCommand<T>): Promise<number>;
|
|
326
306
|
/**
|
|
327
|
-
* Updates
|
|
307
|
+
* Updates all records matching the command filter.
|
|
328
308
|
*
|
|
329
|
-
* @param command
|
|
330
|
-
* @
|
|
309
|
+
* @param command - The updateMany command.
|
|
310
|
+
* @returns The number of records modified.
|
|
331
311
|
* @protected
|
|
332
312
|
*/
|
|
333
313
|
protected _updateMany(command: SqbEntityService.UpdateOneCommand<T>): Promise<number>;
|
|
334
314
|
/**
|
|
335
|
-
* Acquires a connection and performs Repository.create
|
|
315
|
+
* Acquires a connection and performs `Repository.create`.
|
|
336
316
|
*
|
|
337
|
-
* @param input - The document to insert
|
|
338
|
-
* @param options - Optional settings
|
|
317
|
+
* @param input - The document to insert.
|
|
318
|
+
* @param options - Optional settings.
|
|
339
319
|
* @protected
|
|
340
320
|
*/
|
|
341
321
|
protected _dbCreate(input: PartialDTO<T>, options?: Repository.CreateOptions): Promise<PartialDTO<T>>;
|
|
342
322
|
/**
|
|
343
|
-
* Acquires a connection and performs Repository.count
|
|
323
|
+
* Acquires a connection and performs `Repository.count`.
|
|
344
324
|
*
|
|
345
|
-
* @param options -
|
|
325
|
+
* @param options - Optional settings.
|
|
346
326
|
* @protected
|
|
347
327
|
*/
|
|
348
328
|
protected _dbCount(options?: Repository.CountOptions): Promise<number>;
|
|
349
329
|
/**
|
|
350
|
-
* Acquires a connection and performs Repository.delete
|
|
330
|
+
* Acquires a connection and performs `Repository.delete`.
|
|
351
331
|
*
|
|
352
|
-
* @param id -
|
|
353
|
-
* @param options - Optional settings
|
|
332
|
+
* @param id - The key field value identifying the record.
|
|
333
|
+
* @param options - Optional settings.
|
|
354
334
|
* @protected
|
|
355
335
|
*/
|
|
356
336
|
protected _dbDelete(id: SQBAdapter.IdOrIds, options?: Repository.DeleteOptions): Promise<number>;
|
|
357
337
|
/**
|
|
358
|
-
* Acquires a connection and performs Repository.deleteMany
|
|
338
|
+
* Acquires a connection and performs `Repository.deleteMany`.
|
|
359
339
|
*
|
|
360
|
-
* @param options - Optional settings
|
|
340
|
+
* @param options - Optional settings.
|
|
361
341
|
* @protected
|
|
362
342
|
*/
|
|
363
343
|
protected _dbDeleteMany(options?: Repository.DeleteManyOptions): Promise<number>;
|
|
364
344
|
/**
|
|
365
|
-
* Acquires a connection and performs Repository.exists
|
|
345
|
+
* Acquires a connection and performs `Repository.exists`.
|
|
366
346
|
*
|
|
367
|
-
* @param id -
|
|
368
|
-
* @param options - Optional settings
|
|
347
|
+
* @param id - The key field value identifying the record.
|
|
348
|
+
* @param options - Optional settings.
|
|
369
349
|
* @protected
|
|
370
350
|
*/
|
|
371
351
|
protected _dbExists(id: SQBAdapter.IdOrIds, options?: Repository.ExistsOptions): Promise<boolean>;
|
|
372
352
|
/**
|
|
373
|
-
* Acquires a connection and performs Repository.existsOne
|
|
353
|
+
* Acquires a connection and performs `Repository.existsOne`.
|
|
374
354
|
*
|
|
375
|
-
* @param options - Optional settings
|
|
355
|
+
* @param options - Optional settings.
|
|
376
356
|
* @protected
|
|
377
357
|
*/
|
|
378
358
|
protected _dbExistsOne(options?: Repository.ExistsOptions): Promise<boolean>;
|
|
379
359
|
/**
|
|
380
|
-
* Acquires a connection and performs Repository.findById
|
|
360
|
+
* Acquires a connection and performs `Repository.findById`.
|
|
381
361
|
*
|
|
382
|
-
* @param id -
|
|
383
|
-
* @param options - Optional settings
|
|
362
|
+
* @param id - The key field value identifying the record.
|
|
363
|
+
* @param options - Optional settings.
|
|
384
364
|
* @protected
|
|
385
365
|
*/
|
|
386
366
|
protected _dbFindById(id: SQBAdapter.IdOrIds, options?: Repository.FindOptions): Promise<PartialDTO<T> | undefined>;
|
|
387
367
|
/**
|
|
388
|
-
* Acquires a connection and performs Repository.findOne
|
|
368
|
+
* Acquires a connection and performs `Repository.findOne`.
|
|
389
369
|
*
|
|
390
|
-
* @param options - Optional settings
|
|
370
|
+
* @param options - Optional settings.
|
|
391
371
|
* @protected
|
|
392
372
|
*/
|
|
393
373
|
protected _dbFindOne(options?: StrictOmit<Repository.FindOneOptions, 'offset'> & {
|
|
394
374
|
skip?: number;
|
|
395
375
|
}): Promise<PartialDTO<T> | undefined>;
|
|
396
376
|
/**
|
|
397
|
-
* Acquires a connection and performs Repository.findMany
|
|
377
|
+
* Acquires a connection and performs `Repository.findMany`.
|
|
398
378
|
*
|
|
399
|
-
* @param options - Optional settings
|
|
379
|
+
* @param options - Optional settings.
|
|
400
380
|
* @protected
|
|
401
381
|
*/
|
|
402
382
|
protected _dbFindMany(options?: StrictOmit<Repository.FindManyOptions, 'offset'> & {
|
|
403
383
|
skip?: number;
|
|
404
384
|
}): Promise<PartialDTO<T>[]>;
|
|
405
385
|
/**
|
|
406
|
-
* Acquires a connection and performs Repository.update
|
|
386
|
+
* Acquires a connection and performs `Repository.update`.
|
|
407
387
|
*
|
|
408
|
-
* @param id -
|
|
409
|
-
* @param data - The update values
|
|
410
|
-
* @param options - Optional settings
|
|
388
|
+
* @param id - The key field value identifying the record.
|
|
389
|
+
* @param data - The update values.
|
|
390
|
+
* @param options - Optional settings.
|
|
411
391
|
* @protected
|
|
412
392
|
*/
|
|
413
393
|
protected _dbUpdate(id: SQBAdapter.IdOrIds, data: PatchDTO<T>, options?: Repository.UpdateOptions): Promise<PartialDTO<T> | undefined>;
|
|
414
394
|
/**
|
|
415
|
-
* Acquires a connection and performs Repository.updateOnly
|
|
395
|
+
* Acquires a connection and performs `Repository.updateOnly`.
|
|
416
396
|
*
|
|
417
|
-
* @param id -
|
|
418
|
-
* @param data - The update values
|
|
419
|
-
* @param options - Optional settings
|
|
397
|
+
* @param id - The key field value identifying the record.
|
|
398
|
+
* @param data - The update values.
|
|
399
|
+
* @param options - Optional settings.
|
|
420
400
|
* @protected
|
|
421
401
|
*/
|
|
422
402
|
protected _dbUpdateOnly(id: SQBAdapter.IdOrIds, data: PatchDTO<T>, options?: Repository.UpdateOptions): Promise<number>;
|
|
423
403
|
/**
|
|
424
|
-
* Acquires a connection and performs Repository.updateMany
|
|
404
|
+
* Acquires a connection and performs `Repository.updateMany`.
|
|
425
405
|
*
|
|
426
|
-
* @param data - The update values
|
|
427
|
-
* @param options - Optional settings
|
|
406
|
+
* @param data - The update values.
|
|
407
|
+
* @param options - Optional settings.
|
|
428
408
|
* @protected
|
|
429
409
|
*/
|
|
430
410
|
protected _dbUpdateMany(data: PatchDTO<T>, options?: Repository.UpdateManyOptions): Promise<number>;
|
|
431
411
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
412
|
+
* Builds the common filter for the given command.
|
|
413
|
+
* Used primarily for multi-tenant isolation and similar cross-cutting concerns.
|
|
434
414
|
*
|
|
435
415
|
* @protected
|
|
436
|
-
* @returns
|
|
437
|
-
* that resolves to the common filter, or undefined if not available.
|
|
416
|
+
* @returns The resolved filter input, or `undefined` if none is configured.
|
|
438
417
|
*/
|
|
439
418
|
protected _getCommonFilter(command: SqbEntityService.CommandInfo): SQBAdapter.FilterInput | Promise<SQBAdapter.FilterInput> | undefined;
|
|
440
419
|
protected _executeCommand(command: SqbEntityService.CommandInfo, commandFn: () => any): Promise<any>;
|