@aglyn/plugins-workflows 1.0.0-beta.219 → 1.0.0-beta.221

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 (54) hide show
  1. package/README.md +7 -2
  2. package/package.json +13 -13
  3. package/src/lib/components/host-actions-card.component.js +3 -2
  4. package/src/lib/components/host-actions-card.component.js.map +1 -1
  5. package/src/lib/components/host-run-history-card.component.d.ts +2 -2
  6. package/src/lib/components/host-run-history-card.component.js +2 -1
  7. package/src/lib/components/host-run-history-card.component.js.map +1 -1
  8. package/src/lib/components/host-webhooks-card.component.js +2 -1
  9. package/src/lib/components/host-webhooks-card.component.js.map +1 -1
  10. package/src/lib/components/host-workflows-card.component.js +2 -2
  11. package/src/lib/components/host-workflows-card.component.js.map +1 -1
  12. package/src/lib/components/use-automation-step-pickers.js +50 -42
  13. package/src/lib/components/use-automation-step-pickers.js.map +1 -1
  14. package/src/lib/components/use-org-automation-step-pickers.js +23 -11
  15. package/src/lib/components/use-org-automation-step-pickers.js.map +1 -1
  16. package/src/lib/components/workflow-zones.d.ts +49 -0
  17. package/src/lib/components/workflow-zones.js +3 -0
  18. package/src/lib/components/workflow-zones.js.map +1 -1
  19. package/src/lib/engine/crm-action-steps.d.ts +14 -1
  20. package/src/lib/engine/crm-action-steps.js +15 -0
  21. package/src/lib/engine/crm-action-steps.js.map +1 -1
  22. package/src/lib/engine/run-event-actions.js +65 -24
  23. package/src/lib/engine/run-event-actions.js.map +1 -1
  24. package/src/lib/engine/run-event-workflows.js +2 -2
  25. package/src/lib/engine/run-event-workflows.js.map +1 -1
  26. package/src/lib/model/automation-record.d.ts +47 -0
  27. package/src/lib/model/automation-record.js +79 -0
  28. package/src/lib/model/automation-record.js.map +1 -0
  29. package/src/lib/model/step-outcomes.d.ts +42 -0
  30. package/src/lib/model/step-outcomes.js +70 -0
  31. package/src/lib/model/step-outcomes.js.map +1 -0
  32. package/src/lib/model/webhooks.d.ts +36 -0
  33. package/src/lib/model/webhooks.js +24 -0
  34. package/src/lib/model/webhooks.js.map +1 -0
  35. package/src/lib/model/workflows-record-lists.d.ts +18 -0
  36. package/src/lib/model/workflows-record-lists.js +45 -0
  37. package/src/lib/model/workflows-record-lists.js.map +1 -0
  38. package/src/lib/model/workflows.d.ts +16 -4
  39. package/src/lib/model/workflows.js +10 -9
  40. package/src/lib/model/workflows.js.map +1 -1
  41. package/src/lib/plugin.js +33 -2
  42. package/src/lib/plugin.js.map +1 -1
  43. package/src/lib/server/automation-record-index.js +16 -47
  44. package/src/lib/server/automation-record-index.js.map +1 -1
  45. package/src/lib/server.js.map +1 -1
  46. package/src/lib/testing/stand-in-dataset-list.d.ts +28 -0
  47. package/src/lib/testing/stand-in-dataset-list.js +55 -0
  48. package/src/lib/testing/stand-in-dataset-list.js.map +1 -0
  49. package/src/lib/testing/stand-in-overlay-list.d.ts +26 -0
  50. package/src/lib/testing/stand-in-overlay-list.js +53 -0
  51. package/src/lib/testing/stand-in-overlay-list.js.map +1 -0
  52. package/src/lib/usage-axes.d.ts +1 -1
  53. package/src/lib/usage-axes.js +13 -2
  54. package/src/lib/usage-axes.js.map +1 -1
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { registerPluginRecordListSource } from "@aglyn/aglyn/plugin-manager/plugin-record-lists";
17
+ import { collection, documentId, limit, orderBy, query } from "firebase/firestore";
18
+ /**
19
+ * The `overlay` list source the plugin that keeps a site's announcement bars
20
+ * and popups publishes (AGL-3080), stood in for this plugin's specs — this
21
+ * plugin may not load the marketing plugin. It builds the query that plugin's
22
+ * `overlay-record-list.ts` builds (the site's overlays, ordered by document
23
+ * id) from whatever `firebase/firestore` the spec stages, and reads a row as
24
+ * a live overlay named by its name, its bar's text or its popup's headline.
25
+ * What the marketing plugin itself answers is held in its own spec.
26
+ */ export function standInOverlayList() {
27
+ registerPluginRecordListSource('overlay', {
28
+ query (firestore, request) {
29
+ if (!request.hostId) return null;
30
+ return query(collection(firestore, 'hosts', request.hostId, 'overlays'), orderBy(documentId()), limit(request.limit));
31
+ },
32
+ record (id, data) {
33
+ var _data_bar, _data_popup;
34
+ if (!data || data['deletedAt'] != null) return null;
35
+ const bar = (_data_bar = data['bar']) != null ? _data_bar : {};
36
+ const popup = (_data_popup = data['popup']) != null ? _data_popup : {};
37
+ const name = [
38
+ data['name'],
39
+ bar['text'],
40
+ popup['headline']
41
+ ].find((value)=>typeof value === 'string' && value.trim());
42
+ return {
43
+ id,
44
+ name: typeof name === 'string' ? name.trim() : id,
45
+ facts: {}
46
+ };
47
+ }
48
+ }, {
49
+ pluginId: 'marketing'
50
+ });
51
+ }
52
+
53
+ //# sourceMappingURL=stand-in-overlay-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/workflows/src/lib/testing/stand-in-overlay-list.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 { registerPluginRecordListSource } from '@aglyn/aglyn/plugin-manager/plugin-record-lists'\nimport { collection, documentId, limit, orderBy, query } from 'firebase/firestore'\n\n/**\n * The `overlay` list source the plugin that keeps a site's announcement bars\n * and popups publishes (AGL-3080), stood in for this plugin's specs — this\n * plugin may not load the marketing plugin. It builds the query that plugin's\n * `overlay-record-list.ts` builds (the site's overlays, ordered by document\n * id) from whatever `firebase/firestore` the spec stages, and reads a row as\n * a live overlay named by its name, its bar's text or its popup's headline.\n * What the marketing plugin itself answers is held in its own spec.\n */\nexport function standInOverlayList(): void {\n registerPluginRecordListSource(\n 'overlay',\n {\n query(firestore, request) {\n if (!request.hostId) return null\n return query(\n collection(firestore, 'hosts', request.hostId, 'overlays'),\n orderBy(documentId()),\n limit(request.limit),\n )\n },\n record(id, data) {\n if (!data || data['deletedAt'] != null) return null\n const bar = (data['bar'] ?? {}) as Record<string, unknown>\n const popup = (data['popup'] ?? {}) as Record<string, unknown>\n const name = [data['name'], bar['text'], popup['headline']].find(\n (value) => typeof value === 'string' && value.trim(),\n )\n return { id, name: typeof name === 'string' ? name.trim() : id, facts: {} }\n },\n },\n { pluginId: 'marketing' },\n )\n}\n"],"names":["registerPluginRecordListSource","collection","documentId","limit","orderBy","query","standInOverlayList","firestore","request","hostId","record","id","data","bar","popup","name","find","value","trim","facts","pluginId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,8BAA8B,QAAQ,kDAAiD;AAChG,SAASC,UAAU,EAAEC,UAAU,EAAEC,KAAK,EAAEC,OAAO,EAAEC,KAAK,QAAQ,qBAAoB;AAElF;;;;;;;;CAQC,GACD,OAAO,SAASC;IACdN,+BACE,WACA;QACEK,OAAME,SAAS,EAAEC,OAAO;YACtB,IAAI,CAACA,QAAQC,MAAM,EAAE,OAAO;YAC5B,OAAOJ,MACLJ,WAAWM,WAAW,SAASC,QAAQC,MAAM,EAAE,aAC/CL,QAAQF,eACRC,MAAMK,QAAQL,KAAK;QAEvB;QACAO,QAAOC,EAAE,EAAEC,IAAI;gBAEAA,WACEA;YAFf,IAAI,CAACA,QAAQA,IAAI,CAAC,YAAY,IAAI,MAAM,OAAO;YAC/C,MAAMC,OAAOD,YAAAA,IAAI,CAAC,MAAM,YAAXA,YAAe,CAAC;YAC7B,MAAME,SAASF,cAAAA,IAAI,CAAC,QAAQ,YAAbA,cAAiB,CAAC;YACjC,MAAMG,OAAO;gBAACH,IAAI,CAAC,OAAO;gBAAEC,GAAG,CAAC,OAAO;gBAAEC,KAAK,CAAC,WAAW;aAAC,CAACE,IAAI,CAC9D,CAACC,QAAU,OAAOA,UAAU,YAAYA,MAAMC,IAAI;YAEpD,OAAO;gBAAEP;gBAAII,MAAM,OAAOA,SAAS,WAAWA,KAAKG,IAAI,KAAKP;gBAAIQ,OAAO,CAAC;YAAE;QAC5E;IACF,GACA;QAAEC,UAAU;IAAY;AAE5B"}
@@ -23,6 +23,6 @@ import type { PluginUsageAxesDeclaration } from '@aglyn/aglyn/plugin-manager/plu
23
23
  * ONE cost axis for both counters: a run is the same handful of reads, two
