@sassoftware/vi-api 0.0.29 → 1.7.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.
Files changed (40) hide show
  1. package/LICENSE.txt +333 -0
  2. package/README.md +9 -0
  3. package/alert-reps/index.d.ts +5 -1
  4. package/alert-reps/package.json +1 -1
  5. package/api.module.js +72 -0
  6. package/component/bindings.d.ts +15 -7
  7. package/component/index.d.ts +11 -10
  8. package/component/index.js +1 -1
  9. package/config/config-api.d.ts +21 -2
  10. package/control/control-api.d.ts +44 -22
  11. package/control/data-types.d.ts +6 -1
  12. package/control/page.d.ts +14 -0
  13. package/control/toolbar-property-api.d.ts +2 -1
  14. package/event/event-api.d.ts +1 -0
  15. package/event/event-api.js +1 -0
  16. package/index.d.ts +2 -2
  17. package/metadata/metadata-api.d.ts +15 -12
  18. package/object/object-api.d.ts +29 -40
  19. package/package.json +25 -2
  20. package/page-admin/page-admin-api.d.ts +2 -2
  21. package/page-model/page-model-api.d.ts +113 -14
  22. package/page-state/page-state-api.d.ts +23 -0
  23. package/property/property-api.d.ts +66 -6
  24. package/property/property-api.js +2 -2
  25. package/score-reps/index.d.ts +1 -1
  26. package/score-reps/package.json +1 -1
  27. package/search/client/client-search-api.d.ts +15 -11
  28. package/search/client/client-search-api.js +1 -1
  29. package/search/search-api.d.ts +7 -7
  30. package/sheet/sheet-api.d.ts +41 -9
  31. package/sheet/sheet-api.js +9 -1
  32. package/svi-datahub/index.d.ts +218 -173
  33. package/svi-datahub/package.json +1 -1
  34. package/svi-sand/index.d.ts +40 -33
  35. package/svi-sand/package.json +1 -1
  36. package/tab/tab-api.d.ts +1 -1
  37. package/theme/theme-api.d.ts +1 -1
  38. package/theme/theme-api.js +1 -1
  39. package/time-slider/index.d.ts +15 -0
  40. package/traversal/traversal-api.d.ts +7 -1
@@ -1,6 +1,8 @@
1
+ import { FileRestrictions } from "../control/restrictions";
1
2
  import { Control } from "../control/page";
2
3
  import { FileOperation, SASObjectAttachedFile } from "../file/file-api";
3
4
  import { ObjectFieldRestrictions } from "../object/object-api";
5
+ import { PathsRepresentation } from "../svi-sand";
4
6
  export declare enum PageMode {
5
7
  Create = "create",
6
8
  Edit = "edit",
@@ -22,14 +24,17 @@ export interface PageAction {
22
24
  actionName: string;
23
25
  attributes: {
24
26
  [property: string]: any;
25
- displayName: string;
26
- disabled: string;
27
+ displayName?: string;
28
+ disabled?: string;
27
29
  };
28
30
  controlId?: number;
29
31
  displayName: string;
32
+ type: string;
30
33
  };
34
+ childNodes?: PageAction[];
31
35
  }
32
36
  export interface PageActions {
37
+ disabled: boolean;
33
38
  items?: PageAction[];
34
39
  }
