@posiwise/flows 0.0.9 → 0.0.11

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": "@posiwise/flows",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.2.0",
6
6
  "@angular/core": "^22.2.0",
@@ -3,9 +3,9 @@ import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, DestroyRef, Element
3
3
  import * as i1 from "@angular/router";
4
4
  import { LazyLoadEvent, MenuItem } from "primeng/api";
5
5
  import { AppBaseComponent } from "@posiwise/app-base-component";
6
- import * as i30 from "@posiwise/shared-components";
6
+ import * as i33 from "@posiwise/shared-components";
7
7
  import { ConfirmDialogService } from "@posiwise/shared-components";
8
- import * as i32 from "@angular/forms";
8
+ import * as i35 from "@angular/forms";
9
9
  import { UntypedFormGroup } from "@angular/forms";
10
10
  import { Paging } from "@posiwise/common-utilities";
11
11
  import { ProductsHttpService } from "@posiwise/shared-product-services";
@@ -14,18 +14,18 @@ import { PermissionService, SubscriptionService } from "@posiwise/common-service
14
14
  import { TranslocoService } from "@jsverse/transloco";
15
15
  import { ClassicPreset, GetSchemes } from "rete";
16
16
  import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
17
- import * as i31 from "@angular/common";
18
- import * as i33 from "@posiwise/core-guards";
19
- import * as i34 from "@posiwise/core-transloco";
20
- import * as i35 from "@posiwise/app-loader";
21
- import * as i36 from "@posiwise/directives";
22
- import * as i37 from "@posiwise/pipes";
23
- import * as i38 from "@fortawesome/angular-fontawesome";
24
- import * as i39 from "primeng/iconfield";
25
- import * as i40 from "primeng/inputicon";
26
- import * as i41 from "primeng/autocomplete";
27
- import * as i42 from "primeng/inputtext";
28
- import * as i43 from "rete-angular-plugin/22";
17
+ import * as i34 from "@angular/common";
18
+ import * as i36 from "@posiwise/core-guards";
19
+ import * as i37 from "@posiwise/core-transloco";
20
+ import * as i38 from "@posiwise/app-loader";
21
+ import * as i39 from "@posiwise/directives";
22
+ import * as i40 from "@posiwise/pipes";
23
+ import * as i41 from "@fortawesome/angular-fontawesome";
24
+ import * as i42 from "primeng/iconfield";
25
+ import * as i43 from "primeng/inputicon";
26
+ import * as i44 from "primeng/autocomplete";
27
+ import * as i45 from "primeng/inputtext";
28
+ import * as i46 from "rete-angular-plugin/22";
29
29
  declare namespace flows_private_routing_module_d_exports {
30
30
  export { FlowsPrivateRoutingModule };
31
31
  }
@@ -340,8 +340,10 @@ interface FlowParamDetail {
340
340
  label?: string;
341
341
  description?: string;
342
342
  placeholder?: string;
343
- kind?: 'text' | 'textarea' | 'number' | 'select';
343
+ kind?: 'text' | 'textarea' | 'number' | 'select' | 'choices';
344
344
  options?: string[];
345
+ /** select only: the options are suggestions, and typed text (e.g. a {{placeholder}}) is kept too. */
346
+ editable?: boolean;
345
347
  required?: boolean;
346
348
  }
347
349
  /** Field names of an item, and of the entries of each list in it. */
@@ -408,6 +410,8 @@ interface FlowNodeSelection {
408
410
  listSuggestions: string[];
409
411
  /** The same fields, by the connected node they come from; null when none can ever reach it. */
410
412
  fieldSources: FlowFieldSource[] | null;
413
+ /** The fixed settings of the nodes before it, so a `{{name}}` box can show what it stands for. */
414
+ settingValues: Record<string, string>;
411
415
  }
