@posiwise/flows 0.0.1 → 0.0.2
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/fesm2022/posiwise-flows.mjs +232 -94
- package/fesm2022/posiwise-flows.mjs.map +1 -1
- package/package.json +1 -1
- package/types/posiwise-flows.d.ts +73 -17
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, DestroyRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
|
|
2
|
+
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, DestroyRef, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
|
|
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
|
|
6
|
+
import * as i26 from "@posiwise/shared-components";
|
|
7
7
|
import { ConfirmDialogService } from "@posiwise/shared-components";
|
|
8
8
|
import * as i22 from "@angular/forms";
|
|
9
9
|
import { UntypedFormGroup } from "@angular/forms";
|
|
@@ -15,14 +15,15 @@ import { TranslocoService } from "@jsverse/transloco";
|
|
|
15
15
|
import { ClassicPreset, GetSchemes } from "rete";
|
|
16
16
|
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
17
17
|
import * as i21 from "@angular/common";
|
|
18
|
-
import * as i23 from "@posiwise/core-
|
|
19
|
-
import * as i24 from "@posiwise/
|
|
20
|
-
import * as
|
|
21
|
-
import * as i27 from "
|
|
22
|
-
import * as i28 from "primeng/
|
|
23
|
-
import * as i29 from "primeng/
|
|
24
|
-
import * as i30 from "primeng/
|
|
25
|
-
import * as i31 from "
|
|
18
|
+
import * as i23 from "@posiwise/core-guards";
|
|
19
|
+
import * as i24 from "@posiwise/core-transloco";
|
|
20
|
+
import * as i25 from "@posiwise/app-loader";
|
|
21
|
+
import * as i27 from "@fortawesome/angular-fontawesome";
|
|
22
|
+
import * as i28 from "primeng/iconfield";
|
|
23
|
+
import * as i29 from "primeng/inputicon";
|
|
24
|
+
import * as i30 from "primeng/autocomplete";
|
|
25
|
+
import * as i31 from "primeng/inputtext";
|
|
26
|
+
import * as i32 from "rete-angular-plugin/22";
|
|
26
27
|
declare namespace flows_private_routing_module_d_exports {
|
|
27
28
|
export { FlowsPrivateRoutingModule };
|
|
28
29
|
}
|
|
@@ -88,7 +89,7 @@ declare function flowWorkflowStatusOptions(labels: readonly string[]): {
|
|
|
88
89
|
declare function flowWorkflowForm(): UntypedFormGroup;
|
|
89
90
|
declare function flowVersionBadgeClass(version: Pick<FlowVersion, 'published_at'>): string;
|
|
90
91
|
declare function flowWorkflowBadgeClass(status: FlowWorkflowStatus): string;
|
|
91
|
-
declare function flowVersionEditorTitleKey(version: FlowVersion | null): string;
|
|
92
|
+
declare function flowVersionEditorTitleKey(version: FlowVersion | null, duplicateOf?: FlowVersion | null): string;
|
|
92
93
|
declare class FlowsWorkflowService {
|
|
93
94
|
private readonly api;
|
|
94
95
|
constructor(api: ProductsHttpService);
|
|
@@ -138,6 +139,7 @@ declare class FlowsWorkflowsComponent extends AppBaseComponent implements OnInit
|
|
|
138
139
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
139
140
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
140
141
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
142
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
141
143
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
142
144
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
143
145
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -186,6 +188,7 @@ declare class FlowsWorkflowFormComponent extends AppBaseComponent implements OnI
|
|
|
186
188
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
187
189
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
188
190
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
191
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
189
192
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
190
193
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
191
194
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -223,6 +226,8 @@ declare class FlowsWorkflowVersionsComponent extends AppBaseComponent implements
|
|
|
223
226
|
editorOpen: boolean;
|
|
224
227
|
/** Null when authoring a new version. */
|
|
225
228
|
editorVersion: FlowVersion | null;
|
|
229
|
+
/** The version a new one is being copied from. */
|
|
230
|
+
editorDuplicateOf: FlowVersion | null;
|
|
226
231
|
/** Set by a link from a run; opened once, on the first load. */
|
|
227
232
|
private requestedVersionId;
|
|
228
233
|
icons: {
|
|
@@ -235,6 +240,7 @@ declare class FlowsWorkflowVersionsComponent extends AppBaseComponent implements
|
|
|
235
240
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
236
241
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
237
242
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
243
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
238
244
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
239
245
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
240
246
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -246,7 +252,9 @@ declare class FlowsWorkflowVersionsComponent extends AppBaseComponent implements
|
|
|
246
252
|
constructor(injector: Injector, workflowService: FlowsWorkflowService, permissions: PermissionService, cdr: ChangeDetectorRef);
|
|
247
253
|
ngOnInit(): void;
|
|
248
254
|
ngOnDestroy(): void;
|
|
249
|
-
openEditor(version?: FlowVersion | null): void;
|
|
255
|
+
openEditor(version?: FlowVersion | null, duplicateOf?: FlowVersion | null): void;
|
|
256
|
+
/** Opens an unsaved new version holding a copy of this one's graph. */
|
|
257
|
+
duplicate(version: FlowVersion): void;
|
|
250
258
|
closeEditor(): void;
|
|
251
259
|
onVersionSaved(): void;
|
|
252
260
|
publish(version: FlowVersion): void;
|
|
@@ -262,6 +270,20 @@ type FlowNodeCategory = 'trigger' | 'logic' | 'data' | 'action';
|
|
|
262
270
|
declare const FLOW_NODE_CATEGORIES: readonly FlowNodeCategory[];
|
|
263
271
|
/** An edge with no branch leaves through `next`. */
|
|
264
272
|
declare const DEFAULT_FLOW_BRANCH = "next";
|
|
273
|
+
/** What the catalogue says about one param of a node. Every part is optional. */
|
|
274
|
+
interface FlowParamDetail {
|
|
275
|
+
label?: string;
|
|
276
|
+
description?: string;
|
|
277
|
+
placeholder?: string;
|
|
278
|
+
kind?: 'text' | 'textarea' | 'number' | 'select';
|
|
279
|
+
options?: string[];
|
|
280
|
+
required?: boolean;
|
|
281
|
+
}
|
|
282
|
+
/** Field names this subscription's runs saw a node return: of an item, and of the entries of each list in it. */
|
|
283
|
+
interface FlowItemFields {
|
|
284
|
+
names: string[];
|
|
285
|
+
lists: Record<string, string[]>;
|
|
286
|
+
}
|
|
265
287
|
interface FlowNodeDefinition {
|
|
266
288
|
type: string;
|
|
267
289
|
category: FlowNodeCategory;
|
|
@@ -269,6 +291,10 @@ interface FlowNodeDefinition {
|
|
|
269
291
|
label: string;
|
|
270
292
|
/** The only param keys this node may carry. */
|
|
271
293
|
params: string[];
|
|
294
|
+
/** Keyed by param; set on nodes an integration supplies, empty on the engine's own. */
|
|
295
|
+
param_details?: Record<string, FlowParamDetail>;
|
|
296
|
+
/** Absent until the node has run for this subscription. */
|
|
297
|
+
item_fields?: FlowItemFields;
|
|
272
298
|
condition: boolean;
|
|
273
299
|
outputs: string[];
|
|
274
300
|
}
|
|
@@ -300,6 +326,8 @@ interface FlowNodeSelection {
|
|
|
300
326
|
/** Null when the catalogue no longer lists the node's type. */
|
|
301
327
|
definition: FlowNodeDefinition | null;
|
|
302
328
|
fieldSuggestions: string[];
|
|
329
|
+
/** The lists an item reaching the node can hold, for Split out to pick from. */
|
|
330
|
+
listSuggestions: string[];
|
|
303
331
|
}
|
|
304
332
|
interface FlowGraph {
|
|
305
333
|
nodes: FlowGraphNode[];
|
|
@@ -329,6 +357,8 @@ declare class FlowsVersionEditorComponent implements OnInit, OnChanges, OnDestro
|
|
|
329
357
|
private readonly destroy$;
|
|
330
358
|
/** Null when authoring a new version. */
|
|
331
359
|
version: FlowVersion | null;
|
|
360
|
+
/** A new version starts from a copy of this one's graph. */
|
|
361
|
+
duplicateOf: FlowVersion | null;
|
|
332
362
|
workflowId: number;
|
|
333
363
|
subscriptionId: number;
|
|
334
364
|
readonly saved: EventEmitter<void>;
|
|
@@ -344,6 +374,7 @@ declare class FlowsVersionEditorComponent implements OnInit, OnChanges, OnDestro
|
|
|
344
374
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
345
375
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
346
376
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
377
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
347
378
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
348
379
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
349
380
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -376,6 +407,10 @@ declare class FlowsVersionEditorComponent implements OnInit, OnChanges, OnDestro
|
|
|
376
407
|
"alias": "version";
|
|
377
408
|
"required": false;
|
|
378
409
|
};
|
|
410
|
+
"duplicateOf": {
|
|
411
|
+
"alias": "duplicateOf";
|
|
412
|
+
"required": false;
|
|
413
|
+
};
|
|
379
414
|
"workflowId": {
|
|
380
415
|
"alias": "workflowId";
|
|
381
416
|
"required": false;
|
|
@@ -499,6 +534,7 @@ declare class FlowsRunsComponent extends AppBaseComponent implements OnInit {
|
|
|
499
534
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
500
535
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
501
536
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
537
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
502
538
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
503
539
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
504
540
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -670,6 +706,7 @@ declare class FlowsRunInspectorComponent extends AppBaseComponent implements OnI
|
|
|
670
706
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
671
707
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
672
708
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
709
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
673
710
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
674
711
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
675
712
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -883,12 +920,14 @@ declare class FlowsNodePaletteComponent implements OnChanges {
|
|
|
883
920
|
"add": "add";
|
|
884
921
|
}, never, never, false, never>;
|
|
885
922
|
}
|
|
886
|
-
type FlowFieldKind = 'text' | 'textarea' | 'email' | 'member' | 'members' | 'json' | 'pairs' | 'mode' | 'cron' | 'timezone';
|
|
887
|
-
interface FlowNodeField {
|
|
923
|
+
type FlowFieldKind = 'text' | 'textarea' | 'email' | 'member' | 'members' | 'json' | 'pairs' | 'mode' | 'cron' | 'timezone' | 'number' | 'select' | 'list';
|
|
924
|
+
interface FlowNodeField extends Omit<FlowParamDetail, 'kind'> {
|
|
888
925
|
key: string;
|
|
889
926
|
kind: FlowFieldKind;
|
|
890
927
|
}
|
|
891
928
|
declare function flowNodeFields(definition: FlowNodeDefinition): FlowNodeField[];
|
|
929
|
+
/** A number, unless it is a {{placeholder}} that a run fills in. */
|
|
930
|
+
declare function flowNumberValue(value: unknown): unknown;
|
|
892
931
|
/** data.merge accepts only this mode today. */
|
|
893
932
|
declare const FLOW_MERGE_MODES: readonly string[];
|
|
894
933
|
declare function flowParamLabelKey(key: string): string;
|
|
@@ -896,12 +935,15 @@ declare namespace flows_node_inspector_component_d_exports {
|
|
|
896
935
|
export { FlowsNodeInspectorComponent };
|
|
897
936
|
}
|
|
898
937
|
declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked {
|
|
938
|
+
private readonly host;
|
|
899
939
|
node: FlowGraphNode;
|
|
900
940
|
/** Null when the catalogue no longer lists the node's type. */
|
|
901
941
|
definition: FlowNodeDefinition | null;
|
|
902
942
|
subscriptionId: number;
|
|
903
943
|
readOnly: boolean;
|
|
904
944
|
fieldSuggestions: string[];
|
|
945
|
+
/** The lists Split out can pick from; empty until the node before it has run. */
|
|
946
|
+
listSuggestions: string[];
|
|
905
947
|
private leaving?;
|
|
906
948
|
readonly nodeChange: EventEmitter<FlowGraphNode>;
|
|
907
949
|
readonly remove: EventEmitter<void>;
|
|
@@ -915,6 +957,7 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
|
|
|
915
957
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
916
958
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
917
959
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
960
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
918
961
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
919
962
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
920
963
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -927,11 +970,18 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
|
|
|
927
970
|
readonly defaultMergeMode: string;
|
|
928
971
|
readonly labelKey: typeof flowNodeLabelKey;
|
|
929
972
|
readonly paramLabelKey: typeof flowParamLabelKey;
|
|
930
|
-
|
|
973
|
+
readonly numberValue: typeof flowNumberValue;
|
|
974
|
+
/** `id` names the node too, so each node gets its own inputs. */
|
|
975
|
+
fields: (FlowNodeField & {
|
|
976
|
+
id: string;
|
|
977
|
+
})[];
|
|
931
978
|
conditionNotAnObject: boolean;
|
|
932
|
-
constructor(translation: TranslocoService, cdr: ChangeDetectorRef, destroyRef: DestroyRef);
|
|
979
|
+
constructor(translation: TranslocoService, cdr: ChangeDetectorRef, destroyRef: DestroyRef, host: ElementRef<HTMLElement>);
|
|
933
980
|
ngOnChanges(changes: SimpleChanges): void;
|
|
981
|
+
private saveFieldBeingTyped;
|
|
934
982
|
ngAfterViewChecked(): void;
|
|
983
|
+
/** A list is picked from what is known, and typed when nothing is known yet. */
|
|
984
|
+
kindOf(field: FlowNodeField): FlowNodeField['kind'];
|
|
935
985
|
fieldId(key: string): string;
|
|
936
986
|
param(key: string): unknown;
|
|
937
987
|
setParam(key: string, value: unknown): void;
|
|
@@ -959,6 +1009,10 @@ declare class FlowsNodeInspectorComponent implements OnChanges, AfterViewChecked
|
|
|
959
1009
|
"alias": "fieldSuggestions";
|
|
960
1010
|
"required": false;
|
|
961
1011
|
};
|
|
1012
|
+
"listSuggestions": {
|
|
1013
|
+
"alias": "listSuggestions";
|
|
1014
|
+
"required": false;
|
|
1015
|
+
};
|
|
962
1016
|
}, {
|
|
963
1017
|
"nodeChange": "nodeChange";
|
|
964
1018
|
"remove": "remove";
|
|
@@ -1040,6 +1094,7 @@ declare class FlowsConditionFieldComponent implements OnChanges {
|
|
|
1040
1094
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1041
1095
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1042
1096
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1097
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1043
1098
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1044
1099
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1045
1100
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -1110,6 +1165,7 @@ declare class FlowsPairsFieldComponent implements OnChanges {
|
|
|
1110
1165
|
readonly versions: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1111
1166
|
readonly search: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1112
1167
|
readonly publish: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1168
|
+
readonly duplicate: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1113
1169
|
readonly fit: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1114
1170
|
readonly diagram: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
1115
1171
|
readonly json: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -1204,6 +1260,6 @@ declare class FlowsMemberFieldComponent implements OnChanges, OnDestroy {
|
|
|
1204
1260
|
}
|
|
1205
1261
|
export declare class FlowsPrivateModule {
|
|
1206
1262
|
static ɵfac: i0.ɵɵFactoryDeclaration<FlowsPrivateModule, never>;
|
|
1207
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<FlowsPrivateModule, [typeof FlowsTabsComponent, typeof FlowsWorkflowsComponent, typeof FlowsWorkflowFormComponent, typeof FlowsWorkflowVersionsComponent, typeof FlowsVersionEditorComponent, typeof FlowsRunsComponent, typeof FlowsRunsFiltersComponent, typeof FlowsCronFieldComponent, typeof FlowsTimezoneFieldComponent, typeof FlowsRunInspectorComponent, typeof FlowsGraphCanvasComponent, typeof FlowsCanvasNodeComponent, typeof FlowsCanvasSocketComponent, typeof FlowsCanvasConnectionComponent, typeof FlowsNodePaletteComponent, typeof FlowsNodeInspectorComponent, typeof FlowsJsonFieldComponent, typeof FlowsConditionFieldComponent, typeof FlowsPairsFieldComponent, typeof FlowsMemberFieldComponent], [typeof i21.CommonModule, typeof i22.FormsModule, typeof i22.ReactiveFormsModule, typeof i23.
|
|
1263
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FlowsPrivateModule, [typeof FlowsTabsComponent, typeof FlowsWorkflowsComponent, typeof FlowsWorkflowFormComponent, typeof FlowsWorkflowVersionsComponent, typeof FlowsVersionEditorComponent, typeof FlowsRunsComponent, typeof FlowsRunsFiltersComponent, typeof FlowsCronFieldComponent, typeof FlowsTimezoneFieldComponent, typeof FlowsRunInspectorComponent, typeof FlowsGraphCanvasComponent, typeof FlowsCanvasNodeComponent, typeof FlowsCanvasSocketComponent, typeof FlowsCanvasConnectionComponent, typeof FlowsNodePaletteComponent, typeof FlowsNodeInspectorComponent, typeof FlowsJsonFieldComponent, typeof FlowsConditionFieldComponent, typeof FlowsPairsFieldComponent, typeof FlowsMemberFieldComponent], [typeof i21.CommonModule, typeof i22.FormsModule, typeof i22.ReactiveFormsModule, typeof i23.TrackDirtyFormDirective, typeof i24.CoreTranslocoModule, typeof i25.AppLoaderModule, typeof i26.SharedComponentsModule, typeof i27.FontAwesomeModule, typeof i28.IconFieldModule, typeof i29.InputIconModule, typeof i30.AutoCompleteModule, typeof i31.InputTextModule, typeof i32.ReteModule, typeof FlowsPrivateRoutingModule], never>;
|
|
1208
1264
|
static ɵinj: i0.ɵɵInjectorDeclaration<FlowsPrivateModule>;
|
|
1209
1265
|
}
|