35
40
  export interface PageModelData {
@@ -40,20 +45,18 @@ export interface PageModelObjectData {
40
45
  data: PageModelData;
41
46
  displayLabel?: string;
42
47
  fieldRestrictions?: ObjectFieldRestrictions;
43
- fileRestrictions?: ObjectFieldRestrictions;
48
+ fileRestrictions?: Record<string, Record<string, FileRestrictions>>;
44
49
  id?: string;
45
- linkedPages?: any[];
50
+ linkedPages?: LinkedPage[];
46
51
  mode?: PageMode;
47
- objectTypeId?: string;
52
+ objectTypeId?: number;
48
53
  objectTypeVersion?: number;
49
54
  serverPageMode?: ServerPageMode;
50
55
  template?: PageTemplate;
51
56
  templateMetadata?: PageTemplateMetadata;
52
- toolbar?: {
53
- disabled: boolean;
54
- items: Control[];
55
- };
57
+ toolbar?: PageActions;
56
58
  type?: string;
59
+ uuid: string;
57
60
  }
58
61
  export interface PageModel extends PageModelObjectData {
59
62
  attachmentCount?: number;
@@ -72,8 +75,8 @@ export interface PageModel extends PageModelObjectData {
72
75
  getAllMissingFileCategories(): Promise<string[]>;
73
76
  getAllMissingRequiredFields(): string[];
74
77
  setParentModel(parentModel: PageModel): void;
75
- getParentModel(): PageModel;
76
- destroy(): void;
78
+ getParentModel(): PageModel | undefined;
79
+ destroy(): Promise<void>;
77
80
  }
78
81
  export interface PageTemplate {
79
82
  errors?: boolean;
@@ -103,20 +106,116 @@ export interface PageTemplateScreen {
103
106
  locked?: boolean;
104
107
  childNodes?: Control[];
105
108
  }
109
+ export interface LinkedPage {
110
+ templateUuid?: string;
111
+ traversalUuid?: string;
112
+ traversal?: PathsRepresentation;
113
+ }
114
+ export interface IPageEventHook<T extends IPageEventData, R extends IPageEventHookResponse> {
115
+ exec: (pageData: T) => Promise<R | void>;
116
+ /**
117
+ * Run onFail instead of exec if the preceding event action has failed.
118
+ * If not provided, nothing will be executed for this hook in the event of failure.
119
+ */
120
+ onFail?: (pageData: T) => Promise<R | void>;
121
+ /**
122
+ * Hooks are executed in ascending order.
123
+ */
124
+ order?: number;
125
+ }
126
+ export declare type IPrePageEventHook<T extends IPageEventData> = Omit<IPageEventHook<T, IPrePageEventHookResponse>, "onFail">;
127
+ export declare type IPostPageEventHook<T extends IPageEventData> = IPageEventHook<T, IPostPageEventHookResponse>;
128
+ export interface IPageEventHookResponse {
129
+ message: string;
130
+ messages?: string[];
131
+ }
132
+ export interface IPrePageEventHookResponse extends IPageEventHookResponse {
133
+ abort: boolean;
134
+ }
135
+ export declare type IPostPageEventHookResponse = IPageEventHookResponse;
106
136
  /**
107
- * This API is used for creating a PageModel object from source data.
137
+ * A callback to unregister a page event hook.
138
+ * @returns true if the hook was removed, false if it was already removed.
139
+ */
140
+ export declare type PageEventHookRemove = () => boolean;
141
+ export interface IPageEventData {
142
+ pageModel: PageModel;
143
+ }
144
+ /**
145
+ * Page model events which can have pre-event or post-event hooks.
146
+ */
147
+ export declare const enum HookablePageEvents {
148
+ /**
149
+ * A pagemodel is being saved as an object.
150
+ */
151
+ SaveObject = "svi:hookable:pagemodel:saveObject"
152
+ }
153
+ export interface IPageEvent<T extends IPageEventData> {
154
+ /**
155
+ * @method
156
+ * @description Adds a hook to be executed before a hookable event is triggered.
157
+ * @param event {string} the event to hook onto.
158
+ * @param hook {IPrePageEventHook} the hook which defines the callback to run pre-event.
159
+ */
160
+ addPreHook(hook: IPrePageEventHook<T>): PageEventHookRemove;
161
+ /**
162
+ * @method
163
+ * @description Adds a hook to be executed after a hookable event is triggered.
164
+ * @param event {string} the event to hook onto.
165
+ * @param hook {IPostPageEventHook} the hook which defines the callback to run post-event.
166
+ */
167
+ addPostHook(hook: IPostPageEventHook<T>): PageEventHookRemove;
168
+ /**
169
+ * @method
170
+ * @description run pre-hooks, execute the action, run post hooks.
171
+ * @param payload is passed as input for any event hooks.
172
+ * @param action the action to perform.
173
+ */
174
+ trigger<R>(payload: T, action: () => Promise<R>): Promise<R>;
175
+ }
176
+ /**
177
+ * Methods related to page events.
178
+ */
179
+ export interface PageEventsApiBase {
180
+ /**
181
+ * @method
182
+ * @description Get a reference to a hookable page event if it is defined.
183
+ * @param eventName The name of the event.
184
+ * @returns The reference to the hookable page event.
185
+ */
186
+ getPageEvent(eventName: HookablePageEvents.SaveObject): IPageEvent<IPageEventData> | undefined;
187
+ getPageEvent<T extends IPageEventData>(eventName: string): IPageEvent<T> | undefined;
188
+ }
189
+ /**
190
+ * {@link PageEventsApiBase} extension that provides more functionality.
191
+ * @extends PageEventsApiBase
192
+ */
193
+ export interface PageEventsApi extends PageEventsApiBase {
194
+ /**
195
+ * @method
196
+ * @description Add a hookable page event. An error is thrown if the event is already registered.
197
+ * @param eventName The name of the event, this should be unique.
198
+ */
199
+ addPageEvent(eventName: string): void | never;
200
+ }
201
+ /**
202
+ * This API is used for PageModel utilities.
108
203
  * Accessed from the window at window.sas.vi.pageModel.
109
204
  */
110
205
  export interface PageModelApi {
206
+ /**
207
+ * Methods related to page event hooks.
208
+ */
209
+ readonly events: PageEventsApi;
111
210
  /**
112
211
  * @method
113
212
  * @description Creates a new instance of a PageModel when given the object source.
114
- * @param objectSource {PageModelObjectData} Object containing data for the page model.
213
+ * @param object {Partial<PageModel>} Object containing data for the page model.
115
214
  * @param [options] {PageModelApi~CreateFromObjectOptions} Contains a boolean "clone" declaring whether to deep clone the object
116
215
  * when creating the Page Model.
117
216
  * @returns The instance of PageModel
118
217
  */
119
- createFromObject(objectSource: PageModelObjectData, options?: {
218
+ createFromObject(object: Partial<PageModel>, options?: {
120
219
  clone?: boolean;
121
220
  }): PageModel;
122
221
  }
@@ -1,3 +1,4 @@
1
+ import { Template, StoredObjectDTO } from "../svi-datahub";
1
2
  /**
2
3
  * SAS Visual Investigator API's representation of a UI-Router state.
3
4
  * Accessed from the window at window.sas.vi.pageState.
@@ -25,6 +26,18 @@ export interface StateObject {
25
26
  root(): StateObject;
26
27
  toString(): string;
27
28
  }
29
+ export interface HomepageDesignerState {
30
+ isNew: boolean;
31
+ page: Template;
32
+ designerType: string;
33
+ }
34
+ export interface ObjectPageDesignerState {
35
+ isNew: boolean;
36
+ page: Template;
37
+ designerType: string;
38
+ childEntityDataSources: StoredObjectDTO[];
39
+ primaryDataSource: StoredObjectDTO;
40
+ }
28
41
  /**
29
42
  * This API provides functionality that pertains to the page state.
30
43
  * Accessed from the window at window.sas.vi.pageState.
@@ -56,4 +69,14 @@ export interface PageStateApi {
56
69
  * @param id {string | number} ID of the page to be deleted.
57
70
  */
58
71
  remove(id: string | number): void;
72
+ /**
73
+ * Gives the currently active Home page's state, or undefined if a Home page
74
+ * designer tab is not active.
75
+ */
76
+ getCurrentHomepageDesigner(): HomepageDesignerState | undefined;
77
+ /**
78
+ * Gives the currently active object pages state, or undefined if an object page
79
+ * designer tab is not active.
80
+ */
81
+ getCurrentObjectPageDesigner(): ObjectPageDesignerState | undefined;
59
82
  }
@@ -1,5 +1,6 @@
1
+ import { ResourcedString } from "../svi-datahub";
1
2
  import { Control } from "../control/page";
2
- import { TypeAttributes } from "../object/object-api";
3
+ import { ChildNode, TypeAttributes } from "../object/object-api";
3
4
  import { PageTemplateMetadata } from "../page-model/page-model-api";
4
5
  export interface ToolbarPropertyControl {
5
6
  typeAttributes: TypeAttributes;
@@ -7,8 +8,37 @@ export interface ToolbarPropertyControl {
7
8
  export interface PropertyConfig {
8
9
  [property: string]: any;
9
10
  order?: number;
10
- required?: boolean;
11
11
  type: string;
12
+ displayName: ResourcedString;
13
+ required?: boolean | string;
14
+ localizable?: boolean | string;
15
+ allowMultiple?: boolean | string;
16
+ states?: Record<string, boolean>;
17
+ defaultValue?: any;
18
+ disabledExpression?: string;
19
+ picklistName?: string;
20
+ ignoreRestrictions?: boolean;
21
+ }
22
+ export interface SelectedNode {
23
+ id: number;
24
+ node: ChildNode;
25
+ parentNode?: ChildNode;
26
+ parentSubDocument: string;
27
+ dataSources?: {
28
+ [property: string]: any;
29
+ };
30
+ }
31
+ /**
32
+ * This API is available on property editors.
33
+ */
34
+ export interface EditorApi {
35
+ /**
36
+ * Registers a function to be invoked whenever one of the editor's properties changes.
37
+ * @method
38
+ * @param handler The function to be invoked.
39
+ * @returns A function that stops the handler from being invoked.
40
+ */
41
+ onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): () => void;
12
42
  }
13
43
  /**
14
44
  * This API provides the utility or miscellaneous functionality in SAS Visual Investigator.
@@ -19,19 +49,49 @@ export interface PropertyApi {
19
49
  * @method
20
50
  * @description Registers a custom element to be rendered as the property editor.
21
51
  * The element is rendered as a custom web component.
22
- * The element is passed selectedNode, property, propertyKey and categoryKey as attributes.
52
+ * The element is passed selectedNode, property, propertyKey, and categoryKey as attributes.
23
53
  * Throws a console error if the type is already used by another registered editor.
24
- * @param elementName {string} Element to be rendered. For example "custom-editor" renders an element with the tag name "custom-editor".
54
+ * @param elementName {string} Element to be rendered. For example, "custom-editor" renders an element with the tag name "custom-editor".
25
55
  * @param type {string} A custom type that is expected to be unique among registered editors.
26
56
  * @param [validatorFn] {PropertyApi~isPropertyEditorValid} Function to provide custom logic for determining if the editor is valid.
27
57
  * @param [metadataFn] {PropertyApi~getPropertyEditorMetadata} Function to provide custom metadata.
28
58
  */
29
59
  registerCustomEditor(elementName: string, type: string, validatorFn?: (propertyConfig: PropertyConfig, propertyKey: string, control: Control | ToolbarPropertyControl) => boolean, metadataFn?: (propertyConfig: PropertyConfig, propertyKey: string, control: Control | ToolbarPropertyControl) => PageTemplateMetadata): void;
60
+ /**
61
+ * @method
62
+ * @description Determines whether or not the child object data source property editor is valid.
63
+ * Typically passed as a function reference to registerCustomEditor() instead of being called directly.
64
+ * @param {PropertyConfig} propertyConfig Configuration details relating to the property type. For example, required, type, and so on.
65
+ * @param {string} propertyKey Key where this property's value is stored.
66
+ * @param {Control | ToolbarPropertyControl} control The control.
67
+ * @example
68
+ * window.sas.vi.property.registerCustomEditor(
69
+ * name,
70
+ * type,
71
+ * window.sas.vi.property.validateChildObjectDataSource,
72
+ * window.sas.vi.property.getChildObjectMetadata)
73
+ */
74
+ validateChildObjectDataSource(propertyConfig: PropertyConfig, propertyKey: string, control: Control): boolean | undefined;
75
+ /**
76
+ * @method
77
+ * @description Get metadata for the child object data source property editor.
78
+ * Typically passed as a function reference to registerCustomEditor() instead of being called directly.
79
+ * @param {PropertyConfig} propertyConfig Configuration details relating to the property type. For example, required, type, and so on.
80
+ * @param {string} propertyKey Key where this property's value is stored.
81
+ * @param {Control | ToolbarPropertyControl} control The control.
82
+ * @example
83
+ * window.sas.vi.property.registerCustomEditor(
84
+ * name,
85
+ * type,
86
+ * window.sas.vi.property.validateChildObjectDataSource,
87
+ * window.sas.vi.property.getChildObjectMetadata)
88
+ */
89
+ getChildObjectMetadata(propertyConfig: PropertyConfig, propertyKey: string, control: Control): PageTemplateMetadata | undefined;
30
90
  }
31
91
  /**
32
92
  * Determines whether or not the property editor is valid.
33
93
  * @callback PropertyApi~isPropertyEditorValid
34
- * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type and so on.
94
+ * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type, and so on.
35
95
  * @param {string} propertyKey Key where this property's value is stored.
36
96
  * @param {Control | ToolbarPropertyControl} control The control.
37
97
  * @returns {boolean} true if valid, false if not.
@@ -39,7 +99,7 @@ export interface PropertyApi {
39
99
  /**
40
100
  * Get metadata for the property editor.
41
101
  * @callback PropertyApi~getPropertyEditorMetadata
42
- * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type and so on.
102
+ * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type, and so on.
43
103
  * @param {string} propertyKey Key where this property's value is stored.
44
104
  * @param {Control | ToolbarPropertyControl} control The control.
45
105
  * @returns {PageTemplateMetadata}
@@ -2,7 +2,7 @@ export {};
2
2
  /**
3
3
  * Determines whether or not the property editor is valid.
4
4
  * @callback PropertyApi~isPropertyEditorValid
5
- * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type and so on.
5
+ * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type, and so on.
6
6
  * @param {string} propertyKey Key where this property's value is stored.
7
7
  * @param {Control | ToolbarPropertyControl} control The control.
8
8
  * @returns {boolean} true if valid, false if not.
@@ -10,7 +10,7 @@ export {};
10
10
  /**
11
11
  * Get metadata for the property editor.
12
12
  * @callback PropertyApi~getPropertyEditorMetadata
13
- * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type and so on.
13
+ * @param {PropertyConfig} propertyConfig Configuration details relating to the custom property type. For example, required, type, and so on.
14
14
  * @param {string} propertyKey Key where this property's value is stored.
15
15
  * @param {Control | ToolbarPropertyControl} control The control.
16
16
  * @returns {PageTemplateMetadata}
@@ -1,6 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- // Generated using typescript-generator version 2.15.527 on 2022-01-30 09:29:49.
3
+ // Generated using typescript-generator version 2.15.527 on 2023-01-24 10:52:36.
4
4
 
5
5
  export interface BaseRep extends TrackedResource {
6
6
  links?: Link[];
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@types/score-reps",
3
- "version": "2.3.63",
3
+ "version": "3.3.20",
4
4
  "types": "index.d.ts"
5
5
  }
@@ -12,7 +12,7 @@ export declare enum Visualization {
12
12
  Map = "map",
13
13
  Table = "table",
14
14
  Timeline = "timeline",
15
- Network = "network"
15
+ Network = "networkDiagram"
16
16
  }
17
17
  export declare type MapFilter = MapBoundedPolygonFilter | MapRadiusFilter | MapBoundedBoxFilter | MapShapeFilter;
18
18
  export interface SearchQuery {
@@ -39,6 +39,7 @@ export interface NetworkData {
39
39
  showTransactionDetails?: boolean;
40
40
  showTransactionLinks?: boolean;
41
41
  };
42
+ numNodes: number;
42
43
  }
43
44
  export interface ResolvedObjectIdentifier extends ObjectIdentifier {
44
45
  compoundValues: string[];
@@ -50,6 +51,10 @@ export interface SearchAndCreateDialogModel {
50
51
  relateToParentLabel?: string;
51
52
  canCreate?: boolean;
52
53
  linkReasons?: Relationship[];
54
+ /**
55
+ * Values returned on the close of the dialog. May be undefined when dialog is cancelled.
56
+ */
57
+ result?: SearchAndCreateResponse;
53
58
  }
54
59
  export interface SearchObject extends ObjectIdentifier {
55
60
  title?: string;
@@ -68,7 +73,7 @@ export interface SearchAndCreateResponse {
68
73
  relateToModel?: SearchAndCreateRelateToModel;
69
74
  }
70
75
  /**
71
- * {@link SearchApi} extension pertains to functionality related to SAS Visual Investigators search capabilities.
76
+ * {@link SearchApi} extension pertains to functionality related to SAS Visual Investigator's search capabilities.
72
77
  * These additional methods are available only in the SAS Visual Investigator Client Application.
73
78
  * Accessed from the window at window.sas.vi.search.
74
79
  * @extends SearchApi
@@ -78,7 +83,7 @@ export interface ClientSearchApi extends SearchApi {
78
83
  * @method
79
84
  * @description Performs a search against the svi-sand service.
80
85
  * @param query {SearchRepresentation} Query to send to the service.
81
- * @returns A promise containing the search response.
86
+ * @returns A Promise containing the search response.
82
87
  */
83
88
  performSearch(query: SearchRepresentation): Promise<SearchResponse>;
84
89
  /**
@@ -99,7 +104,7 @@ export interface ClientSearchApi extends SearchApi {
99
104
  * @method
100
105
  * @description Converts a query model generated by the query builder to a string.
101
106
  * @param queryModel {QueryBuilderModel} Query builder model.
102
- * @returns A promise containing the string representation of the query.
107
+ * @returns A Promise containing the string representation of the query.
103
108
  */
104
109
  createQueryStringFromModel(queryModel: QueryBuilderModel): Promise<string>;
105
110
  /**
@@ -112,15 +117,15 @@ export interface ClientSearchApi extends SearchApi {
112
117
  /**
113
118
  * @method
114
119
  * @description Sets the query builder model for the given ID. If no ID is given, it sets the query model for SEARCH.
115
- * Once stored, the query model is used to initially populate a Query Builder opened with the given ID.
120
+ * When stored, the query model is used to initially populate a Query Builder opened with the given ID.
116
121
  * @param queryModel {QueryBuilderModel} A query builder model.
117
122
  * @param [id] {string} ID of the model to set. Defaults to SEARCH.
118
123
  */
119
124
  setQueryBuilderModel(queryModel: QueryBuilderModel, id?: string): void;
120
125
  /**
121
126
  * @method
122
- * @description Opens up the "Add Objects to Workspace" dialog box and then performs the action once a document and workspace have been selected.
123
- * @param visualizationName {Visualization} Visualization to initially display once the objects have been added.
127
+ * @description Opens the "Add Objects to Workspace" dialog box and then performs the action after a document and workspace have been selected.
128
+ * @param visualizationName {Visualization} Visualization to initially display after the objects have been added.
124
129
  * @param objects {Array<ObjectIdentifier | ResolvedObjectIdentifier>} Objects to add to the workspace.
125
130
  * @param [currentObject] {ObjectIdentifier} The document the user is currently viewing. This is used as a visual aid in the dialog box.
126
131
  * @param [networkData] {NetworkData} Network visualization data to be copied to the workspace.
@@ -142,7 +147,7 @@ export interface ClientSearchApi extends SearchApi {
142
147
  * @param objectsToAdd {Array<ObjectIdentifier | ResolvedObjectIdentifier>} Objects to add to the workspace.
143
148
  * @param targetObjectType {string} Object type where the workspace is created.
144
149
  * @param [targetObjectId] {string} Object to add to the workspace. If undefined, a new object is created.
145
- * @param [visualization] {"summary" | "map" | "table" | "timeline" | "network"} Visualization to initially display in the new workspace.
150
+ * @param [visualization] {"summary" | "map" | "table" | "timeline" | "networkDiagram"} Visualization to initially display in the new workspace.
146
151
  * @param [workspaceName] {string} Name of the new workspace.
147
152
  * @param [networkData] {NetworkData} Network visualization data to be copied to the new workspace.
148
153
  */
@@ -152,8 +157,7 @@ export interface ClientSearchApi extends SearchApi {
152
157
  * @description Launches a wizard allowing users to search first, before creating an object/relationship.
153
158
  * Relationship wizard is determined by relateToParentLabel or relateToParentName being defined within the wizardValues parameter.
154
159
  * @param wizardValues {SearchAndCreateDialogModel} Object containing entity and relationship data.
155
- * @param [onRelationshipSuccess] {function} A callback function that is defined when creating a relationship.
156
- * It is invoked when a relationship is saved successfully.
160
+ * @returns A Promise which resolves when the dialog is closed.
157
161
  */
158
- openSearchAndCreateDialog(wizardValues: SearchAndCreateDialogModel, onRelationshipSuccess?: () => void): Promise<SearchAndCreateResponse>;
162
+ openSearchAndCreateDialog(wizardValues: SearchAndCreateDialogModel): Promise<SearchAndCreateDialogModel>;
159
163
  }
@@ -10,5 +10,5 @@ export var Visualization;
10
10
  Visualization["Map"] = "map";
11
11
  Visualization["Table"] = "table";
12
12
  Visualization["Timeline"] = "timeline";
13
- Visualization["Network"] = "network";
13
+ Visualization["Network"] = "networkDiagram";
14
14
  })(Visualization || (Visualization = {}));
@@ -1,12 +1,12 @@
1
1
  export interface QueryBuilderItem {
2
2
  booleanValue?: boolean | string;
3
3
  boost?: number;
4
- dateTimeValue?: string;
5
- dateValue?: string;
4
+ dateTimeValue?: string | Date;
5
+ dateValue?: string | Date;
6
6
  exclude?: boolean;
7
7
  field?: string;
8
- fromDateTimeValue?: string;
9
- fromDateValue?: string;
8
+ fromDateTimeValue?: string | Date;
9
+ fromDateValue?: string | Date;
10
10
  fromNumericValue?: number;
11
11
  numericValue?: number;
12
12
  operator?: string;
@@ -22,8 +22,8 @@ export interface QueryBuilderItem {
22
22
  stringValidationError?: boolean;
23
23
  synonym?: boolean;
24
24
  textValue?: string;
25
- toDateTimeValue?: string;
26
- toDateValue?: string;
25
+ toDateTimeValue?: string | Date;
26
+ toDateValue?: string | Date;
27
27
  toNumericValue?: number;
28
28
  userGroupValue?: Array<{
29
29
  id: string;
@@ -57,7 +57,7 @@ export interface SearchApi {
57
57
  * @param [queryModel] {QueryBuilderModel} An existing query model that can be used to initially populate the query builder.
58
58
  * @param [enforceObjectType] {string} If enforceObjectType is set, the user cannot choose which entity to query. It is pre-set to the specified entity.
59
59
  * @param [restrictObjectTypes] {Array<string>} If restrictObjectTypes is set, then the entity dropdown is filtered to show only the entities in this list.
60
- * @returns A promise containing the result of the dialog box.
60
+ * @returns A Promise containing the result of the dialog box.
61
61
  * @example
62
62
  * const searchApi: SearchApi = window.sas.vi.search;
63
63
  * const dialogTitle = 'Intelligence Search'
@@ -1,7 +1,7 @@
1
1
  import { ObjectIdentifier, ObjectSheetSettings, VIObject } from "../object/object-api";
2
2
  import { NetworkData, ResolvedObjectIdentifier, Visualization } from "../search/client/client-search-api";
3
3
  /**
4
- * This API pertains to functionality related to SAS Visual Investigators sheet capabilities.
4
+ * This API pertains to functionality related to SAS Visual Investigator's sheet capabilities.
5
5
  * Accessed from the window at window.sas.vi.sheet.
6
6
  */
7
7
  export interface SheetApi {
@@ -27,15 +27,35 @@ export interface SheetApi {
27
27
  */
28
28
  getOpenObjectBySheet(sheet: ClientSheet): VIObject | undefined;
29
29
  /**
30
+ * @deprecated use {@link registerNetworkMenuCallback} instead.
30
31
  * @method
31
- * @description Creates and returns the list containing all Context Menu Items for a right-click on a network diagram node.
32
+ * @description Deprecated. This function is deprecated and replaced with registerNetworkMenuCallback. The original
33
+ * function did not allow users to extend the menu being constructed by a context click.
34
+ *
35
+ * Creates and returns the list containing all Context Menu Items for a right-click on a network diagram node.
32
36
  * The menu is not rendered on the network diagram.
33
- * @param workspace {ClientSheet} Workspace containing the network.
34
- * @param handleAddToWorkspaceFn {function} A callback to handle adding the selected nodes to a Workspace.
37
+ * @param workspace {ClientSheet} Workspace containing the network. The workspace should not be manually constructed.
38
+ * @param handleAddToWorkspaceFn {function} A callback to handle adding the selected nodes to a workspace.
35
39
  * @param handleAddToInsightsFn {function} A callback to handle adding the NLD to an Insight.
36
40
  * @returns Promise resolving to the list containing all Context Menu Items.
37
41
  */
38
- createContextMenuForNodes(workspace: ClientSheet, handleAddToWorkspaceFn: () => void, handleAddToInsightsFn: () => void): Promise<ContextMenuItem[]>;
42
+ createContextMenuForNodes(workspace: ClientSheet, handleAddToWorkspaceFn?: () => void, handleAddToInsightsFn?: () => void): Promise<ContextMenuItem[]>;
43
+ /**
44
+ * @method
45
+ * @description Registers a callback that is invoked whenever the node or network context menu is constructed.
46
+ * The caller can extend the menu to provide access to extra functionality. It is the caller's responsibility
47
+ * to ensure that they properly extend the menu. Failing to do so can result in application errors.
48
+ *
49
+ * The callback can be unregistered by calling this function without passing in a callback function
50
+ * or setting it to undefined.
51
+ *
52
+ * @param menuType {NetworkMenuType} The type of menu to extend.
53
+ * @param callback {NetworkMenuCallback} The callback function invoked when the context menu is constructed.
54
+ * This function is passed the menu object, which can be modified/extended, and the "client Id" of the current workspace.
55
+ * If callback not passed in or is undefined, the callback is unregistered.
56
+ * @returns void
57
+ */
58
+ registerNetworkMenuCallback(menuType: NetworkMenuType, callback?: NetworkMenuCallback): void;
39
59
  /**
40
60
  * @method
41
61
  * @description Adds objects to a workspace selected in the "Add Objects to Workspace" dialog box.
@@ -68,22 +88,22 @@ export interface SheetApi {
68
88
  * @param targetObject {VIObject} Object containing the existing workspace.
69
89
  * @param workspaceClientId {string} Client ID of the workspace to add to.
70
90
  * @param objectsToAdd {Array<ObjectIdentifier | ResolvedObjectIdentifier>} Objects to add. It is safe to pass objects that are already in the workspace.
71
- * @param [networkData] {NetworkData} If provided, network data that shall be merged into any existing network data on the workspace.
91
+ * @param [networkData] {NetworkData} If provided, network data that will be merged into any existing network data on the workspace.
72
92
  * @param [isUndoRedo] {boolean} Specifies if the function was called as part of an undo/redo operation.
73
93
  */
74
94
  addToExistingWorkspace(targetObject: VIObject, workspaceClientId: string, objectsToAdd: Array<ObjectIdentifier | ResolvedObjectIdentifier>, networkData?: NetworkData, isUndoRedo?: boolean): Promise<void>;
75
95
  }
76
96
  export interface AddAllObjectsToWorkspaceDialogOptions {
77
97
  /**
78
- * The visualization to initially display once the objects have been added
98
+ * The visualization to initially display after the objects have been added.
79
99
  */
80
100
  visualizationName?: Visualization;
81
101
  /**
82
- * The object the user is currently viewing. This is used as a visual aid in the dialog
102
+ * The object the user is currently viewing. This is used as a visual aid in the dialog.
83
103
  */
84
104
  currentObject?: ObjectIdentifier;
85
105
  /**
86
- * Network visualization data to be copied to the workspace
106
+ * Network visualization data to be copied to the workspace.
87
107
  */
88
108
  networkData?: NetworkData;
89
109
  }
@@ -182,3 +202,15 @@ export interface ClientSheet extends Sheet {
182
202
  clientId: string;
183
203
  document: ObjectSheetSettings;
184
204
  }
205
+ /**
206
+ * The set of menu types which can be extended
207
+ * via the registerNetworkMenuCallback function.
208
+ */
209
+ export declare enum NetworkMenuType {
210
+ NetworkContext = "networkContext",
211
+ NodeContext = "nodeContext"
212
+ }
213
+ /**
214
+ * The type of function that can be registered as a callback for modifying the Network menus.
215
+ */
216
+ export declare type NetworkMenuCallback = (menu: ContextMenuItem, workspaceClientId: string) => void;
@@ -1 +1,9 @@
1
- export {};
1
+ /**
2
+ * The set of menu types which can be extended
3
+ * via the registerNetworkMenuCallback function.
4
+ */
5
+ export var NetworkMenuType;
6
+ (function (NetworkMenuType) {
7
+ NetworkMenuType["NetworkContext"] = "networkContext";
8
+ NetworkMenuType["NodeContext"] = "nodeContext";
9
+ })(NetworkMenuType || (NetworkMenuType = {}));