@dxos/functions 0.3.8-next.f4e0086 → 0.3.8

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 +1 @@
1
- {"inputs":{"packages/core/functions/src/handler.ts":{"bytes":1109,"imports":[],"format":"esm"},"packages/core/functions/src/manifest.ts":{"bytes":1358,"imports":[],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":15536,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"portfinder","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/trigger-manager.ts":{"bytes":17315,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":584,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/trigger-manager.ts","kind":"import-statement","original":"./trigger-manager"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":637,"imports":[{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/manifest.ts","kind":"import-statement","original":"./manifest"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"./runtime"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15421},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"portfinder","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DevServer","TriggerManager"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":3815},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/trigger-manager.ts":{"bytesInOutput":4642}},"bytes":9049}}}
1
+ {"inputs":{"packages/core/functions/src/handler.ts":{"bytes":1308,"imports":[],"format":"esm"},"packages/core/functions/src/manifest.ts":{"bytes":1730,"imports":[],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":18548,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":16636,"imports":[{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":561,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":632,"imports":[{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/manifest.ts","kind":"import-statement","original":"./manifest"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"./runtime"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16609},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DevServer","Scheduler"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":4734},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":4184}},"bytes":9499}}}
@@ -26,64 +26,67 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/core/functions/src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
29
+ var node_exports = {};
30
+ __export(node_exports, {
33
31
  DevServer: () => DevServer,
34
- TriggerManager: () => TriggerManager
32
+ Scheduler: () => Scheduler
35
33
  });
36
- module.exports = __toCommonJS(src_exports);
37
-
38
- // packages/core/functions/src/runtime/dev-server.ts
34
+ module.exports = __toCommonJS(node_exports);
39
35
  var import_express = __toESM(require("express"));
36
+ var import_get_port_please = require("get-port-please");
40
37
  var import_node_path = require("node:path");
41
- var import_portfinder = require("portfinder");
42
38
  var import_async = require("@dxos/async");
39
+ var import_invariant = require("@dxos/invariant");
43
40
  var import_log = require("@dxos/log");
44
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/functions/src/runtime/dev-server.ts";
45
- var DEFAULT_PORT = 7001;
41
+ var import_cron = require("cron");
42
+ var import_async2 = require("@dxos/async");
43
+ var import_context = require("@dxos/context");
44
+ var import_echo_schema = require("@dxos/echo-schema");
45
+ var import_invariant2 = require("@dxos/invariant");
46
+ var import_log2 = require("@dxos/log");
47
+ var import_util = require("@dxos/util");
48
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
49
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
50
+ }) : x)(function(x) {
51
+ if (typeof require !== "undefined")
52
+ return require.apply(this, arguments);
53
+ throw Error('Dynamic require of "' + x + '" is not supported');
54
+ });
55
+ var __dxlog_file = "/home/circleci/project/packages/core/functions/src/runtime/dev-server.ts";
46
56
  var DevServer = class {
47
57
  // prettier-ignore
48
58
  constructor(_client, _options) {
49
59
  this._client = _client;
50
60
  this._options = _options;
51
61
  this._handlers = {};
52
- }
53
- get port() {
54
- return this._port;
62
+ this._seq = 0;
55
63
  }
56
64
  get endpoint() {
57
- return this._port ? `http://localhost:${this._port}` : void 0;
65
+ (0, import_invariant.invariant)(this._port, void 0, {
66
+ F: __dxlog_file,
67
+ L: 45,
68
+ S: this,
69
+ A: [
70
+ "this._port",
71
+ ""
72
+ ]
73
+ });
74
+ return `http://localhost:${this._port}`;
75
+ }
76
+ get proxy() {
77
+ return this._proxy;
58
78
  }
59
79
  get functions() {
60
80
  return Object.values(this._handlers);
61
81
  }
62
82
  async initialize() {
63
83
  for (const def of this._options.manifest.functions) {
64
- const { id, endpoint, handler: path } = def;
65
84
  try {
66
- const module2 = require((0, import_node_path.join)(this._options.directory, path));
67
- const handler = module2.default;
68
- if (typeof handler !== "function") {
69
- throw new Error(`Handler must export default function: ${id}`);
70
- }
71
- if (this._handlers[endpoint]) {
72
- import_log.log.warn(`Function already registered: ${id}`, void 0, {
73
- F: __dxlog_file,
74
- L: 64,
75
- S: this,
76
- C: (f, a) => f(...a)
77
- });
78
- }
79
- this._handlers[endpoint] = {
80
- def,
81
- handler
82
- };
85
+ await this._load(def);
83
86
  } catch (err) {
84
87
  import_log.log.error("parsing function (check manifest)", err, {
85
88
  F: __dxlog_file,
86
- L: 69,
89
+ L: 62,
87
90
  S: this,
88
91
  C: (f, a) => f(...a)
89
92
  });
@@ -93,66 +96,55 @@ var DevServer = class {
93
96
  async start() {
94
97
  const app = (0, import_express.default)();
95
98
  app.use(import_express.default.json());
96
- app.post("/:endpoint", async (req, res) => {
97
- const { endpoint } = req.params;
98
- const response = {
99
- status: (code) => {
100
- res.statusCode = code;
101
- return response;
102
- },
103
- succeed: (result = {}) => {
104
- res.end(JSON.stringify(result));
105
- return response;
106
- }
107
- };
108
- const context = {
109
- client: this._client,
110
- status: response.status.bind(response)
111
- };
112
- void (async () => {
113
- try {
114
- (0, import_log.log)("invoking", {
115
- endpoint
116
- }, {
117
- F: __dxlog_file,
118
- L: 100,
119
- S: this,
120
- C: (f, a) => f(...a)
121
- });
122
- const { handler } = this._handlers[endpoint];
123
- const response2 = await handler({
124
- context,
125
- event: req.body
126
- });
127
- (0, import_log.log)("done", {
128
- response: response2
129
- }, {
130
- F: __dxlog_file,
131
- L: 103,
132
- S: this,
133
- C: (f, a) => f(...a)
134
- });
135
- } catch (err) {
136
- res.statusCode = 500;
137
- res.end(err.message);
99
+ app.post("/:name", async (req, res) => {
100
+ const { name } = req.params;
101
+ try {
102
+ if (this._options.reload) {
103
+ const { def } = this._handlers[name];
104
+ await this._load(def, true);
138
105
  }
139
- })();
106
+ res.statusCode = await this._invoke(name, req.body);
107
+ res.end();
108
+ } catch (err) {
109
+ import_log.log.error(err, void 0, {
110
+ F: __dxlog_file,
111
+ L: 82,
112
+ S: this,
113
+ C: (f, a) => f(...a)
114
+ });
115
+ res.statusCode = 500;
116
+ res.end();
117
+ }
140
118
  });
141
- this._port = await (0, import_portfinder.getPortPromise)({
142
- startPort: DEFAULT_PORT
119
+ this._port = await (0, import_get_port_please.getPort)({
120
+ port: 7200,
121
+ portRange: [
122
+ 7200,
123
+ 7299
124
+ ]
143
125
  });
144
126
  this._server = app.listen(this._port);
145
127
  try {
146
- const { registrationId } = await this._client.services.services.FunctionRegistryService.register({
128
+ const { registrationId, endpoint } = await this._client.services.services.FunctionRegistryService.register({
147
129
  endpoint: this.endpoint,
148
- functions: this.functions.map(({ def: { endpoint } }) => ({
149
- name: endpoint
130
+ functions: this.functions.map(({ def: { name } }) => ({
131
+ name
150
132
  }))
151
133
  });
134
+ import_log.log.info("registered", {
135
+ registrationId,
136
+ endpoint
137
+ }, {
138
+ F: __dxlog_file,
139
+ L: 98,
140
+ S: this,
141
+ C: (f, a) => f(...a)
142
+ });
152
143
  this._registrationId = registrationId;
144
+ this._proxy = endpoint;
153
145
  } catch (err) {
154
146
  await this.stop();
155
- throw new Error("FunctionRegistryService not available; check config (agent.plugins.functions).");
147
+ throw new Error("FunctionRegistryService not available (check plugin is configured).");
156
148
  }
157
149
  }
158
150
  async stop() {
@@ -162,31 +154,101 @@ var DevServer = class {
162
154
  await this._client.services.services.FunctionRegistryService.unregister({
163
155
  registrationId: this._registrationId
164
156
  });
157
+ import_log.log.info("unregistered", {
158
+ registrationId: this._registrationId
159
+ }, {
160
+ F: __dxlog_file,
161
+ L: 115,
162
+ S: this,
163
+ C: (f, a) => f(...a)
164
+ });
165
165
  this._registrationId = void 0;
166
+ this._proxy = void 0;
166
167
  }
167
168
  trigger.wake();
168
169
  });
169
170
  await trigger.wait();
170
- this._server = void 0;
171
171
  this._port = void 0;
172
+ this._server = void 0;
173
+ }
174
+ /**
175
+ * Load function.
176
+ */
177
+ async _load(def, flush = false) {
178
+ const { id, name, handler } = def;
179
+ const path = (0, import_node_path.join)(this._options.directory, handler);
180
+ import_log.log.info("loading", {
181
+ id
182
+ }, {
183
+ F: __dxlog_file,
184
+ L: 134,
185
+ S: this,
186
+ C: (f, a) => f(...a)
187
+ });
188
+ if (flush) {
189
+ Object.keys(__require.cache).filter((key) => key.startsWith(path)).forEach((key) => delete __require.cache[key]);
190
+ }
191
+ const module2 = __require(path);
192
+ if (typeof module2.default !== "function") {
193
+ throw new Error(`Handler must export default function: ${id}`);
194
+ }
195
+ this._handlers[name] = {
196
+ def,
197
+ handler: module2.default
198
+ };
199
+ }
200
+ /**
201
+ * Invoke function handler.
202
+ */
203
+ async _invoke(name, event) {
204
+ const seq = ++this._seq;
205
+ const now = Date.now();
206
+ import_log.log.info("req", {
207
+ seq,
208
+ name
209
+ }, {
210
+ F: __dxlog_file,
211
+ L: 159,
212
+ S: this,
213
+ C: (f, a) => f(...a)
214
+ });
215
+ const { handler } = this._handlers[name];
216
+ const context = {
217
+ client: this._client
218
+ };
219
+ let statusCode = 200;
220
+ const response = {
221
+ status: (code) => {
222
+ statusCode = code;
223
+ return response;
224
+ }
225
+ };
226
+ await handler({
227
+ context,
228
+ event,
229
+ response
230
+ });
231
+ import_log.log.info("res", {
232
+ seq,
233
+ name,
234
+ statusCode,
235
+ duration: Date.now() - now
236
+ }, {
237
+ F: __dxlog_file,
238
+ L: 175,
239
+ S: this,
240
+ C: (f, a) => f(...a)
241
+ });
242
+ return statusCode;
172
243
  }
173
244
  };
174
-
175
- // packages/core/functions/src/runtime/trigger-manager.ts
176
- var import_async2 = require("@dxos/async");
177
- var import_context = require("@dxos/context");
178
- var import_echo_schema = require("@dxos/echo-schema");
179
- var import_invariant = require("@dxos/invariant");
180
- var import_log2 = require("@dxos/log");
181
- var import_util = require("@dxos/util");
182
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/functions/src/runtime/trigger-manager.ts";
183
- var TriggerManager = class {
184
- constructor(_client, _manifest, _invokeOptions) {
245
+ var __dxlog_file2 = "/home/circleci/project/packages/core/functions/src/runtime/scheduler.ts";
246
+ var Scheduler = class {
247
+ constructor(_client, _manifest, _options) {
185
248
  this._client = _client;
186
249
  this._manifest = _manifest;
187
- this._invokeOptions = _invokeOptions;
188
- this._mounts = new import_util.ComplexMap(({ name, spaceKey }) => `${spaceKey.toHex()}:${name}`);
189
- this._queries = /* @__PURE__ */ new Set();
250
+ this._options = _options;
251
+ this._mounts = new import_util.ComplexMap(({ id, spaceKey }) => `${spaceKey.toHex()}:${id}`);
190
252
  }
191
253
  async start() {
192
254
  this._client.spaces.subscribe(async (spaces) => {
@@ -199,22 +261,22 @@ var TriggerManager = class {
199
261
  });
200
262
  }
201
263
  async stop() {
202
- for (const { name, spaceKey } of this._mounts.keys()) {
203
- await this.unmount(name, spaceKey);
264
+ for (const { id, spaceKey } of this._mounts.keys()) {
265
+ await this.unmount(id, spaceKey);
204
266
  }
205
267
  }
206
268
  async mount(ctx, space, trigger) {
207
269
  const key = {
208
- name: trigger.function,
270
+ id: trigger.function,
209
271
  spaceKey: space.key
210
272
  };
211
- const config = this._manifest.functions.find((config2) => config2.id === trigger.function);
212
- (0, import_invariant.invariant)(config, `Function not found: ${trigger.function}`, {
273
+ const def = this._manifest.functions.find((config) => config.id === trigger.function);
274
+ (0, import_invariant2.invariant)(def, `Function not found: ${trigger.function}`, {
213
275
  F: __dxlog_file2,
214
- L: 58,
276
+ L: 59,
215
277
  S: this,
216
278
  A: [
217
- "config",
279
+ "def",
218
280
  "`Function not found: ${trigger.function}`"
219
281
  ]
220
282
  });
@@ -229,57 +291,55 @@ var TriggerManager = class {
229
291
  trigger
230
292
  }, {
231
293
  F: __dxlog_file2,
232
- L: 62,
294
+ L: 64,
233
295
  S: this,
234
296
  C: (f, a) => f(...a)
235
297
  });
236
298
  if (ctx.disposed) {
237
299
  return;
238
300
  }
239
- const objectIds = /* @__PURE__ */ new Set();
240
- const task = new import_async2.DeferredTask(ctx, async () => {
241
- await this.execFunction(this._invokeOptions, config.endpoint, {
242
- space: space.key,
243
- objects: Array.from(objectIds)
301
+ if (trigger.schedule) {
302
+ const task = new import_async2.DeferredTask(ctx, async () => {
303
+ await this.execFunction(def, {
304
+ space: space.key
305
+ });
244
306
  });
245
- });
246
- let count = 0;
247
- const subscription = (0, import_echo_schema.createSubscription)(({ added, updated }) => {
248
- for (const object of added) {
249
- objectIds.add(object.id);
250
- }
251
- for (const object of updated) {
252
- objectIds.add(object.id);
253
- }
254
- (0, import_log2.log)("updated", {
255
- trigger,
256
- space: space.key,
257
- objects: objectIds.size,
258
- count
259
- }, {
260
- F: __dxlog_file2,
261
- L: 85,
262
- S: this,
263
- C: (f, a) => f(...a)
307
+ const job = new import_cron.CronJob(trigger.schedule, () => task.schedule());
308
+ job.start();
309
+ ctx.onDispose(() => job.stop());
310
+ }
311
+ if (trigger.subscription) {
312
+ const objectIds = /* @__PURE__ */ new Set();
313
+ const task = new import_async2.DeferredTask(ctx, async () => {
314
+ await this.execFunction(def, {
315
+ space: space.key,
316
+ objects: Array.from(objectIds)
317
+ });
264
318
  });
265
- task.schedule();
266
- count++;
267
- });
268
- const query = space.db.query(import_echo_schema.Filter.typename(trigger.subscription.type, trigger.subscription.props));
269
- this._queries.add(query);
270
- const unsubscribe = query.subscribe(({ objects }) => {
271
- subscription.update(objects);
272
- }, true);
273
- ctx.onDispose(() => {
274
- subscription.unsubscribe();
275
- unsubscribe();
276
- this._queries.delete(query);
277
- });
319
+ const subscription = (0, import_echo_schema.createSubscription)(({ added, updated }) => {
320
+ for (const object of added) {
321
+ objectIds.add(object.id);
322
+ }
323
+ for (const object of updated) {
324
+ objectIds.add(object.id);
325
+ }
326
+ task.schedule();
327
+ });
328
+ const { type, props } = trigger.subscription;
329
+ const query = space.db.query(import_echo_schema.Filter.typename(type, props));
330
+ const unsubscribe = query.subscribe(({ objects }) => {
331
+ subscription.update(objects);
332
+ }, true);
333
+ ctx.onDispose(() => {
334
+ subscription.unsubscribe();
335
+ unsubscribe();
336
+ });
337
+ }
278
338
  }
279
339
  }
280
- async unmount(name, spaceKey) {
340
+ async unmount(id, spaceKey) {
281
341
  const key = {
282
- name,
342
+ id,
283
343
  spaceKey
284
344
  };
285
345
  const { ctx } = this._mounts.get(key) ?? {};
@@ -288,59 +348,39 @@ var TriggerManager = class {
288
348
  await ctx.dispose();
289
349
  }
290
350
  }
291
- async execFunction(options, functionName, data) {
292
- const { endpoint, runtime } = options;
293
- (0, import_invariant.invariant)(endpoint, "Missing endpoint", {
294
- F: __dxlog_file2,
295
- L: 121,
296
- S: this,
297
- A: [
298
- "endpoint",
299
- "'Missing endpoint'"
300
- ]
301
- });
302
- (0, import_invariant.invariant)(runtime, "Missing runtime", {
303
- F: __dxlog_file2,
304
- L: 122,
305
- S: this,
306
- A: [
307
- "runtime",
308
- "'Missing runtime'"
309
- ]
310
- });
351
+ async execFunction(def, data) {
311
352
  try {
312
- (0, import_log2.log)("invoke", {
313
- function: functionName
353
+ (0, import_log2.log)("request", {
354
+ function: def.id
314
355
  }, {
315
356
  F: __dxlog_file2,
316
- L: 125,
357
+ L: 130,
317
358
  S: this,
318
359
  C: (f, a) => f(...a)
319
360
  });
320
- const url = `${endpoint}/${runtime}/${functionName}`;
321
- const res = await fetch(url, {
361
+ const response = await fetch(`${this._options.endpoint}/${def.name}`, {
322
362
  method: "POST",
323
- body: JSON.stringify(data),
324
363
  headers: {
325
364
  "Content-Type": "application/json"
326
- }
365
+ },
366
+ body: JSON.stringify(data)
327
367
  });
328
368
  (0, import_log2.log)("result", {
329
- function: functionName,
330
- result: await res.json()
369
+ function: def.id,
370
+ result: response.status
331
371
  }, {
332
372
  F: __dxlog_file2,
333
- L: 135,
373
+ L: 140,
334
374
  S: this,
335
375
  C: (f, a) => f(...a)
336
376
  });
337
377
  } catch (err) {
338
378
  import_log2.log.error("error", {
339
- function: functionName,
379
+ function: def.id,
340
380
  error: err.message
341
381
  }, {
342
382
  F: __dxlog_file2,
343
- L: 137,
383
+ L: 142,
344
384
  S: this,
345
385
  C: (f, a) => f(...a)
346
386
  });
@@ -350,6 +390,6 @@ var TriggerManager = class {
350
390
  // Annotate the CommonJS export names for ESM import in node:
351
391
  0 && (module.exports = {
352
392
  DevServer,
353
- TriggerManager
393
+ Scheduler
354
394
  });
355
395
  //# sourceMappingURL=index.cjs.map