412
416
  interface FlowGraph {
413
417
  nodes: FlowGraphNode[];
@@ -442,8 +446,11 @@ declare function toFlowWorkflowFields(rows: FlowWorkflowFieldsRow[] | undefined)
442
446
  declare class FlowsNodeService {
443
447
  private readonly api;
444
448
  private readonly cache;
449
+ private readonly refetched;
445
450
  constructor(api: ProductsHttpService);
446
- getNodes(subscriptionId: number): Observable<FlowNodeDefinition[]>;
451
+ /** A list cached before `needed` types were declared is fetched again. */
452
+ getNodes(subscriptionId: number, needed?: readonly string[]): Observable<FlowNodeDefinition[]>;
453
+ private cached;
447
454
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowsNodeService, never>;
448
455
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
449
456
  }
@@ -1008,7 +1015,6 @@ declare class FlowsRunInspectorComponent extends AppBaseComponent implements OnI
1008
1015
  stepBadgeClass(status: FlowRunStepStatus): string;
1009
1016
  elapsed(from: string | null, to: string | null): number | null;
1010
1017
  toggleItems(stepId: number): void;
1011
- asJson(value: unknown): string;
1012
1018
  private watch;
1013
1019
  private nameNodes;
1014
1020
  private fail;
@@ -1162,6 +1168,9 @@ declare class FlowCanvasNode extends ClassicPreset.Node {
1162
1168
  width: number;
1163
1169
  height: number;
1164
1170
  constructor(flowNode: FlowGraphNode, definition: FlowNodeDefinition | null, label: string, hasInput: boolean, outputs: readonly string[]);
1171
+ syncOutputs(outputs: readonly string[]): string[];
1172
+ private addBranch;
1173
+ private fitHeight;
1165
1174
  }
1166
1175
  declare class FlowCanvasConnection extends ClassicPreset.Connection<ClassicPreset.Node, ClassicPreset.Node> {}
1167
1176
  type FlowCanvasSchemes = GetSchemes<FlowCanvasNode, FlowCanvasConnection>;
@@ -1297,7 +1306,7 @@ declare class FlowsNodePaletteComponent implements OnChanges {
1297
1306
  "add": "add";
1298
1307
  }, never, never, false, never>;
1299
1308
  }
1300
- type FlowFieldKind$1 = 'text' | 'textarea' | 'email' | 'member' | 'members' | 'json' | 'pairs' | 'mode' | 'cron' | 'timezone' | 'number' | 'select' | 'list';
1309
+ type FlowFieldKind$1 = 'text' | 'textarea' | 'email' | 'member' | 'members' | 'json' | 'pairs' | 'mode' | 'cron' | 'timezone' | 'number' | 'select' | 'list' | 'choices';
1301
1310
  interface FlowNodeField extends Omit<FlowParamDetail, 'kind'> {
1302
1311
  key: string;
1303
1312
  kind: FlowFieldKind$1;
@@ -1323,6 +1332,8 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
1323
1332
  fieldSuggestions: string[];
1324
1333
  /** The lists Split out can pick from; empty until the node before it has run. */
1325
1334
  listSuggestions: string[];
1335
+ /** The fixed settings of the nodes before this one, by param name. */
1336
+ settingValues: Record<string, string>;
1326
1337
  /** The same fields, by the connected node they come from; null hides the section. */
1327
1338
  fieldSources: FlowFieldSource[] | null;
1328
1339
  /** The workflow has not run yet, so no fields have been seen. */
@@ -1350,26 +1361,18 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
1350
1361
  readonly turnOn: import("@fortawesome/fontawesome-common-types").IconDefinition;
1351
1362
  readonly turnOff: import("@fortawesome/fontawesome-common-types").IconDefinition;
1352
1363
  };
1353
- mergeModes: {
1354
- value: string;
1355
- label: string;
1356
- }[];
1357
- readonly defaultMergeMode: string;
1358
1364
  readonly labelKey: typeof flowNodeLabelKey;
1359
1365
  readonly paramLabelKey: typeof flowParamLabelKey;
1360
1366
  readonly paramHelpKey: typeof flowParamHelpKey;
1361
- readonly numberValue: typeof flowNumberValue;
1362
1367
  /** `id` names the node too, so each node gets its own inputs. */
1363
1368
  fields: (FlowNodeField & {
1364
1369
  id: string;
1365
1370
  })[];
1366
1371
  conditionNotAnObject: boolean;
1367
- constructor(translation: TranslocoService, cdr: ChangeDetectorRef, destroyRef: DestroyRef, host: ElementRef<HTMLElement>);
1372
+ constructor(host: ElementRef<HTMLElement>);
1368
1373
  ngOnChanges(changes: SimpleChanges): void;
