@sassoftware/vi-api 1.55.1 → 1.56.1

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.
@@ -10,12 +10,12 @@
10
10
  * If you need to add a new interface, please consider whether it can extend an existing one or if a new base interface should be created to group related bindings together.
11
11
  * Please also add JSDoc comments to the new bindings and interfaces to explain their purpose and usage.
12
12
  */
13
- import { PageDataChange, PageModeChange } from "../control/events";
13
+ import { PageDataChange, PageDataChangeWithPageModel, PageModeChange, PageModeChangeWithPageModel } from "../control/events";
14
14
  import { Relationship } from "../svi-datahub";
15
15
  import { QueryMode } from "../svi-sand";
16
- import { ControlContainer, VIObject } from "../object/object-api";
16
+ import { APISelectedItem, ControlContainer, CreateDialogResponse, IRelationshipWithLabel, RelationshipInformation, VIObject } from "../object/object-api";
17
17
  import { PageModel, PageModelObjectData } from "../page-model/page-model-api";
18
- import { SearchObject, SearchQuery } from "../search/client/client-search-api";
18
+ import { LinkStatusResult, SearchObject, SearchQuery } from "../search/client/client-search-api";
19
19
  import { HandleType, MinMaxDates, TimeSliderContextMenuHideOptions, TimeSliderEventDates, TimeSliderRange, TimeSliderRangeChangedEvent } from "../time-slider";
20
20
  import { PageModeEvent } from "../control";
