@lowdefy/operators-mql 6.1.0 → 7.0.0

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.
@@ -112,4 +112,18 @@ function mql({ params, location, methodName }) {
112
112
  });
113
113
  }
114
114
  mql.dynamic = false;
115
+ // mingo evaluates $$NOW to the current time, and $rand and $sample are random. Only the pipeline,
116
+ // expression or query is scanned, never the data it runs on.
117
+ mql.tracking = ({ methodName, params })=>{
118
+ const argName = {
119
+ aggregate: 'pipeline',
120
+ expr: 'expr',
121
+ test: 'test'
122
+ }[methodName];
123
+ const arg = type.isArray(params) ? params[1] : params?.[argName];
124
+ const volatile = /\$\$NOW|\$\$CLUSTER_TIME|\$rand\b|\$sample/.test(JSON.stringify(arg) ?? '');
125
+ return {
126
+ kind: volatile ? 'volatile' : 'pure'
127
+ };
128
+ };
115
129
  export default mql;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/operators-mql",
3
- "version": "6.1.0",
3
+ "version": "7.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -27,6 +27,9 @@
27
27
  "url": "https://github.com/lowdefy/lowdefy.git"
28
28
  },
29
29
  "type": "module",
30
+ "sideEffects": [
31
+ "**/*.css"
32
+ ],
30
33
  "exports": {
31
34
  "./operators/client": "./dist/operatorsClient.js",
32
35
  "./operators/server": "./dist/operatorsServer.js",
@@ -37,12 +40,12 @@
37
40
  "dist/*"
38
41
  ],
39
42
  "dependencies": {
40
- "@lowdefy/helpers": "6.1.0",
41
- "@lowdefy/operators": "6.1.0",
43
+ "@lowdefy/helpers": "7.0.0",
44
+ "@lowdefy/operators": "7.0.0",
42
45
  "mingo": "7.2.1"
43
46
  },
44
47
  "devDependencies": {
45
- "@lowdefy/node-utils": "6.1.0",
48
+ "@lowdefy/node-utils": "7.0.0",
46
49
  "@swc/cli": "0.8.1",
47
50
  "@swc/core": "1.15.32",
48
51
  "@swc/jest": "0.2.39",