@posiwise/flows 0.0.9 → 0.0.10

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.10",
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,7 +340,7 @@ 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
345
  required?: boolean;
346
346
  }
@@ -442,8 +442,11 @@ declare function toFlowWorkflowFields(rows: FlowWorkflowFieldsRow[] | undefined)
442
442
  declare class FlowsNodeService {
443
443
  private readonly api;
444
444
  private readonly cache;
445
+ private readonly refetched;
445
446
  constructor(api: ProductsHttpService);
446
- getNodes(subscriptionId: number): Observable<FlowNodeDefinition[]>;
447
+ /** A list cached before `needed` types were declared is fetched again. */
448
+ getNodes(subscriptionId: number, needed?: readonly string[]): Observable<FlowNodeDefinition[]>;
449
+ private cached;
447
450
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowsNodeService, never>;
448
451
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
449
452
  }
@@ -1008,7 +1011,6 @@ declare class FlowsRunInspectorComponent extends AppBaseComponent implements OnI
1008
1011
  stepBadgeClass(status: FlowRunStepStatus): string;
1009
1012
  elapsed(from: string | null, to: string | null): number | null;
1010
1013
  toggleItems(stepId: number): void;
1011
- asJson(value: unknown): string;
1012
1014
  private watch;
1013
1015
  private nameNodes;
1014
1016
  private fail;
@@ -1162,6 +1164,9 @@ declare class FlowCanvasNode extends ClassicPreset.Node {
1162
1164
  width: number;
1163
1165
  height: number;
1164
1166
  constructor(flowNode: FlowGraphNode, definition: FlowNodeDefinition | null, label: string, hasInput: boolean, outputs: readonly string[]);
1167
+ syncOutputs(outputs: readonly string[]): string[];
1168
+ private addBranch;
1169
+ private fitHeight;
1165
1170
  }
1166
1171
  declare class FlowCanvasConnection extends ClassicPreset.Connection<ClassicPreset.Node, ClassicPreset.Node> {}
1167
1172
  type FlowCanvasSchemes = GetSchemes<FlowCanvasNode, FlowCanvasConnection>;
@@ -1297,7 +1302,7 @@ declare class FlowsNodePaletteComponent implements OnChanges {
1297
1302
  "add": "add";
1298
1303
  }, never, never, false, never>;
1299
1304
  }
1300
- type FlowFieldKind$1 = 'text' | 'textarea' | 'email' | 'member' | 'members' | 'json' | 'pairs' | 'mode' | 'cron' | 'timezone' | 'number' | 'select' | 'list';
1305
+ type FlowFieldKind$1 = 'text' | 'textarea' | 'email' | 'member' | 'members' | 'json' | 'pairs' | 'mode' | 'cron' | 'timezone' | 'number' | 'select' | 'list' | 'choices';
1301
1306
  interface FlowNodeField extends Omit<FlowParamDetail, 'kind'> {
1302
1307
  key: string;
1303
1308
  kind: FlowFieldKind$1;
@@ -1350,26 +1355,18 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
1350
1355
  readonly turnOn: import("@fortawesome/fontawesome-common-types").IconDefinition;
1351
1356
  readonly turnOff: import("@fortawesome/fontawesome-common-types").IconDefinition;
1352
1357
  };
1353
- mergeModes: {
1354
- value: string;
1355
- label: string;
1356
- }[];
1357
- readonly defaultMergeMode: string;
1358
1358
  readonly labelKey: typeof flowNodeLabelKey;
1359
1359
  readonly paramLabelKey: typeof flowParamLabelKey;
1360
1360
  readonly paramHelpKey: typeof flowParamHelpKey;
1361
- readonly numberValue: typeof flowNumberValue;
1362
1361
  /** `id` names the node too, so each node gets its own inputs. */
1363
1362
  fields: (FlowNodeField & {
1364
1363
  id: string;
1365
1364
  })[];
1366
1365
  conditionNotAnObject: boolean;
