@opra/sqb 1.0.0-alpha.38 → 1.0.0-alpha.39

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/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@opra/sqb",
3
- "version": "1.0.0-alpha.38",
3
+ "version": "1.0.0-alpha.39",
4
4
  "description": "Opra SQB adapter package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
8
  "reflect-metadata": "^0.2.2",
9
- "tslib": "^2.6.3",
9
+ "tslib": "^2.7.0",
10
10
  "valgen": "^5.9.0"
11
11
  },
12
12
  "peerDependencies": {
13
- "@opra/core": "^1.0.0-alpha.38",
13
+ "@opra/core": "^1.0.0-alpha.39",
14
14
  "@sqb/connect": ">= 4.10.6"
15
15
  },
16
16
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { PartialDTO, PatchDTO, RequiredSome, Type } from 'ts-gems';
1
+ import type { PartialDTO, PatchDTO, RequiredSome, Type } from 'ts-gems';
2
2
  import { SQBAdapter } from './sqb-adapter.js';
3
3
  import { SqbEntityService } from './sqb-entity-service.js';
4
4
  /**
@@ -1,8 +1,8 @@
1
1
  import { ComplexType } from '@opra/common';
2
2
  import { HttpContext, ServiceBase } from '@opra/core';
3
3
  import { EntityMetadata, Repository, SqbClient, SqbConnection } from '@sqb/connect';
4
- import { Nullish, PartialDTO, PatchDTO, RequiredSome, StrictOmit, Type } from 'ts-gems';
5
- import { IsObject } from 'valgen';
4
+ import type { Nullish, PartialDTO, PatchDTO, RequiredSome, StrictOmit, Type } from 'ts-gems';
5
+ import { type IsObject } from 'valgen';
6
6
  import { SQBAdapter } from './sqb-adapter.js';
7
7
  /**
8
8
  * @namespace SqbEntityService
@@ -95,8 +95,9 @@ export declare namespace SqbEntityService {
95
95
  */
96
96
  interface UpdateManyOptions extends Repository.UpdateManyOptions {
97
97
  }
98
- interface CreateCommand extends StrictOmit<RequiredSome<CommandInfo, 'input'>, 'documentId'> {
98
+ interface CreateCommand<T> extends StrictOmit<RequiredSome<CommandInfo, 'input'>, 'documentId'> {
99
99
  crud: 'create';
100
+ input: PatchDTO<T>;
100
101
  options?: CreateOptions;
101
102
  }
102
103
  interface CountCommand extends StrictOmit<CommandInfo, 'documentId' | 'input'> {
@@ -229,7 +230,7 @@ export declare class SqbEntityService<T extends object = object> extends Service
229
230
  * @returns - A promise that resolves to the created resource
230
231
  * @protected
231
232
  */
232
- protected _create(command: SqbEntityService.CreateCommand): Promise<PartialDTO<T>>;
233
+ protected _create(command: SqbEntityService.CreateCommand<T>): Promise<PartialDTO<T>>;
233
234
  /**
234
235
  * Returns the count of records based on the provided options
235
236
  *
@@ -428,12 +429,12 @@ export declare class SqbEntityService<T extends object = object> extends Service
428
429
  */
429
430
  protected _getCommonFilter(command: SqbEntityService.CommandInfo): SQBAdapter.FilterInput | Promise<SQBAdapter.FilterInput> | undefined;
430
431
  protected _executeCommand(command: SqbEntityService.CommandInfo, commandFn: () => any): Promise<any>;
431
- protected _beforeCreate(command: SqbEntityService.CreateCommand): Promise<void>;
432
+ protected _beforeCreate(command: SqbEntityService.CreateCommand<T>): Promise<void>;
432
433
  protected _beforeUpdate(command: SqbEntityService.UpdateOneCommand<T>): Promise<void>;
433
434
  protected _beforeUpdateMany(command: SqbEntityService.UpdateManyCommand<T>): Promise<void>;
434
435
  protected _beforeDelete(command: SqbEntityService.DeleteOneCommand): Promise<void>;
435
436
  protected _beforeDeleteMany(command: SqbEntityService.DeleteManyCommand): Promise<void>;
436
- protected _afterCreate(command: SqbEntityService.CreateCommand, result: PartialDTO<T>): Promise<void>;
437
+ protected _afterCreate(command: SqbEntityService.CreateCommand<T>, result: PartialDTO<T>): Promise<void>;
437
438
  protected _afterUpdate(command: SqbEntityService.UpdateOneCommand<T>, result?: PartialDTO<T>): Promise<void>;
438
439
  protected _afterUpdateMany(command: SqbEntityService.UpdateManyCommand<T>, affected: number): Promise<void>;
439
440
  protected _afterDelete(command: SqbEntityService.DeleteOneCommand, affected: number): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { PartialDTO, PatchDTO, RequiredSome, Type } from 'ts-gems';
1
+ import type { PartialDTO, PatchDTO, RequiredSome, Type } from 'ts-gems';
2
2
  import { SQBAdapter } from './sqb-adapter.js';
3
3
  import { SqbEntityService } from './sqb-entity-service.js';
4
4
  /**