@aglyn/plugins-workflows 1.23.0 → 1.24.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-workflows",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,17 +25,17 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/aglyn": "1.23.0",
29
- "@aglyn/shared-data-mdi": "1.23.0",
30
- "@aglyn/shared-ui-jsx": "1.23.0",
31
- "@aglyn/shared-ui-next": "1.23.0",
32
- "@aglyn/shared-ui-snackstack": "1.23.0",
33
- "@aglyn/shared-util-email": "1.23.0",
34
- "@aglyn/shared-util-http": "1.23.0",
35
- "@aglyn/shared-util-timestamp": "1.23.0",
36
- "@aglyn/tenant-data-admin": "1.23.0",
37
- "@aglyn/tenant-feature-instance": "1.23.0",
38
- "@aglyn/tenant-runtime": "1.23.0",
28
+ "@aglyn/aglyn": "1.24.0",
29
+ "@aglyn/shared-data-mdi": "1.24.0",
30
+ "@aglyn/shared-ui-jsx": "1.24.0",
31
+ "@aglyn/shared-ui-next": "1.24.0",
32
+ "@aglyn/shared-ui-snackstack": "1.24.0",
33
+ "@aglyn/shared-util-email": "1.24.0",
34
+ "@aglyn/shared-util-http": "1.24.0",
35
+ "@aglyn/shared-util-timestamp": "1.24.0",
36
+ "@aglyn/tenant-data-admin": "1.24.0",
37
+ "@aglyn/tenant-feature-instance": "1.24.0",
38
+ "@aglyn/tenant-runtime": "1.24.0",
39
39
  "@swc/helpers": "0.5.24"
40
40
  },
41
41
  "peerDependencies": {
@@ -44,6 +44,7 @@
44
44
  if (actor.uid) triggeredBy['uid'] = actor.uid;
45
45
  if (actor.email) triggeredBy['email'] = actor.email;
46
46
  if (actor.apiKeyName) triggeredBy['apiKeyName'] = actor.apiKeyName;
47
+ if (actor.connectedAppName) triggeredBy['connectedAppName'] = actor.connectedAppName;
47
48
  return {
48
49
  triggeredBy
49
50
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/workflows/src/lib/engine/run-trigger-actor.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks'\nimport type { HostEventActor } from '@aglyn/tenant-runtime/host-event-listeners'\n\n/**\n * Who set a run off (AGL-3376), carried beside the engine rather than\n * through it.\n *\n * An event reaches a run-row writer through the listener, the fan-out to\n * workflows and actions, their steps, chained events and nested workflows —\n * a parameter on every one of those frames would be threaded through code\n * that never reads it. The listener runs the engine inside this scope once,\n * and each writer reads the scope, so an event a step raises in turn is\n * credited to whoever caused the first one.\n *\n * A resumed enrollment (a wait that ended on the cron) runs outside any\n * scope and writes no `triggeredBy`: the person who started it is not the\n * one acting now, and the history says it was not recorded.\n */\nconst scope = new AsyncLocalStorage<HostEventActor | undefined>()\n\n/** Runs `work` with `actor` as the cause of every run it writes. */\nexport function withRunTriggerActor<T>(\n actor: HostEventActor | undefined,\n work: () => Promise<T>,\n): Promise<T> {\n return scope.run(actor, work)\n}\n\n/**\n * The `triggeredBy` field for a run row, or nothing outside a scope. Only\n * the keys the door knew — Firestore refuses an `undefined` value.\n */\nexport function runTriggeredByFields(): {\n triggeredBy?: Record<string, string>\n} {\n const actor = scope.getStore()\n if (!actor?.kind) return {}\n const triggeredBy: Record<string, string> = { kind: actor.kind }\n if (actor.uid) triggeredBy['uid'] = actor.uid\n if (actor.email) triggeredBy['email'] = actor.email\n if (actor.apiKeyName) triggeredBy['apiKeyName'] = actor.apiKeyName\n return { triggeredBy }\n}\n"],"names":["AsyncLocalStorage","scope","withRunTriggerActor","actor","work","run","runTriggeredByFields","getStore","kind","triggeredBy","uid","email","apiKeyName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,iBAAiB,QAAQ,mBAAkB;AAGpD;;;;;;;;;;;;;;CAcC,GACD,MAAMC,QAAQ,IAAID;AAElB,kEAAkE,GAClE,OAAO,SAASE,oBACdC,KAAiC,EACjCC,IAAsB;IAEtB,OAAOH,MAAMI,GAAG,CAACF,OAAOC;AAC1B;AAEA;;;CAGC,GACD,OAAO,SAASE;IAGd,MAAMH,QAAQF,MAAMM,QAAQ;IAC5B,IAAI,EAACJ,yBAAAA,MAAOK,IAAI,GAAE,OAAO,CAAC;IAC1B,MAAMC,cAAsC;QAAED,MAAML,MAAMK,IAAI;IAAC;IAC/D,IAAIL,MAAMO,GAAG,EAAED,WAAW,CAAC,MAAM,GAAGN,MAAMO,GAAG;IAC7C,IAAIP,MAAMQ,KAAK,EAAEF,WAAW,CAAC,QAAQ,GAAGN,MAAMQ,KAAK;IACnD,IAAIR,MAAMS,UAAU,EAAEH,WAAW,CAAC,aAAa,GAAGN,MAAMS,UAAU;IAClE,OAAO;QAAEH;IAAY;AACvB"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/workflows/src/lib/engine/run-trigger-actor.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks'\nimport type { HostEventActor } from '@aglyn/tenant-runtime/host-event-listeners'\n\n/**\n * Who set a run off (AGL-3376), carried beside the engine rather than\n * through it.\n *\n * An event reaches a run-row writer through the listener, the fan-out to\n * workflows and actions, their steps, chained events and nested workflows —\n * a parameter on every one of those frames would be threaded through code\n * that never reads it. The listener runs the engine inside this scope once,\n * and each writer reads the scope, so an event a step raises in turn is\n * credited to whoever caused the first one.\n *\n * A resumed enrollment (a wait that ended on the cron) runs outside any\n * scope and writes no `triggeredBy`: the person who started it is not the\n * one acting now, and the history says it was not recorded.\n */\nconst scope = new AsyncLocalStorage<HostEventActor | undefined>()\n\n/** Runs `work` with `actor` as the cause of every run it writes. */\nexport function withRunTriggerActor<T>(\n actor: HostEventActor | undefined,\n work: () => Promise<T>,\n): Promise<T> {\n return scope.run(actor, work)\n}\n\n/**\n * The `triggeredBy` field for a run row, or nothing outside a scope. Only\n * the keys the door knew — Firestore refuses an `undefined` value.\n */\nexport function runTriggeredByFields(): {\n triggeredBy?: Record<string, string>\n} {\n const actor = scope.getStore()\n if (!actor?.kind) return {}\n const triggeredBy: Record<string, string> = { kind: actor.kind }\n if (actor.uid) triggeredBy['uid'] = actor.uid\n if (actor.email) triggeredBy['email'] = actor.email\n if (actor.apiKeyName) triggeredBy['apiKeyName'] = actor.apiKeyName\n if (actor.connectedAppName) triggeredBy['connectedAppName'] = actor.connectedAppName\n return { triggeredBy }\n}\n"],"names":["AsyncLocalStorage","scope","withRunTriggerActor","actor","work","run","runTriggeredByFields","getStore","kind","triggeredBy","uid","email","apiKeyName","connectedAppName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,iBAAiB,QAAQ,mBAAkB;AAGpD;;;;;;;;;;;;;;CAcC,GACD,MAAMC,QAAQ,IAAID;AAElB,kEAAkE,GAClE,OAAO,SAASE,oBACdC,KAAiC,EACjCC,IAAsB;IAEtB,OAAOH,MAAMI,GAAG,CAACF,OAAOC;AAC1B;AAEA;;;CAGC,GACD,OAAO,SAASE;IAGd,MAAMH,QAAQF,MAAMM,QAAQ;IAC5B,IAAI,EAACJ,yBAAAA,MAAOK,IAAI,GAAE,OAAO,CAAC;IAC1B,MAAMC,cAAsC;QAAED,MAAML,MAAMK,IAAI;IAAC;IAC/D,IAAIL,MAAMO,GAAG,EAAED,WAAW,CAAC,MAAM,GAAGN,MAAMO,GAAG;IAC7C,IAAIP,MAAMQ,KAAK,EAAEF,WAAW,CAAC,QAAQ,GAAGN,MAAMQ,KAAK;IACnD,IAAIR,MAAMS,UAAU,EAAEH,WAAW,CAAC,aAAa,GAAGN,MAAMS,UAAU;IAClE,IAAIT,MAAMU,gBAAgB,EAAEJ,WAAW,CAAC,mBAAmB,GAAGN,MAAMU,gBAAgB;IACpF,OAAO;QAAEJ;IAAY;AACvB"}