@sassoftware/vi-api 1.9.0 → 1.15.3
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.
- package/alert-reps/index.d.ts +6 -6
- package/alert-reps/package.json +1 -1
- package/api.module.js +60 -72
- package/component/bindings.d.ts +44 -0
- package/config/config-api.d.ts +56 -0
- package/control/control-api.d.ts +5 -6
- package/control/events.d.ts +1 -0
- package/control/page.d.ts +2 -2
- package/index.d.ts +70 -67
- package/index.js +1 -1
- package/init/index.d.ts +54 -0
- package/init/index.js +17 -0
- package/init/init-api.d.ts +26 -0
- package/init/init-api.js +83 -0
- package/init/package.json +9 -0
- package/init/public-api.d.ts +1 -0
- package/init/public-api.js +1 -0
- package/localization/localization-api.d.ts +75 -0
- package/metadata/metadata-api.d.ts +37 -3
- package/object/object-api.d.ts +22 -8
- package/object/object-api.js +5 -0
- package/package.json +1 -1
- package/property/property-api.d.ts +71 -1
- package/public-api.d.ts +1 -1
- package/public-api.js +1 -1
- package/resource/resource-api.d.ts +1 -0
- package/score-reps/index.d.ts +1 -1
- package/score-reps/package.json +1 -1
- package/search/client/client-search-api.d.ts +4 -9
- package/sheet/sheet-api.d.ts +7 -7
- package/svi-datahub/index.d.ts +208 -132
- package/svi-datahub/package.json +1 -1
- package/svi-sand/index.d.ts +17 -2
- package/svi-sand/package.json +1 -1
package/init/init-api.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ReplaySubject, throwError } from "rxjs";
|
|
2
|
+
import { take, timeoutWith } from "rxjs/operators";
|
|
3
|
+
import { APP_INIT_TIMEOUT_MS, ERR_INIT_TIMEOUT, SviInitEvent, ERR_EXISTING_APP_DECLARED, ERR_EXISTING_RESOURCE_BUNDLE_DECLARED } from ".";
|
|
4
|
+
export class SviInitApi {
|
|
5
|
+
constructor(globalI18nResources) {
|
|
6
|
+
this.globalI18nResources = globalI18nResources;
|
|
7
|
+
this.appReadyStates = new Map();
|
|
8
|
+
this.resourceReadyStates = new Map();
|
|
9
|
+
this.resourceServiceSubject = new ReplaySubject();
|
|
10
|
+
this.resourceService$ = this.resourceServiceSubject.pipe(take(1));
|
|
11
|
+
this.defaultTimeout = APP_INIT_TIMEOUT_MS;
|
|
12
|
+
}
|
|
13
|
+
declareApp(appName, i18nResourceBundleName) {
|
|
14
|
+
if (this.isAppDeclared(appName)) {
|
|
15
|
+
throw ERR_EXISTING_APP_DECLARED(appName);
|
|
16
|
+
}
|
|
17
|
+
this.initReadyState(this.appReadyStates, appName, true);
|
|
18
|
+
if (!i18nResourceBundleName) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (this.isResourceBundleDeclared(i18nResourceBundleName)) {
|
|
22
|
+
throw ERR_EXISTING_RESOURCE_BUNDLE_DECLARED(i18nResourceBundleName);
|
|
23
|
+
}
|
|
24
|
+
this.initReadyState(this.resourceReadyStates, i18nResourceBundleName, true);
|
|
25
|
+
}
|
|
26
|
+
async whenAppReady(appName, timeout) {
|
|
27
|
+
return this.whenReady(this.appReadyStates, appName, timeout);
|
|
28
|
+
}
|
|
29
|
+
notifyAppReady(appName) {
|
|
30
|
+
this.notifyReady(this.appReadyStates, appName);
|
|
31
|
+
}
|
|
32
|
+
registerResourceBundle(bundleName, resources) {
|
|
33
|
+
// register bundle with the global i18nResources object which will be picked up by our resource services on construction.
|
|
34
|
+
this.globalI18nResources[bundleName] = resources;
|
|
35
|
+
this.notifyReady(this.resourceReadyStates, bundleName);
|
|
36
|
+
// also register the bundle to be added when the resource service is ready.
|
|
37
|
+
// this supports any consumers which may call this after init
|
|
38
|
+
this.resourceService$.subscribe(resourceService => {
|
|
39
|
+
resourceService.registerResourceBundle(bundleName, resources);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
checkAllDeclaredAppsReady() {
|
|
43
|
+
this.whenAllDeclaredReady(this.appReadyStates).then(() => this.notifyAppReady(SviInitEvent.AllDeclaredApps));
|
|
44
|
+
}
|
|
45
|
+
checkAllDeclaredResourcesReady() {
|
|
46
|
+
this.whenAllDeclaredReady(this.resourceReadyStates).then(() => this.notifyAppReady(SviInitEvent.AllDeclaredI18nResourceBundles));
|
|
47
|
+
}
|
|
48
|
+
setResourceApi(resourceService) {
|
|
49
|
+
this.resourceServiceSubject.next(resourceService);
|
|
50
|
+
this.resourceServiceSubject.complete();
|
|
51
|
+
}
|
|
52
|
+
isAppDeclared(appName) {
|
|
53
|
+
return !!this.appReadyStates.get(appName)?.isDeclared;
|
|
54
|
+
}
|
|
55
|
+
isResourceBundleDeclared(bundleName) {
|
|
56
|
+
return !!this.resourceReadyStates.get(bundleName)?.isDeclared;
|
|
57
|
+
}
|
|
58
|
+
notifyReady(map, name) {
|
|
59
|
+
const readyState = this.initReadyState(map, name);
|
|
60
|
+
readyState.subject.next(undefined);
|
|
61
|
+
readyState.subject.complete();
|
|
62
|
+
}
|
|
63
|
+
async whenReady(map, name, timeout) {
|
|
64
|
+
const readySubject = this.initReadyState(map, name).subject;
|
|
65
|
+
const timeoutMs = timeout ?? this.defaultTimeout;
|
|
66
|
+
await readySubject.pipe(timeoutWith(timeoutMs, throwError(ERR_INIT_TIMEOUT(name, timeoutMs)))).toPromise();
|
|
67
|
+
}
|
|
68
|
+
async whenAllDeclaredReady(map) {
|
|
69
|
+
const toWaitFor = [];
|
|
70
|
+
for (const [name, readyState] of map.entries()) {
|
|
71
|
+
if (readyState.isDeclared) {
|
|
72
|
+
toWaitFor.push(this.whenReady(map, name).catch(console.error));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
await Promise.all(toWaitFor);
|
|
76
|
+
}
|
|
77
|
+
initReadyState(map, name, declare) {
|
|
78
|
+
const state = map.get(name) ?? { subject: new ReplaySubject() };
|
|
79
|
+
state.isDeclared = declare ?? state.isDeclared;
|
|
80
|
+
map.set(name, state);
|
|
81
|
+
return state;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index";
|
|
@@ -23,4 +23,79 @@ export interface LocalizationApi {
|
|
|
23
23
|
* @returns The current application display direction.
|
|
24
24
|
*/
|
|
25
25
|
getDirection(): "ltr" | "rtl";
|
|
26
|
+
/**
|
|
27
|
+
* Methods related to Solution content localization.
|
|
28
|
+
*/
|
|
29
|
+
solution: SolutionLocalizationApi;
|
|
30
|
+
}
|
|
31
|
+
export interface SolutionLocalizationApi {
|
|
32
|
+
/**
|
|
33
|
+
* if {@link isEnabled}, returns the {@link SolutionLocalizationBundle} used to lookup translations.
|
|
34
|
+
*/
|
|
35
|
+
getLocalizationBundle(): SolutionLocalizationBundle | undefined;
|
|
36
|
+
/**
|
|
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.
|
|
40
|
+
*/
|
|
41
|
+
isEnabled(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* returns the localized value for the given resource key, else, undefined.
|
|
44
|
+
* @param resourceKey
|
|
45
|
+
*/
|
|
46
|
+
getLocalizedResource(resourceKey: string): string | undefined;
|
|
47
|
+
/**
|
|
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
|
|
54
|
+
* @example
|
|
55
|
+
* localize("red", "colours.red.txt") === "rouge"
|
|
56
|
+
*/
|
|
57
|
+
localize(str: string, resourceKey?: string): string;
|
|
58
|
+
/**
|
|
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
|
|
65
|
+
* @example
|
|
66
|
+
* localizeObject({ label: "red" }, { "label": "colours.red.txt" }) === { label: "rouge" }
|
|
67
|
+
*/
|
|
68
|
+
localizeObject<T extends object>(obj: T, props: Record<string, string | undefined>): T;
|
|
69
|
+
/**
|
|
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
|
|
75
|
+
* @example
|
|
76
|
+
* localizeList(
|
|
77
|
+
* [{ id: "red", label: "Red" }, { id: "blue", label: "Blue"} ],
|
|
78
|
+
* (item) => ({ "label": `colours.${item.id}.title` })
|
|
79
|
+
* ) === [{ id: "red", label: "Rouge" }, { id: "blue", label: "Bleu"} ]
|
|
80
|
+
*/
|
|
81
|
+
localizeList<T extends object>(list: T[], getProps: (obj: T) => Record<string, string | undefined>): T[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Stores localized strings by key and value.
|
|
85
|
+
* @example
|
|
86
|
+
* {
|
|
87
|
+
* bykey: {
|
|
88
|
+
* "colours.red.label": "rouge",
|
|
89
|
+
* "colours.blue.label": "bleu"
|
|
90
|
+
* },
|
|
91
|
+
* byValue: {
|
|
92
|
+
* "red": "rouge",
|
|
93
|
+
* "blue": "bleu"
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
*/
|
|
97
|
+
interface SolutionLocalizationBundle {
|
|
98
|
+
byKey: Record<string, string>;
|
|
99
|
+
byValue: Record<string, string>;
|
|
26
100
|
}
|
|
101
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { IIdentityOption } from "@sas/nexus-shared-ui/identities/input";
|
|
2
1
|
import { CoreStoredObjectField, Entity, Relationship, RelationshipDTO, StoredObjectDTO } from "../svi-datahub";
|
|
2
|
+
import { IdentitySummary } from "../current-user/currentUser-api";
|
|
3
|
+
export interface IdentityOption extends IdentitySummary {
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
}
|
|
3
7
|
export interface NodeShapeMultipliers {
|
|
4
8
|
square: number;
|
|
5
9
|
circle: number;
|
|
@@ -80,7 +84,7 @@ export interface DataObjectField extends PersistableObject, LocalizableObject {
|
|
|
80
84
|
cascadingReferenceDataFilterByCode?: string;
|
|
81
85
|
cascadingReferenceDataFilterByField?: string;
|
|
82
86
|
masked?: boolean;
|
|
83
|
-
authorizedToRevealMasked?:
|
|
87
|
+
authorizedToRevealMasked?: IdentityOption[];
|
|
84
88
|
[index: string]: any;
|
|
85
89
|
}
|
|
86
90
|
export interface LocalizableObject {
|
|
@@ -119,6 +123,15 @@ export interface EntityAccessRules {
|
|
|
119
123
|
read: Promise<boolean>;
|
|
120
124
|
update: Promise<boolean>;
|
|
121
125
|
}
|
|
126
|
+
export interface EntityAccessRule {
|
|
127
|
+
documentType: string;
|
|
128
|
+
access?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface EntitiesAccessRules {
|
|
131
|
+
create: Promise<EntityAccessRule[]>;
|
|
132
|
+
read: Promise<EntityAccessRule[]>;
|
|
133
|
+
update: Promise<EntityAccessRule[]>;
|
|
134
|
+
}
|
|
122
135
|
export interface ReferenceDataItem {
|
|
123
136
|
group?: string;
|
|
124
137
|
displayText: string;
|
|
@@ -144,6 +157,13 @@ export interface MetadataApi {
|
|
|
144
157
|
* @returns Object with a Promise of type boolean for each rule.
|
|
145
158
|
*/
|
|
146
159
|
getEntityAccessRules(objectType: string): EntityAccessRules;
|
|
160
|
+
/**
|
|
161
|
+
* @method
|
|
162
|
+
* @description Gets create, read, and update access rights for the provided entities via Batch call.
|
|
163
|
+
* @param objectType {string[]} Entity name(s).
|
|
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
|
+
*/
|
|
166
|
+
getEntitiesAccessRules(objectTypes: string[]): EntitiesAccessRules;
|
|
147
167
|
/**
|
|
148
168
|
* @method
|
|
149
169
|
* @description Checks access rights and gets metadata for an entity. Returns undefined if the entity does not exist.
|
|
@@ -186,10 +206,11 @@ export interface MetadataApi {
|
|
|
186
206
|
* @param objectType {string} Finds relationships for the entity.
|
|
187
207
|
* @param [relationshipObjectType] {string} Used for filtering the name of an expected related entity.
|
|
188
208
|
* @param [relationshipName] {string} Used for filtering the name of an expected relationship.
|
|
209
|
+
* @param flattenMultiLinkIntoSingles whether Relationships with a One->(multiple) links will get flattened into many One->Single relationships
|
|
189
210
|
* @returns A Promise resolving to an object containing relationship type metadata.
|
|
190
211
|
* The object is empty if no relationship types exist.
|
|
191
212
|
*/
|
|
192
|
-
getAllValidRelationshipTypes(objectType: string, relationshipObjectType?: string, relationshipName?: string): Promise<ValidRelationshipTypes>;
|
|
213
|
+
getAllValidRelationshipTypes(objectType: string, relationshipObjectType?: string, relationshipName?: string, flattenMultiLinkIntoSingles?: boolean): Promise<ValidRelationshipTypes>;
|
|
193
214
|
/**
|
|
194
215
|
* @method
|
|
195
216
|
* @description Gets metadata for all resolved entities.
|
|
@@ -233,6 +254,7 @@ export interface MetadataApi {
|
|
|
233
254
|
parentCode?: string;
|
|
234
255
|
}): Promise<Picklist | undefined>;
|
|
235
256
|
/**
|
|
257
|
+
* @deprecated
|
|
236
258
|
* @method
|
|
237
259
|
* @description Gets relationships with a specified end type.
|
|
238
260
|
* @param endType {string} End type entity name.
|
|
@@ -240,4 +262,16 @@ export interface MetadataApi {
|
|
|
240
262
|
* @returns A Promise resolving to a list of relationships, or an empty list if none are found.
|
|
241
263
|
*/
|
|
242
264
|
getRelationshipsFilteredByEndType(endType: string, includeHeterogeneous?: boolean): Promise<RelationshipWithLabel[]>;
|
|
265
|
+
/**
|
|
266
|
+
* @method
|
|
267
|
+
* @description Gets relationships with a specified end type.
|
|
268
|
+
* @param endType endType {string} End type entity name.
|
|
269
|
+
* @param options see {@link OptionsForGetRelationshipsForObjectType}
|
|
270
|
+
*/
|
|
271
|
+
getRelationshipsForObjectType(endType: string, options: OptionsForGetRelationshipsForObjectType): Promise<RelationshipWithLabel[]>;
|
|
272
|
+
}
|
|
273
|
+
export interface OptionsForGetRelationshipsForObjectType {
|
|
274
|
+
includeHeterogeneous?: boolean;
|
|
275
|
+
includeMultipleTypeRelationships?: boolean;
|
|
276
|
+
expandMultipleRelationshipsToSingle?: boolean;
|
|
243
277
|
}
|
package/object/object-api.d.ts
CHANGED
|
@@ -130,6 +130,15 @@ export interface ObjectApi {
|
|
|
130
130
|
* @return A Promise that resolves to a relationship.
|
|
131
131
|
*/
|
|
132
132
|
updateObjectRelationship(relationshipId: string, payload: any): Promise<ObjectRelationship>;
|
|
133
|
+
/**
|
|
134
|
+
* @method
|
|
135
|
+
* @description Updates an existing relationship in SAS Visual Investigator.
|
|
136
|
+
* @param relationshipId {string} Relationship ID.
|
|
137
|
+
* @param originalFieldValues {FieldValues} Field values before the relationship was edited
|
|
138
|
+
* @param newFieldValues {FieldValues} Field values after the relationship was edited
|
|
139
|
+
* @return A Promise that resolves to a relationship.
|
|
140
|
+
*/
|
|
141
|
+
patchObjectRelationship(relationshipId: string, originalFieldValues: FieldValues, newFieldValues: FieldValues): Promise<ObjectRelationship>;
|
|
133
142
|
/**
|
|
134
143
|
* @method
|
|
135
144
|
* @description Deletes relationship with the specified ID.
|
|
@@ -140,12 +149,12 @@ export interface ObjectApi {
|
|
|
140
149
|
/**
|
|
141
150
|
* @method
|
|
142
151
|
* @description Creates a relationship between two objects.
|
|
143
|
-
* @param from {
|
|
144
|
-
* @param to {
|
|
152
|
+
* @param from {LinkObject} Object that relationship is from.
|
|
153
|
+
* @param to {LinkObject} Object that relationship is to.
|
|
145
154
|
* @param relationship {ObjectRelationship} The relationship.
|
|
146
155
|
* @return A Promise that resolves to an object.
|
|
147
156
|
*/
|
|
148
|
-
relateObject(from:
|
|
157
|
+
relateObject(from: LinkObject, to: LinkObject, relationship: ObjectRelationship): Promise<ObjectRelationship>;
|
|
149
158
|
/**
|
|
150
159
|
* @method
|
|
151
160
|
* @description Gets object summary label.
|
|
@@ -157,12 +166,12 @@ export interface ObjectApi {
|
|
|
157
166
|
/**
|
|
158
167
|
* @method
|
|
159
168
|
* @description Creates a new object and relates it with an existing one.
|
|
160
|
-
* @param from {
|
|
161
|
-
* @param to {
|
|
169
|
+
* @param from {LinkObject} existing Object that the relationship is from.
|
|
170
|
+
* @param to {NewLinkObject} new Object to be created and related to.
|
|
162
171
|
* @param relationship {ObjectRelationship} The relationship.
|
|
163
172
|
* @return A Promise that resolves to a newly created relationship.
|
|
164
173
|
*/
|
|
165
|
-
createAndRelateObject(from:
|
|
174
|
+
createAndRelateObject(from: LinkObject, to: NewLinkObject, relationship: ObjectRelationship): Promise<ObjectRelationship>;
|
|
166
175
|
/**
|
|
167
176
|
* @method
|
|
168
177
|
* @description Processes an array of objects and formats them for display.
|
|
@@ -238,6 +247,8 @@ export interface VIObject {
|
|
|
238
247
|
id: string;
|
|
239
248
|
title?: string;
|
|
240
249
|
}
|
|
250
|
+
export declare type LinkObject = Pick<VIObject, "id" | "objectTypeName">;
|
|
251
|
+
export declare type NewLinkObject = Pick<VIObject, "objectTypeName" | "fieldValues" | "fileOperations">;
|
|
241
252
|
export interface ValidationResult {
|
|
242
253
|
isValid: boolean;
|
|
243
254
|
message?: string;
|
|
@@ -308,11 +319,14 @@ export interface NodeAttributes extends TypeAttributes {
|
|
|
308
319
|
}>;
|
|
309
320
|
};
|
|
310
321
|
}
|
|
322
|
+
export declare enum ActionState {
|
|
323
|
+
Disabled = "disabled",
|
|
324
|
+
Hidden = "hidden"
|
|
325
|
+
}
|
|
311
326
|
export interface ChildNodeAttrs {
|
|
312
327
|
attributes?: {
|
|
313
328
|
disabled: boolean;
|
|
314
|
-
|
|
315
|
-
showVersionHistory: boolean;
|
|
329
|
+
state?: ActionState;
|
|
316
330
|
};
|
|
317
331
|
id: string;
|
|
318
332
|
category: string;
|
package/object/object-api.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export var ActionState;
|
|
2
|
+
(function (ActionState) {
|
|
3
|
+
ActionState["Disabled"] = "disabled";
|
|
4
|
+
ActionState["Hidden"] = "hidden";
|
|
5
|
+
})(ActionState || (ActionState = {}));
|
|
1
6
|
export var ConditionReferenceType;
|
|
2
7
|
(function (ConditionReferenceType) {
|
|
3
8
|
ConditionReferenceType["TemplateControl"] = "TEMPLATE_CONTROL";
|
package/package.json
CHANGED
|
@@ -5,6 +5,12 @@ import { PageTemplateMetadata } from "../page-model/page-model-api";
|
|
|
5
5
|
export interface ToolbarPropertyControl {
|
|
6
6
|
typeAttributes: TypeAttributes;
|
|
7
7
|
}
|
|
8
|
+
export interface EntityToolbarItem {
|
|
9
|
+
actionName: string;
|
|
10
|
+
attributes: {
|
|
11
|
+
[attr: string]: any;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
8
14
|
export interface PropertyConfig {
|
|
9
15
|
[property: string]: any;
|
|
10
16
|
order?: number;
|
|
@@ -28,6 +34,64 @@ export interface SelectedNode {
|
|
|
28
34
|
[property: string]: any;
|
|
29
35
|
};
|
|
30
36
|
}
|
|
37
|
+
export declare type LocalizerType = "page" | "toolbar";
|
|
38
|
+
export declare type ControlPropertyLocalizer = ToolbarControlPropertyLocalizer | PageControlPropertyLocalizer;
|
|
39
|
+
export interface ToolbarControlPropertyLocalizer extends PropertyLocalizer<EntityToolbarItem> {
|
|
40
|
+
localizerType: "toolbar";
|
|
41
|
+
/**
|
|
42
|
+
* Generate resources to be inluded when the toolbar item is saved.
|
|
43
|
+
*
|
|
44
|
+
* @param propertyKey the control attribute
|
|
45
|
+
* @param control the toolbar item
|
|
46
|
+
* @returns the resource keys and values for the given toolbar item property
|
|
47
|
+
*/
|
|
48
|
+
createResources: (propertyKey: string, control: EntityToolbarItem) => Record<string, string>;
|
|
49
|
+
/**
|
|
50
|
+
* Use generated resource keys & values to localize the given control property.
|
|
51
|
+
*
|
|
52
|
+
* @param propertyKey the control attribute to be localized
|
|
53
|
+
* @param control the toolbar item
|
|
54
|
+
* @param resources toolbar item resources
|
|
55
|
+
*/
|
|
56
|
+
localizeControlAttribute: (propertyKey: string, control: EntityToolbarItem, resources: Record<string, string>) => void;
|
|
57
|
+
}
|
|
58
|
+
export interface PageControlPropertyLocalizer extends PropertyLocalizer<Control> {
|
|
59
|
+
localizerType: "page";
|
|
60
|
+
/**
|
|
61
|
+
* Generate resources to be included when the page control is saved.
|
|
62
|
+
* Page control resources are stored on the page template metadata
|
|
63
|
+
* and so resource keys should be made to be unique per control.
|
|
64
|
+
*
|
|
65
|
+
* @param propertyKey the control attribute
|
|
66
|
+
* @param control the page control
|
|
67
|
+
* @returns the resource keys and values for the given control property
|
|
68
|
+
*/
|
|
69
|
+
createResources: (propertyKey: string, control: Control) => Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Use generated resource keys & values to localize the given control property.
|
|
72
|
+
*
|
|
73
|
+
* @param propertyKey the control attribute to be localized
|
|
74
|
+
* @param control the page control
|
|
75
|
+
* @param resources page template resources
|
|
76
|
+
*/
|
|
77
|
+
localizeControlAttribute: (propertyKey: string, control: Control, resources: Record<string, string>) => void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Handle the localization of control properties for a given property type.
|
|
81
|
+
*/
|
|
82
|
+
export interface PropertyLocalizer<T> {
|
|
83
|
+
/**
|
|
84
|
+
* control type to be localized
|
|
85
|
+
*/
|
|
86
|
+
localizerType: LocalizerType;
|
|
87
|
+
/**
|
|
88
|
+
* property type to be localized.
|
|
89
|
+
* (the type that the property editor is registered against)
|
|
90
|
+
*/
|
|
91
|
+
propertyType: string;
|
|
92
|
+
createResources: (propertyKey: string, control: T) => Record<string, string>;
|
|
93
|
+
localizeControlAttribute: (propertyKey: string, control: T, resources: Record<string, string>) => void;
|
|
94
|
+
}
|
|
31
95
|
/**
|
|
32
96
|
* This API is available on property editors.
|
|
33
97
|
*/
|
|
@@ -41,7 +105,7 @@ export interface EditorApi {
|
|
|
41
105
|
onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): () => void;
|
|
42
106
|
}
|
|
43
107
|
/**
|
|
44
|
-
* This API
|
|
108
|
+
* This API pertains to page/toolbar control properties in SAS Visual Investigator.
|
|
45
109
|
* Accessed from the window at window.sas.vi.property.
|
|
46
110
|
*/
|
|
47
111
|
export interface PropertyApi {
|
|
@@ -57,6 +121,12 @@ export interface PropertyApi {
|
|
|
57
121
|
* @param [metadataFn] {PropertyApi~getPropertyEditorMetadata} Function to provide custom metadata.
|
|
58
122
|
*/
|
|
59
123
|
registerCustomEditor(elementName: string, type: string, validatorFn?: (propertyConfig: PropertyConfig, propertyKey: string, control: Control | ToolbarPropertyControl) => boolean, metadataFn?: (propertyConfig: PropertyConfig, propertyKey: string, control: Control | ToolbarPropertyControl) => PageTemplateMetadata): void;
|
|
124
|
+
/**
|
|
125
|
+
* Register a localizer to manage internationalization resources for control properties of a given type.
|
|
126
|
+
* Properties will be localized unless they they are explicitly configured with localizable=false (see {@link PropertyConfig})
|
|
127
|
+
* @param localizer property localizer which defines resource keys to be saved, and parses the same keys to localize the properties.
|
|
128
|
+
*/
|
|
129
|
+
registerPropertyLocalizer(localizer: ControlPropertyLocalizer): void;
|
|
60
130
|
/**
|
|
61
131
|
* @method
|
|
62
132
|
* @description Determines whether or not the child object data source property editor is valid.
|
package/public-api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SviClientApi, SviAdminApi, SviWindow } from "./index";
|
|
1
|
+
export { SviClientApi, SviAdminApi, SviWindow, SviApi } from "./index";
|
package/public-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ export interface I18nResources {
|
|
|
2
2
|
[key: string]: string | I18nResources;
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated Use window.sas.viInit.registerResourceBundle to register resources before the rest of the Visual Investigator API is ready.
|
|
5
6
|
* This API provides the resource functionality in SAS Visual Investigator.
|
|
6
7
|
* Accessed from the window at window.sas.vi.resource.
|
|
7
8
|
*/
|
package/score-reps/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
// Generated using typescript-generator version 2.15.527 on 2023-
|
|
3
|
+
// Generated using typescript-generator version 2.15.527 on 2023-11-21 12:26:02.
|
|
4
4
|
|
|
5
5
|
export interface BaseRep extends TrackedResource {
|
|
6
6
|
links?: Link[];
|
package/score-reps/package.json
CHANGED
|
@@ -41,9 +41,6 @@ export interface NetworkData {
|
|
|
41
41
|
};
|
|
42
42
|
numNodes: number;
|
|
43
43
|
}
|
|
44
|
-
export interface ResolvedObjectIdentifier extends ObjectIdentifier {
|
|
45
|
-
compoundValues: string[];
|
|
46
|
-
}
|
|
47
44
|
export interface SearchAndCreateDialogModel {
|
|
48
45
|
entityName: string;
|
|
49
46
|
entityLabel: string;
|
|
@@ -58,10 +55,8 @@ export interface SearchAndCreateDialogModel {
|
|
|
58
55
|
}
|
|
59
56
|
export interface SearchObject extends ObjectIdentifier {
|
|
60
57
|
title?: string;
|
|
61
|
-
isResolvedEntity?: boolean;
|
|
62
58
|
typeLabel?: string;
|
|
63
59
|
uniqueKey?: string;
|
|
64
|
-
compoundValues?: string[];
|
|
65
60
|
}
|
|
66
61
|
export interface SearchAndCreateRelateToModel {
|
|
67
62
|
linkReason?: Relationship;
|
|
@@ -126,11 +121,11 @@ export interface ClientSearchApi extends SearchApi {
|
|
|
126
121
|
* @method
|
|
127
122
|
* @description Opens the "Add Objects to Workspace" dialog box and then performs the action after a document and workspace have been selected.
|
|
128
123
|
* @param visualizationName {Visualization} Visualization to display after the objects have been added.
|
|
129
|
-
* @param objects {
|
|
124
|
+
* @param objects {ObjectIdentifier[]} Objects to add to the workspace.
|
|
130
125
|
* @param [currentObject] {ObjectIdentifier} The document the user is currently viewing. This is used as a visual aid in the dialog box.
|
|
131
126
|
* @param [networkData] {NetworkData} Network visualization data to be copied to the workspace.
|
|
132
127
|
*/
|
|
133
|
-
openAddObjectsToWorkspaceDialog(visualizationName: Visualization, objects:
|
|
128
|
+
openAddObjectsToWorkspaceDialog(visualizationName: Visualization, objects: ObjectIdentifier[], currentObject?: ObjectIdentifier, networkData?: NetworkData): Promise<void>;
|
|
134
129
|
/**
|
|
135
130
|
* @method
|
|
136
131
|
* @description Adds an image to the Insights selected in the "Add image to Insights" dialog box.
|
|
@@ -144,14 +139,14 @@ export interface ClientSearchApi extends SearchApi {
|
|
|
144
139
|
* @method
|
|
145
140
|
* @description Creates a new workspace in the target object, populating it with an initial set of objects.
|
|
146
141
|
* Allows the creation of new objects assuming create mode is supported for the object type.
|
|
147
|
-
* @param objectsToAdd {
|
|
142
|
+
* @param objectsToAdd {ObjectIdentifier[]} Objects to add to the workspace.
|
|
148
143
|
* @param targetObjectType {string} Object type where the workspace is created.
|
|
149
144
|
* @param [targetObjectId] {string} Object to add to the workspace. If undefined, a new object is created.
|
|
150
145
|
* @param [visualization] {"summary" | "map" | "table" | "timeline" | "networkDiagram"} Visualization to initially display in the new workspace.
|
|
151
146
|
* @param [workspaceName] {string} Name of the new workspace.
|
|
152
147
|
* @param [networkData] {NetworkData} Network visualization data to be copied to the new workspace.
|
|
153
148
|
*/
|
|
154
|
-
addToNewWorkspace(objectsToAdd:
|
|
149
|
+
addToNewWorkspace(objectsToAdd: ObjectIdentifier[], targetObjectType: string, targetObjectId?: string, visualization?: Visualization, workspaceName?: string, networkData?: NetworkData): Promise<void>;
|
|
155
150
|
/**
|
|
156
151
|
* @method
|
|
157
152
|
* @description Launches a wizard allowing users to search, before creating an object/relationship.
|
package/sheet/sheet-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectIdentifier, ObjectSheetSettings, VIObject } from "../object/object-api";
|
|
2
|
-
import { NetworkData,
|
|
2
|
+
import { NetworkData, Visualization } from "../search/client/client-search-api";
|
|
3
3
|
/**
|
|
4
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.
|
|
@@ -59,10 +59,10 @@ export interface SheetApi {
|
|
|
59
59
|
/**
|
|
60
60
|
* @method
|
|
61
61
|
* @description Adds objects to a workspace selected in the "Add Objects to Workspace" dialog box.
|
|
62
|
-
* @param objects {
|
|
62
|
+
* @param objects {ObjectIdentifier[]} Objects to add to a workspace.
|
|
63
63
|
* @param [options] {AddAllObjectsToWorkspaceDialogOptions} Additional options to customize the dialog box and select the Visualization to display after the objects are added.
|
|
64
64
|
*/
|
|
65
|
-
openAddAllObjectsToWorkspaceDialog(objects:
|
|
65
|
+
openAddAllObjectsToWorkspaceDialog(objects: ObjectIdentifier[], options?: AddAllObjectsToWorkspaceDialogOptions): Promise<void>;
|
|
66
66
|
/**
|
|
67
67
|
* @method
|
|
68
68
|
* @description Adds an image to the Insights selected in the "Add image to Insights" dialog box.
|
|
@@ -77,21 +77,21 @@ export interface SheetApi {
|
|
|
77
77
|
* @description Creates a new workspace in the target object, populating it with an initial set of objects.
|
|
78
78
|
* Allows the creation of new objects assuming create mode is supported for the object type.
|
|
79
79
|
* If options.targetObjectId is undefined, then a new object is created.
|
|
80
|
-
* @param objectsToAdd {
|
|
80
|
+
* @param objectsToAdd {ObjectIdentifier[]} Objects to add to the new workspace.
|
|
81
81
|
* @param targetObjectType {string} Object type where the workspace is created.
|
|
82
82
|
* @param [options] {AddToNewWorkspaceOptions} Additional options to set a target object ID, workspace name and so on.
|
|
83
83
|
*/
|
|
84
|
-
addToNewWorkspace(objectsToAdd:
|
|
84
|
+
addToNewWorkspace(objectsToAdd: ObjectIdentifier[], targetObjectType: string, options: AddToNewWorkspaceOptions): Promise<void>;
|
|
85
85
|
/**
|
|
86
86
|
* @method
|
|
87
87
|
* @description Adds objects to an existing workspace.
|
|
88
88
|
* @param targetObject {VIObject} Object containing the existing workspace.
|
|
89
89
|
* @param workspaceClientId {string} Client ID of the workspace to add to.
|
|
90
|
-
* @param objectsToAdd {
|
|
90
|
+
* @param objectsToAdd {ObjectIdentifier[]} Objects to add. It is safe to pass objects that are already in the workspace.
|
|
91
91
|
* @param [networkData] {NetworkData} If provided, network data that will be merged into any existing network data on the workspace.
|
|
92
92
|
* @param [isUndoRedo] {boolean} Specifies if the function was called as part of an undo/redo operation.
|
|
93
93
|
*/
|
|
94
|
-
addToExistingWorkspace(targetObject: VIObject, workspaceClientId: string, objectsToAdd:
|
|
94
|
+
addToExistingWorkspace(targetObject: VIObject, workspaceClientId: string, objectsToAdd: ObjectIdentifier[], networkData?: NetworkData, isUndoRedo?: boolean): Promise<void>;
|
|
95
95
|
}
|
|
96
96
|
export interface AddAllObjectsToWorkspaceDialogOptions {
|
|
97
97
|
/**
|