@opra/sqb 0.26.4 → 0.26.5

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.
@@ -15,7 +15,7 @@ var SQBAdapter;
15
15
  function transformRequest(request) {
16
16
  const { resource } = request;
17
17
  if (resource instanceof common_1.Collection || resource instanceof common_1.Singleton) {
18
- const { params, operation } = request;
18
+ const { params, endpoint } = request;
19
19
  let options = {};
20
20
  const entityMetadata = connect_1.EntityMetadata.get(resource.type.ctor);
21
21
  if (!entityMetadata)
@@ -27,6 +27,7 @@ var SQBAdapter;
27
27
  if (primaryKeys.sort().join() !== [...resource.primaryKey].sort().join())
28
28
  throw new Error('Resource primaryKey definition differs from SQB Entity primaryKey definition');
29
29
  }
30
+ const operation = endpoint.name;
30
31
  if (operation === 'create' || operation === 'update' ||
31
32
  operation === 'get' || operation === 'findMany') {
32
33
  options.pick = params?.pick;
@@ -11,7 +11,7 @@ export var SQBAdapter;
11
11
  function transformRequest(request) {
12
12
  const { resource } = request;
13
13
  if (resource instanceof Collection || resource instanceof Singleton) {
14
- const { params, operation } = request;
14
+ const { params, endpoint } = request;
15
15
  let options = {};
16
16
  const entityMetadata = EntityMetadata.get(resource.type.ctor);
17
17
  if (!entityMetadata)
@@ -23,6 +23,7 @@ export var SQBAdapter;
23
23
  if (primaryKeys.sort().join() !== [...resource.primaryKey].sort().join())
24
24
  throw new Error('Resource primaryKey definition differs from SQB Entity primaryKey definition');
25
25
  }
26
+ const operation = endpoint.name;
26
27
  if (operation === 'create' || operation === 'update' ||
27
28
  operation === 'get' || operation === 'findMany') {
28
29
  options.pick = params?.pick;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/sqb",
3
- "version": "0.26.4",
3
+ "version": "0.26.5",
4
4
  "description": "Opra SQB adapter package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "ts-gems": "^2.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@opra/core": "^0.26.4",
40
+ "@opra/core": "^0.26.5",
41
41
  "@sqb/connect": ">= 4.9.0"
42
42
  },
43
43
  "type": "module",