21
21
  export interface SearchAndSelectWithPreviewInputBindings {
@@ -135,7 +135,7 @@ export interface CommonPageViewerBindings {
135
135
  /** A callback that is called when the page viewer dirty state changes. */
136
136
  onDirty?: (isDirty: boolean) => void;
137
137
  /** A callback that is called when the pageModel's mode or data changes. */
138
- onChange?: (change: PageDataChange | PageModeChange) => void;
138
+ onChange?: (change: PageDataChange | PageModeChange | PageDataChangeWithPageModel | PageModeChangeWithPageModel) => void;
139
139
  }
140
140
  /** @deprecated use {@link PageViewerBindings} */
141
141
  export interface PageBindings {
@@ -156,7 +156,7 @@ export interface PageBindings {
156
156
  setApi?: (api: PageViewerApi) => void;
157
157
  mainTab?: string;
158
158
  onDirty?: (isDirty: boolean) => void;
159
- onChange?: (change: PageDataChange | PageModeChange) => void;
159
+ onChange?: (change: PageDataChange | PageModeChange | PageDataChangeWithPageModel | PageModeChangeWithPageModel) => void;
160
160
  }
161
161
  export interface PagePreviewBindings {
162
162
  templateUuid: string;
@@ -169,7 +169,7 @@ export interface ControlCollectionBindings {
169
169
  /**
170
170
  * Defines the bindings for managing relationship details in a component.
171
171
  */
172
- export interface RelationshipDetailsBindings {
172
+ export interface RelationshipDetailsInputBindings {
173
173
  /**
174
174
  * Defines the identifier of the target object type that the relationship references.
175
175
  */
@@ -189,15 +189,16 @@ export interface RelationshipDetailsBindings {
189
189
  /**
190
190
  * Represents the list of reasons that define the purpose or context of the relationship.
191
191
  */
192
- linkReasons: Relationship[];
192
+ linkReasons: Relationship[] | IRelationshipWithLabel[];
193
193
  /**
194
194
  * Represents the currently selected item in the relationship, if applicable.
195
- * Contains an object with `id` and `type` fields to identify the selected item.
195
+ * Contains an object with `id`, `type`, and optional `title` fields to identify the selected item.
196
196
  */
197
- selectedItem?: {
198
- id: string;
199
- type: string;
200
- };
197
+ selectedItem?: APISelectedItem;
198
+ /**
199
+ * Represents the list of currently selected items in the relationship, if applicable.
200
+ */
201
+ selectedItems?: APISelectedItem[];
201
202
  /**
202
203
  * Fields that are read-only and cannot be modified by the user within the relationships properties panel
203
204
  */
@@ -208,24 +209,50 @@ export interface RelationshipDetailsBindings {
208
209
  hiddenFields?: string[];
209
210
  /**
210
211
  * Contains the data for a new page model, if applicable.
211
- * Includes a `PageModelObjectData` object to represent the model structure.
212
+ * Includes a `PageModel` or `PageModelObjectData` object to represent the model structure.
212
213
  */
213
214
  newPageModel?: {
214
- model: PageModelObjectData;
215
+ model: PageModel | PageModelObjectData;
215
216
  };
216
217
  /**
217
- * Callback invoked when a link reason is selected.
218
- * @param linkReason - The selected link reason.
218
+ * Indicates whether to display the page viewer component. Default: true
219
219
  */
220
- onLinkReasonSelected: (linkReason: Relationship) => void;
220
+ showPageViewer?: boolean;
221
+ /**
222
+ * Used to show link status in the relationship properties component when coming from the relate to button bulk link flow
223
+ */
224
+ linkStatusResults?: LinkStatusResult[];
225
+ /**
226
+ * Used to show link status in the relationship properties component when coming from the relate to button bulk link flow
227
+ */
228
+ originalWizardResults?: CreateDialogResponse[];
221
229
  /**
222
230
  * Represents the current field values of the relationship as key-value pairs.
223
231
  */
224
- relationshipValues?: Record<string, any>;
232
+ relationshipValues?: Record<string, unknown>;
225
233
  /**
226
234
  * Represents the initial field values used to populate the related object during creation.
227
235
  */
228
- initialCreateData?: Record<string, any>;
236
+ initialCreateData?: Record<string, unknown>;
237
+ /**
238
+ * Entity names of the selected items.
239
+ */
240
+ entityNames?: string[];
241
+ /**
242
+ * Entity name of the parent object to which we are relating.
243
+ */
244
+ relateToParentName?: string;
245
+ /**
246
+ * Stored relationship info for each selected item, used to restore state when navigating between wizard steps.
247
+ */
248
+ storedAllRelationshipInfo?: Map<string, RelationshipInformation>;
249
+ }
250
+ export interface RelationshipDetailsBindings extends RelationshipDetailsInputBindings {
251
+ /**
252
+ * Callback invoked when a link reason is selected.
253
+ * @param linkReason - The selected link reason.
254
+ */
255
+ onLinkReasonSelected: (linkReason: Relationship | IRelationshipWithLabel | undefined) => void;
229
256
  /**
230
257
  * Callback to set the API for the page viewer.
231
258
  * Provides a `PageViewerAPI` instance to the component.
@@ -235,20 +262,36 @@ export interface RelationshipDetailsBindings {
235
262
  /**
236
263
  * Callback invoked when the related page changes.
237
264
  * Triggered by events such as data updates or mode transitions.
238
- * @param change - The event describing the change, either `PageDataChange` or `PageModeChange`.
265
+ * @param change - The event describing the change, either `PageDataChange`, `PageModeChange`, `PageDataChangeWithPageModel`, or `PageModeChangeWithPageModel`.
239
266
  */
240
- onRelatedPageChange?: (change: PageDataChange | PageModeChange) => void;
267
+ onRelatedPageChange?: (change: PageDataChange | PageModeChange | PageDataChangeWithPageModel | PageModeChangeWithPageModel) => void;
241
268
  /**
242
269
  * Callback invoked when the relationship values are updated.
243
270
  * Provides both the current and previous values for comparison.
244
- * @param current - The updated relationship values.
245
- * @param previous - The previous relationship values, if available.
271
+ * @param event - Object containing current and previous relationship values.
246
272
  */
247
- onRelationshipValuesChange?: (current: Record<string, any>, previous?: Record<string, any>) => void;
273
+ onRelationshipValuesChange?: (event: {
274
+ current: Record<string, any>;
275
+ previous?: Record<string, any>;
276
+ }) => void;
248
277
  /**
249
- * Callback invoked when the related page is loading is complete.
278
+ * Callback invoked when the related page loading is complete.
250
279
  */
251
280
  onRelatedPageLoad?: () => void;
281
+ /**
282
+ * Callback invoked when the relationship information is updated.
283
+ * @param allRelationshipInfo - Map of all relationship information keyed by item ID.
284
+ */
285
+ onAllRelationshipInfoChanged?: (allRelationshipInfo: Map<string, RelationshipInformation>) => void;
286
+ /**
287
+ * Callback invoked when the selected items are updated.
288
+ * @param event - Object containing the updated selected items and optionally the removed item.
289
+ */
290
+ selectedItemsUpdated?: (event: {
291
+ selectedItems: APISelectedItem[] | undefined;
292
+ removedItem?: APISelectedItem;
293
+ removedItemIndex?: number;
294
+ }) => void;
252
295
  }
253
296
  export interface SearchInputInputBindings {
254
297
  entityName: string;
@@ -48,5 +48,6 @@ export declare enum StandardPropertyTypes {
48
48
  NetworkLinkSelector = "NetworkLinkSelector",
49
49
  Hidden = "Hidden",
50
50
  Disabled = "Disabled",
51
- Condition = "Condition"
51
+ Condition = "Condition",
52
+ CreateRelationshipSelection = "CreateRelationshipSelection"
52
53
  }
@@ -51,6 +51,7 @@ export var StandardPropertyTypes;
51
51
  StandardPropertyTypes["Hidden"] = "Hidden";
52
52
  StandardPropertyTypes["Disabled"] = "Disabled";
53
53
  StandardPropertyTypes["Condition"] = "Condition";
54
+ StandardPropertyTypes["CreateRelationshipSelection"] = "CreateRelationshipSelection";
54
55
  /**
55
56
  * @internal For now as there is no consumer request and the editor only supports the usage by the (feature flagged) generated text control.
56
57
  */
@@ -58,6 +58,11 @@ export interface PageDataChange {
58
58
  old?: PageModelData;
59
59
  };
60
60
  }
61
+ export interface PageDataChangeWithPageModel extends PageDataChange {
62
+ pageModel: {
63
+ model: PageModelData;
64
+ };
65
+ }
61
66
  export interface PageModeChange {
62
67
  readonly type: ChangeType.PAGE_MODE;
63
68
  value: {
@@ -65,6 +70,11 @@ export interface PageModeChange {
65
70
  old?: PageMode;
66
71
  };
67
72
  }
73
+ export interface PageModeChangeWithPageModel extends PageModeChange {
74
+ pageModel: {
75
+ model: PageModelData;
76
+ };
77
+ }
68
78
  export interface StateChange {
69
79
  readOnly?: boolean;
70
80
  hidden?: boolean;
package/mcp/mcp-api.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface RemoteMCPServerConfig {
17
17
  }
18
18
  export interface BaseMCPServerConfig {
19
19
  name: string;
20
+ title?: string;
20
21
  version: string;
21
22
  }
22
23
  export interface StreamableMCPServerConfig extends BaseMCPServerConfig, RemoteMCPServerConfig {
package/mcp/mcp-api.js CHANGED
@@ -1,6 +1,8 @@
1
- // eslint-disable-next-line no-restricted-imports
1
+ // eslint-disable-next-line no-restricted-imports -- helper fns
2
2
  import { expectType } from "../../shared/util/helper-functions";
3
3
  expectType(true);
4
4
  expectType(true);
5
5
  expectType(true);
6
6
  expectType(true);
7
+ expectType(true);
8
+ expectType(true);
@@ -282,4 +282,5 @@ export interface OptionsForGetRelationshipsForObjectType {
282
282
  includeHeterogeneous?: boolean;
283
283
  includeMultipleTypeRelationships?: boolean;
284
284
  expandMultipleRelationshipsToSingle?: boolean;
285
+ filterToRelationshipIds?: number[];
285
286
  }
@@ -1,7 +1,9 @@
1
- import { Comment, Relationship, StoredObjectFieldDTO } from "../svi-datahub";
1
+ import { Comment, Relationship, RelationshipDTO, StoredObjectFieldDTO } from "../svi-datahub";
2
2
  import { FileOperation } from "../file/file-api";
3
- import { PageModel } from "../page-model/page-model-api";
3
+ import { PageModel, PageModelData } from "../page-model/page-model-api";
4
4
  import { ClientSheet, Sheet } from "../sheet/sheet-api";
5
+ import { PageViewerApi } from "../component/bindings";
6
+ import { PageDataChange, PageModeChange } from "../control";
5
7
  export interface ObjectIdentifier {
6
8
  id: string;
7
9
  type: string;
@@ -482,6 +484,13 @@ export interface ObjectRelationship {
482
484
  };
483
485
  qualifiedTypeName?: string;
484
486
  }
487
+ export interface ObjectRelationshipMultiple extends ObjectRelationship {
488
+ fromId?: string;
489
+ fromEntityType?: string;
490
+ toId?: string;
491
+ toEntityType?: string;
492
+ operation?: string;
493
+ }
485
494
  export interface AttachmentRow {
486
495
  description?: string;
487
496
  location: string;
@@ -534,14 +543,113 @@ export interface DisplayTextFields {
534
543
  name: string;
535
544
  displayIndex: number;
536
545
  }
546
+ export declare enum SearchAndCreateStep {
547
+ Search = "search",
548
+ SearchResults = "searchResults",
549
+ Entity = "entity",
550
+ Relationship = "relationship"
551
+ }
552
+ interface SearchAndCreatePanelContext {
553
+ [SearchAndCreateStep.Search]: {
554
+ doSearch: (query: string, additionalModes?: string[]) => void;
555
+ updateQuery: (query: string) => void;
556
+ query: {
557
+ text: string;
558
+ };
559
+ };
560
+ [SearchAndCreateStep.SearchResults]: {
561
+ query: {
562
+ text: string;
563
+ };
564
+ updateSelection: (results: Array<{
565
+ id: string;
566
+ type: string;
567
+ }>) => void;
568
+ };
569
+ [SearchAndCreateStep.Entity]: {
570
+ setPageViewerApi(api: PageViewerApi): void;
571
+ onPageChange(change?: PageDataChange | PageModeChange): void;
572
+ newPageModel: {
573
+ model?: PageModel | PageModelData | null;
574
+ };
575
+ selectedItems: Array<{
576
+ id?: string;
577
+ type?: string;
578
+ title?: string;
579
+ }> | null | undefined;
580
+ };
581
+ [SearchAndCreateStep.Relationship]: {
582
+ updateLinkReason: (linkReason: Relationship) => void;
583
+ onPageChange(change?: PageDataChange | PageModeChange): void;
584
+ setPageViewerApi(api: PageViewerApi): void;
585
+ newPageModel: {
586
+ model?: PageModel | PageModelData | null;
587
+ };
588
+ selectedItems: Array<{
589
+ id?: string;
590
+ type?: string;
591
+ title?: string;
592
+ }> | null | undefined;
593
+ };
594
+ }
595
+ export interface SearchAndCreateFooterContext {
596
+ query?: {
597
+ text: string;
598
+ };
599
+ selectedItems?: Array<{
600
+ id?: string;
601
+ type?: string;
602
+ title?: string;
603
+ }> | null;
604
+ linkReason?: Relationship;
605
+ newPageModel?: {
606
+ model?: PageModel | PageModelData | null;
607
+ };
608
+ relationshipValues?: Record<string, any>;
609
+ doSearch: (queryText?: string) => void;
610
+ commit: () => void;
611
+ relateToSelected: () => void;
612
+ relateToNew: () => void;
613
+ close: (result?: unknown) => void;
614
+ }
615
+ interface BaseButton {
616
+ label: string;
617
+ primary?: boolean;
618
+ disabled?: boolean;
619
+ }
620
+ export type SearchAndCreateDialogButton = (BaseButton & {
621
+ onClick: () => void | Promise<void>;
622
+ }) | (BaseButton & {
623
+ items: Array<{
624
+ text: string;
625
+ click: () => void;
626
+ }>;
627
+ });
628
+ export interface CustomSearchAndCreateStep<Step extends SearchAndCreateStep> {
629
+ panel?: {
630
+ render: (container: HTMLDivElement, context: SearchAndCreatePanelContext[Step]) => void;
631
+ };
632
+ footer?: {
633
+ getButtons: (context: SearchAndCreateFooterContext) => SearchAndCreateDialogButton[];
634
+ };
635
+ }
636
+ export type CustomSearchAndCreateSteps = {
637
+ [Step in SearchAndCreateStep]?: CustomSearchAndCreateStep<Step>;
638
+ };
537
639
  export interface SearchOrCreateAndLinkDialogBase<T> {
538
640
  entityName: string;
539
641
  entityLabel: string;
642
+ entityNames?: string[];
643
+ entityLabels?: string[];
540
644
  onClose?: (result?: T) => Promise<boolean>;
541
645
  /**
542
646
  * Values returned on the close of the dialog box. May be undefined when dialog box is cancelled.
543
647
  */
544
648
  result?: T;
649
+ multipleSearchChoice?: boolean;
650
+ showPageViewer?: boolean;
651
+ customSteps?: CustomSearchAndCreateSteps;
652
+ customResult?: unknown;
545
653
  }
546
654
  export interface CreateRelationshipDialogModel<T> extends SearchOrCreateAndLinkDialogBase<T> {
547
655
  relateToParentName: string;
@@ -561,4 +669,18 @@ export interface CreateRelateToModel extends CreateRelationshipDialogResultModel
561
669
  model: PageModel;
562
670
  };
563
671
  }
672
+ export interface IRelationshipWithLabel extends RelationshipDTO {
673
+ relationshipLabel: string;
674
+ }
675
+ export type APISelectedItem = ObjectIdentifier & {
676
+ title?: string;
677
+ };
678
+ export interface RelationshipInformation {
679
+ relationshipTypeId?: number;
680
+ relationshipValues?: Record<string, any>;
681
+ selectedItemTitle?: string;
682
+ requiredFieldsStatus?: any;
683
+ entityIconClass?: string;
684
+ entityType?: string;
685
+ }
564
686
  export {};
@@ -16,3 +16,10 @@ export var ConditionFactType;
16
16
  ConditionFactType["Field"] = "FIELD";
17
17
  ConditionFactType["Condition"] = "CONDITION_REFERENCE";
18
18
  })(ConditionFactType || (ConditionFactType = {}));
19
+ export var SearchAndCreateStep;
20
+ (function (SearchAndCreateStep) {
21
+ SearchAndCreateStep["Search"] = "search";
22
+ SearchAndCreateStep["SearchResults"] = "searchResults";
23
+ SearchAndCreateStep["Entity"] = "entity";
24
+ SearchAndCreateStep["Relationship"] = "relationship";
25
+ })(SearchAndCreateStep || (SearchAndCreateStep = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/vi-api",
3
- "version": "1.55.1",
3
+ "version": "1.56.1",
4
4
  "description": "Types used in the SAS Visual Investigator API",
5
5
  "keywords": [
6
6
  "SAS",
@@ -1,5 +1,5 @@
1
1
  import { MapBoundedBoxFilter, MapBoundedPolygonFilter, MapRadiusFilter, MapShapeFilter, QueryMode, SearchRepresentation, SearchResponse, SummaryVisualizationResponse } from "../../svi-sand";
2
- import { CreateRelationshipDialogModel, CreateRelationshipDialogResultModel, ObjectIdentifier, SearchOrCreateAndLinkDialogBase } from "../../object/object-api";
2
+ import { CreateDialogResponse, CreateRelationshipDialogModel, CreateRelationshipDialogResultModel, ObjectIdentifier, SearchOrCreateAndLinkDialogBase } from "../../object/object-api";
3
3
  import { QueryBuilderModel, SearchApi } from "../search-api";
4
4
  export declare enum SearchVisualization {
5
5
  Summary = "summary",
@@ -40,9 +40,36 @@ export interface NetworkData {
40
40
  };
41
41
  numNodes: number;
42
42
  }
43
+ export interface LinkStatusErrorResponse {
44
+ errorCode?: number;
45
+ message?: string;
46
+ details?: string[];
47
+ id?: string;
48
+ version?: number;
49
+ httpStatusCode?: number;
50
+ }
51
+ export interface LinkStatusResult {
52
+ link: {
53
+ id?: string;
54
+ relationshipTypeName?: string;
55
+ fromEntityType?: string;
56
+ fromId?: string;
57
+ toEntityType?: string;
58
+ toId?: string;
59
+ operation?: string;
60
+ error?: LinkStatusErrorResponse;
61
+ };
62
+ success?: boolean;
63
+ error?: string;
64
+ }
43
65
  export type SearchAndCreateDialogModel = CreateRelationshipDialogModel<SearchAndCreateResponse>;
44
66
  export interface SearchDialogModel extends SearchOrCreateAndLinkDialogBase<SearchDialogResponse> {
45
67
  canCreate?: boolean;
68
+ canCreateMap?: Record<string, boolean>;
69
+ initialQuery?: string;
70
+ initialCreateData?: Record<string, unknown>;
71
+ linkStatusResults?: LinkStatusResult[];
72
+ originalWizardResults?: CreateDialogResponse[];
46
73
  }
47
74
  export interface SearchDialogResponse {
48
75
  selectedItem?: SearchObject;