@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.
@@ -1497,7 +1497,7 @@ interface WorkspaceAPI {
1497
1497
  strict?: boolean;
1498
1498
  includeWorkspaceData?: boolean;
1499
1499
  }>): Promise<void>;
1500
- templates(params?: Partial<Pick<TemplatesListParams, "branchId" | "since">>): Promise<void>;
1500
+ templates(params?: Partial<Pick<TemplatesListParams, "branchId" | "since">>): Promise<BackendResult<readonly FieldTemplate[]>>;
1501
1501
  participants(params?: Partial<{
1502
1502
  branchId: string;
1503
1503
  since?: number | string;
@@ -1651,6 +1651,7 @@ type DuplicateOptions = {
1651
1651
  nameStrategy?: (old?: string) => string | undefined;
1652
1652
  optionIdStrategy?: (old: string) => string;
1653
1653
  };
1654
+ type DuplicateManyOptions = Omit<DuplicateOptions, "id">;
1654
1655
  type EditorNodeLookup = {
1655
1656
  kind: "tag";
1656
1657
  data?: Tag;
@@ -1703,6 +1704,7 @@ declare class Editor {
1703
1704
  redo(): boolean;
1704
1705
  clearService(id: string): void;
1705
1706
  duplicate(ref: NodeRef, opts?: DuplicateOptions): string;
1707
+ duplicateMany(ids: readonly string[], opts?: DuplicateManyOptions): string[];
1706
1708
  reLabel(id: string, nextLabel: string): void;
1707
1709
  setFieldName(fieldId: string, nextName: string | null | undefined): void;
1708
1710
  getLastPolicyDiagnostics(): PolicyDiagnostic[] | undefined;
@@ -1755,6 +1757,29 @@ declare class Editor {
1755
1757
  updateField(id: string, patch: Partial<Field>): void;
1756
1758
  removeField(id: string): void;
1757
1759
  remove(id: string): void;
1760
+ removeMany(ids: readonly string[]): void;
1761
+ clearServiceMany(ids: readonly string[]): void;
1762
+ rebindMany(ids: readonly string[], targetTagId: string, opts?: {
1763
+ allowTagCycles?: boolean;
1764
+ }): void;
1765
+ includeMany(receiverId: string, ids: readonly string[]): void;
1766
+ excludeMany(receiverId: string, ids: readonly string[]): void;
1767
+ clearRelationsMany(ids: readonly string[], mode?: "owned" | "incoming" | "both"): void;
1768
+ renameLabelsMany(ids: readonly string[], input: {
1769
+ prefix?: string;
1770
+ suffix?: string;
1771
+ }): void;
1772
+ setPricingRoleMany(ids: readonly string[], role: "base" | "utility"): void;
1773
+ clearFieldDefaultsMany(ids: readonly string[]): void;
1774
+ clearFieldValidationMany(ids: readonly string[]): void;
1775
+ autoCreateOptionsMany(ids: readonly string[], makeOption?: (fieldId: string) => {
1776
+ id?: string;
1777
+ label: string;
1778
+ value?: string | number;
1779
+ }): void;
1780
+ clearAllOptionsMany(ids: readonly string[]): void;
1781
+ removeNoticesForNodes(ids: readonly string[]): void;
1782
+ setNoticesVisibilityForNodes(ids: readonly string[], type: "public" | "private"): void;
1758
1783
  getNode(id: string): EditorNodeLookup;
1759
1784
  getFieldQuantityRule(id: string): QuantityRule | undefined;
1760
1785
  setFieldQuantityRule(id: string, rule: unknown): void;
@@ -1977,7 +2002,19 @@ interface UseCanvasReturn {
1977
2002
  graph: GraphSnapshot;
1978
2003
  api: CanvasAPI;
1979
2004
  props?: ServiceProps;
1980
- }
2005
+ selectionCapabilities: SelectionCapabilities;
2006
+ }
2007
+ type SelectionCapabilities = {
2008
+ hasTags: boolean;
2009
+ hasFields: boolean;
2010
+ hasOptions: boolean;
2011
+ hasServiceBearingNodes: boolean;
2012
+ hasSelectedFieldWithOptions: boolean;
2013
+ hasNoticesForSelection: boolean;
2014
+ canIncludeExcludeTargets: boolean;
2015
+ canRebind: boolean;
2016
+ };
2017
+ declare function deriveSelectionCapabilities(props: ServiceProps | undefined, selectionInfo: CanvasSelection): SelectionCapabilities;
1981
2018
  /** ---------------- hook ---------------- */
1982
2019
  declare function useCanvas(): UseCanvasReturn;
1983
2020
 
@@ -2280,4 +2317,4 @@ interface WorkspaceProps {
2280
2317
  */
2281
2318
  declare function Workspace(props: WorkspaceProps): React.JSX.Element;
2282
2319
 
2283
- export { type Actor, type AdapterOptions, type Author, type AuthorsBackend, type BackendError, type BackendResult, type BackendScope, type Branch, type BranchAccessBackend, type BranchParticipant, type BranchesBackend, type BranchesSlice, Canvas, CanvasProvider, type CanvasSelection, type ClearTarget, type CommentsBackend, type Commit, type CreateMemoryWorkspaceBackendOptions, type Draft, type ErrorKind, type ErrorLog, type FieldTemplate, type FlowCanvasProps, type LabelPlacement, type LiveOptions, type Loadable, type MemoryBackendSeed, type MemorySeedBranchSnapshots, type MemorySeedComments, type MemorySeedParticipants, type MergeResult, type MergedErrors, type PermissionsBackend, type PermissionsMap, type PoliciesBackend, type PoliciesLoadResult, type PolicyScope, type Result, type ServiceSnapshot, type ServicesBackend, type ServicesInput, type SnapshotSlice, type SnapshotsBackend, type SnapshotsLoadResult, type TemplateCreateInput, type TemplateUpdatePatch, type TemplateValidator, type TemplatesBackend, type TemplatesListParams, type ToolsConfig, type TreeNode, type UseCanvasReturn, type UseErrorsOptions, type UseErrorsReturn, type ValidationRow, Workspace, type WorkspaceAPI, type WorkspaceBackend, type WorkspaceBootSection, type WorkspaceBootSectionState, type WorkspaceBootSectionStatus, type WorkspaceBootState, WorkspaceContext, type WorkspaceEvent, type WorkspaceInfo, type WorkspaceLiveAdapter, type WorkspaceLiveAdapterContext, type WorkspaceLiveAdapterHandlers, type WorkspaceLiveAdapterRegistry, type WorkspaceLiveStatus, type WorkspaceLiveTick, type WorkspaceProps, WorkspaceProvider, type WorkspaceProviderProps, createMemoryWorkspaceBackend, createPollAdapter, useCanvas, useCanvasAPI, useCanvasFromBuilder, useCanvasFromExisting, useCanvasOwned, useErrors, useWorkspace, useWorkspaceBoot, useWorkspaceMaybe };
2320
+ export { type Actor, type AdapterOptions, type Author, type AuthorsBackend, type BackendError, type BackendResult, type BackendScope, type Branch, type BranchAccessBackend, type BranchParticipant, type BranchesBackend, type BranchesSlice, Canvas, CanvasProvider, type CanvasSelection, type ClearTarget, type CommentsBackend, type Commit, type CreateMemoryWorkspaceBackendOptions, type Draft, type ErrorKind, type ErrorLog, type FieldTemplate, type FlowCanvasProps, type LabelPlacement, type LiveOptions, type Loadable, type MemoryBackendSeed, type MemorySeedBranchSnapshots, type MemorySeedComments, type MemorySeedParticipants, type MergeResult, type MergedErrors, type PermissionsBackend, type PermissionsMap, type PoliciesBackend, type PoliciesLoadResult, type PolicyScope, type Result, type SelectionCapabilities, type ServiceSnapshot, type ServicesBackend, type ServicesInput, type SnapshotSlice, type SnapshotsBackend, type SnapshotsLoadResult, type TemplateCreateInput, type TemplateUpdatePatch, type TemplateValidator, type TemplatesBackend, type TemplatesListParams, type ToolsConfig, type TreeNode, type UseCanvasReturn, type UseErrorsOptions, type UseErrorsReturn, type ValidationRow, Workspace, type WorkspaceAPI, type WorkspaceBackend, type WorkspaceBootSection, type WorkspaceBootSectionState, type WorkspaceBootSectionStatus, type WorkspaceBootState, WorkspaceContext, type WorkspaceEvent, type WorkspaceInfo, type WorkspaceLiveAdapter, type WorkspaceLiveAdapterContext, type WorkspaceLiveAdapterHandlers, type WorkspaceLiveAdapterRegistry, type WorkspaceLiveStatus, type WorkspaceLiveTick, type WorkspaceProps, WorkspaceProvider, type WorkspaceProviderProps, createMemoryWorkspaceBackend, createPollAdapter, deriveSelectionCapabilities, useCanvas, useCanvasAPI, useCanvasFromBuilder, useCanvasFromExisting, useCanvasOwned, useErrors, useWorkspace, useWorkspaceBoot, useWorkspaceMaybe };
@@ -1497,7 +1497,7 @@ interface WorkspaceAPI {
1497
1497
  strict?: boolean;
1498
1498
  includeWorkspaceData?: boolean;
1499
1499
  }>): Promise<void>;
1500
- templates(params?: Partial<Pick<TemplatesListParams, "branchId" | "since">>): Promise<void>;
1500
+ templates(params?: Partial<Pick<TemplatesListParams, "branchId" | "since">>): Promise<BackendResult<readonly FieldTemplate[]>>;
1501
1501
  participants(params?: Partial<{
1502
1502
  branchId: string;
1503
1503
  since?: number | string;
@@ -1651,6 +1651,7 @@ type DuplicateOptions = {
1651
1651
  nameStrategy?: (old?: string) => string | undefined;
1652
1652
  optionIdStrategy?: (old: string) => string;
1653
1653
  };
1654
+ type DuplicateManyOptions = Omit<DuplicateOptions, "id">;
1654
1655
  type EditorNodeLookup = {
1655
1656
  kind: "tag";
1656
1657
  data?: Tag;
@@ -1703,6 +1704,7 @@ declare class Editor {
1703
1704
  redo(): boolean;
1704
1705
  clearService(id: string): void;
1705
1706
  duplicate(ref: NodeRef, opts?: DuplicateOptions): string;
1707
+ duplicateMany(ids: readonly string[], opts?: DuplicateManyOptions): string[];
1706
1708
  reLabel(id: string, nextLabel: string): void;
1707
1709
  setFieldName(fieldId: string, nextName: string | null | undefined): void;
1708
1710
  getLastPolicyDiagnostics(): PolicyDiagnostic[] | undefined;
@@ -1755,6 +1757,29 @@ declare class Editor {
1755
1757
  updateField(id: string, patch: Partial<Field>): void;
1756
1758
  removeField(id: string): void;
1757
1759
  remove(id: string): void;
1760
+ removeMany(ids: readonly string[]): void;
1761
+ clearServiceMany(ids: readonly string[]): void;
1762
+ rebindMany(ids: readonly string[], targetTagId: string, opts?: {
1763
+ allowTagCycles?: boolean;
1764
+ }): void;
1765
+ includeMany(receiverId: string, ids: readonly string[]): void;
1766
+ excludeMany(receiverId: string, ids: readonly string[]): void;
1767
+ clearRelationsMany(ids: readonly string[], mode?: "owned" | "incoming" | "both"): void;
1768
+ renameLabelsMany(ids: readonly string[], input: {
1769
+ prefix?: string;
1770
+ suffix?: string;
1771
+ }): void;
1772
+ setPricingRoleMany(ids: readonly string[], role: "base" | "utility"): void;
1773
+ clearFieldDefaultsMany(ids: readonly string[]): void;
1774
+ clearFieldValidationMany(ids: readonly string[]): void;
1775
+ autoCreateOptionsMany(ids: readonly string[], makeOption?: (fieldId: string) => {
1776
+ id?: string;
1777
+ label: string;
1778
+ value?: string | number;
1779
+ }): void;
1780
+ clearAllOptionsMany(ids: readonly string[]): void;
1781
+ removeNoticesForNodes(ids: readonly string[]): void;
1782
+ setNoticesVisibilityForNodes(ids: readonly string[], type: "public" | "private"): void;
1758
1783
  getNode(id: string): EditorNodeLookup;
1759
1784
  getFieldQuantityRule(id: string): QuantityRule | undefined;
1760
1785
  setFieldQuantityRule(id: string, rule: unknown): void;
@@ -1977,7 +2002,19 @@ interface UseCanvasReturn {
1977
2002
  graph: GraphSnapshot;
1978
2003
  api: CanvasAPI;
1979
2004
  props?: ServiceProps;
1980
- }
2005
+ selectionCapabilities: SelectionCapabilities;
2006
+ }
2007
+ type SelectionCapabilities = {
2008
+ hasTags: boolean;
2009
+ hasFields: boolean;
2010
+ hasOptions: boolean;
2011
+ hasServiceBearingNodes: boolean;
2012
+ hasSelectedFieldWithOptions: boolean;
2013
+ hasNoticesForSelection: boolean;
2014
+ canIncludeExcludeTargets: boolean;
2015
+ canRebind: boolean;
2016
+ };
2017
+ declare function deriveSelectionCapabilities(props: ServiceProps | undefined, selectionInfo: CanvasSelection): SelectionCapabilities;
1981
2018
  /** ---------------- hook ---------------- */
1982
2019
  declare function useCanvas(): UseCanvasReturn;
1983
2020
 
@@ -2280,4 +2317,4 @@ interface WorkspaceProps {
2280
2317
  */
2281
2318
  declare function Workspace(props: WorkspaceProps): React.JSX.Element;
2282
2319
 
2283
- export { type Actor, type AdapterOptions, type Author, type AuthorsBackend, type BackendError, type BackendResult, type BackendScope, type Branch, type BranchAccessBackend, type BranchParticipant, type BranchesBackend, type BranchesSlice, Canvas, CanvasProvider, type CanvasSelection, type ClearTarget, type CommentsBackend, type Commit, type CreateMemoryWorkspaceBackendOptions, type Draft, type ErrorKind, type ErrorLog, type FieldTemplate, type FlowCanvasProps, type LabelPlacement, type LiveOptions, type Loadable, type MemoryBackendSeed, type MemorySeedBranchSnapshots, type MemorySeedComments, type MemorySeedParticipants, type MergeResult, type MergedErrors, type PermissionsBackend, type PermissionsMap, type PoliciesBackend, type PoliciesLoadResult, type PolicyScope, type Result, type ServiceSnapshot, type ServicesBackend, type ServicesInput, type SnapshotSlice, type SnapshotsBackend, type SnapshotsLoadResult, type TemplateCreateInput, type TemplateUpdatePatch, type TemplateValidator, type TemplatesBackend, type TemplatesListParams, type ToolsConfig, type TreeNode, type UseCanvasReturn, type UseErrorsOptions, type UseErrorsReturn, type ValidationRow, Workspace, type WorkspaceAPI, type WorkspaceBackend, type WorkspaceBootSection, type WorkspaceBootSectionState, type WorkspaceBootSectionStatus, type WorkspaceBootState, WorkspaceContext, type WorkspaceEvent, type WorkspaceInfo, type WorkspaceLiveAdapter, type WorkspaceLiveAdapterContext, type WorkspaceLiveAdapterHandlers, type WorkspaceLiveAdapterRegistry, type WorkspaceLiveStatus, type WorkspaceLiveTick, type WorkspaceProps, WorkspaceProvider, type WorkspaceProviderProps, createMemoryWorkspaceBackend, createPollAdapter, useCanvas, useCanvasAPI, useCanvasFromBuilder, useCanvasFromExisting, useCanvasOwned, useErrors, useWorkspace, useWorkspaceBoot, useWorkspaceMaybe };
2320
+ export { type Actor, type AdapterOptions, type Author, type AuthorsBackend, type BackendError, type BackendResult, type BackendScope, type Branch, type BranchAccessBackend, type BranchParticipant, type BranchesBackend, type BranchesSlice, Canvas, CanvasProvider, type CanvasSelection, type ClearTarget, type CommentsBackend, type Commit, type CreateMemoryWorkspaceBackendOptions, type Draft, type ErrorKind, type ErrorLog, type FieldTemplate, type FlowCanvasProps, type LabelPlacement, type LiveOptions, type Loadable, type MemoryBackendSeed, type MemorySeedBranchSnapshots, type MemorySeedComments, type MemorySeedParticipants, type MergeResult, type MergedErrors, type PermissionsBackend, type PermissionsMap, type PoliciesBackend, type PoliciesLoadResult, type PolicyScope, type Result, type SelectionCapabilities, type ServiceSnapshot, type ServicesBackend, type ServicesInput, type SnapshotSlice, type SnapshotsBackend, type SnapshotsLoadResult, type TemplateCreateInput, type TemplateUpdatePatch, type TemplateValidator, type TemplatesBackend, type TemplatesListParams, type ToolsConfig, type TreeNode, type UseCanvasReturn, type UseErrorsOptions, type UseErrorsReturn, type ValidationRow, Workspace, type WorkspaceAPI, type WorkspaceBackend, type WorkspaceBootSection, type WorkspaceBootSectionState, type WorkspaceBootSectionStatus, type WorkspaceBootState, WorkspaceContext, type WorkspaceEvent, type WorkspaceInfo, type WorkspaceLiveAdapter, type WorkspaceLiveAdapterContext, type WorkspaceLiveAdapterHandlers, type WorkspaceLiveAdapterRegistry, type WorkspaceLiveStatus, type WorkspaceLiveTick, type WorkspaceProps, WorkspaceProvider, type WorkspaceProviderProps, createMemoryWorkspaceBackend, createPollAdapter, deriveSelectionCapabilities, useCanvas, useCanvasAPI, useCanvasFromBuilder, useCanvasFromExisting, useCanvasOwned, useErrors, useWorkspace, useWorkspaceBoot, useWorkspaceMaybe };