24
24
  * writes and a moment of compute whichever builder produced it, so both are
25
25
  * priced at `perRun` on one line. TWO bands, because each builder sells its
26
- * own.
26
+ * own; the workflow band also warns the workspace as it fills.
27
27
  */
28
28
  export declare function workflowsUsageAxes(): PluginUsageAxesDeclaration;
@@ -21,7 +21,7 @@
21
21
  * ONE cost axis for both counters: a run is the same handful of reads, two
22
22
  * writes and a moment of compute whichever builder produced it, so both are
23
23
  * priced at `perRun` on one line. TWO bands, because each builder sells its
24
- * own.
24
+ * own; the workflow band also warns the workspace as it fills.
25
25
  */ export function workflowsUsageAxes() {
26
26
  return {
27
27
  costAxes: [
@@ -43,7 +43,18 @@
43
43
  fields: [
44
44
  'workflowRuns'
45
45
  ],
46
- entitlement: 'workflowRunsPerMonth'
46
+ entitlement: 'workflowRunsPerMonth',
47
+ hostCounter: 'workflowRuns',
48
+ // The runtime stops workflows silently at the monthly cap, so the
49
+ // owner is warned approaching it and told on reaching it why their
50
+ // automations went quiet.
51
+ alert: {
52
+ label: 'monthly workflow runs',
53
+ noun: 'workflow runs',
54
+ outcome: 'stops',
55
+ reached: 'Workflows pause until next month and nothing is charged — ' + 'upgrade in Billing to keep them running.',
56
+ approach: 'Nothing changes and nothing is charged — at the included amount, ' + 'workflows pause until next month unless you upgrade in Billing.'
57
+ }
47
58
  },
48
59
  {
49
60
  id: 'actionRuns',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/plugins/workflows/src/lib/usage-axes.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 type { PluginUsageAxesDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-usage-axes'\n\n/**\n * THE WORKFLOWS PLUGIN'S METERS (AGL-3080): workflow and action runs, in the\n * platform's cost model and utilization table. Compiled into core by the\n * manifest generator (`register.usageAxes`).\n *\n * ONE cost axis for both counters: a run is the same handful of reads, two\n * writes and a moment of compute whichever builder produced it, so both are\n * priced at `perRun` on one line. TWO bands, because each builder sells its\n * own.\n */\nexport function workflowsUsageAxes(): PluginUsageAxesDeclaration {\n return {\n costAxes: [\n {\n id: 'runs',\n order: 90,\n fields: ['workflowRuns', 'actionRuns'],\n rate: 'perRun',\n },\n ],\n bands: [\n {\n id: 'workflowRuns',\n label: 'Workflow runs',\n order: 100,\n fields: ['workflowRuns'],\n entitlement: 'workflowRunsPerMonth',\n },\n {\n id: 'actionRuns',\n label: 'Action runs',\n order: 110,\n fields: ['actionRuns'],\n entitlement: 'actionRunsPerMonth',\n },\n ],\n }\n}\n"],"names":["workflowsUsageAxes","costAxes","id","order","fields","rate","bands","label","entitlement"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;;;;;CASC,GACD,OAAO,SAASA;IACd,OAAO;QACLC,UAAU;YACR;gBACEC,IAAI;gBACJC,OAAO;gBACPC,QAAQ;oBAAC;oBAAgB;iBAAa;gBACtCC,MAAM;YACR;SACD;QACDC,OAAO;YACL;gBACEJ,IAAI;gBACJK,OAAO;gBACPJ,OAAO;gBACPC,QAAQ;oBAAC;iBAAe;gBACxBI,aAAa;YACf;YACA;gBACEN,IAAI;gBACJK,OAAO;gBACPJ,OAAO;gBACPC,QAAQ;oBAAC;iBAAa;gBACtBI,aAAa;YACf;SACD;IACH;AACF"}
1
+ {"version":3,"sources":["../../../../../../libs/plugins/workflows/src/lib/usage-axes.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 type { PluginUsageAxesDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-usage-axes'\n\n/**\n * THE WORKFLOWS PLUGIN'S METERS (AGL-3080): workflow and action runs, in the\n * platform's cost model and utilization table. Compiled into core by the\n * manifest generator (`register.usageAxes`).\n *\n * ONE cost axis for both counters: a run is the same handful of reads, two\n * writes and a moment of compute whichever builder produced it, so both are\n * priced at `perRun` on one line. TWO bands, because each builder sells its\n * own; the workflow band also warns the workspace as it fills.\n */\nexport function workflowsUsageAxes(): PluginUsageAxesDeclaration {\n return {\n costAxes: [\n {\n id: 'runs',\n order: 90,\n fields: ['workflowRuns', 'actionRuns'],\n rate: 'perRun',\n },\n ],\n bands: [\n {\n id: 'workflowRuns',\n label: 'Workflow runs',\n order: 100,\n fields: ['workflowRuns'],\n entitlement: 'workflowRunsPerMonth',\n hostCounter: 'workflowRuns',\n // The runtime stops workflows silently at the monthly cap, so the\n // owner is warned approaching it and told on reaching it why their\n // automations went quiet.\n alert: {\n label: 'monthly workflow runs',\n noun: 'workflow runs',\n outcome: 'stops',\n reached:\n 'Workflows pause until next month and nothing is charged — ' +\n 'upgrade in Billing to keep them running.',\n approach:\n 'Nothing changes and nothing is charged — at the included amount, ' +\n 'workflows pause until next month unless you upgrade in Billing.',\n },\n },\n {\n id: 'actionRuns',\n label: 'Action runs',\n order: 110,\n fields: ['actionRuns'],\n entitlement: 'actionRunsPerMonth',\n },\n ],\n }\n}\n"],"names":["workflowsUsageAxes","costAxes","id","order","fields","rate","bands","label","entitlement","hostCounter","alert","noun","outcome","reached","approach"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;;;;;CASC,GACD,OAAO,SAASA;IACd,OAAO;QACLC,UAAU;YACR;gBACEC,IAAI;gBACJC,OAAO;gBACPC,QAAQ;oBAAC;oBAAgB;iBAAa;gBACtCC,MAAM;YACR;SACD;QACDC,OAAO;YACL;gBACEJ,IAAI;gBACJK,OAAO;gBACPJ,OAAO;gBACPC,QAAQ;oBAAC;iBAAe;gBACxBI,aAAa;gBACbC,aAAa;gBACb,kEAAkE;gBAClE,mEAAmE;gBACnE,0BAA0B;gBAC1BC,OAAO;oBACLH,OAAO;oBACPI,MAAM;oBACNC,SAAS;oBACTC,SACE,+DACA;oBACFC,UACE,sEACA;gBACJ;YACF;YACA;gBACEZ,IAAI;gBACJK,OAAO;gBACPJ,OAAO;gBACPC,QAAQ;oBAAC;iBAAa;gBACtBI,aAAa;YACf;SACD;IACH;AACF"}