@dxos/compute 0.8.4-main.c1de068 → 0.8.4-main.fd6878d
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/dist/lib/browser/{chunk-AURNYRCC.mjs → chunk-X2FWMHD4.mjs} +32 -3
- package/dist/lib/browser/{chunk-AURNYRCC.mjs.map → chunk-X2FWMHD4.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +4 -1
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node-esm/{chunk-DZMSWKOY.mjs → chunk-RP7HSSCA.mjs} +32 -3
- package/dist/lib/node-esm/{chunk-DZMSWKOY.mjs.map → chunk-RP7HSSCA.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +4 -1
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/types/src/compute-graph-registry.d.ts +1 -1
- package/dist/types/src/compute-graph-registry.d.ts.map +1 -1
- package/dist/types/src/compute-graph.d.ts.map +1 -1
- package/dist/types/src/functions/async-function.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -20
- package/src/compute-graph-registry.ts +1 -1
- package/src/compute-graph.ts +3 -3
- package/src/functions/async-function.ts +2 -2
- package/src/hyperformula.test.ts +1 -1
- package/src/types/types.test.ts +2 -2
|
@@ -79,6 +79,9 @@ import { Event } from "@dxos/async";
|
|
|
79
79
|
import { Resource } from "@dxos/context";
|
|
80
80
|
import { DetailedCellError as DetailedCellError2 } from "#hyperformula";
|
|
81
81
|
var ComputeNode = class extends Resource {
|
|
82
|
+
_graph;
|
|
83
|
+
sheetId;
|
|
84
|
+
update;
|
|
82
85
|
constructor(_graph, sheetId) {
|
|
83
86
|
super(), this._graph = _graph, this.sheetId = sheetId, this.update = new Event();
|
|
84
87
|
}
|
|
@@ -120,7 +123,7 @@ var ComputeNode = class extends Resource {
|
|
|
120
123
|
import defaultsDeep from "lodash.defaultsdeep";
|
|
121
124
|
import { debounce } from "@dxos/async";
|
|
122
125
|
import { log } from "@dxos/log";
|
|
123
|
-
import { CellError,
|
|
126
|
+
import { CellError, EmptyValue, ErrorType, FunctionPlugin } from "#hyperformula";
|
|
124
127
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/core/compute/src/functions/async-function.ts";
|
|
125
128
|
var defaultFunctionContextOptions = {
|
|
126
129
|
defaultTtl: 5e3,
|
|
@@ -128,6 +131,8 @@ var defaultFunctionContextOptions = {
|
|
|
128
131
|
remoteFunctionUrl: "https://edge.dxos.workers.dev/functions"
|
|
129
132
|
};
|
|
130
133
|
var FunctionContext = class _FunctionContext {
|
|
134
|
+
_hf;
|
|
135
|
+
_space;
|
|
131
136
|
// Mangle name with params.
|
|
132
137
|
static createInvocationKey(name, ...args) {
|
|
133
138
|
return JSON.stringify({
|
|
@@ -135,6 +140,18 @@ var FunctionContext = class _FunctionContext {
|
|
|
135
140
|
...args
|
|
136
141
|
});
|
|
137
142
|
}
|
|
143
|
+
// TODO(wittjosiah): Persist cached values.
|
|
144
|
+
// Cached values for cell.
|
|
145
|
+
_cache;
|
|
146
|
+
// Active requests.
|
|
147
|
+
_pending;
|
|
148
|
+
// Query subscriptions.
|
|
149
|
+
_subscriptions;
|
|
150
|
+
// Invocation count.
|
|
151
|
+
_invocations;
|
|
152
|
+
_options;
|
|
153
|
+
// Debounced update handler.
|
|
154
|
+
_onUpdate;
|
|
138
155
|
constructor(_hf, _space, _options) {
|
|
139
156
|
this._hf = _hf;
|
|
140
157
|
this._space = _space;
|
|
@@ -2795,6 +2812,17 @@ var parseSheetName = (name) => {
|
|
|
2795
2812
|
};
|
|
2796
2813
|
};
|
|
2797
2814
|
var ComputeGraph = class extends Resource2 {
|
|
2815
|
+
_hf;
|
|
2816
|
+
_space;
|
|
2817
|
+
_options;
|
|
2818
|
+
id;
|
|
2819
|
+
// Map of nodes indexed by sheet number.
|
|
2820
|
+
_nodes;
|
|
2821
|
+
// Cached function objects.
|
|
2822
|
+
_remoteFunctions;
|
|
2823
|
+
update;
|
|
2824
|
+
// The context is passed to all functions.
|
|
2825
|
+
context;
|
|
2798
2826
|
constructor(_hf, _space, _options) {
|
|
2799
2827
|
super(), this._hf = _hf, this._space = _space, this._options = _options, this.id = `graph-${PublicKey.random().truncate()}`, this._nodes = /* @__PURE__ */ new Map(), this._remoteFunctions = [], this.update = new Event2();
|
|
2800
2828
|
this.context = new FunctionContext(this._hf, this._space, {
|
|
@@ -2997,11 +3025,12 @@ var defaultPlugins = [
|
|
|
2997
3025
|
}
|
|
2998
3026
|
];
|
|
2999
3027
|
var ComputeGraphRegistry = class extends Resource3 {
|
|
3028
|
+
_graphs = /* @__PURE__ */ new Map();
|
|
3029
|
+
_options;
|
|
3000
3030
|
constructor(options = {
|
|
3001
3031
|
plugins: defaultPlugins
|
|
3002
3032
|
}) {
|
|
3003
3033
|
super();
|
|
3004
|
-
this._graphs = /* @__PURE__ */ new Map();
|
|
3005
3034
|
this._options = defaultsDeep2({}, options, defaultOptions);
|
|
3006
3035
|
this._options.plugins?.forEach(({ plugin, translations }) => {
|
|
3007
3036
|
HyperFormula.registerFunctionPlugin(plugin, translations);
|
|
@@ -3075,4 +3104,4 @@ export {
|
|
|
3075
3104
|
defaultPlugins,
|
|
3076
3105
|
ComputeGraphRegistry
|
|
3077
3106
|
};
|
|
3078
|
-
//# sourceMappingURL=chunk-
|
|
3107
|
+
//# sourceMappingURL=chunk-X2FWMHD4.mjs.map
|