@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.
@@ -1,6 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- // Generated using typescript-generator version 2.15.527 on 2023-07-07 09:34:28.
3
+ // Generated using typescript-generator version 2.15.527 on 2023-11-21 12:24:57.
4
4
 
5
5
  export interface ActionRequestRep {
6
6
  version?: number;
@@ -107,6 +107,10 @@ export interface AlertRep extends BaseRep {
107
107
  strategyRangeLow?: number;
108
108
  strategyRangeHigh?: number;
109
109
  alertVersionTimestamp?: string;
110
+ userServiceTimestamp?: string;
111
+ systemServiceTimestamp?: string;
112
+ autoCloseTimestamp?: string;
113
+ autoActivateTimestamp?: string;
110
114
  statusTimestamp?: string;
111
115
  dispositionTimestamp?: string;
112
116
  suppressionEndTimestamp?: string;
@@ -114,10 +118,6 @@ export interface AlertRep extends BaseRep {
114
118
  queueEntryTimestamp?: string;
115
119
  assignmentTimestamp?: string;
116
120
  checkoutTimestamp?: string;
117
- userServiceTimestamp?: string;
118
- systemServiceTimestamp?: string;
119
- autoCloseTimestamp?: string;
120
- autoActivateTimestamp?: 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
- eventType?: string;
634
633
  payloadType?: string;
634
+ eventType?: 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.0.12",
3
+ "version": "16.1.0",
4
4
  "types": "index.d.ts"
5
5
  }
package/api.module.js CHANGED
@@ -1,72 +1,60 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { NgModule } from "@angular/core";
8
- import { ComponentApiService } from "./component/component-api.service";
9
- import { ConfigApiService } from "./config/config-api.service";
10
- import { CurrentUserApiService } from "./current-user/currentUser-api.service";
11
- import { EventApiService } from "./event/event-api.service";
12
- import { FileApiService } from "./file/file-api.service";
13
- import { HttpApiService } from "./http/http-api.service";
14
- import { LocalizationApiService } from "./localization/localization-api.service";
15
- import { AdminMetadataApiService } from "./metadata/admin/admin-metadata-api.service";
16
- import { MetadataApiService } from "./metadata/metadata-api.service";
17
- import { ObjectApiService } from "./object/object-api.service";
18
- import { PageAdminApiService } from "./page-admin/page-admin-api.service";
19
- import { PageModelApiService } from "./page-model/page-model-api.service";
20
- import { PageStateApiService } from "./page-state/page-state-api.service";
21
- import { PropertyApiService } from "./property/property-api.service";
22
- import { RefDataApiService } from "./reference-data/refData.service";
23
- import { ResourceApiService } from "./resource/resource-api.service";
24
- import { ClientSearchApiService } from "./search/client/client-search-api.service";
25
- import { SearchApiService } from "./search/search-api.service";
26
- import { SheetApiService } from "./sheet/sheet-api.service";
27
- import { TabApiService } from "./tab/tab-api.service";
28
- import { ThemeApiService } from "./theme/theme-api.service";
29
- import { TraversalApiService } from "./traversal/traversal-api.service";
30
- import { LifeCycleEvent } from "../application-life-cycle.service";
31
- import { filter, take } from "rxjs/operators";
32
- let ApiModule = class ApiModule {
33
- constructor(appBootstrapService, apiInitService) {
34
- this.appBootstrapService = appBootstrapService;
35
- this.apiInitService = apiInitService;
36
- this.appBootstrapService
37
- .getCurrentLifeCycleStage()
38
- .pipe(filter(lifeCycleEvent => lifeCycleEvent === LifeCycleEvent.InitComplete), take(1))
39
- .subscribe(() => {
40
- this.apiInitService.createSviApi();
41
- });
42
- }
43
- };
44
- ApiModule = __decorate([
45
- NgModule({
46
- providers: [
47
- AdminMetadataApiService,
48
- ClientSearchApiService,
49
- ComponentApiService,
50
- ConfigApiService,
51
- CurrentUserApiService,
52
- EventApiService,
53
- FileApiService,
54
- HttpApiService,
55
- LocalizationApiService,
56
- MetadataApiService,
57
- ObjectApiService,
58
- PageAdminApiService,
59
- PageModelApiService,
60
- PageStateApiService,
61
- PropertyApiService,
62
- RefDataApiService,
63
- ResourceApiService,
64
- SheetApiService,
65
- SearchApiService,
66
- TabApiService,
67
- ThemeApiService,
68
- TraversalApiService
69
- ]
70
- })
71
- ], ApiModule);
72
- export { ApiModule };
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { NgModule } from "@angular/core";
8
+ import { ComponentApiService } from "./component/component-api.service";
9
+ import { ConfigApiService } from "./config/config-api.service";
10
+ import { CurrentUserApiService } from "./current-user/currentUser-api.service";
11
+ import { EventApiService } from "./event/event-api.service";
12
+ import { FileApiService } from "./file/file-api.service";
13
+ import { HttpApiService } from "./http/http-api.service";
14
+ import { LocalizationApiService } from "./localization/localization-api.service";
15
+ import { AdminMetadataApiService } from "./metadata/admin/admin-metadata-api.service";
16
+ import { MetadataApiService } from "./metadata/metadata-api.service";
17
+ import { ObjectApiService } from "./object/object-api.service";
18
+ import { PageAdminApiService } from "./page-admin/page-admin-api.service";
19
+ import { PageModelApiService } from "./page-model/page-model-api.service";
20
+ import { PageStateApiService } from "./page-state/page-state-api.service";
21
+ import { PropertyApiService } from "./property/property-api.service";
22
+ import { RefDataApiService } from "./reference-data/refData.service";
23
+ import { ResourceApiService } from "./resource/resource-api.service";
24
+ import { ClientSearchApiService } from "./search/client/client-search-api.service";
25
+ import { SearchApiService } from "./search/search-api.service";
26
+ import { SheetApiService } from "./sheet/sheet-api.service";
27
+ import { TabApiService } from "./tab/tab-api.service";
28
+ import { ThemeApiService } from "./theme/theme-api.service";
29
+ import { TraversalApiService } from "./traversal/traversal-api.service";
30
+ let ApiModule = class ApiModule {
31
+ };
32
+ ApiModule = __decorate([
33
+ NgModule({
34
+ providers: [
35
+ AdminMetadataApiService,
36
+ ClientSearchApiService,
37
+ ComponentApiService,
38
+ ConfigApiService,
39
+ CurrentUserApiService,
40
+ EventApiService,
41
+ FileApiService,
42
+ HttpApiService,
43
+ LocalizationApiService,
44
+ MetadataApiService,
45
+ ObjectApiService,
46
+ PageAdminApiService,
47
+ PageModelApiService,
48
+ PageStateApiService,
49
+ PropertyApiService,
50
+ RefDataApiService,
51
+ ResourceApiService,
52
+ SheetApiService,
53
+ SearchApiService,
54
+ TabApiService,
55
+ ThemeApiService,
56
+ TraversalApiService
57
+ ]
58
+ })
59
+ ], ApiModule);
60
+ export { ApiModule };
@@ -68,6 +68,50 @@ export interface SearchInputInputBindings {
68
68
  showQueryBuilder?: boolean;
69
69
  queryText?: string;
70
70
  autoFocus?: boolean;
71
+ queryBuilderOkButtonLabel?: string;
72
+ queryModel?: QueryBuilderModel;
73
+ performSearch?: boolean;
74
+ }
75
+ export interface QueryBuilderModel {
76
+ manualQueryString?: string;
77
+ model: QueryBuilderEntityModel[];
78
+ }
79
+ export interface QueryBuilderEntityModel {
80
+ entity: string;
81
+ queries: QueryBuilderItem[];
82
+ singleChildSearch?: boolean;
83
+ }
84
+ export interface QueryBuilderItem {
85
+ booleanValue?: boolean | string;
86
+ boost?: number;
87
+ dateTimeValue?: string | Date;
88
+ dateValue?: string | Date;
89
+ exclude?: boolean;
90
+ field?: string;
91
+ fromDateTimeValue?: string | Date;
92
+ fromDateValue?: string | Date;
93
+ fromNumericValue?: number;
94
+ numericValue?: number;
95
+ operator?: string;
96
+ phonetic?: boolean;
97
+ previousField?: string;
98
+ proximity?: number;
99
+ rangeValidationError?: boolean;
100
+ referenceValue?: string;
101
+ relationshipField?: boolean;
102
+ relationshipTypeValue?: string;
103
+ relativeDateDatetimeNumericValue?: number;
104
+ relativeDateDatetimeUnitsValue?: string;
105
+ stringValidationError?: boolean;
106
+ synonym?: boolean;
107
+ textValue?: string;
108
+ toDateTimeValue?: string | Date;
109
+ toDateValue?: string | Date;
110
+ toNumericValue?: number;
111
+ userGroupValue?: Array<{
112
+ id: string;
113
+ type: string;
114
+ }>;
71
115
  }
72
116
  export interface SearchInputBindings extends SearchInputInputBindings {
73
117
  onSearch?: (model: SearchQuery) => void;
@@ -57,6 +57,36 @@ export interface SviLinkedFile {
57
57
  content?: string;
58
58
  size: number;
59
59
  }
60
+ export interface AppConfigBundle<T> {
61
+ /** unique bundle name */
62
+ name: string;
63
+ /** display name I18n resource key */
64
+ descriptiveName: string;
65
+ /** description I18n resource key */
66
+ description: string;
67
+ /** ID of the the app config that the bundle belongs to */
68
+ appConfigurationId: string;
69
+ /** configuration data */
70
+ configuration: T;
71
+ /** I18n resources to export localizable properties of the configuration data */
72
+ resources?: {
73
+ [key: string]: string;
74
+ };
75
+ /** configuration category e.g. category-desktop */
76
+ categoryId: string;
77
+ /** Visual Investigator version */
78
+ viVersion: string;
79
+ /** HTTP ETag header value based on the last modified timestamp */
80
+ eTag: string;
81
+ /** media type schema version */
82
+ version: number;
83
+ /** creation UTC timestamp string */
84
+ creationTimeStamp?: string;
85
+ /** last modified UTC timestamp string */
86
+ modifiedTimeStamp?: string;
87
+ /** name of the assigned solution */
88
+ solutionName?: string;
89
+ }
60
90
  /**
61
91
  * Functionality related to configuration.
62
92
  * Accessed from the window at window.sas.vi.config.
@@ -109,4 +139,30 @@ export interface ConfigApi {
109
139
  * @param config {SviDocumentManager} Document manager configuration.
110
140
  */
111
141
  registerDocumentManager(config: SviDocumentManager): void;
142
+ /**
143
+ * @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
147
+ * allow the user to modify the given configuration bundle.
148
+ */
149
+ registerOpenConfigurationCallback(bundleName: string, callback: () => void): void;
150
+ /**
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.
155
+ */
156
+ getAppConfigBundle<T extends object>(appConfigId: string, bundleName: string): Promise<AppConfigBundle<T>>;
157
+ /**
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.
161
+ */
162
+ updateAppConfigBundle<T extends object>(bundle: AppConfigBundle<T>): Promise<AppConfigBundle<T>>;
163
+ /**
164
+ * @method
165
+ * @returns a reference to the HTML element which is the default container for modal dialogs to be spawned within the application.
166
+ */
167
+ getSharedDialogContainer(): HTMLElement;
112
168
  }
@@ -46,6 +46,10 @@ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = T
46
46
  readonly state: ControlStateApi;
47
47
  /** Control type. */
48
48
  readonly type: string;
49
+ /** Control Mask */
50
+ isMaskedControl(): boolean;
51
+ /** Control Mask Authorization */
52
+ isAuthorizedToUnmask(): boolean;
49
53
  /**
50
54
  * Sets the value of the control's field.
51
55
  * Field must be configured as dataSource in the control's typeAttributes.
@@ -170,12 +174,7 @@ export interface ControlStateApi {
170
174
  * Returns the masked state of the calling control.
171
175
  * True if the control is masked, otherwise false.
172
176
  */
173
- readonly masked: boolean;
174
- /**
175
- * Returns the authorization state of a masked field of the calling control.
176
- * True if the control is masked, otherwise false.
177
- */
178
- readonly authorizedToUnmask: boolean;
177
+ readonly maskActive: boolean;
179
178
  /**
180
179
  * Returns the disabled state of the calling control.
181
180
  * True if the control is disabled, otherwise false.
@@ -72,4 +72,5 @@ export interface StateChange {
72
72
  allowInput?: boolean;
73
73
  couldBeReadOnly?: boolean;
74
74
  couldBeRequired?: boolean;
75
+ maskActive?: boolean;
75
76
  }
package/control/page.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Type } from "@angular/core";
2
+ import { ActionState } from "../object/object-api";
2
3
  export declare const enum PageModeEvent {
3
4
  CREATE = "create",
4
5
  EDIT = "edit",
@@ -16,8 +17,7 @@ export interface Control<ControlTypeAttributes extends TypeAttributes = TypeAttr
16
17
  export interface ControlAttrs {
17
18
  attributes?: {
18
19
  disabled: boolean;
19
- showActionHistory: boolean;
20
- showVersionHistory: boolean;
20
+ state?: ActionState;
21
21
  };
22
22
  id: string;
23
23
  category: string;
package/index.d.ts CHANGED
@@ -1,67 +1,70 @@
1
- import { ComponentApi } from "./component";
2
- import { ConfigApi } from "./config/config-api";
3
- import { CurrentUserApi } from "./current-user/currentUser-api";
4
- import { EventApi } from "./event/event-api";
5
- import { FileApi } from "./file/file-api";
6
- import { HttpApi } from "./http";
7
- import { LocalizationApi } from "./localization/localization-api";
8
- import { AdminMetadataApi } from "./metadata/admin/admin-metadata-api";
9
- import { MetadataApi } from "./metadata/metadata-api";
10
- import { ObjectApi } from "./object/object-api";
11
- import { PageAdminApi } from "./page-admin/page-admin-api";
12
- import { PageModelApi } from "./page-model/page-model-api";
13
- import { PageStateApi } from "./page-state/page-state-api";
14
- import { PropertyApi } from "./property/property-api";
15
- import { RefDataApi } from "./reference-data/refData";
16
- import { ResourceApi } from "./resource/resource-api";
17
- import { ClientSearchApi } from "./search/client/client-search-api";
18
- import { SearchApi } from "./search/search-api";
19
- import { SheetApi } from "./sheet/sheet-api";
20
- import { TabApi } from "./tab/tab-api";
21
- import { ThemeApi } from "./theme/theme-api";
22
- import { TraversalApi } from "./traversal/traversal-api";
23
- import { ShellTabsApi } from "./shell-tabs/shell-tabs-api";
24
- /**
25
- * Common API Functions.
26
- */
27
- export interface SviCommonApi {
28
- component: ComponentApi;
29
- currentUser: CurrentUserApi;
30
- event: EventApi;
31
- file: FileApi;
32
- http: HttpApi;
33
- localization: LocalizationApi;
34
- metadata: MetadataApi;
35
- pageAdmin: PageAdminApi;
36
- pageModel: PageModelApi;
37
- pageState: PageStateApi;
38
- property: PropertyApi;
39
- refData: RefDataApi;
40
- resource: ResourceApi;
41
- search: SearchApi;
42
- theme: ThemeApi;
43
- traversal: TraversalApi;
44
- config: ConfigApi;
45
- shellTabs: ShellTabsApi;
46
- }
47
- /**
48
- * The Client API.
49
- */
50
- export interface SviClientApi extends SviCommonApi {
51
- object: ObjectApi;
52
- search: ClientSearchApi;
53
- sheet: SheetApi;
54
- tab: TabApi;
55
- }
56
- /**
57
- * The Admin API.
58
- */
59
- export interface SviAdminApi extends SviCommonApi {
60
- metadata: AdminMetadataApi;
61
- }
62
- export declare type SviApi = SviClientApi | SviAdminApi;
63
- export declare type SviWindow = typeof window & {
64
- sas: {
65
- vi: SviApi;
66
- };
67
- };
1
+ import { ComponentApi } from "./component";
2
+ import { ConfigApi } from "./config/config-api";
3
+ import { CurrentUserApi } from "./current-user/currentUser-api";
4
+ import { EventApi } from "./event/event-api";
5
+ import { FileApi } from "./file/file-api";
6
+ import { HttpApi } from "./http";
7
+ import { LocalizationApi } from "./localization/localization-api";
8
+ import { AdminMetadataApi } from "./metadata/admin/admin-metadata-api";
9
+ import { MetadataApi } from "./metadata/metadata-api";
10
+ import { ObjectApi } from "./object/object-api";
11
+ import { PageAdminApi } from "./page-admin/page-admin-api";
12
+ import { PageModelApi } from "./page-model/page-model-api";
13
+ import { PageStateApi } from "./page-state/page-state-api";
14
+ import { PropertyApi } from "./property/property-api";
15
+ import { RefDataApi } from "./reference-data/refData";
16
+ import { ResourceApi } from "./resource/resource-api";
17
+ import { ClientSearchApi } from "./search/client/client-search-api";
18
+ import { SearchApi } from "./search/search-api";
19
+ import { SheetApi } from "./sheet/sheet-api";
20
+ import { TabApi } from "./tab/tab-api";
21
+ import { ThemeApi } from "./theme/theme-api";
22
+ import { TraversalApi } from "./traversal/traversal-api";
23
+ import { ShellTabsApi } from "./shell-tabs/shell-tabs-api";
24
+ import { InitApi } from "./init";
25
+ /**
26
+ * Common API Functions.
27
+ */
28
+ export interface SviCommonApi {
29
+ component: ComponentApi;
30
+ currentUser: CurrentUserApi;
31
+ event: EventApi;
32
+ file: FileApi;
33
+ http: HttpApi;
34
+ localization: LocalizationApi;
35
+ metadata: MetadataApi;
36
+ pageAdmin: PageAdminApi;
37
+ pageModel: PageModelApi;
38
+ pageState: PageStateApi;
39
+ property: PropertyApi;
40
+ refData: RefDataApi;
41
+ /** @deprecated Use window.sas.viInit.registerResourceBundle to register resources before the rest of the Visual Investigator API is ready. */
42
+ resource: ResourceApi;
43
+ search: SearchApi;
44
+ theme: ThemeApi;
45
+ traversal: TraversalApi;
46
+ config: ConfigApi;
47
+ shellTabs: ShellTabsApi;
48
+ }
49
+ /**
50
+ * The Client API.
51
+ */
52
+ export interface SviClientApi extends SviCommonApi {
53
+ object: ObjectApi;
54
+ search: ClientSearchApi;
55
+ sheet: SheetApi;
56
+ tab: TabApi;
57
+ }
58
+ /**
59
+ * The Admin API.
60
+ */
61
+ export interface SviAdminApi extends SviCommonApi {
62
+ metadata: AdminMetadataApi;
63
+ }
64
+ export declare type SviApi = SviClientApi | SviAdminApi;
65
+ export declare type SviWindow = typeof window & {
66
+ sas: {
67
+ vi: SviApi;
68
+ viInit: InitApi;
69
+ };
70
+ };
package/index.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -0,0 +1,54 @@
1
+ export declare const APP_INIT_TIMEOUT_MS: number;
2
+ export declare const ERR_EXISTING_APP_DECLARED: (appName: string) => string;
3
+ export declare const ERR_EXISTING_RESOURCE_BUNDLE_DECLARED: (appName: string) => string;
4
+ export declare const ERR_INIT_TIMEOUT: (name: string, timeout?: number) => string;
5
+ /**
6
+ * An API to manage the asynchronous initialisation of solution applications
7
+ * before the Visual Investigator application is fully initialised.
8
+ */
9
+ export interface InitApi {
10
+ /**
11
+ * Declare an application.
12
+ * Visual Investigator will await whenReady for each before continuing its own app initialisation.
13
+ * notifyAppReady should be called to indicate when the app initialisation is complete.
14
+ * if provided, registerResourceBundle should be called to indicate when the I18n resource bundle is ready.
15
+ * @param appName appName of the app configuration.
16
+ * @param i18nResourceBundleName I18n resource bundle name of the app configuration.
17
+ */
18
+ declareApp(appName: string, i18nResourceBundleName?: string): void;
19
+ /**
20
+ * Notify listeners that the app has been initialised.
21
+ * @param appName appName of the app configuration.
22
+ */
23
+ notifyAppReady(appName: string): void;
24
+ /**
25
+ * Resolves once notifyAppReady has been called for the given app name,
26
+ * or once the given {@link SviInitEvent} is ready.
27
+ * Will reject with an error if timeout elapses before notifyAppReady is called.
28
+ * @param name name of the app configuration or init event.
29
+ * @param timeout max wait (milliseconds) before the promise is rejected (defaults to {@link APP_INIT_TIMEOUT_MS}).
30
+ */
31
+ whenAppReady(name: SviInitEvent | string, timeout?: number): Promise<void>;
32
+ /**
33
+ * Register a resource bundle with the Resource Service.
34
+ * @param bundleName {string} Name for the bundle to be stored in the resource cache.
35
+ * @param resources {I18nResources} Object containing the resources to be added for the bundle
36
+ * specified by the bundleName parameter.
37
+ */
38
+ registerResourceBundle(bundleName: string, resources: I18nResources): void;
39
+ }
40
+ /**
41
+ * Initialisation events for the Visual Investigator application.
42
+ * These can be awaited using window.sas.viInit.whenReady
43
+ */
44
+ export declare enum SviInitEvent {
45
+ /** all apps which were declared through window.sas.viInit */
46
+ AllDeclaredApps = "viInit::all-apps",
47
+ /** all I18n resource bundles which were declared through window.sas.viInit */
48
+ AllDeclaredI18nResourceBundles = "viInit::all-i18n-resources",
49
+ /** the full window.sas.vi API, depends on {@link AllDeclaredI18nResourceBundles} */
50
+ SviClientApi = "viInit::sas-vi-api"
51
+ }
52
+ export interface I18nResources {
53
+ [key: string]: string | I18nResources;
54
+ }
package/init/index.js ADDED
@@ -0,0 +1,17 @@
1
+ export const APP_INIT_TIMEOUT_MS = 120 * 1000;
2
+ export const ERR_EXISTING_APP_DECLARED = (appName) => `App: '${appName}' has already been declared.`;
3
+ export const ERR_EXISTING_RESOURCE_BUNDLE_DECLARED = (appName) => `I18n resource bundle: '${appName}' has already been declared.`;
4
+ export const ERR_INIT_TIMEOUT = (name, timeout) => `Ready check for '${name}' timed out after ${timeout ?? APP_INIT_TIMEOUT_MS}ms.`;
5
+ /**
6
+ * Initialisation events for the Visual Investigator application.
7
+ * These can be awaited using window.sas.viInit.whenReady
8
+ */
9
+ export var SviInitEvent;
10
+ (function (SviInitEvent) {
11
+ /** all apps which were declared through window.sas.viInit */
12
+ SviInitEvent["AllDeclaredApps"] = "viInit::all-apps";
13
+ /** all I18n resource bundles which were declared through window.sas.viInit */
14
+ SviInitEvent["AllDeclaredI18nResourceBundles"] = "viInit::all-i18n-resources";
15
+ /** the full window.sas.vi API, depends on {@link AllDeclaredI18nResourceBundles} */
16
+ SviInitEvent["SviClientApi"] = "viInit::sas-vi-api";
17
+ })(SviInitEvent || (SviInitEvent = {}));
@@ -0,0 +1,26 @@
1
+ import { I18nResources, SviInitEvent, InitApi } from ".";
2
+ export interface ResourceApi {
3
+ registerResourceBundle(bundleName: string, resources: I18nResources): void;
4
+ }
5
+ export declare class SviInitApi implements InitApi {
6
+ private globalI18nResources;
7
+ private appReadyStates;
8
+ private resourceReadyStates;
9
+ private resourceServiceSubject;
10
+ private resourceService$;
11
+ private defaultTimeout;
12
+ constructor(globalI18nResources: I18nResources);
13
+ declareApp(appName: string, i18nResourceBundleName?: string): void;
14
+ whenAppReady(appName: SviInitEvent | string, timeout?: number): Promise<void>;
15
+ notifyAppReady(appName: SviInitEvent | string): void;
16
+ registerResourceBundle(bundleName: string, resources: I18nResources): void;
17
+ checkAllDeclaredAppsReady(): void;
18
+ checkAllDeclaredResourcesReady(): void;
19
+ setResourceApi(resourceService: ResourceApi): void;
20
+ private isAppDeclared;
21
+ private isResourceBundleDeclared;
22
+ private notifyReady;
23
+ private whenReady;
24
+ private whenAllDeclaredReady;
25
+ private initReadyState;
26
+ }