proto.io 0.0.171 → 0.0.172

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.
@@ -1,5 +1,5 @@
1
- import { T as TSchema, P as ProtoService } from '../../internals/index-BB2vDnq0.js';
2
- import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-B5u7VXjz.js';
1
+ import { T as TSchema, P as ProtoService } from '../../internals/index-BhWRmBiq.js';
2
+ import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-K0jhERvZ.js';
3
3
  import '@o2ter/utils-js';
4
4
  import 'jsonwebtoken';
5
5
  import '@o2ter/server-js';
@@ -1,5 +1,5 @@
1
- import { P as ProtoService } from '../../internals/index-BB2vDnq0.js';
2
- import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-B5u7VXjz.js';
1
+ import { P as ProtoService } from '../../internals/index-BhWRmBiq.js';
2
+ import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-K0jhERvZ.js';
3
3
  import '@o2ter/utils-js';
4
4
  import 'jsonwebtoken';
5
5
  import '@o2ter/server-js';
@@ -1,7 +1,7 @@
1
1
  import * as _google_cloud_storage from '@google-cloud/storage';
2
2
  import { Storage } from '@google-cloud/storage';
3
- import { P as ProtoService } from '../../internals/index-BB2vDnq0.js';
4
- import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-B5u7VXjz.js';
3
+ import { P as ProtoService } from '../../internals/index-BhWRmBiq.js';
4
+ import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-K0jhERvZ.js';
5
5
  import '@o2ter/utils-js';
6
6
  import 'jsonwebtoken';
7
7
  import '@o2ter/server-js';
@@ -1,5 +1,5 @@
1
1
  import { Pool, PoolClient, PoolConfig } from 'pg';
2
- import { _ as _TValue, o as EventData, T as TSchema, Q as QuerySelector, p as DecodedQuery, F as FindOptions, R as RelationOptions, q as DecodedSortOption, I as InsertOptions, r as TValue, t as FindOneOptions, u as TUpdateOp, v as FieldSelectorExpression, w as QueryExpression, x as TStorage, y as TransactionOptions, h as TObject, z as TQueryRandomOptions, A as TPubSub } from '../../internals/index-BB2vDnq0.js';
2
+ import { _ as _TValue, o as EventData, T as TSchema, Q as QuerySelector, p as DecodedQuery, F as FindOptions, R as RelationOptions, q as DecodedSortOption, I as InsertOptions, r as TValue, t as FindOneOptions, u as TUpdateOp, v as FieldSelectorExpression, w as QueryExpression, x as TStorage, y as TransactionOptions, h as TObject, z as TQueryRandomOptions, A as TPubSub } from '../../internals/index-BhWRmBiq.js';
3
3
  import * as _o2ter_utils_js from '@o2ter/utils-js';
4
4
  import { asyncStream } from '@o2ter/utils-js';
5
5
  import 'jsonwebtoken';
@@ -2108,7 +2108,9 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2108
2108
  break;
2109
2109
  if (_.isNil(expr.value))
2110
2110
  return sql `${element} IS NULL`;
