@timeax/digital-service-engine 0.3.0 → 0.3.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.
@@ -1476,6 +1476,7 @@ type DuplicateOptions = {
1476
1476
  nameStrategy?: (old?: string) => string | undefined;
1477
1477
  optionIdStrategy?: (old: string) => string;
1478
1478
  };
1479
+ type DuplicateManyOptions = Omit<DuplicateOptions, "id">;
1479
1480
  type EditorNodeLookup = {
1480
1481
  kind: "tag";
1481
1482
  data?: Tag;
@@ -1528,6 +1529,7 @@ declare class Editor {
1528
1529
  redo(): boolean;
1529
1530
  clearService(id: string): void;
1530
1531
  duplicate(ref: NodeRef, opts?: DuplicateOptions): string;
1532
+ duplicateMany(ids: readonly string[], opts?: DuplicateManyOptions): string[];
1531
1533
  reLabel(id: string, nextLabel: string): void;
1532
1534
  setFieldName(fieldId: string, nextName: string | null | undefined): void;
1533
1535
  getLastPolicyDiagnostics(): PolicyDiagnostic[] | undefined;
@@ -1580,6 +1582,29 @@ declare class Editor {
1580
1582
  updateField(id: string, patch: Partial<Field>): void;
1581
1583
  removeField(id: string): void;
1582
1584
  remove(id: string): void;
1585
+ removeMany(ids: readonly string[]): void;
1586
+ clearServiceMany(ids: readonly string[]): void;
1587
+ rebindMany(ids: readonly string[], targetTagId: string, opts?: {
1588
+ allowTagCycles?: boolean;
1589
+ }): void;
1590
+ includeMany(receiverId: string, ids: readonly string[]): void;
1591
+ excludeMany(receiverId: string, ids: readonly string[]): void;
1592
+ clearRelationsMany(ids: readonly string[], mode?: "owned" | "incoming" | "both"): void;
1593
+ renameLabelsMany(ids: readonly string[], input: {
1594
+ prefix?: string;
1595
+ suffix?: string;
1596
+ }): void;
1597
+ setPricingRoleMany(ids: readonly string[], role: "base" | "utility"): void;
1598
+ clearFieldDefaultsMany(ids: readonly string[]): void;
1599
+ clearFieldValidationMany(ids: readonly string[]): void;
1600
+ autoCreateOptionsMany(ids: readonly string[], makeOption?: (fieldId: string) => {
1601
+ id?: string;
1602
+ label: string;
1603
+ value?: string | number;
1604
+ }): void;
1605
+ clearAllOptionsMany(ids: readonly string[]): void;
1606
+ removeNoticesForNodes(ids: readonly string[]): void;
1607
+ setNoticesVisibilityForNodes(ids: readonly string[], type: "public" | "private"): void;
1583
1608
  getNode(id: string): EditorNodeLookup;
1584
1609
  getFieldQuantityRule(id: string): QuantityRule | undefined;
1585
1610
  setFieldQuantityRule(id: string, rule: unknown): void;
@@ -1816,11 +1841,18 @@ type Adapter = {
1816
1841
  getInputPropsFromField?: (props: AdapterCtx) => any;
1817
1842
  toValue?: (value: any) => any;
1818
1843
  };
1844
+ type InputOptionCapability = {
1845
+ supported?: boolean;
1846
+ autoCreate?: boolean;
1847
+ defaultLabel?: string;
1848
+ defaultValue?: string | number;
1849
+ };
1819
1850
  type InputDescriptor = {
1820
1851
  Component: React.ComponentType<Record<string, unknown>>;
1821
1852
  adapter?: Adapter;
1822
1853
  defaultProps?: Record<string, unknown>;
1823
1854
  ui?: Record<string, Ui>;
1855
+ options?: InputOptionCapability;
1824
1856
  };
1825
1857
  type VariantMap = Map<InputVariant, InputDescriptor>;
1826
1858
  type RegistryStore = Map<InputKind, VariantMap>;
@@ -1856,6 +1888,7 @@ declare function Provider({ children, initialRegistry, }: {
1856
1888
  initialRegistry?: Registry;
1857
1889
  }): react_jsx_runtime.JSX.Element;
1858
1890
  declare function useInputs(): InputsCtxValue;
1891
+ declare function useInputsMaybe(): InputsCtxValue | null;
1859
1892
 
1860
1893
  type InputWrapperProps = {
1861
1894
  field: Field;
@@ -2246,4 +2279,4 @@ type Props = {
2246
2279
  };
2247
2280
  declare function FallbackAddRegistrationDialog({ open, onClose, onSelect, }: Props): react_jsx_runtime.JSX.Element | null;
2248
2281
 
2249
- export { type Adapter, type AdapterCtx, CanvasAPI, type EditorSettings, EventBus, type EventMap, FallbackAddCandidatesDialog, FallbackAddRegistrationDialog, FallbackDetailsPanel, FallbackEditor, type FallbackEditorData, FallbackEditorHeader, FallbackEditorProvider, type FallbackEditorProviderProps, FallbackRegistrationsPanel, FallbackServiceSidebar, FallbackSettingsPanel, type FormApi, FormProvider, type FormProviderProps, type FormSnapshot, type InputDescriptor, type InputKind, type InputVariant, type InputWrapperProps, OrderFlowProvider, Provider, type RegistrationItem, type RegistrationScope, type Registry, type ServiceSummary, type ValidationMessage, type ValidationTone, VirtualServiceList, Wrapper, createInputRegistry, registerEntries, resolveInputDescriptor, useActiveFallbackRegistrations, useEligibleServiceList, useFallbackEditor, useFallbackEditorContext, useFormApi, useInputs, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };
2282
+ export { type Adapter, type AdapterCtx, CanvasAPI, type EditorSettings, EventBus, type EventMap, FallbackAddCandidatesDialog, FallbackAddRegistrationDialog, FallbackDetailsPanel, FallbackEditor, type FallbackEditorData, FallbackEditorHeader, FallbackEditorProvider, type FallbackEditorProviderProps, FallbackRegistrationsPanel, FallbackServiceSidebar, FallbackSettingsPanel, type FormApi, FormProvider, type FormProviderProps, type FormSnapshot, type InputDescriptor, type InputKind, type InputOptionCapability, type InputVariant, type InputWrapperProps, OrderFlowProvider, Provider, type RegistrationItem, type RegistrationScope, type Registry, type ServiceSummary, type ValidationMessage, type ValidationTone, VirtualServiceList, Wrapper, createInputRegistry, registerEntries, resolveInputDescriptor, useActiveFallbackRegistrations, useEligibleServiceList, useFallbackEditor, useFallbackEditorContext, useFormApi, useInputs, useInputsMaybe, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };
@@ -1476,6 +1476,7 @@ type DuplicateOptions = {
1476
1476
  nameStrategy?: (old?: string) => string | undefined;
1477
1477
  optionIdStrategy?: (old: string) => string;
1478
1478
  };
1479
+ type DuplicateManyOptions = Omit<DuplicateOptions, "id">;
1479
1480
  type EditorNodeLookup = {
1480
1481
  kind: "tag";
1481
1482
  data?: Tag;
@@ -1528,6 +1529,7 @@ declare class Editor {
1528
1529
  redo(): boolean;
1529
1530
  clearService(id: string): void;
1530
1531
  duplicate(ref: NodeRef, opts?: DuplicateOptions): string;
1532
+ duplicateMany(ids: readonly string[], opts?: DuplicateManyOptions): string[];
1531
1533
  reLabel(id: string, nextLabel: string): void;
1532
1534
  setFieldName(fieldId: string, nextName: string | null | undefined): void;
1533
1535
  getLastPolicyDiagnostics(): PolicyDiagnostic[] | undefined;
@@ -1580,6 +1582,29 @@ declare class Editor {
1580
1582
  updateField(id: string, patch: Partial<Field>): void;
1581
1583
  removeField(id: string): void;
1582
1584
  remove(id: string): void;
1585
+ removeMany(ids: readonly string[]): void;
1586
+ clearServiceMany(ids: readonly string[]): void;
1587
+ rebindMany(ids: readonly string[], targetTagId: string, opts?: {
1588
+ allowTagCycles?: boolean;
1589
+ }): void;
1590
+ includeMany(receiverId: string, ids: readonly string[]): void;
1591
+ excludeMany(receiverId: string, ids: readonly string[]): void;
1592
+ clearRelationsMany(ids: readonly string[], mode?: "owned" | "incoming" | "both"): void;
1593
+ renameLabelsMany(ids: readonly string[], input: {
1594
+ prefix?: string;
1595
+ suffix?: string;
1596
+ }): void;
1597
+ setPricingRoleMany(ids: readonly string[], role: "base" | "utility"): void;
1598
+ clearFieldDefaultsMany(ids: readonly string[]): void;
1599
+ clearFieldValidationMany(ids: readonly string[]): void;
1600
+ autoCreateOptionsMany(ids: readonly string[], makeOption?: (fieldId: string) => {
1601
+ id?: string;
1602
+ label: string;
1603
+ value?: string | number;
1604
+ }): void;
1605
+ clearAllOptionsMany(ids: readonly string[]): void;
1606
+ removeNoticesForNodes(ids: readonly string[]): void;
1607
+ setNoticesVisibilityForNodes(ids: readonly string[], type: "public" | "private"): void;
1583
1608
  getNode(id: string): EditorNodeLookup;
1584
1609
  getFieldQuantityRule(id: string): QuantityRule | undefined;
1585
1610
  setFieldQuantityRule(id: string, rule: unknown): void;
@@ -1816,11 +1841,18 @@ type Adapter = {
1816
1841
  getInputPropsFromField?: (props: AdapterCtx) => any;
1817
1842
  toValue?: (value: any) => any;
1818
1843
  };
1844
+ type InputOptionCapability = {
1845
+ supported?: boolean;
1846
+ autoCreate?: boolean;
1847
+ defaultLabel?: string;
1848
+ defaultValue?: string | number;
1849
+ };
1819
1850
  type InputDescriptor = {
1820
1851
  Component: React.ComponentType<Record<string, unknown>>;
1821
1852
  adapter?: Adapter;
1822
1853
  defaultProps?: Record<string, unknown>;
1823
1854
  ui?: Record<string, Ui>;
1855
+ options?: InputOptionCapability;
1824
1856
  };
1825
1857
  type VariantMap = Map<InputVariant, InputDescriptor>;
1826
1858
  type RegistryStore = Map<InputKind, VariantMap>;
@@ -1856,6 +1888,7 @@ declare function Provider({ children, initialRegistry, }: {
1856
1888
  initialRegistry?: Registry;
1857
1889
  }): react_jsx_runtime.JSX.Element;
1858
1890
  declare function useInputs(): InputsCtxValue;
1891
+ declare function useInputsMaybe(): InputsCtxValue | null;
1859
1892
 
1860
1893
  type InputWrapperProps = {
1861
1894
  field: Field;
@@ -2246,4 +2279,4 @@ type Props = {
2246
2279
  };
2247
2280
  declare function FallbackAddRegistrationDialog({ open, onClose, onSelect, }: Props): react_jsx_runtime.JSX.Element | null;
2248
2281
 
2249
- export { type Adapter, type AdapterCtx, CanvasAPI, type EditorSettings, EventBus, type EventMap, FallbackAddCandidatesDialog, FallbackAddRegistrationDialog, FallbackDetailsPanel, FallbackEditor, type FallbackEditorData, FallbackEditorHeader, FallbackEditorProvider, type FallbackEditorProviderProps, FallbackRegistrationsPanel, FallbackServiceSidebar, FallbackSettingsPanel, type FormApi, FormProvider, type FormProviderProps, type FormSnapshot, type InputDescriptor, type InputKind, type InputVariant, type InputWrapperProps, OrderFlowProvider, Provider, type RegistrationItem, type RegistrationScope, type Registry, type ServiceSummary, type ValidationMessage, type ValidationTone, VirtualServiceList, Wrapper, createInputRegistry, registerEntries, resolveInputDescriptor, useActiveFallbackRegistrations, useEligibleServiceList, useFallbackEditor, useFallbackEditorContext, useFormApi, useInputs, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };
2282
+ export { type Adapter, type AdapterCtx, CanvasAPI, type EditorSettings, EventBus, type EventMap, FallbackAddCandidatesDialog, FallbackAddRegistrationDialog, FallbackDetailsPanel, FallbackEditor, type FallbackEditorData, FallbackEditorHeader, FallbackEditorProvider, type FallbackEditorProviderProps, FallbackRegistrationsPanel, FallbackServiceSidebar, FallbackSettingsPanel, type FormApi, FormProvider, type FormProviderProps, type FormSnapshot, type InputDescriptor, type InputKind, type InputOptionCapability, type InputVariant, type InputWrapperProps, OrderFlowProvider, Provider, type RegistrationItem, type RegistrationScope, type Registry, type ServiceSummary, type ValidationMessage, type ValidationTone, VirtualServiceList, Wrapper, createInputRegistry, registerEntries, resolveInputDescriptor, useActiveFallbackRegistrations, useEligibleServiceList, useFallbackEditor, useFallbackEditorContext, useFormApi, useInputs, useInputsMaybe, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };