@sassoftware/vi-api 1.40.4 → 1.44.0

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 (133) hide show
  1. package/README.md +36 -5
  2. package/alert-reps/index.d.ts +16 -3
  3. package/alert-reps/package.json +1 -1
  4. package/component/index.d.ts +5 -1
  5. package/component/package.json +2 -2
  6. package/config/config-api.d.ts +23 -3
  7. package/config/config-api.js +10 -0
  8. package/config/package.json +2 -2
  9. package/control/control-api.d.ts +40 -8
  10. package/control/events.d.ts +1 -1
  11. package/control/masking-api.d.ts +187 -0
  12. package/control/masking-api.js +3 -0
  13. package/control/package.json +2 -2
  14. package/control/restrictions.d.ts +7 -1
  15. package/current-user/currentUser-api.d.ts +7 -2
  16. package/current-user/package.json +2 -2
  17. package/elements/bindings.d.ts +25 -0
  18. package/elements/identity-select.d.ts +274 -0
  19. package/elements/identity-select.js +24 -0
  20. package/elements/index.d.ts +49 -0
  21. package/elements/index.js +50 -0
  22. package/elements/labelled-control.d.ts +47 -0
  23. package/elements/labelled-control.js +1 -0
  24. package/elements/mask-toggle-button.d.ts +37 -0
  25. package/elements/mask-toggle-button.js +1 -0
  26. package/elements/package.json +9 -0
  27. package/event/event-api.d.ts +10 -5
  28. package/event/event-api.js +3 -2
  29. package/event/package.json +2 -2
  30. package/file/file-api.d.ts +5 -1
  31. package/file/package.json +2 -2
  32. package/http/index.d.ts +5 -1
  33. package/http/package.json +2 -2
  34. package/index.d.ts +3 -1
  35. package/init/index.d.ts +12 -7
  36. package/init/index.js +3 -2
  37. package/init/package.json +2 -2
  38. package/localization/localization-api.d.ts +24 -9
  39. package/localization/package.json +2 -2
  40. package/metadata/admin/admin-metadata-api.d.ts +5 -1
  41. package/metadata/admin/index.d.ts +1 -0
  42. package/metadata/admin/index.js +1 -0
  43. package/metadata/metadata-api.d.ts +9 -5
  44. package/metadata/package.json +2 -2
  45. package/object/object-api.d.ts +15 -9
  46. package/object/package.json +2 -2
  47. package/package.json +3 -3
  48. package/page-admin/package.json +2 -2
  49. package/page-admin/page-admin-api.d.ts +5 -1
  50. package/page-model/package.json +2 -2
  51. package/page-model/page-model-api.d.ts +7 -6
  52. package/page-model/page-model-api.js +10 -0
  53. package/page-state/package.json +2 -2
  54. package/page-state/page-state-api.d.ts +4 -1
  55. package/page-template/package.json +2 -2
  56. package/page-template/page-template-api.d.ts +5 -1
  57. package/property/package.json +2 -2
  58. package/property/property-api.d.ts +6 -2
  59. package/reference-data/package.json +2 -2
  60. package/reference-data/refData.d.ts +4 -1
  61. package/resource/package.json +2 -2
  62. package/resource/resource-api.d.ts +5 -1
  63. package/score-reps/index.d.ts +11 -2
  64. package/score-reps/package.json +1 -1
  65. package/search/client/client-search-api.d.ts +7 -3
  66. package/search/client/index.d.ts +1 -0
  67. package/search/client/index.js +1 -0
  68. package/search/package.json +2 -2
  69. package/search/search-api.d.ts +5 -1
  70. package/sheet/package.json +2 -2
  71. package/sheet/sheet-api.d.ts +5 -1
  72. package/shell-tabs/package.json +2 -2
  73. package/shell-tabs/shell-tabs-api.d.ts +11 -7
  74. package/svi-datahub/index.d.ts +266 -231
  75. package/svi-datahub/package.json +1 -1
  76. package/svi-sand/index.d.ts +29 -2
  77. package/svi-sand/package.json +1 -1
  78. package/tab/package.json +2 -2
  79. package/tab/tab-api.d.ts +5 -1
  80. package/theme/package.json +2 -2
  81. package/theme/theme-api.d.ts +6 -2
  82. package/traversal/package.json +2 -2
  83. package/traversal/traversal-api.d.ts +5 -1
  84. package/component/public-api.d.ts +0 -1
  85. package/component/public-api.js +0 -1
  86. package/http/public-api.d.ts +0 -1
  87. package/http/public-api.js +0 -1
  88. package/init/public-api.d.ts +0 -1
  89. package/init/public-api.js +0 -1
  90. package/public-api.d.ts +0 -1
  91. /package/config/{public-api.d.ts → index.d.ts} +0 -0
  92. /package/config/{public-api.js → index.js} +0 -0
  93. /package/control/{public-api.d.ts → index.d.ts} +0 -0
  94. /package/control/{public-api.js → index.js} +0 -0
  95. /package/current-user/{public-api.d.ts → index.d.ts} +0 -0
  96. /package/current-user/{public-api.js → index.js} +0 -0
  97. /package/{public-api.js → elements/bindings.js} +0 -0
  98. /package/event/{public-api.d.ts → index.d.ts} +0 -0
  99. /package/event/{public-api.js → index.js} +0 -0
  100. /package/file/{public-api.d.ts → index.d.ts} +0 -0
  101. /package/file/{public-api.js → index.js} +0 -0
  102. /package/localization/{public-api.d.ts → index.d.ts} +0 -0
  103. /package/localization/{public-api.js → index.js} +0 -0
  104. /package/metadata/{public-api.d.ts → index.d.ts} +0 -0
  105. /package/metadata/{public-api.js → index.js} +0 -0
  106. /package/object/{public-api.d.ts → index.d.ts} +0 -0
  107. /package/object/{public-api.js → index.js} +0 -0
  108. /package/page-admin/{public-api.d.ts → index.d.ts} +0 -0
  109. /package/page-admin/{public-api.js → index.js} +0 -0
  110. /package/page-model/{public-api.d.ts → index.d.ts} +0 -0
  111. /package/page-model/{public-api.js → index.js} +0 -0
  112. /package/page-state/{public-api.d.ts → index.d.ts} +0 -0
  113. /package/page-state/{public-api.js → index.js} +0 -0
  114. /package/page-template/{public-api.d.ts → index.d.ts} +0 -0
  115. /package/page-template/{public-api.js → index.js} +0 -0
  116. /package/property/{public-api.d.ts → index.d.ts} +0 -0
  117. /package/property/{public-api.js → index.js} +0 -0
  118. /package/reference-data/{public-api.d.ts → index.d.ts} +0 -0
  119. /package/reference-data/{public-api.js → index.js} +0 -0
  120. /package/resource/{public-api.d.ts → index.d.ts} +0 -0
  121. /package/resource/{public-api.js → index.js} +0 -0
  122. /package/search/{public-api.d.ts → index.d.ts} +0 -0
  123. /package/search/{public-api.js → index.js} +0 -0
  124. /package/sheet/{public-api.d.ts → index.d.ts} +0 -0
  125. /package/sheet/{public-api.js → index.js} +0 -0
  126. /package/shell-tabs/{public-api.d.ts → index.d.ts} +0 -0
  127. /package/shell-tabs/{public-api.js → index.js} +0 -0
  128. /package/tab/{public-api.d.ts → index.d.ts} +0 -0
  129. /package/tab/{public-api.js → index.js} +0 -0
  130. /package/theme/{public-api.d.ts → index.d.ts} +0 -0
  131. /package/theme/{public-api.js → index.js} +0 -0
  132. /package/traversal/{public-api.d.ts → index.d.ts} +0 -0
  133. /package/traversal/{public-api.js → index.js} +0 -0
