@opra/sqb 1.0.0-alpha.29 → 1.0.0-alpha.30
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/cjs/sqb-adapter.js
CHANGED
|
@@ -9,7 +9,7 @@ var SQBAdapter;
|
|
|
9
9
|
SQBAdapter.parseFilter = parse_filter_js_1.default;
|
|
10
10
|
async function parseRequest(context) {
|
|
11
11
|
const { operation } = context;
|
|
12
|
-
if (operation
|
|
12
|
+
if (operation?.composition?.startsWith('Entity.') && operation.compositionOptions?.type) {
|
|
13
13
|
const dataType = context.document.node.getComplexType(operation.compositionOptions?.type);
|
|
14
14
|
const entityMetadata = connect_1.EntityMetadata.get(dataType.ctor);
|
|
15
15
|
if (!entityMetadata)
|
|
@@ -19,7 +19,7 @@ class SqbSingletonService extends sqb_entity_service_js_1.SqbEntityService {
|
|
|
19
19
|
*/
|
|
20
20
|
constructor(dataType, options) {
|
|
21
21
|
super(dataType, options);
|
|
22
|
-
this.id =
|
|
22
|
+
this.id = options?.id || 1;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Asserts the existence of a resource based on the given options.
|
package/esm/sqb-adapter.js
CHANGED
|
@@ -5,7 +5,7 @@ export var SQBAdapter;
|
|
|
5
5
|
SQBAdapter.parseFilter = _parseFilter;
|
|
6
6
|
async function parseRequest(context) {
|
|
7
7
|
const { operation } = context;
|
|
8
|
-
if (operation
|
|
8
|
+
if (operation?.composition?.startsWith('Entity.') && operation.compositionOptions?.type) {
|
|
9
9
|
const dataType = context.document.node.getComplexType(operation.compositionOptions?.type);
|
|
10
10
|
const entityMetadata = EntityMetadata.get(dataType.ctor);
|
|
11
11
|
if (!entityMetadata)
|
|
@@ -16,7 +16,7 @@ export class SqbSingletonService extends SqbEntityService {
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(dataType, options) {
|
|
18
18
|
super(dataType, options);
|
|
19
|
-
this.id =
|
|
19
|
+
this.id = options?.id || 1;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Asserts the existence of a resource based on the given options.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/sqb",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.30",
|
|
4
4
|
"description": "Opra SQB adapter package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,18 +28,19 @@
|
|
|
28
28
|
"clean:cover": "rimraf ../../coverage/client"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"reflect-metadata": "^0.2.2"
|
|
31
|
+
"reflect-metadata": "^0.2.2",
|
|
32
|
+
"tslib": "^2.6.3"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@faker-js/faker": "^8.4.1",
|
|
35
36
|
"@sqb/builder": "^4.14.0",
|
|
36
37
|
"@sqb/connect": "^4.14.0",
|
|
37
38
|
"@sqb/postgres": "^4.14.0",
|
|
38
|
-
"postgrejs": "^2.15.
|
|
39
|
+
"postgrejs": "^2.15.4",
|
|
39
40
|
"ts-gems": "^3.4.0"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
|
-
"@opra/core": "^1.0.0-alpha.
|
|
43
|
+
"@opra/core": "^1.0.0-alpha.30",
|
|
43
44
|
"@sqb/connect": ">= 4.10.6"
|
|
44
45
|
},
|
|
45
46
|
"type": "module",
|
|
@@ -150,7 +150,7 @@ export interface SqbEntityService {
|
|
|
150
150
|
*/
|
|
151
151
|
export declare class SqbEntityService<T extends object = object> extends ServiceBase {
|
|
152
152
|
protected _dataType_: Type | string;
|
|
153
|
-
protected _dataType
|
|
153
|
+
protected _dataType?: ComplexType;
|
|
154
154
|
protected _dataTypeClass?: Type;
|
|
155
155
|
protected _entityMetadata?: EntityMetadata;
|
|
156
156
|
protected _inputCodecs: Record<string, IsObject.Validator<T>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ColumnFieldMetadata } from '@sqb/connect';
|
|
2
1
|
import { PartialDTO, PatchDTO, Type } from 'ts-gems';
|
|
3
2
|
import { SQBAdapter } from './sqb-adapter.js';
|
|
4
3
|
import { SqbEntityService } from './sqb-entity-service.js';
|
|
@@ -57,7 +56,6 @@ export declare namespace SqbSingletonService {
|
|
|
57
56
|
* @template T - The data type class type of the resource
|
|
58
57
|
*/
|
|
59
58
|
export declare abstract class SqbSingletonService<T extends object = object> extends SqbEntityService {
|
|
60
|
-
protected _primaryKeyFields?: ColumnFieldMetadata[];
|
|
61
59
|
/**
|
|
62
60
|
* Represents a unique identifier for singleton record
|
|
63
61
|
* @property {SQBAdapter.IdOrIds}
|