2111
- if (!_.isString(dataType) && dataType?.type === 'pointer' && expr.value instanceof index.TObject && expr.value.objectId) {
2111
+ if (!_.isString(dataType) && dataType?.type === 'pointer') {
2112
+ if (!(expr.value instanceof index.TObject) || dataType.target !== expr.value.className || !expr.value.objectId)
2113
+ break;
2112
2114
  return sql `${element} ${nullSafeEqual()} ${{ value: expr.value.objectId }}`;
2113
2115
  }
2114
2116
  return sql `${element} ${nullSafeEqual()} ${encodeValue(expr.value)}`;
@@ -2119,7 +2121,9 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2119
2121
  break;
2120
2122
  if (_.isNil(expr.value))
2121
2123
  return sql `${element} IS NOT NULL`;
2122
- if (!_.isString(dataType) && dataType?.type === 'pointer' && expr.value instanceof index.TObject && expr.value.objectId) {
2124
+ if (!_.isString(dataType) && dataType?.type === 'pointer') {
2125
+ if (!(expr.value instanceof index.TObject) || dataType.target !== expr.value.className || !expr.value.objectId)
2126
+ break;
2123
2127
  return sql `${element} ${nullSafeNotEqual()} ${{ value: expr.value.objectId }}`;
2124
2128
  }
2125
2129
  return sql `${element} ${nullSafeNotEqual()} ${encodeValue(expr.value)}`;
@@ -2195,7 +2199,7 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2195
2199
  if (!_.isString(dataType) && dataType?.type === 'pointer') {
2196
2200
  if (_.isNil(value))
2197
2201
  return sql `${element} IS NULL`;
2198
- if (!(value instanceof index.TObject) || !value.objectId)
2202
+ if (!(value instanceof index.TObject) || dataType.target !== value.className || !value.objectId)
2199
2203
  break;
2200
2204
  return sql `${element} ${nullSafeEqual()} ${{ value: value.objectId }}`;
2201
2205
  }
@@ -2205,7 +2209,7 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2205
2209
  const containsNil = _.some(expr.value, x => _.isNil(x));
2206
2210
  const values = _.filter(expr.value, x => !_.isNil(x));
2207
2211
  if (!_.isString(dataType) && dataType?.type === 'pointer') {
2208
- if (!_.every(values, x => x instanceof index.TObject && x.objectId))
2212
+ if (!_.every(values, x => x instanceof index.TObject && dataType.target === x.className && x.objectId))
2209
2213
  break;
2210
2214
  if (containsNil) {
2211
2215
  return sql `${element} IS NULL OR ${element} IN (${_.map(values, (x) => sql `${{ value: x.objectId }}`)})`;
@@ -2231,7 +2235,7 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2231
2235
  if (!_.isString(dataType) && dataType?.type === 'pointer') {
2232
2236
  if (_.isNil(value))
2233
2237
  return sql `${element} IS NOT NULL`;
2234
- if (!(value instanceof index.TObject) || !value.objectId)
2238
+ if (!(value instanceof index.TObject) || dataType.target !== value.className || !value.objectId)
2235
2239
  break;
2236
2240
  return sql `${element} ${nullSafeNotEqual()} ${{ value: value.objectId }}`;
2237
2241
  }
@@ -2241,7 +2245,7 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2241
2245
  const containsNil = _.some(expr.value, x => _.isNil(x));
2242
2246
  const values = _.filter(expr.value, x => !_.isNil(x));
2243
2247
  if (!_.isString(dataType) && dataType?.type === 'pointer') {
2244
- if (!_.every(values, x => x instanceof index.TObject && x.objectId))
2248
+ if (!_.every(values, x => x instanceof index.TObject && dataType.target === x.className && x.objectId))
2245
2249
  break;
2246
2250
  if (containsNil) {
2247
2251
  return sql `${element} IS NOT NULL AND ${element} NOT IN (${_.map(values, (x) => sql `${{ value: x.objectId }}`)})`;
@@ -2276,7 +2280,7 @@ const encodeFieldExpression = (compiler, parent, field, expr) => {
2276
2280
  return sql `${element} ${{ literal: op }} ${{ value: index._encodeValue(expr.value) }}`;
2277
2281
  }
2278
2282
  if (relation && parent.className) {
2279
- if (!_.every(expr.value, x => x instanceof index.TObject && x.objectId))
2283
+ if (!_.every(expr.value, x => x instanceof index.TObject && relation.target === x.className && x.objectId))
2280
2284
  break;
2281
2285
  const tempName = `_populate_expr_$${compiler.nextIdx()}`;
2282
2286
  const populate = _selectRelationPopulate(compiler, { className: parent.className, name: parent.name }, relation.populate, `$${field}`, false);