@sassoftware/vi-api 1.15.3 → 1.40.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.
@@ -1,6 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- // Generated using typescript-generator version 2.15.527 on 2023-11-21 12:24:57.
3
+ // Generated using typescript-generator version 2.15.527 on 2024-04-05 10:39:48.
4
4
 
5
5
  export interface ActionRequestRep {
6
6
  version?: number;
@@ -106,18 +106,18 @@ export interface AlertRep extends BaseRep {
106
106
  autoActivateScore?: number;
107
107
  strategyRangeLow?: number;
108
108
  strategyRangeHigh?: number;
109
- alertVersionTimestamp?: string;
109
+ suppressionEndTimestamp?: string;
110
+ holdEndTimestamp?: string;
111
+ queueEntryTimestamp?: string;
112
+ assignmentTimestamp?: string;
113
+ checkoutTimestamp?: string;
110
114
  userServiceTimestamp?: string;
111
115
  systemServiceTimestamp?: string;
112
116
  autoCloseTimestamp?: string;
113
117
  autoActivateTimestamp?: string;
118
+ alertVersionTimestamp?: string;
114
119
  statusTimestamp?: string;
115
120
  dispositionTimestamp?: string;
116
- suppressionEndTimestamp?: string;
117
- holdEndTimestamp?: string;
118
- queueEntryTimestamp?: string;
119
- assignmentTimestamp?: string;
120
- checkoutTimestamp?: string;
121
121
  }
122
122
 
123
123
  export interface AlertVersionSummaryRep {
@@ -630,8 +630,8 @@ export interface Link extends Serializable {
630
630
  }
631
631
 
632
632
  export interface TypedPayload {
633
- payloadType?: string;
634
633
  eventType?: string;
634
+ payloadType?: string;
635
635
  }
636
636
 
637
637
  export interface TrackedResource extends Serializable, ETaggable, TimeTrackedResource, ETagAndLastModifiedProvider {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@types/alert-reps",
3
- "version": "16.1.0",
3
+ "version": "18.0.2",
4
4
  "types": "index.d.ts"
5
5
  }
package/api.module.js CHANGED
@@ -27,6 +27,7 @@ import { SheetApiService } from "./sheet/sheet-api.service";
27
27
  import { TabApiService } from "./tab/tab-api.service";
28
28
  import { ThemeApiService } from "./theme/theme-api.service";
29
29
  import { TraversalApiService } from "./traversal/traversal-api.service";
30
+ import { PageTemplateApiService } from "./page-template/page-template-api.service";
30
31
  let ApiModule = class ApiModule {
31
32
  };
32
33
  ApiModule = __decorate([
@@ -45,6 +46,7 @@ ApiModule = __decorate([
45
46
  ObjectApiService,
46
47
  PageAdminApiService,
47
48
  PageModelApiService,
49
+ PageTemplateApiService,
48
50
  PageStateApiService,
49
51
  PropertyApiService,
50
52
  RefDataApiService,
@@ -27,6 +27,7 @@ export interface PageBindings {
27
27
  showToolbar?: boolean;
28
28
  tempCreateId?: string;
29
29
  containerClass?: string;
30
+ fitToContainerHeight?: boolean;
30
31
  pageClass?: string;
31
32
  enableSheets?: string;
32
33
  pageModel?: PageModel;
@@ -37,6 +38,9 @@ export interface PageBindings {
37
38
  onDirty?: (isDirty: boolean) => void;
38
39
  onChange?: (change: PageDataChange | PageModeChange) => void;
39
40
  }
41
+ export interface PagePreviewBindings {
42
+ templateUuid: string;
43
+ }
40
44
  export interface ControlCollectionBindings {
41
45
  controlContainer?: ControlContainer;
42
46
  pageModel?: PageModel;
@@ -134,4 +138,4 @@ export interface TimeSliderBindings extends TimeSliderInputBindings {
134
138
  onLoad?: () => void;
135
139
  close?: () => void;
136
140
  }
137
- export declare type SviComponentBindings = ControlCollectionBindings | RelationshipDetailsBindings | SearchInputBindings | PageBindings | SearchAndSelectWithPreviewBindings | TimeSliderBindings;
141
+ export type SviComponentBindings = ControlCollectionBindings | RelationshipDetailsBindings | SearchInputBindings | PageBindings | SearchAndSelectWithPreviewBindings | TimeSliderBindings;
@@ -1,9 +1,10 @@
1
- import { ControlCollectionBindings, PageBindings, RelationshipDetailsBindings, SearchAndSelectWithPreviewBindings, SearchInputBindings, SviComponentBindings, TimeSliderBindings } from "./bindings";
1
+ import { ControlCollectionBindings, PageBindings, PagePreviewBindings, RelationshipDetailsBindings, SearchAndSelectWithPreviewBindings, SearchInputBindings, SviComponentBindings, TimeSliderBindings } from "./bindings";
2
2
  export declare enum SviComponent {
3
3
  ControlCollection = "svi-control-collection",
4
4
  RelationshipDetails = "svi-relationship-details",
5
5
  SearchInput = "svi-search-input",
6
6
  Page = "svi-page",
7
+ PagePreview = "svi-page-preview",
7
8
  SearchAndSelectWithPreview = "svi-search-and-select-with-preview",
8
9
  TimeSlider = "svi-time-slider"
9
10
  }
@@ -20,6 +21,7 @@ export interface ComponentCreationResult<T> {
20
21
  export interface ComponentApi {
21
22
  create(component: SviComponent.ControlCollection, target: HTMLElement, bindings?: ControlCollectionBindings): Promise<ComponentCreationResult<ControlCollectionBindings>>;
22
23
  create(component: SviComponent.Page, target: HTMLElement, bindings?: PageBindings): Promise<ComponentCreationResult<PageBindings>>;
24
+ create(component: SviComponent.PagePreview, target: HTMLElement, bindings?: PagePreviewBindings): Promise<ComponentCreationResult<PagePreviewBindings>>;
23
25
  create(component: SviComponent.RelationshipDetails, target: HTMLElement, bindings?: RelationshipDetailsBindings): Promise<ComponentCreationResult<RelationshipDetailsBindings>>;
24
26
  create(component: SviComponent.SearchInput, target: HTMLElement, bindings?: SearchInputBindings): Promise<ComponentCreationResult<SearchInputBindings>>;
25
27
  create(component: SviComponent.SearchAndSelectWithPreview, target: HTMLElement, bindings?: SearchAndSelectWithPreviewBindings): Promise<ComponentCreationResult<SearchAndSelectWithPreviewBindings>>;
@@ -5,6 +5,7 @@ export var SviComponent;
5
5
  SviComponent["RelationshipDetails"] = "svi-relationship-details";
6
6
  SviComponent["SearchInput"] = "svi-search-input";
7
7
  SviComponent["Page"] = "svi-page";
8
+ SviComponent["PagePreview"] = "svi-page-preview";
8
9
  SviComponent["SearchAndSelectWithPreview"] = "svi-search-and-select-with-preview";
9
10
  SviComponent["TimeSlider"] = "svi-time-slider";
10
11
  })(SviComponent || (SviComponent = {}));
@@ -11,8 +11,11 @@ export interface Solution {
11
11
  }
12
12
  export interface SolutionExtension extends ControlMetadata {
13
13
  controlAttributes?: SolutionExtensionConfigTypeAttributes;
14
+ /** refers to controlAttributes.metadata, populated upon registration */
14
15
  metadata?: SolutionExtensionMetadata;
16
+ /** resolved displayName resource string, populated upon registration */
15
17
  resolvedDisplayName?: string;
18
+ /** resolved description resource string, populated upon registration */
16
19
  resolvedDescription?: string;
17
20
  clientApplication?: string;
18
21
  name: string;
@@ -44,8 +47,9 @@ export interface SolutionExtensionMetadata {
44
47
  path?: string;
45
48
  showInToolbox?: "true" | "false";
46
49
  mainDocumentOnly?: boolean;
50
+ requiredServices?: RequiredResourcesExpression;
47
51
  }
48
- export declare type SviDocumentManager = {
52
+ export type SviDocumentManager = {
49
53
  key: string;
50
54
  displayName: string;
51
55
  onClick: (onFilesAdded: (files: SviLinkedFile[]) => void) => void;
@@ -88,20 +92,36 @@ export interface AppConfigBundle<T> {
88
92
  solutionName?: string;
89
93
  }
90
94
  /**
91
- * Functionality related to configuration.
95
+ * A boolean expression to specify required resources by string identifier.
96
+ */
97
+ export type RequiredResourcesExpression = string | RequiredResourcesAndExpression | RequiredResourcesOrExpression;
98
+ export type RequiredResourcesOrExpression = {
99
+ or: RequiredResourcesExpression[];
100
+ and?: never;
101
+ };
102
+ export type RequiredResourcesAndExpression = {
103
+ and: RequiredResourcesExpression[];
104
+ or?: never;
105
+ };
106
+ export interface VersionSummary {
107
+ softwareVersionNumber: string;
108
+ apiVersionNumber: string;
109
+ }
110
+ /**
111
+ * Configuration-related functionality.
92
112
  * Accessed from the window at window.sas.vi.config.
93
113
  */
94
114
  export interface ConfigApi {
95
115
  /**
96
116
  * @method
97
117
  * @description Gets the soft expansion limit of the network nodes.
98
- * @returns Promise containing the soft expansion limit.
118
+ * @returns A Promise containing the soft expansion limit.
99
119
  */
100
120
  getSoftExpansionLimit(): Promise<number>;
101
121
  /**
102
122
  * @method
103
123
  * @description Gets the hard expansion limit of the network nodes.
104
- * @returns Promise containing the hard expansion limit.
124
+ * @returns A Promise containing the hard expansion limit.
105
125
  */
106
126
  getHardExpansionLimit(): Promise<number>;
107
127
  /**
@@ -112,10 +132,10 @@ export interface ConfigApi {
112
132
  getSolutions(): Map<string, Solution>;
113
133
  /**
114
134
  * @method
115
- * @description Registers a new solution and version in the SAS Visual Investigator about dialog box.
135
+ * @description Registers a new solution and version in the SAS Visual Investigator About dialog box.
116
136
  * If a solution with that key already exists, it will not be overwritten.
117
137
  * @param key {string} Unique identifier for the solution.
118
- * @param label {string} Localised name of the solution to be shown to the user.
138
+ * @param label {string} Localized name of the solution to be shown to the user.
119
139
  * @param [version] {string} Version of the solution.
120
140
  */
121
141
  registerSolution(key: string, label: string, version?: string): void;
@@ -141,28 +161,41 @@ export interface ConfigApi {
141
161
  registerDocumentManager(config: SviDocumentManager): void;
142
162
  /**
143
163
  * @method
144
- * @description Register a callback to override the default action when selecting the given configuration bundle in the administration application.
145
- * @param bundleName the name of the configuration bundle.
146
- * @param callback a function which should open a view to
164
+ * @description Register a callback to override the default action when selecting the configuration bundle in the administration application.
165
+ * @param bundleName {string} The name of the configuration bundle.
166
+ * @param callback {function(): void} A function which should open a view to
147
167
  * allow the user to modify the given configuration bundle.
148
168
  */
149
169
  registerOpenConfigurationCallback(bundleName: string, callback: () => void): void;
150
170
  /**
151
- * GET an app configuration bundle.
152
- *
153
- * @param appConfigId ID for the the app config that the bundle belongs to.
154
- * @param bundleName The name of the configuration bundle.
171
+ * @method
172
+ * @description Send a GET request to retrieve an application configuration bundle.
173
+ * @param appConfigId {string} The identifier for the application configuration that the bundle belongs to.
174
+ * @param bundleName {string} The name of the configuration bundle.
155
175
  */
156
176
  getAppConfigBundle<T extends object>(appConfigId: string, bundleName: string): Promise<AppConfigBundle<T>>;
157
177
  /**
158
- * Send a PUT request to the appConfigurations endpoint with an updated bundle.
159
- * @param bundle The updated app configuration bundle.
160
- * @returns a promise resolving resolving to the saved configuration bundle.
178
+ * @method
179
+ * @description Send a PUT request to save an application configuration bundle.
180
+ * @param bundle {AppConfigBundle} The updated application configuration bundle.
181
+ * @returns A Promise resolving to the saved configuration bundle.
161
182
  */
162
183
  updateAppConfigBundle<T extends object>(bundle: AppConfigBundle<T>): Promise<AppConfigBundle<T>>;
163
184
  /**
164
185
  * @method
165
- * @returns a reference to the HTML element which is the default container for modal dialogs to be spawned within the application.
186
+ * @returns A reference to the HTML element that is the default container for modal dialog boxes to be spawned within the application.
166
187
  */
167
188
  getSharedDialogContainer(): HTMLElement;
189
+ /**
190
+ * @method
191
+ * @description Get the services which are an optional part of the SAS Visual Investigator deployment.
192
+ * @returns A map of service identifiers to their enabled status (true or false).
193
+ */
194
+ getEnabledOptionalServices(): Record<string, boolean>;
195
+ /**
196
+ * @method
197
+ * @description Gets the current software version number and API version of the application.
198
+ * @returns The software version number and the installed version of the API.
199
+ */
200
+ getCurrentVersions(): VersionSummary;
168
201
  }
@@ -307,6 +307,12 @@ export interface ControlPageApi extends ControlPageApiBase {
307
307
  * @returns True, if the toolbar is disabled. Otherwise false.
308
308
  */
309
309
  isToolbarDisabled(): boolean;
310
+ /**
311
+ * Sets the toolbar control to be disabled.
312
+ * @param control {Control} The control to be disabled.
313
+ * @method
314
+ */
315
+ setToolbarItemDisabled(actionName: string, setDisabled: boolean): void;
310
316
  /**
311
317
  * Triggers a certain type of notification for users.
312
318
  * For example, a type EDIT_FAIL notification if a sheet has failed to be added to a workspace.
@@ -339,6 +345,11 @@ export interface ControlPageApi extends ControlPageApiBase {
339
345
  * @param [controlToRefresh] {Control} Individual control to be refreshed.
340
346
  */
341
347
  reloadRefreshableControls(categoryToRefresh?: string, controlToRefresh?: Control): void;
348
+ /**
349
+ * @method
350
+ * @returns True if any RefreshableControls have options.requiresIndex present. Otherwise False
351
+ */
352
+ hasAnyRefreshableControlRequiresIndex(): boolean;
342
353
  /**
343
354
  * Sets a page to be dirty, that is, when it has been edited and not saved.
344
355
  * @method
@@ -1,13 +1,14 @@
1
- export declare type FieldType = "STRING" | "BOOLEAN" | "REFERENCEDATA" | "USER_GROUP" | "JSON" | DateDataType | NumberDataType;
2
- export declare type NumberDataType = "SMALLINT" | "INTEGER" | "LONG" | "FLOAT" | "DOUBLE" | "NUMERIC";
3
- export declare type DateDataType = "DATE" | "TIMESTAMP" | "TIMESTAMP_WITH_TIME_ZONE";
1
+ export type FieldType = "STRING" | "BOOLEAN" | "REFERENCEDATA" | "USER_GROUP" | "JSON" | DateDataType | NumberDataType;
2
+ export type NumberDataType = "SMALLINT" | "INTEGER" | "LONG" | "FLOAT" | "DOUBLE" | "NUMERIC";
3
+ export type DateDataType = "DATE" | "TIMESTAMP" | "TIMESTAMP_WITH_TIME_ZONE";
4
+ export declare const isFieldDataTypeDate: (field?: string) => boolean;
4
5
  export interface UserGroup {
5
6
  id: string;
6
7
  type: "user" | "group";
7
8
  }
8
- export declare type FieldTypeToValue<Type extends FieldType> = Type extends "BOOLEAN" ? boolean : Type extends "STRING" | DateDataType | "REFERENCEDATA" ? string : Type extends NumberDataType ? number : Type extends "JSON" ? object : Type extends "USER_GROUP" ? UserGroup[] : never;
9
- export declare type FieldValue = undefined | string | number | boolean | object | UserGroup | Date | ChildObject[] | null;
10
- export declare type ChildObject = {
9
+ export type FieldTypeToValue<Type extends FieldType> = Type extends "BOOLEAN" ? boolean : Type extends "STRING" | DateDataType | "REFERENCEDATA" ? string : Type extends NumberDataType ? number : Type extends "JSON" ? object : Type extends "USER_GROUP" ? UserGroup[] : never;
10
+ export type FieldValue = undefined | string | number | boolean | object | UserGroup | Date | ChildObject[] | null;
11
+ export type ChildObject = {
11
12
  id?: string;
12
13
  isNew?: boolean;
13
14
  fieldValues: Record<string, FieldValue>;
@@ -1 +1 @@
1
- export {};
1
+ export const isFieldDataTypeDate = (field) => field ? ["DATE", "TIMESTAMP", "TIMESTAMP_WITH_TIME_ZONE"].includes(field) : false;
@@ -28,7 +28,7 @@ export interface ControlConfigChange<ControlTypeAttributes extends TypeAttribute
28
28
  type: "controlConfig";
29
29
  config: TypeAttributesChange<ControlTypeAttributes> | ConfigStateChange;
30
30
  }
31
- export declare type TypeAttributesChange<ControlTypeAttributes extends TypeAttributes, Property extends keyof ControlTypeAttributes = keyof ControlTypeAttributes> = Property extends any ? {
31
+ export type TypeAttributesChange<ControlTypeAttributes extends TypeAttributes, Property extends keyof ControlTypeAttributes = keyof ControlTypeAttributes> = Property extends any ? {
32
32
  type: "typeAttributes";
33
33
  value: {
34
34
  new: ControlTypeAttributes[Property];
@@ -48,7 +48,7 @@ export interface PageModelData {
48
48
  [property: string]: any;
49
49
  }
50
50
  export declare enum ChangeType {
51
- PAGE_MODE = "mode",
51
+ PAGE_MODE = "mode",// aligned with Mobile API
52
52
  PAGE_DATA = "pageData"
53
53
  }
54
54
  export interface PageDataChange {
@@ -26,7 +26,7 @@ export interface ReferenceDataRestrictions extends FieldRestrictions {
26
26
  cascadingReferenceDataFilterByCode?: string;
27
27
  cascadingReferenceDataFilterByField?: string;
28
28
  }
29
- export declare type UserGroupStrategy = "USERS" | "GROUPS" | "USERS_AND_GROUPS";
29
+ export type UserGroupStrategy = "USERS" | "GROUPS" | "USERS_AND_GROUPS";
30
30
  export interface UserGroupRestrictions extends FieldRestrictions {
31
31
  allowMultipleSelections: boolean;
32
32
  userSelectionStrategy: UserGroupStrategy;
@@ -34,4 +34,4 @@ export interface UserGroupRestrictions extends FieldRestrictions {
34
34
  export interface FileRestrictions extends RequirableRestriction {
35
35
  allowMultipleFiles: boolean;
36
36
  }
37
- export declare type FieldTypeToRestrictions<Type extends FieldType> = Type extends "STRING" ? StringRestrictions : Type extends "NUMERIC" ? NumericRestrictions : Type extends "REFERENCEDATA" ? ReferenceDataRestrictions : Type extends "USER_GROUP" ? UserGroupRestrictions : FieldRestrictions;
37
+ export type FieldTypeToRestrictions<Type extends FieldType> = Type extends "STRING" ? StringRestrictions : Type extends "NUMERIC" ? NumericRestrictions : Type extends "REFERENCEDATA" ? ReferenceDataRestrictions : Type extends "USER_GROUP" ? UserGroupRestrictions : FieldRestrictions;
@@ -20,6 +20,9 @@ export declare enum PageEvents {
20
20
  MaskToggleEvent = "spb::mask-toggle",
21
21
  MaskAllEvent = "spb::mask-all"
22
22
  }
23
+ export declare enum DocumentGeneratorEvents {
24
+ AfterDocumentGenerated = "docgen::after-document-generated"
25
+ }
23
26
  export interface Subscription {
24
27
  unsubscribe(): void;
25
28
  }
@@ -21,6 +21,10 @@ export var PageEvents;
21
21
  PageEvents["MaskToggleEvent"] = "spb::mask-toggle";
22
22
  PageEvents["MaskAllEvent"] = "spb::mask-all";
23
23
  })(PageEvents || (PageEvents = {}));
24
+ export var DocumentGeneratorEvents;
25
+ (function (DocumentGeneratorEvents) {
26
+ DocumentGeneratorEvents["AfterDocumentGenerated"] = "docgen::after-document-generated";
27
+ })(DocumentGeneratorEvents || (DocumentGeneratorEvents = {}));
24
28
  /**
25
29
  * Callback function executed when subscription is triggered by an event.
26
30
  * @callback EventApi~subscriptionCallback
package/index.d.ts CHANGED
@@ -21,6 +21,7 @@ import { TabApi } from "./tab/tab-api";
21
21
  import { ThemeApi } from "./theme/theme-api";
22
22
  import { TraversalApi } from "./traversal/traversal-api";
23
23
  import { ShellTabsApi } from "./shell-tabs/shell-tabs-api";
24
+ import { PageTemplateApi } from "./page-template/page-template-api";
24
25
  import { InitApi } from "./init";
25
26
  /**
26
27
  * Common API Functions.
@@ -36,6 +37,7 @@ export interface SviCommonApi {
36
37
  pageAdmin: PageAdminApi;
37
38
  pageModel: PageModelApi;
38
39
  pageState: PageStateApi;
40
+ pageTemplate: PageTemplateApi;
39
41
  property: PropertyApi;
40
42
  refData: RefDataApi;
41
43
  /** @deprecated Use window.sas.viInit.registerResourceBundle to register resources before the rest of the Visual Investigator API is ready. */
@@ -61,8 +63,8 @@ export interface SviClientApi extends SviCommonApi {
61
63
  export interface SviAdminApi extends SviCommonApi {
62
64
  metadata: AdminMetadataApi;
63
65
  }
64
- export declare type SviApi = SviClientApi | SviAdminApi;
65
- export declare type SviWindow = typeof window & {
66
+ export type SviApi = SviClientApi | SviAdminApi;
67
+ export type SviWindow = typeof window & {
66
68
  sas: {
67
69
  vi: SviApi;
68
70
  viInit: InitApi;
@@ -24,54 +24,68 @@ export interface LocalizationApi {
24
24
  */
25
25
  getDirection(): "ltr" | "rtl";
26
26
  /**
27
- * Methods related to Solution content localization.
27
+ * Methods related to solution content localization.
28
28
  */
29
29
  solution: SolutionLocalizationApi;
30
30
  }
31
+ /**
32
+ * This API is used for solution content localization.
33
+ * Accessed from the window at window.sas.vi.localization.solution.
34
+ */
31
35
  export interface SolutionLocalizationApi {
32
36
  /**
33
- * if {@link isEnabled}, returns the {@link SolutionLocalizationBundle} used to lookup translations.
37
+ * @method
38
+ * @returns The {@link SolutionLocalizationBundle} used to lookup translations if solution localization is enabled, else undefined.
34
39
  */
35
40
  getLocalizationBundle(): SolutionLocalizationBundle | undefined;
36
41
  /**
37
- * returns true if solution localization is enabled.
38
- * methods will return unmodified inputs if not enabled.
39
- * note that solution localization is disabled in the administration application.
42
+ * @method
43
+ * @description
44
+ * Check that solution localization is enabled.
45
+ * Localization methods will return unmodified inputs if isEnabled returns false.
46
+ * Solution localization is not available in the administration application.
47
+ * @returns True if solution localization is enabled, else false.
40
48
  */
41
49
  isEnabled(): boolean;
42
50
  /**
43
- * returns the localized value for the given resource key, else, undefined.
44
- * @param resourceKey
51
+ * @method
52
+ * @returns The localized value for the given resource key, else undefined.
53
+ * @param resourceKey {string} A resource key used to lookup the localized value.
54
+ * @example
55
+ * getLocalizedResource("colours.red.txt") === "rouge"
45
56
  */
46
57
  getLocalizedResource(resourceKey: string): string | undefined;
47
58
  /**
48
- * localize a string using a resourceKey.
49
- * fallback to lookup by value if the resourceKey is not supplied/found.
50
- * mappings are defined by the contents of {@link getLocalizationBundle}
51
- * @param str string to localize
52
- * @param resourceKey a resource key used to lookup the localized value
53
- * @returns the localized string
59
+ * @method
60
+ * @description
61
+ * Localize a string using a resourceKey.
62
+ * Fallback to lookup by value if the resourceKey is not found or not supplied.
63
+ * @param str {string} The string to localize.
64
+ * @param resourceKey {string} A resource key used to lookup the localized value.
65
+ * @returns The localized string.
54
66
  * @example
55
67
  * localize("red", "colours.red.txt") === "rouge"
56
68
  */
57
69
  localize(str: string, resourceKey?: string): string;
58
70
  /**
59
- * localize string properties of an object
60
- * properties are provided as a map of <propertyKey, resourceKey>, deep property keys are accepted.
61
- * {@link localize} is applied to each property with its given resourceKey.
62
- * @param obj source object to localize
63
- * @param props properties to localize and their resource keys
64
- * @returns the localized object
71
+ * @method
72
+ * @description
73
+ * Localize string properties of an object.
74
+ * Properties are provided as a map of property keys to resource keys, deep property keys are accepted.
75
+ * @param obj {T} The source object to localize.
76
+ * @param props {Record<string, string | undefined>} The properties to localize and their resource keys.
77
+ * @returns The localized object.
65
78
  * @example
66
79
  * localizeObject({ label: "red" }, { "label": "colours.red.txt" }) === { label: "rouge" }
67
80
  */
68
81
  localizeObject<T extends object>(obj: T, props: Record<string, string | undefined>): T;
69
82
  /**
70
- * localize a list of objects.
71
- * {@link localizeObject} is applied to each element in the list.
72
- * @param list objects to translate
73
- * @param getProps callback to return a map of properties and resource keys for the given list element
74
- * @returns the localized list
83
+ * @method
84
+ * @description
85
+ * Localize a list of objects.
86
+ * @param list {T[]} The objects to translate.
87
+ * @param getProps {function(T): Record<string, string | undefined>} A callback to return a map of properties and resource keys for the given list element.
88
+ * @returns The localized list.
75
89
  * @example
76
90
  * localizeList(
77
91
  * [{ id: "red", label: "Red" }, { id: "blue", label: "Blue"} ],
@@ -137,7 +137,7 @@ export interface ReferenceDataItem {
137
137
  displayText: string;
138
138
  value: string | null;
139
139
  }
140
- export declare type Picklist = ReferenceDataItem[];
140
+ export type Picklist = ReferenceDataItem[];
141
141
  export interface RelationshipWithLabel extends RelationshipDTO {
142
142
  relationshipLabel?: string;
143
143
  }
@@ -159,7 +159,7 @@ export interface MetadataApi {
159
159
  getEntityAccessRules(objectType: string): EntityAccessRules;
160
160
  /**
161
161
  * @method
162
- * @description Gets create, read, and update access rights for the provided entities via Batch call.
162
+ * @description Gets create, read, and update access rights for the provided entities via batch call.
163
163
  * @param objectType {string[]} Entity name(s).
164
164
  * @returns Object with a Promise of type EntityAccessRule[] for each rule, where EntityAccessRule maps to the access rule of a given entity name.
165
165
  */
@@ -216,6 +216,14 @@ export interface ObjectApi {
216
216
  * @return An observable that resolves to an array of validation results.
217
217
  */
218
218
  validate(model: PageModel, childObject: StoredObjectMetadata): Promise<ValidationResult[]>;
219
+ /**
220
+ * @method
221
+ * @description Launches a wizard allowing users to create an object/relationship.
222
+ * The relationship wizard is determined by the relateToParentLabel or relateToParentName defined in the wizardValues parameter.
223
+ * @param wizardValues {CreateDialogModel} Object containing entity and relationship data.
224
+ * @returns A Promise which resolves when the dialog box is closed.
225
+ */
226
+ openCreateAndLinkDialog(wizardValues: CreateDialogModel): Promise<CreateDialogModel>;
219
227
  }
220
228
  export interface PageData {
221
229
  fieldValues: FieldValues;
@@ -247,8 +255,8 @@ export interface VIObject {
247
255
  id: string;
248
256
  title?: string;
249
257
  }
250
- export declare type LinkObject = Pick<VIObject, "id" | "objectTypeName">;
251
- export declare type NewLinkObject = Pick<VIObject, "objectTypeName" | "fieldValues" | "fileOperations">;
258
+ export type LinkObject = Pick<VIObject, "id" | "objectTypeName">;
259
+ export type NewLinkObject = Pick<VIObject, "objectTypeName" | "fieldValues" | "fileOperations">;
252
260
  export interface ValidationResult {
253
261
  isValid: boolean;
254
262
  message?: string;
@@ -260,7 +268,7 @@ export interface PageAction {
260
268
  attributes: {
261
269
  [property: string]: any;
262
270
  displayName: string;
263
- disabled: string;
271
+ disabled: boolean;
264
272
  };
265
273
  controlId?: number;
266
274
  displayName: string;
@@ -520,4 +528,31 @@ export interface DisplayTextFields {
520
528
  name: string;
521
529
  displayIndex: number;
522
530
  }
531
+ export interface SearchOrCreateAndLinkDialogBase<T> {
532
+ entityName: string;
533
+ entityLabel: string;
534
+ onClose?: (result?: T) => Promise<boolean>;
535
+ /**
536
+ * Values returned on the close of the dialog box. May be undefined when dialog box is cancelled.
537
+ */
538
+ result?: T;
539
+ }
540
+ export interface CreateRelationshipDialogModel<T> extends SearchOrCreateAndLinkDialogBase<T> {
541
+ relateToParentName: string;
542
+ relateToParentLabel: string;
543
+ linkReasons?: Relationship[];
544
+ }
545
+ export interface CreateDialogModel extends CreateRelationshipDialogModel<CreateDialogResponse> {
546
+ }
547
+ export interface CreateDialogResponse {
548
+ relateToModel?: CreateRelateToModel;
549
+ }
550
+ export interface CreateReleationshipDialogResultModel {
551
+ linkReason?: Relationship;
552
+ }
553
+ export interface CreateRelateToModel extends CreateReleationshipDialogResultModel {
554
+ newPageModel?: {
555
+ model: PageModel;
556
+ };
557
+ }
523
558
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/vi-api",
3
- "version": "1.15.3",
3
+ "version": "1.40.2",
4
4
  "description": "Types used in the SAS Visual Investigator API",
5
5
  "keywords": [
6
6
  "SAS",
@@ -3,6 +3,7 @@ import { Control } from "../control/page";
3
3
  import { FileOperation, SASObjectAttachedFile } from "../file/file-api";
4
4
  import { ObjectFieldRestrictions } from "../object/object-api";
5
5
  import { PathsRepresentation } from "../svi-sand";
6
+ import { TemplateFileCategoryAssociationDTO } from "../svi-datahub";
6
7
  export declare enum PageMode {
7
8
  Create = "create",
8
9
  Edit = "edit",
@@ -25,7 +26,7 @@ export interface PageAction {
25
26
  attributes: {
26
27
  [property: string]: any;
27
28
  displayName?: string;
28
- disabled?: string;
29
+ disabled?: boolean;
29
30
  };
30
31
  controlId?: number;
31
32
  displayName: string;
@@ -87,9 +88,13 @@ export interface PageTemplate {
87
88
  }
88
89
  export interface PageTemplateMetadata {
89
90
  dataSources: PageTemplateMetadataDataSource[];
91
+ fileCategories?: TemplateFileCategoryAssociationDTO[];
90
92
  insightsCreationEnabled: boolean;
91
93
  insightsEnabled: boolean;
92
- linkedTemplates: any[];
94
+ linkedTemplates: Array<{
95
+ templateUuid: string;
96
+ traversalUuid: string;
97
+ }>;
93
98
  resources: {
94
99
  [property: string]: string;
95
100
  };
@@ -123,8 +128,8 @@ export interface IPageEventHook<T extends IPageEventData, R extends IPageEventHo
123
128
  */
124
129
  order?: number;
125
130
  }
126
- export declare type IPrePageEventHook<T extends IPageEventData> = Omit<IPageEventHook<T, IPrePageEventHookResponse>, "onFail">;
127
- export declare type IPostPageEventHook<T extends IPageEventData> = IPageEventHook<T, IPostPageEventHookResponse>;
131
+ export type IPrePageEventHook<T extends IPageEventData> = Omit<IPageEventHook<T, IPrePageEventHookResponse>, "onFail">;
132
+ export type IPostPageEventHook<T extends IPageEventData> = IPageEventHook<T, IPostPageEventHookResponse>;
128
133
  export interface IPageEventHookResponse {
129
134
  message: string;
130
135
  messages?: string[];
@@ -132,12 +137,12 @@ export interface IPageEventHookResponse {
132
137
  export interface IPrePageEventHookResponse extends IPageEventHookResponse {
133
138
  abort: boolean;
134
139
  }
135
- export declare type IPostPageEventHookResponse = IPageEventHookResponse;
140
+ export type IPostPageEventHookResponse = IPageEventHookResponse;
136
141
  /**
137
142
  * A callback to unregister a page event hook.
138
143
  * @returns true if the hook was removed, false if it was already removed.
139
144
  */
140
- export declare type PageEventHookRemove = () => boolean;
145
+ export type PageEventHookRemove = () => boolean;
141
146
  export interface IPageEventData {
142
147
  pageModel: PageModel;
143
148
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@sassoftware/vi-api/page-template",
3
+ "files": [
4
+ "**/*.d.ts",
5
+ "**/*.js"
6
+ ],
7
+ "main": "public-api.js",
8
+ "types": "public-api.d.ts"
9
+ }