@cuboapp/api-backend 1.0.24 → 1.0.25

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.ts +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuboapp/api-backend",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Backend Api for CuboApp",
5
5
  "main": "src/index.ts",
6
6
  "repository": "git@github.com:cuboapp/api-backend.git",
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "dependencies": {
11
11
  "@cuboapp/constants": "^2.0.6",
12
- "@cuboapp/crdt": "1.0.2",
12
+ "@cuboapp/crdt": "1.0.5",
13
13
  "@cuboapp/database": "^1.0.3",
14
14
  "@cuboapp/types": "^2.0.11",
15
15
  "@cuboapp/utils": "1.0.9",
package/src/index.ts CHANGED
@@ -89,7 +89,9 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
89
89
  throw 'Имя документа обязательно: "name"'
90
90
  }
91
91
 
92
- console.log('open document', name)
92
+ if (this.options.crdt.debug) {
93
+ console.log('open document', name)
94
+ }
93
95
 
94
96
  try {
95
97
  const document = await this.crdt.getDocument(name)
@@ -181,7 +183,7 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
181
183
  if (!['limit', 'with'].includes(key)) {
182
184
  const [formula, str] = `${value}`.split(':')
183
185
 
184
- console.log({ formula, str, value: row[key] })
186
+ // console.log({ formula, str, value: row[key] })
185
187
 
186
188
  if (!str) {
187
189
  if (row[key] !== value) {
@@ -240,7 +242,7 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown>
240
242
  // filterCheck
241
243
  // })
242
244
 
243
- if (needCrdtPush) {
245
+ if (needCrdtPush && data?.length) {
244
246
  client.send(JSON.stringify({ method: 'message', event: `crdt:update:${entityAlias}:${id}`, data: Array.from(data) }))
245
247
  }
246
248