1367
- constructor(translation: TranslocoService, cdr: ChangeDetectorRef, destroyRef: DestroyRef, host: ElementRef<HTMLElement>);
1366
+ constructor(host: ElementRef<HTMLElement>);
1368
1367
  ngOnChanges(changes: SimpleChanges): void;
1369
1368
  private saveFieldBeingTyped;
1370
1369
  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
1370
  fieldId(key: string): string;
1374
1371
  param(key: string): unknown;
1375
1372
  setParam(key: string, value: unknown): void;
@@ -1601,6 +1598,123 @@ declare class FlowsPairsFieldComponent implements OnChanges {
1601
1598
  "valueChange": "valueChange";
1602
1599
  }, never, never, false, never>;
1603
1600
  }
1601
+ declare const FLOW_AI_DECIDE_TYPE = "logic.ai_decide";
1602
+ interface FlowAiChoice {
1603
+ name: string;
1604
+ description: string;
1605
+ }
1606
+ declare function flowAiChoices(node: FlowGraphNode): FlowAiChoice[];
1607
+ /** Must match products-api FlowNodeOutputs.of. */
1608
+ declare function flowNodeOutputs(node: FlowGraphNode, definition: FlowNodeDefinition): string[];
1609
+ declare namespace flows_choices_field_component_d_exports {
1610
+ export { FLOW_RESERVED_CHOICES, FlowsChoicesFieldComponent, flowChoiceName, flowChoiceProblem };
1611
+ }
1612
+ /** Lower snake case, which is what products-api accepts as a branch name. */
1613
+ declare function flowChoiceName(name: string): string;
1614
+ /** products-api FlowAiDecideParams::RESERVED: the node's own branches. */
1615
+ declare const FLOW_RESERVED_CHOICES: string[];
1616
+ /** A name that would get no output of its own: a built-in branch, or one used above. */
1617
+ declare function flowChoiceProblem(names: readonly string[], index: number): string | null;
1618
+ declare class FlowsChoicesFieldComponent implements OnChanges {
1619
+ value: unknown;
1620
+ inputId: string;
1621
+ readOnly: boolean;
1622
+ readonly valueChange: EventEmitter<FlowAiChoice[]>;
1623
+ readonly icons: {
1624
+ readonly inspect: import("@fortawesome/fontawesome-common-types").IconDefinition;
1625
+ readonly back: import("@fortawesome/fontawesome-common-types").IconDefinition;
1626
+ readonly error: import("@fortawesome/fontawesome-common-types").IconDefinition;
1627
+ readonly create: import("@fortawesome/fontawesome-common-types").IconDefinition;
1628
+ readonly edit: import("@fortawesome/fontawesome-common-types").IconDefinition;
1629
+ readonly delete: import("@fortawesome/fontawesome-common-types").IconDefinition;
1630
+ readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
1631
+ readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
1632
+ readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
1633
+ readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
1634
+ readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
1635
+ readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
1636
+ readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
1637
+ readonly warning: import("@fortawesome/fontawesome-common-types").IconDefinition;
1638
+ readonly collapsed: import("@fortawesome/fontawesome-common-types").IconDefinition;
1639
+ readonly expanded: import("@fortawesome/fontawesome-common-types").IconDefinition;
1640
+ readonly turnOn: import("@fortawesome/fontawesome-common-types").IconDefinition;
1641
+ readonly turnOff: import("@fortawesome/fontawesome-common-types").IconDefinition;
1642
+ };
1643
+ choices: FlowAiChoice[];
1644
+ problems: (string | null)[];
1645
+ private emitted;
1646
+ ngOnChanges(): void;
1647
+ addChoice(): void;
1648
+ removeChoice(index: number): void;
1649
+ commit(): void;
1650
+ private checkNames;
1651
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowsChoicesFieldComponent, never>;
1652
+ static ɵcmp: i0.ɵɵComponentDeclaration<FlowsChoicesFieldComponent, "pw-flows-choices-field", never, {
1653
+ "value": {
1654
+ "alias": "value";
1655
+ "required": false;
1656
+ };
1657
+ "inputId": {
1658
+ "alias": "inputId";
1659
+ "required": false;
1660
+ };
1661
+ "readOnly": {
1662
+ "alias": "readOnly";
1663
+ "required": false;
1664
+ };
1665
+ }, {
1666
+ "valueChange": "valueChange";
1667
+ }, never, never, false, never>;
1668
+ }
1669
+ declare namespace flows_param_field_component_d_exports {
1670
+ export { FlowsParamFieldComponent };
1671
+ }
1672
+ declare class FlowsParamFieldComponent {
1673
+ /** `id` names the node too, so each node gets its own inputs. */
1674
+ field: FlowNodeField & {
1675
+ id: string;
1676
+ };
1677
+ value: unknown;
1678
+ readOnly: boolean;
1679
+ subscriptionId: number;
1680
+ /** The lists Split out can pick from; empty until the node before it has run. */
1681
+ listSuggestions: string[];
1682
+ readonly valueChange: EventEmitter<unknown>;
1683
+ mergeModes: {
1684
+ value: string;
1685
+ label: string;
1686
+ }[];
1687
+ readonly defaultMergeMode: string;
1688
+ readonly numberValue: typeof flowNumberValue;
1689
+ constructor(translation: TranslocoService, cdr: ChangeDetectorRef, destroyRef: DestroyRef);
1690
+ /** A list is picked from what is known, and typed when nothing is known yet. */
1691
+ get kind(): FlowNodeField['kind'];
1692
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowsParamFieldComponent, never>;
1693
+ static ɵcmp: i0.ɵɵComponentDeclaration<FlowsParamFieldComponent, "pw-flows-param-field", never, {
1694
+ "field": {
1695
+ "alias": "field";
1696
+ "required": false;
1697
+ };
1698
+ "value": {
1699
+ "alias": "value";
1700
+ "required": false;
1701
+ };
1702
+ "readOnly": {
1703
+ "alias": "readOnly";
1704
+ "required": false;
1705
+ };
1706
+ "subscriptionId": {
1707
+ "alias": "subscriptionId";
1708
+ "required": false;
1709
+ };
1710
+ "listSuggestions": {
1711
+ "alias": "listSuggestions";
1712
+ "required": false;
1713
+ };
1714
+ }, {
1715
+ "valueChange": "valueChange";
1716
+ }, never, never, false, never>;
1717
+ }
1604
1718
  interface FlowMember {
1605
1719
  id: number;
1606
1720
  name: string;
@@ -1867,8 +1981,21 @@ declare class FlowWorkflowBadgePipe implements PipeTransform {
1867
1981
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowWorkflowBadgePipe, never>;
1868
1982
  static ɵpipe: i0.ɵɵPipeDeclaration<FlowWorkflowBadgePipe, "flowWorkflowBadge", false>;
1869
1983
  }
1984
+ declare namespace flow_json_lines_pipe_d_exports {
1985
+ export { FlowJsonLine, FlowJsonLinesPipe };
1986
+ }
1987
+ interface FlowJsonLine {
1988
+ depth: number;
1989
+ text: string;
1990
+ }
1991
+ /** Pretty JSON as lines with their depth, so a long value that wraps stays under its own line. */
1992
+ declare class FlowJsonLinesPipe implements PipeTransform {
1993
+ transform(value: unknown): FlowJsonLine[];
1994
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowJsonLinesPipe, never>;
1995
+ static ɵpipe: i0.ɵɵPipeDeclaration<FlowJsonLinesPipe, "flowJsonLines", false>;
1996
+ }
1870
1997
  export declare class FlowsPrivateModule {
1871
1998
  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>;
1999
+ 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
2000
  static ɵinj: i0.ɵɵInjectorDeclaration<FlowsPrivateModule>;
1874
2001
  }