package/README.md CHANGED
@@ -1,9 +1,40 @@
1
- # SAS Visual Investigator API
1
+ # Visual Investigator API
2
2
 
3
- ## Overview
4
-
5
- A package containing TypeScript type definitions to be used with the Visual Investigator Client API.
3
+ The [SAS Visual Investigator](https://www.sas.com/en_us/software/intelligence-analytics-visual-investigator.html) API provides a set of components and service methods that enable developers to create customized solutions within the application.
6
4
 
7
5
  ## Getting Started
8
6
 
9
- For documentation and examples please see our [Solution Extension GitHub](https://github.com/sassoftware/vi-solution-extensions)
7
+ For documentation and examples please see our [Solution Extension GitHub](https://github.com/sassoftware/vi-solution-extensions).
8
+
9
+ ### Installation
10
+ To use the API, install the NPM package [@sassoftware/vi-api](https://www.npmjs.com/package/@sassoftware/vi-api):
11
+ ```bash
12
+ npm install @sassoftware/vi-api
13
+ ```
14
+
15
+ ### API
16
+
17
+ The SVI API is available through the JavaScript window object:
18
+ ```javascript
19
+ window.sas.vi.metadata.getEntity("person");
20
+ ```
21
+ ### Typings
22
+
23
+ To complement the API, solution developers can download the API typings package.
24
+ Run the following command in your project:
25
+ ```
26
+ npm install @sassoftware/vi-api
27
+ ```
28
+ The types can be used to help with autocompletion of API spaces, methods, and expected return types.
29
+ ```typescript
30
+ import { SviWindow } from "@sassoftware/vi-api";
31
+ import { StoredObjectDTO } from "@sassoftware/vi-api/svi-datahub";
32
+
33
+ const sviWindow = window as SviWindow;
34
+ sviWindow.sas.vi.metadata.getEntity("person").then((entity: StoredObjectDTO | undefined) => {
35
+ if (entity) {
36
+ console.log("Retrieved entity:", entity.label);
37
+ }
38
+ });
39
+ ```
40
+
@@ -1,6 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- // Generated using typescript-generator version 2.15.527 on 2024-05-10 11:17:19.
3
+ // Generated using typescript-generator version 2.15.527 on 2024-10-31 19:39:54.
4
4
 
5
5
  export interface ActionRequestRep {
6
6
  version?: number;
@@ -17,6 +17,15 @@ export interface ActionResponseRep {
17
17
  alertChanged?: boolean;
18
18
  }
19
19
 
20
+ export interface AlertConstants {
21
+ }
22
+
23
+ export interface Length {
24
+ }
25
+
26
+ export interface LengthConstants {
27
+ }
28
+
20
29
  export interface AlertDispositionRep extends BaseRep {
21
30
  alertDispositionDescription?: string;
22
31
  alertDispositionId?: string;
@@ -130,8 +139,8 @@ export interface AlertVersionSummaryRep {
130
139
  versionDispositionResolutionCode?: string;
131
140
  versionScore?: number;
132
141
  versionLastUpdateTimeStamp?: string;
133
- versionCreationTimestamp?: string;
134
142
  versionLastUpdateTimestamp?: string;
143
+ versionCreationTimestamp?: string;
135
144
  }
136
145
 
137
146
  export interface AlertWorkflowRep {
@@ -228,6 +237,7 @@ export interface DispositionNotificationRep extends TypedPayload {
228
237
 
229
238
  export interface DispositionQueueRep extends BaseRep {
230
239
  displayCode?: string;
240
+ dispositionAutoApplied?: boolean;
231
241
  dispositionId?: string;
232
242
  dispositionName?: string;
233
243
  groupId?: string;
@@ -617,7 +627,7 @@ export interface MapType {
617
627
  entry?: MapEntryType[];
618
628
  }
619
629
 
620
- export interface Link extends Serializable {
630
+ export interface Link extends Serializable, Comparable<Link> {
621
631
  method?: string;
622
632
  rel?: string;
623
633
  href?: string;
@@ -659,6 +669,9 @@ export interface ETagAndLastModifiedProvider extends ETaggable, LastModifiedProv
659
669
  export interface XmlAdapter<ValueType, BoundType> {
660
670
  }
661
671
 
672
+ export interface Comparable<T> {
673
+ }
674
+
662
675
  export interface Preconditionable {
663
676
  }
664
677
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@types/alert-reps",
3
- "version": "18.0.4",
3
+ "version": "19.5.5",
4
4
  "types": "index.d.ts"
5
5
  }
@@ -16,7 +16,11 @@ export interface ComponentCreationResult<T> {
16
16
  }
17
17
  /**
18
18
  * Functionality related to dynamically creating SAS Visual Investigator user interface components.
19
- * Accessed from the window at window.sas.vi.component.
19
+ *
20
+ * Accessed from the window at `window.sas.vi.component`.
21
+ *
22
+ * @example window.sas.vi.component.create(SviComponent.Page, targetElement, bindings);
23
+ * @category API
20
24
  */
21
25
  export interface ComponentApi {
22
26
  create(component: SviComponent.ControlCollection, target: HTMLElement, bindings?: ControlCollectionBindings): Promise<ComponentCreationResult<ControlCollectionBindings>>;
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -5,6 +5,15 @@ export declare enum ControlType {
5
5
  Angular = "angular",
6
6
  WebComponent = "webcomponent"
7
7
  }
8
+ export declare enum ControlCategory {
9
+ Renderer = "Renderers",
10
+ Control = "Fields",
11
+ Toolbar = "ToolbarItems",
12
+ Home = "Home",
13
+ Chart = "Charts",
14
+ Panels = "Panels",
15
+ Container = "Container"
16
+ }
8
17
  export interface Solution {
9
18
  label: string;
10
19
  version?: string;
@@ -20,6 +29,13 @@ export interface SolutionExtension extends ControlMetadata {
20
29
  clientApplication?: string;
21
30
  name: string;
22
31
  }
32
+ export interface HomepageSolutionExtension extends SolutionExtension {
33
+ /** When set to true, the solution extension is reused when the homepage is reloaded instead. If unset, or set to
34
+ * false, then the control will be destroyed and recreated when the homepage is revisited.
35
+ */
36
+ reuse?: boolean;
37
+ category: ControlCategory.Home;
38
+ }
23
39
  export interface SolutionExtensionConfigTypeAttributes {
24
40
  metadata?: SolutionExtensionMetadata;
25
41
  attributes?: Record<string, SolutionExtensionAttribute>;
@@ -109,7 +125,11 @@ export interface VersionSummary {
109
125
  }
110
126
  /**
111
127
  * Configuration-related functionality.
112
- * Accessed from the window at window.sas.vi.config.
128
+ *
129
+ * Accessed from the window at `window.sas.vi.config`.
130
+ *
131
+ * @example window.sas.vi.config.getSolutions();
132
+ * @category API
113
133
  */
114
134
  export interface ConfigApi {
115
135
  /**
@@ -145,14 +165,14 @@ export interface ConfigApi {
145
165
  * @param name {string} Name of the solution extension.
146
166
  * @returns A Promise that resolves to the solution extension if the name is found.
147
167
  */
148
- getSolutionExtension(name: string): Promise<SolutionExtension | undefined>;
168
+ getSolutionExtension(name: string): Promise<SolutionExtension | HomepageSolutionExtension | undefined>;
149
169
  /**
150
170
  * @method
151
171
  * @description Registers a solution extension with the application.
152
172
  * @param config {SolutionExtension} Solution extension configuration.
153
173
  * @returns A Promise that resolves when the solution has been sent to the cache.
154
174
  */
155
- registerSolutionExtension(config: SolutionExtension): Promise<void>;
175
+ registerSolutionExtension(config: SolutionExtension | HomepageSolutionExtension): Promise<void>;
156
176
  /**
157
177
  * @method
158
178
  * @description Registers a document manager with the application.
@@ -4,3 +4,13 @@ export var ControlType;
4
4
  ControlType["Angular"] = "angular";
5
5
  ControlType["WebComponent"] = "webcomponent";
6
6
  })(ControlType || (ControlType = {}));
7
+ export var ControlCategory;
8
+ (function (ControlCategory) {
9
+ ControlCategory["Renderer"] = "Renderers";
10
+ ControlCategory["Control"] = "Fields";
11
+ ControlCategory["Toolbar"] = "ToolbarItems";
12
+ ControlCategory["Home"] = "Home";
13
+ ControlCategory["Chart"] = "Charts";
14
+ ControlCategory["Panels"] = "Panels";
15
+ ControlCategory["Container"] = "Container";
16
+ })(ControlCategory || (ControlCategory = {}));
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -5,6 +5,7 @@ import { PageDataChange, PageModeChange, StateChange } from "./events";
5
5
  import { Control, RefreshablePageControlOptions, SlidingPanelContent, SlidingPanelProperties, TypeAttributes } from "./page";
6
6
  import { FieldTypeToRestrictions, FileRestrictions } from "./restrictions";
7
7
  import { AttachmentFormData } from "./file";
8
+ import { MaskingControlApi, MaskingPageApi } from "./masking-api";
8
9
  /**
9
10
  * The minimum API that should be supported on control members across solutions.
10
11
  */
@@ -21,6 +22,7 @@ export interface ControlMemberApiBase<ControlTypeAttributes extends TypeAttribut
21
22
  /**
22
23
  * {@link ControlMemberApiBase} extension that provides more functionality.
23
24
  * @extends ControlMemberApiBase
25
+ * @category API
24
26
  */
25
27
  export interface ControlMemberApi<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = any> extends ControlMemberApiBase<ControlTypeAttributes, ControlFieldType> {
26
28
  /**
@@ -46,9 +48,14 @@ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = T
46
48
  readonly state: ControlStateApi;
47
49
  /** Control type. */
48
50
  readonly type: string;
49
- /** Control Mask */
51
+ /**
52
+ * Control Mask
53
+ * @deprecated use `api.control.masking.isConfiguredForMasking` instead.
54
+ **/
50
55
  isMaskedControl(): boolean;
51
- /** Control Mask Authorization */
56
+ /** Control Mask Authorization
57
+ * @deprecated use `api.control.masking.isAuthorizedToUnmask`
58
+ **/
52
59
  isAuthorizedToUnmask(): boolean;
53
60
  /**
54
61
  * Sets the value of the control's field.
@@ -84,9 +91,15 @@ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = T
84
91
  * @returns Object representing the calling control.
85
92
  */
86
93
  getControl(): Control<ControlTypeAttributes>;
94
+ /**
95
+ * Access the Control Data Masking API
96
+ */
97
+ masking: MaskingControlApi;
87
98
  }
88
99
  /**
89
100
  * This API pertains to administration functionality for controls, for example registering resources.
101
+ *
102
+ * @category API
90
103
  */
91
104
  export interface ControlAdminApi {
92
105
  /**
@@ -100,6 +113,7 @@ export interface ControlAdminApi {
100
113
  /**
101
114
  * Extension of {@link ControlApiBase} supplied by SAS Visual Investigator to provide more functionality.
102
115
  * @extends ControlApiBase
116
+ * @category API
103
117
  */
104
118
  export interface ControlApi<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = never> extends ControlApiBase<ControlTypeAttributes, ControlFieldType> {
105
119
  /**
@@ -138,6 +152,8 @@ export interface ControlApi<ControlTypeAttributes extends TypeAttributes = TypeA
138
152
  }
139
153
  /**
140
154
  * Methods and properties related to the state of the control.
155
+ *
156
+ * @category API
141
157
  */
142
158
  export interface ControlStateApi {
143
159
  /**
@@ -170,16 +186,17 @@ export interface ControlStateApi {
170
186
  * True if the control is hidden, otherwise false.
171
187
  */
172
188
  readonly hidden: boolean;
173
- /**
174
- * Returns the masked state of the calling control.
175
- * True if the control is masked, otherwise false.
176
- */
177
- readonly maskActive: boolean;
178
189
  /**
179
190
  * Returns the disabled state of the calling control.
180
191
  * True if the control is disabled, otherwise false.
181
192
  */
182
193
  readonly disabled: boolean;
194
+ /**
195
+ * Returns the masked state of the calling control.
196
+ * True if the control is masked, otherwise false.
197
+ * @deprecated use `api.control.masking.isMasked`
198
+ */
199
+ readonly maskActive: boolean;
183
200
  /**
184
201
  * Registers a function to be invoked whenever a state change event occurs.
185
202
  * This function receives an object that contains information about the change event.
@@ -197,6 +214,8 @@ export interface ControlStateApi {
197
214
  }
198
215
  /**
199
216
  * API methods related to object fields associated with a page.
217
+ *
218
+ * @category API
200
219
  */
201
220
  export interface ControlPageFieldApi {
202
221
  /**
@@ -277,6 +296,7 @@ export interface ControlPageApiBase {
277
296
  /**
278
297
  * {@link ControlPageApiBase} extension that provides more functionality.
279
298
  * @extends ControlPageApiBase
299
+ * @category API
280
300
  */
281
301
  export interface ControlPageApi extends ControlPageApiBase {
282
302
  /**
@@ -309,7 +329,8 @@ export interface ControlPageApi extends ControlPageApiBase {
309
329
  isToolbarDisabled(): boolean;
310
330
  /**
311
331
  * Sets the toolbar control to be disabled.
312
- * @param control {Control} The control to be disabled.
332
+ * @param {string} actionName the toolbar action name.
333
+ * @param {boolean} setDisabled disable the toolbar item.
313
334
  * @method
314
335
  */
315
336
  setToolbarItemDisabled(actionName: string, setDisabled: boolean): void;
@@ -413,6 +434,11 @@ export interface ControlPageApi extends ControlPageApiBase {
413
434
  * @returns A Promise which resolves when the page has been saved.
414
435
  */
415
436
  save(stopEditing: boolean, closeObject: boolean): Promise<void>;
437
+ /**
438
+ * Access the Page Data Masking API
439
+ */
440
+ masking: MaskingPageApi;
441
+ onNavigationStart(callback: () => void): void;
416
442
  }
417
443
  /**
418
444
  * Methods related to files.
@@ -429,6 +455,7 @@ export interface ControlFileApiBase {
429
455
  /**
430
456
  * {@link ControlFileApiBase} extension that provides more functionality.
431
457
  * @extends ControlFileApiBase
458
+ * @category API
432
459
  */
433
460
  export interface ControlFileApi extends ControlFileApiBase {
434
461
  /**
@@ -495,3 +522,8 @@ export interface ControlFileApi extends ControlFileApiBase {
495
522
  */
496
523
  export interface ControlPageEventsApi extends PageEventsApiBase {
497
524
  }
525
+ export interface FieldNotOnPageError {
526
+ name: "FieldNotOnPageError";
527
+ message: string;
528
+ fields: string[];
529
+ }
@@ -72,5 +72,5 @@ export interface StateChange {
72
72
  allowInput?: boolean;
73
73
  couldBeReadOnly?: boolean;
74
74
  couldBeRequired?: boolean;
75
- maskActive?: boolean;
75
+ masked?: boolean;
76
76
  }
@@ -0,0 +1,187 @@
1
+ import { FieldValue } from "./data-types";
2
+ export interface UnmaskEventData {
3
+ data: {
4
+ [fieldName: string]: FieldValue;
5
+ };
6
+ fieldNames: string[];
7
+ documentId: string;
8
+ documentType: string;
9
+ scopeId: string;
10
+ nodeId?: string;
11
+ }
12
+ export interface MaskEventData {
13
+ fieldNames: string[];
14
+ documentId: string;
15
+ documentType: string;
16
+ scopeId: string;
17
+ nodeId?: string;
18
+ }
19
+ export interface MaskResetEventData {
20
+ scopeId: string;
21
+ documentId: string;
22
+ fieldNames: string[];
23
+ }
24
+ export declare const MASKED_FIELD_CHAR = "\u2022";
25
+ export declare const MASKED_FIELD_PLACEHOLDER: string;
26
+ export declare const MASKED_FIELD_ISO_CODE_PLACEHOLDER: string;
27
+ export interface MaskingPageApi {
28
+ /**
29
+ * Determines whether a field is masked.
30
+ * @throws {FieldNotOnPageError}
31
+ * @param fieldName The field name.
32
+ * @returns A boolean.
33
+ */
34
+ isMasked(fieldName: string): boolean;
35
+ /**
36
+ * Masks a field.
37
+ * @throws {NotConfiguredForMaskingError}
38
+ * @throws {FieldNotOnPageError}
39
+ * @param fieldName The field name.
40
+ */
41
+ mask(fieldName: string): void;
42
+ /**
43
+ * Masks the fields.
44
+ * If no fields array is passed in then all fields that are configured for masking on the page will be masked.
45
+ * @throws {NotConfiguredForMaskingError} If one or more of the fields are not configured for masking.
46
+ * @throws {FieldNotOnPageError} If one or more of the fields are not available on the page.
47
+ * @param fieldNames The field names.
48
+ */
49
+ maskAll(fieldNames?: string[]): void;
50
+ /**
51
+ * Unmasks the field via a fetch.
52
+ * Subsequent get field value calls return the unmasked value.
53
+ * If the field is unmasked or has been unmasked in the current page mode, no fetch is made.
54
+ * If the field is not on the page the promise will reject with a {@link FieldNotOnPageError}.
55
+ * If the field is not configured for masking the promise will reject with a {@link NotConfiguredForMaskingError}.
56
+ * If the user is not authorized to reveal the field, the returned promise will reject with an {@link UnmaskAuthError}.
57
+ * @param fieldName The field name.
58
+ * @returns A promise that resolves when the unmask is successful.
59
+ */
60
+ unmask(fieldName: string): Promise<void>;
61
+ /**
62
+ * Unmasks the fields via a fetch.
63
+ * Subsequent get field value calls return the unmasked value.
64
+ * If no fields array is passed in then all fields on the page configured for masking will be unmasked.
65
+ * For each field, if the field is unmasked or has been unmasked in the current page mode, no fetch for it is made.
66
+ * If one or more of the fields are not on the page the promise will reject with a {@link FieldNotOnPageError}.
67
+ * If one or more of the fields are not configured for masking the promise will reject with a {@link NotConfiguredForMaskingError}.
68
+ * If the user is not authorized to reveal one or more of the fields, the returned promise will reject with an {@link UnmaskAuthError}.
69
+ * @param fieldNames The field names.
70
+ * @returns A promise that resolves when the unmasks are successful.
71
+ */
72
+ unmaskAll(fieldNames?: string[]): Promise<void>;
73
+ /**
74
+ * Invokes the callback whenever any field value is masked.
75
+ * When an individual field is masked via a mask call, the callback will be invoked once.
76
+ * When multiple fields are masked via a single mask/mask all call, the callback will be invoked once.
77
+ * @param callback The callback function.
78
+ * @returns A function that removes the callback.
79
+ */
80
+ onEveryMask(callback: (mask: {
81
+ fieldNames: string[];
82
+ }) => void): () => void;
83
+ /**
84
+ * Invokes the callback whenever the specified field is masked.
85
+ * @throws {FieldNotOnPageError}
86
+ * @param fieldName The field name.
87
+ * @param callback The callback function.
88
+ * @returns A function that removes the callback.
89
+ */
90
+ onMask(fieldName: string, callback: () => void): () => void;
91
+ /**
92
+ * Invokes the callback whenever any field value is unmasked.
93
+ * When an individual field is unmasked via an unmask call, the callback will be invoked once.
94
+ * When multiple fields are unmasked via a single unmask/unmask all call, the callback will be invoked once.
95
+ * @param callback The callback function.
96
+ * @returns A function that removes the callback.
97
+ */
98
+ onEveryUnmask(callback: (unmask: {
99
+ fieldNames: string[];
100
+ }) => void): () => void;
101
+ /**
102
+ * Invokes the callback whenever the specified field is unmasked.
103
+ * @throws {FieldNotOnPageError}
104
+ * @param fieldName The field name.
105
+ * @param callback The callback function.
106
+ * @returns A function that removes the callback.
107
+ */
108
+ onUnmask(fieldName: string, callback: () => void): () => void;
109
+ /**
110
+ * Determines whether the field is configured for masking via the field's restrictions.
111
+ * @throws {FieldNotOnPageError}
112
+ * @param fieldName The field name.
113
+ * @returns Whether the field is configured for masking.
114
+ */
115
+ isConfiguredForMasking(fieldName: string): boolean;
116
+ /**
117
+ * Determines whether the current user can unmask the field.
118
+ * @throws {FieldNotOnPageError}
119
+ * @throws {NotConfiguredForMaskingError}
120
+ * @param fieldName The field name.
121
+ * @returns Whether the current can unmask the field.
122
+ */
123
+ isAuthorizedToUnmask(fieldName: string): boolean;
124
+ }
125
+ export interface MaskingControlApi {
126
+ /**
127
+ * In the case of a single field control, determines whether the control's field is masked.
128
+ * In the case of a multiple field control, determines whether one or more of the control's fields are masked.
129
+ * @returns A boolean.
130
+ */
131
+ isMasked(): boolean;
132
+ /**
133
+ * Masks the control's field(s) that are configured for masking.
134
+ * @throws {NotConfiguredForMaskingError} If a single field control's field is not configured for masking or if
135
+ * all of a multiple field control's fields are not configured for masking.
136
+ */
137
+ mask(): void;
138
+ /**
139
+ * Unmasks the controls field(s) via a fetch.
140
+ * Subsequent get field value calls return the unmasked value.
141
+ * For each field, if the field is unmasked or has been unmasked in the current page mode, no fetch for it is made.
142
+ * If a single field control's field is not configured for masking or if all of a multiple field control's fields are not configured for masking the returned
143
+ * promise will reject with a {@link NotConfiguredForMaskingError}.
144
+ * If the user is not authorized to reveal one or more of the control's fields, the returned promise will reject with an {@link UnmaskAuthError}.
145
+ * @returns A promise that resolves when the unmask is successful.
146
+ */
147
+ unmask(): Promise<void>;
148
+ /**
149
+ * Invokes the callback whenever the control's field is (or, in the case of a multiple field control, fields are) masked.
150
+ * @param callback The callback function.
151
+ * @returns A function that removes the callback.
152
+ */
153
+ onMask(callback: (mask: {
154
+ fieldNames: string[];
155
+ }) => void): () => void;
156
+ /**
157
+ * Invokes the callback whenever the control's field is (or, in the case of a multiple field control, fields are) unmasked.
158
+ * @param callback The callback function.
159
+ * @returns A function that removes the callback.
160
+ */
161
+ onUnmask(callback: (unmask: {
162
+ fieldNames: string[];
163
+ }) => void): () => void;
164
+ /**
165
+ * In the case of a single field control, determines (via the field restrictions) whether the control's field is configured for masking.
166
+ * In the case of a multiple field control, determines (via the field restrictions) whether one or more of the control's fields are configured for masking.
167
+ * @returns Whether the control is configured for masking.
168
+ */
169
+ isConfiguredForMasking(): boolean;
170
+ /**
171
+ * In the case of a single field control, determines whether the current user is able to unmask the control's field.
172
+ * In the case of a multiple field control, determines whether the current user is able to unmask all of the control's fields.
173
+ * @throws {NotConfiguredForMaskingError}
174
+ * @returns Whether the current user is able to unmask the control.
175
+ */
176
+ isAuthorizedToUnmask(): boolean;
177
+ }
178
+ export interface UnmaskAuthError {
179
+ name: "UnmaskAuthError";
180
+ message: string;
181
+ fields: string[];
182
+ }
183
+ export interface NotConfiguredForMaskingError {
184
+ name: "NotConfiguredForMaskingError";
185
+ message: string;
186
+ fields: string[];
187
+ }
@@ -0,0 +1,3 @@
1
+ export const MASKED_FIELD_CHAR = "\u2022";
2
+ export const MASKED_FIELD_PLACEHOLDER = MASKED_FIELD_CHAR.repeat(9);
3
+ export const MASKED_FIELD_ISO_CODE_PLACEHOLDER = MASKED_FIELD_CHAR.repeat(3);
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -1,5 +1,11 @@
1
1
  import { FieldType, NumberDataType } from "./data-types";
2
- export interface RequirableRestriction {
2
+ export interface MaskedFieldRestriction {
3
+ masked?: {
4
+ currentUserIsAuthorizedToReveal: boolean;
5
+ revealUrl?: string;
6
+ };
7
+ }
8
+ export interface RequirableRestriction extends MaskedFieldRestriction {
3
9
  required: boolean;
4
10
  }
5
11
  export interface FieldRestrictions extends RequirableRestriction {
@@ -28,7 +28,11 @@ export interface SessionDetails {
28
28
  }
29
29
  /**
30
30
  * This API is used to get the details and functionality associated with the current user.
31
- * Accessed from the window at window.sas.vi.currentUser.
31
+ *
32
+ * Accessed from the window at `window.sas.vi.currentUser`.
33
+ *
34
+ * @example window.sas.vi.currentUser.getSessionDetails();
35
+ * @category API
32
36
  */
33
37
  export interface CurrentUserApi {
34
38
  /**
@@ -46,9 +50,10 @@ export interface CurrentUserApi {
46
50
  /**
47
51
  * @method
48
52
  * @description Gets the list of groups to which the current user belongs.
53
+ * @param limit Maximum number of groups to be returned. Default: 1000.
49
54
  * @returns A list of group details.
50
55
  */
51
- getUserMemberships(): Promise<IdentitySummary[]>;
56
+ getUserMemberships(limit?: number): Promise<IdentitySummary[]>;
52
57
  /**
53
58
  * @method
54
59
  * @description Verifies if the current user has administration features.
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -0,0 +1,25 @@
1
+ import { PageModel } from "../page-model";
2
+ import { Control } from "../control";
3
+ /**
4
+ * @category Properties
5
+ */
6
+ export interface SASInputBindings<T = any> {
7
+ id?: string;
8
+ readOnly?: boolean;
9
+ placeholder?: string;
10
+ autocomplete?: string;
11
+ isDisabled?: boolean;
12
+ model?: T;
13
+ inputFocus?: (event: FocusEvent) => void;
14
+ inputBlur?: (event: FocusEvent) => void;
15
+ modelChanged?: (modelValue: T) => void;
16
+ }
17
+ /**
18
+ * Page Controls require a valid {@link Control | childNode} and {@link PageModel | pageModel}.</strong>
19
+ *
20
+ * @category Properties
21
+ **/
22
+ export interface PageControlBindings {
23
+ childNode: Control;
24
+ pageModel: PageModel;
25
+ }