1369
1374
  private saveFieldBeingTyped;
1370
1375
  ngAfterViewChecked(): void;
1371
- /** A list is picked from what is known, and typed when nothing is known yet. */
1372
- kindOf(field: FlowNodeField): FlowNodeField['kind'];
1373
1376
  fieldId(key: string): string;
1374
1377
  param(key: string): unknown;
1375
1378
  setParam(key: string, value: unknown): void;
@@ -1402,6 +1405,10 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
1402
1405
  "alias": "listSuggestions";
1403
1406
  "required": false;
1404
1407
  };
1408
+ "settingValues": {
1409
+ "alias": "settingValues";
1410
+ "required": false;
1411
+ };
1405
1412
  "fieldSources": {
1406
1413
  "alias": "fieldSources";
1407
1414
  "required": false;
@@ -1601,6 +1608,134 @@ declare class FlowsPairsFieldComponent implements OnChanges {
1601
1608
  "valueChange": "valueChange";
1602
1609
  }, never, never, false, never>;
1603
1610
  }
1611
+ declare const FLOW_AI_DECIDE_TYPE = "logic.ai_decide";
1612
+ interface FlowAiChoice {
1613
+ name: string;
1614
+ description: string;
1615
+ }
1616
+ declare function flowAiChoices(node: FlowGraphNode): FlowAiChoice[];
1617
+ /** Must match products-api FlowNodeOutputs.of. */
1618
+ declare function flowNodeOutputs(node: FlowGraphNode, definition: FlowNodeDefinition): string[];
1619
+ declare namespace flows_choices_field_component_d_exports {
1620
+ export { FLOW_RESERVED_CHOICES, FlowsChoicesFieldComponent, flowChoiceName, flowChoiceProblem };
1621
+ }
1622
+ /** Lower snake case, which is what products-api accepts as a branch name. */
1623
+ declare function flowChoiceName(name: string): string;
1624
+ /** products-api FlowAiDecideParams::RESERVED: the node's own branches. */
1625
+ declare const FLOW_RESERVED_CHOICES: string[];
1626
+ /** A name that would get no output of its own: a built-in branch, or one used above. */
1627
+ declare function flowChoiceProblem(names: readonly string[], index: number): string | null;
1628
+ declare class FlowsChoicesFieldComponent implements OnChanges {
1629
+ value: unknown;
1630
+ inputId: string;
1631
+ readOnly: boolean;
1632
+ readonly valueChange: EventEmitter<FlowAiChoice[]>;
1633
+ readonly icons: {
1634
+ readonly inspect: import("@fortawesome/fontawesome-common-types").IconDefinition;
1635
+ readonly back: import("@fortawesome/fontawesome-common-types").IconDefinition;
1636
+ readonly error: import("@fortawesome/fontawesome-common-types").IconDefinition;
1637
+ readonly create: import("@fortawesome/fontawesome-common-types").IconDefinition;
1638
+ readonly edit: import("@fortawesome/fontawesome-common-types").IconDefinition;
1639
+ readonly delete: import("@fortawesome/fontawesome-common-types").IconDefinition;
1640
+ readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
1641
+ readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
1642
+ readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
1643
+ readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
1644
+ readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
1645
+ readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
1646
+ readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
1647
+ readonly warning: import("@fortawesome/fontawesome-common-types").IconDefinition;
1648
+ readonly collapsed: import("@fortawesome/fontawesome-common-types").IconDefinition;
1649
+ readonly expanded: import("@fortawesome/fontawesome-common-types").IconDefinition;
1650
+ readonly turnOn: import("@fortawesome/fontawesome-common-types").IconDefinition;
1651
+ readonly turnOff: import("@fortawesome/fontawesome-common-types").IconDefinition;
1652
+ };
1653
+ choices: FlowAiChoice[];
1654
+ problems: (string | null)[];
1655
+ private emitted;
1656
+ ngOnChanges(): void;
1657
+ addChoice(): void;
1658
+ removeChoice(index: number): void;
1659
+ commit(): void;
1660
+ private checkNames;
1661
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowsChoicesFieldComponent, never>;
1662
+ static ɵcmp: i0.ɵɵComponentDeclaration<FlowsChoicesFieldComponent, "pw-flows-choices-field", never, {
1663
+ "value": {
1664
+ "alias": "value";
1665
+ "required": false;
1666
+ };
1667
+ "inputId": {
1668
+ "alias": "inputId";
1669
+ "required": false;
1670
+ };
1671
+ "readOnly": {
1672
+ "alias": "readOnly";
1673
+ "required": false;
1674
+ };
1675
+ }, {
1676
+ "valueChange": "valueChange";
1677
+ }, never, never, false, never>;
1678
+ }
1679
+ declare namespace flows_param_field_component_d_exports {
1680
+ export { FlowsParamFieldComponent };
1681
+ }
1682
+ declare class FlowsParamFieldComponent {
1683
+ /** `id` names the node too, so each node gets its own inputs. */
1684
+ field: FlowNodeField & {
1685
+ id: string;
1686
+ };
1687
+ value: unknown;
1688
+ readOnly: boolean;
1689
+ subscriptionId: number;
1690
+ /** The lists Split out can pick from; empty until the node before it has run. */
1691
+ listSuggestions: string[];
1692
+ /** The fixed settings of the nodes before this one, by param name. */
1693
+ settingValues: Record<string, string>;
1694
+ readonly valueChange: EventEmitter<unknown>;
1695
+ mergeModes: {
1696
+ value: string;
1697
+ label: string;
1698
+ }[];
1699
+ readonly defaultMergeMode: string;
1700
+ readonly numberValue: typeof flowNumberValue;
1701
+ constructor(translation: TranslocoService, cdr: ChangeDetectorRef, destroyRef: DestroyRef);
1702
+ /**
1703
+ * What an editable select shows: `Duo` for a saved `{{vendor_name}}` when an earlier node
1704
+ * is set to Duo. Only the shown text changes; the saved placeholder is untouched.
1705
+ */
1706
+ get shownValue(): unknown;
1707
+ /** A list is picked from what is known, and typed when nothing is known yet. */
1708
+ get kind(): FlowNodeField['kind'];
1709
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowsParamFieldComponent, never>;
1710
+ static ɵcmp: i0.ɵɵComponentDeclaration<FlowsParamFieldComponent, "pw-flows-param-field", never, {
1711
+ "field": {
1712
+ "alias": "field";
1713
+ "required": false;
1714
+ };
1715
+ "value": {
1716
+ "alias": "value";
1717
+ "required": false;
1718
+ };
1719
+ "readOnly": {
1720
+ "alias": "readOnly";
1721
+ "required": false;
1722
+ };
1723
+ "subscriptionId": {
1724
+ "alias": "subscriptionId";
1725
+ "required": false;
1726
+ };
1727
+ "listSuggestions": {
1728
+ "alias": "listSuggestions";
1729
+ "required": false;
1730
+ };
1731
+ "settingValues": {
1732
+ "alias": "settingValues";
1733
+ "required": false;
1734
+ };
1735
+ }, {
1736
+ "valueChange": "valueChange";
1737
+ }, never, never, false, never>;
1738
+ }
1604
1739
  interface FlowMember {
1605
1740
  id: number;
1606
1741
  name: string;
@@ -1867,8 +2002,21 @@ declare class FlowWorkflowBadgePipe implements PipeTransform {
1867
2002
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowWorkflowBadgePipe, never>;
1868
2003
  static ɵpipe: i0.ɵɵPipeDeclaration<FlowWorkflowBadgePipe, "flowWorkflowBadge", false>;
1869
2004
  }
2005
+ declare namespace flow_json_lines_pipe_d_exports {
2006
+ export { FlowJsonLine, FlowJsonLinesPipe };
2007
+ }
2008
+ interface FlowJsonLine {
2009
+ depth: number;
2010
+ text: string;
2011
+ }
2012
+ /** Pretty JSON as lines with their depth, so a long value that wraps stays under its own line. */
2013
+ declare class FlowJsonLinesPipe implements PipeTransform {
2014
+ transform(value: unknown): FlowJsonLine[];
2015
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowJsonLinesPipe, never>;
2016
+ static ɵpipe: i0.ɵɵPipeDeclaration<FlowJsonLinesPipe, "flowJsonLines", false>;
2017
+ }
1870
2018
  export declare class FlowsPrivateModule {
1871
2019
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowsPrivateModule, never>;
1872
- static ɵmod: i0.ɵɵNgModuleDeclaration<FlowsPrivateModule, [typeof FlowsTabsComponent, typeof FlowsWorkflowsComponent, typeof FlowsWorkflowFormComponent, typeof FlowsWorkflowVersionsComponent, typeof FlowsVersionEditorComponent, typeof FlowsGraphCheckComponent, typeof FlowsRunsComponent, typeof FlowsRunsFiltersComponent, typeof FlowsCronFieldComponent, typeof FlowsTimezoneFieldComponent, typeof FlowsRunInspectorComponent, typeof FlowsRunProgressComponent, typeof FlowsStepErrorComponent, typeof FlowsRunErrorComponent, typeof FlowsGraphCanvasComponent, typeof FlowsCanvasNodeComponent, typeof FlowsCanvasSocketComponent, typeof FlowsCanvasConnectionComponent, typeof FlowsNodePaletteComponent, typeof FlowsNodeInspectorComponent, typeof FlowsJsonFieldComponent, typeof FlowsConditionFieldComponent, typeof FlowsPairsFieldComponent, typeof FlowsMemberFieldComponent, typeof FlowsRetryFieldComponent, typeof FlowsAvailableFieldsComponent, typeof FlowsUnknownFieldsComponent, typeof FlowsWorkflowStatusComponent, typeof FlowWorkflowBadgePipe], [typeof i30.PwStickyActionsComponent, typeof i31.CommonModule, typeof i32.FormsModule, typeof i32.ReactiveFormsModule, typeof i33.TrackDirtyFormDirective, typeof i34.CoreTranslocoModule, typeof i35.AppLoaderModule, typeof i30.SharedComponentsModule, typeof i36.DirectivesModule, typeof i37.PipesModule, typeof i38.FontAwesomeModule, typeof i39.IconFieldModule, typeof i40.InputIconModule, typeof i41.AutoCompleteModule, typeof i42.InputTextModule, typeof i43.ReteModule, typeof FlowsPrivateRoutingModule], never>;
2020
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FlowsPrivateModule, [typeof FlowsTabsComponent, typeof FlowsWorkflowsComponent, typeof FlowsWorkflowFormComponent, typeof FlowsWorkflowVersionsComponent, typeof FlowsVersionEditorComponent, typeof FlowsGraphCheckComponent, typeof FlowsRunsComponent, typeof FlowsRunsFiltersComponent, typeof FlowsCronFieldComponent, typeof FlowsTimezoneFieldComponent, typeof FlowsRunInspectorComponent, typeof FlowsRunProgressComponent, typeof FlowsStepErrorComponent, typeof FlowsRunErrorComponent, typeof FlowsGraphCanvasComponent, typeof FlowsCanvasNodeComponent, typeof FlowsCanvasSocketComponent, typeof FlowsCanvasConnectionComponent, typeof FlowsNodePaletteComponent, typeof FlowsNodeInspectorComponent, typeof FlowsJsonFieldComponent, typeof FlowsConditionFieldComponent, typeof FlowsPairsFieldComponent, typeof FlowsChoicesFieldComponent, typeof FlowsParamFieldComponent, typeof FlowsMemberFieldComponent, typeof FlowsRetryFieldComponent, typeof FlowsAvailableFieldsComponent, typeof FlowsUnknownFieldsComponent, typeof FlowsWorkflowStatusComponent, typeof FlowWorkflowBadgePipe, typeof FlowJsonLinesPipe], [typeof i33.PwStickyActionsComponent, typeof i34.CommonModule, typeof i35.FormsModule, typeof i35.ReactiveFormsModule, typeof i36.TrackDirtyFormDirective, typeof i37.CoreTranslocoModule, typeof i38.AppLoaderModule, typeof i33.SharedComponentsModule, typeof i39.DirectivesModule, typeof i40.PipesModule, typeof i41.FontAwesomeModule, typeof i42.IconFieldModule, typeof i43.InputIconModule, typeof i44.AutoCompleteModule, typeof i45.InputTextModule, typeof i46.ReteModule, typeof FlowsPrivateRoutingModule], never>;
1873
2021
  static ɵinj: i0.ɵɵInjectorDeclaration<FlowsPrivateModule>;
1874
2022
  }