@sassoftware/vi-api 1.5.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/alert-reps/package.json +5 -0
  2. package/component/bindings.d.ts +10 -4
  3. package/component/index.d.ts +11 -10
  4. package/component/index.js +1 -1
  5. package/component/package.json +9 -0
  6. package/config/config-api.d.ts +20 -2
  7. package/config/package.json +9 -0
  8. package/control/control-api.d.ts +25 -15
  9. package/control/package.json +9 -0
  10. package/current-user/package.json +9 -0
  11. package/event/package.json +9 -0
  12. package/file/package.json +9 -0
  13. package/http/package.json +9 -0
  14. package/index.d.ts +2 -2
  15. package/localization/package.json +9 -0
  16. package/metadata/metadata-api.d.ts +12 -12
  17. package/metadata/package.json +9 -0
  18. package/object/object-api.d.ts +20 -20
  19. package/object/package.json +9 -0
  20. package/package.json +2 -1
  21. package/page-admin/package.json +9 -0
  22. package/page-admin/page-admin-api.d.ts +2 -2
  23. package/page-model/package.json +9 -0
  24. package/page-model/page-model-api.d.ts +92 -1
  25. package/page-state/package.json +9 -0
  26. package/page-state/page-state-api.d.ts +1 -1
  27. package/property/package.json +9 -0
  28. package/property/property-api.d.ts +6 -6
  29. package/property/property-api.js +2 -2
  30. package/reference-data/package.json +9 -0
  31. package/resource/package.json +9 -0
  32. package/score-reps/package.json +5 -0
  33. package/search/client/client-search-api.d.ts +8 -8
  34. package/search/package.json +9 -0
  35. package/search/search-api.d.ts +1 -1
  36. package/sheet/package.json +9 -0
  37. package/sheet/sheet-api.d.ts +6 -6
  38. package/svi-datahub/index.d.ts +37 -24
  39. package/svi-datahub/package.json +5 -0
  40. package/svi-sand/index.d.ts +31 -24
  41. package/svi-sand/package.json +5 -0
  42. package/tab/package.json +9 -0
  43. package/tab/tab-api.d.ts +1 -1
  44. package/theme/package.json +9 -0
  45. package/time-slider/index.d.ts +9 -0
  46. package/traversal/package.json +9 -0
  47. package/api-init.service.js +0 -86
  48. package/component/component-api.service.js +0 -161
  49. package/config/config-api.service.js +0 -54
  50. package/current-user/currentUser-api.service.js +0 -49
  51. package/event/event-api.service.js +0 -32
  52. package/file/file-api.service.js +0 -24
  53. package/http/http-api.service.js +0 -64
  54. package/localization/localization-api.service.js +0 -38
  55. package/metadata/admin/admin-metadata-api.service.js +0 -30
  56. package/metadata/metadata-api.service.js +0 -85
  57. package/object/object-api.service.js +0 -207
  58. package/page-admin/page-admin-api.service.js +0 -25
  59. package/page-model/page-model-api.service.js +0 -25
  60. package/page-state/page-state-api.service.js +0 -70
  61. package/property/property-api.service.js +0 -34
  62. package/reference-data/refData.service.js +0 -40
  63. package/resource/resource-api.service.js +0 -24
  64. package/search/client/client-search-api.service.js +0 -111
  65. package/search/search-api.service.js +0 -28
  66. package/sheet/network-menu-handler.service.js +0 -39
  67. package/sheet/sheet-api.service.js +0 -140
  68. package/tab/tab-api.service.js +0 -35
  69. package/theme/theme-api.service.js +0 -35
  70. package/traversal/traversal-api.service.js +0 -77
@@ -1,207 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { map } from "rxjs/operators";
9
- import { getAngularJsInjectable } from "../../commons/angular-angularjs-utils";
10
- let ObjectApiService = class ObjectApiService {
11
- constructor(attachmentsService, childObjectViewerValidationService) {
12
- this.attachmentsService = attachmentsService;
13
- this.childObjectViewerValidationService = childObjectViewerValidationService;
14
- this.documentService = () => getAngularJsInjectable("spbDocumentService");
15
- this.documentDisplayFormatter = () => getAngularJsInjectable("spbDocumentDisplayFormatter");
16
- this.dataDictionaryService = () => getAngularJsInjectable("dataDictionaryService");
17
- this.getObjectAccessRules = (objectType, objectId) => {
18
- return {
19
- canReadObject: this.dataDictionaryService().canReadDocument(objectType, objectId),
20
- canUpdateObject: this.dataDictionaryService().canUpdateDocument(objectType, objectId),
21
- canDeleteObject: this.dataDictionaryService().canDeleteDocument(objectType, objectId)
22
- };
23
- };
24
- this.getObject = (objectType, objectId, includeDisplayLabel = true) => {
25
- return this.documentService().getDocument(objectType, objectId, { includeDisplayLabel });
26
- };
27
- this.getChildObjects = (objectType, objectId, childObjectType, maxResponses = 25) => {
28
- return this.documentService().getSubDocuments(objectId, objectType, childObjectType, { maxResponses });
29
- };
30
- this.updateObject = (objectType, objectId, objectTypeId, objectTypeVersion, fieldValues, options) => {
31
- return this.documentService().saveDocument(objectTypeId, objectType, objectTypeVersion, objectId, fieldValues, options?.fileOperations, options?.sheets, options?.isExternalObject);
32
- };
33
- this.deleteObject = (objectType, objectId) => {
34
- return this.documentService().deleteDocument(objectType, objectId);
35
- };
36
- this.createObject = (objectType, objectTypeId, fieldValues, options) => {
37
- return this.documentService().createDocument(objectTypeId, objectType, fieldValues, options?.fileOperations, options?.comments, options?.sheets);
38
- };
39
- this.getObjectRelationship = (relationshipId) => {
40
- return this.documentService().getLink(relationshipId);
41
- };
42
- this.updateObjectRelationship = (relationshipId, payload) => {
43
- return this.documentService().saveLink(relationshipId, payload);
44
- };
45
- this.deleteObjectRelationship = (relationshipId) => {
46
- return this.documentService().deleteLink(relationshipId);
47
- };
48
- this.relateObject = (from, to, relationship) => {
49
- return new Promise((resolve, reject) => {
50
- this.documentService()
51
- .linkDocument(this.convertObjectForType(from), this.convertObjectForType(to), this.convertObjectRelationshipForName(relationship))
52
- .then(result => {
53
- resolve(result.data);
54
- })
55
- .catch(error => {
56
- reject(error.data.message);
57
- });
58
- });
59
- };
60
- this.getObjectSummaryLabel = (objectType, objectId) => {
61
- return this.documentService().getDocumentSummaryLabel(objectType, objectId);
62
- };
63
- this.createAndRelateObject = (from, to, relationship) => {
64
- return new Promise((resolve, reject) => {
65
- this.documentService()
66
- .createAndLinkDocument(this.convertObjectForType(from), this.convertObjectForData(to), this.convertObjectRelationshipForName(relationship))
67
- .then(result => {
68
- resolve(result.data);
69
- })
70
- .catch(error => {
71
- reject(error.data.message);
72
- });
73
- });
74
- };
75
- this.formatObjectFieldsForDisplay = (objects, objectType, options) => {
76
- return this.documentDisplayFormatter().processDocumentArray(objects, objectType, options?.skipFormatReferenceData ?? false, options?.skipFormatUserGroups ?? false, options?.skipFormatBooleans ?? false, options?.formatCallback);
77
- };
78
- this.uploadAttachment = (attachmentModel, objectType, objectId) => {
79
- return this.attachmentsService
80
- .createAttachment(attachmentModel, objectType, objectId)
81
- .pipe(map(result => result.body ?? {}))
82
- .toPromise()
83
- .catch(error => Promise.reject(error.message));
84
- };
85
- this.deleteAttachment = (objectType, objectId, attachmentId) => {
86
- return this.attachmentsService
87
- .removeAttachment(objectType, objectId, attachmentId)
88
- .toPromise()
89
- .then(() => Promise.resolve())
90
- .catch(error => Promise.reject(error.message));
91
- };
92
- this.getAttachment = (objectType, objectId, attachmentId) => {
93
- return this.attachmentsService
94
- .getAttachment(objectId, objectType, attachmentId)
95
- .pipe(map(result => result.body ?? {}))
96
- .toPromise()
97
- .catch(error => Promise.reject(error.message));
98
- };
99
- this.validate = (pageModel, childObject) => {
100
- return this.childObjectViewerValidationService
101
- .validate(pageModel, childObject)
102
- .toPromise();
103
- };
104
- /**
105
- * Edits the property names of the type to conform to AngularJS services currently injected.
106
- *
107
- * fieldValues to data
108
- * objectTypeName to name
109
- *
110
- * @param object {VIObject} The SAS Visual Investigator Object to be edited.
111
- * @return {ObjectForDocumentServiceRelationships}
112
- * @ignore
113
- *
114
- */
115
- this.convertObjectForData = (object) => {
116
- return {
117
- data: object.fieldValues,
118
- fileOperations: object.fileOperations,
119
- comments: object.comments,
120
- createdAt: object.createdAt,
121
- lastUpdatedAt: object.lastUpdatedAt,
122
- objectTypeId: object.objectTypeId,
123
- type: object.objectTypeName,
124
- sheets: object.sheets,
125
- id: object.id
126
- };
127
- };
128
- /**
129
- * Edits the property names of the type to conform to AngularJS services currently injected.
130
- *
131
- * objectTypeName to name
132
- *
133
- * @param object {VIObject} The SAS Visual Investigator Object to be edited.
134
- * @returns {ObjectForDocumentServiceRelationships}
135
- * @ignore
136
- */
137
- this.convertObjectForType = (object) => {
138
- return {
139
- fieldValues: object.fieldValues,
140
- fileOperations: object.fileOperations,
141
- comments: object.comments,
142
- createdAt: object.createdAt,
143
- lastUpdatedAt: object.lastUpdatedAt,
144
- objectTypeId: object.objectTypeId,
145
- type: object.objectTypeName,
146
- sheets: object.sheets,
147
- id: object.id
148
- };
149
- };
150
- /**
151
- * Edits the property names of the type to conform to AngularJS services currently injected.
152
- *
153
- * relationshipTypeName to name
154
- *
155
- * @param relationship {ObjectRelationship} Object Relationship to be edited.
156
- * @returns {RelationshipForDocumentServiceRelationships}
157
- * @ignore
158
- */
159
- this.convertObjectRelationshipForName = (relationship) => {
160
- return {
161
- name: relationship.relationshipTypeName,
162
- relationshipTypeLabel: relationship.relationshipTypeLabel,
163
- id: relationship.id,
164
- createdAt: relationship.createdAt,
165
- lastUpdatedAt: relationship.lastUpdatedAt,
166
- validFrom: relationship.validFrom,
167
- validTo: relationship.validTo,
168
- displayLabel: relationship.displayLabel,
169
- fromObjectTypeName: relationship.fromObjectTypeName,
170
- fromObjectTypeVersion: relationship.fromObjectTypeVersion,
171
- fromObjectId: relationship.fromObjectId,
172
- fromObjectDisplayLabel: relationship.fromObjectDisplayLabel,
173
- toObjectTypeName: relationship.toObjectTypeName,
174
- toObjectTypeVersion: relationship.toObjectTypeVersion,
175
- toObjectId: relationship.toObjectId,
176
- toObjectDisplayLabel: relationship.toObjectDisplayLabel,
177
- fieldValues: relationship.fieldValues,
178
- qualifiedTypeName: relationship.qualifiedTypeName
179
- };
180
- };
181
- }
182
- getApi() {
183
- return {
184
- getObjectRelationship: this.getObjectRelationship,
185
- updateObjectRelationship: this.updateObjectRelationship,
186
- deleteObjectRelationship: this.deleteObjectRelationship,
187
- getObject: this.getObject,
188
- updateObject: this.updateObject,
189
- deleteObject: this.deleteObject,
190
- createObject: this.createObject,
191
- getChildObjects: this.getChildObjects,
192
- relateObject: this.relateObject,
193
- getObjectSummaryLabel: this.getObjectSummaryLabel,
194
- createAndRelateObject: this.createAndRelateObject,
195
- formatObjectFieldsForDisplay: this.formatObjectFieldsForDisplay,
196
- uploadAttachment: this.uploadAttachment,
197
- deleteAttachment: this.deleteAttachment,
198
- getAttachment: this.getAttachment,
199
- getObjectAccessRules: this.getObjectAccessRules,
200
- validate: this.validate
201
- };
202
- }
203
- };
204
- ObjectApiService = __decorate([
205
- Injectable()
206
- ], ObjectApiService);
207
- export { ObjectApiService };
@@ -1,25 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { getAngularJsInjectable } from "../../commons/angular-angularjs-utils";
9
- let PageAdminApiService = class PageAdminApiService {
10
- constructor() {
11
- this.spbPageDesignerConfigService = () => getAngularJsInjectable("spbPageDesignerConfigService");
12
- this.registerPageType = (name, applicationType, templateType, controlGroups, canvasCssClass, previewCssClass, options, dataTypeControlMappings) => {
13
- this.spbPageDesignerConfigService().registerPageType(name, applicationType, templateType, controlGroups, canvasCssClass, previewCssClass, options, dataTypeControlMappings);
14
- };
15
- }
16
- getApi() {
17
- return {
18
- registerPageType: this.registerPageType
19
- };
20
- }
21
- };
22
- PageAdminApiService = __decorate([
23
- Injectable()
24
- ], PageAdminApiService);
25
- export { PageAdminApiService };
@@ -1,25 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { getAngularJsInjectable } from "../../commons/angular-angularjs-utils";
9
- let PageModelApiService = class PageModelApiService {
10
- constructor() {
11
- this.createFromObject = (objectSource, options) => {
12
- this.spbPageModel = getAngularJsInjectable("spbPageModel");
13
- return this.spbPageModel.createFromObject(objectSource, options);
14
- };
15
- }
16
- getApi() {
17
- return {
18
- createFromObject: this.createFromObject
19
- };
20
- }
21
- };
22
- PageModelApiService = __decorate([
23
- Injectable()
24
- ], PageModelApiService);
25
- export { PageModelApiService };
@@ -1,70 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { getAngularJsInjectable } from "../../commons/angular-angularjs-utils";
9
- let PageStateApiService = class PageStateApiService {
10
- constructor(spbPageStateService) {
11
- this.spbPageStateService = spbPageStateService;
12
- this.pageDesignerConfig = () => getAngularJsInjectable("spbPageDesignerConfigService");
13
- this.tabs = () => getAngularJsInjectable("TabService");
14
- this.getCurrentPageState = () => {
15
- return this.spbPageStateService.getCurrentState();
16
- };
17
- this.getPageState = (id) => {
18
- return this.spbPageStateService.get(id);
19
- };
20
- this.addPageState = (id, state) => {
21
- this.spbPageStateService.add(id, state);
22
- };
23
- this.removePageState = (id) => {
24
- this.spbPageStateService.remove(id);
25
- };
26
- this.getCurrentHomepageDesigner = () => {
27
- if (!this.isOnHomepageDesigner())
28
- return undefined;
29
- return this.spbPageStateService.getCurrentState();
30
- };
31
- this.getCurrentObjectPageDesigner = () => {
32
- if (!this.isOnObjectPageDesigner())
33
- return undefined;
34
- return this.spbPageStateService.getCurrentState();
35
- };
36
- }
37
- getApi() {
38
- return {
39
- getCurrent: this.getCurrentPageState,
40
- get: this.getPageState,
41
- add: this.addPageState,
42
- remove: this.removePageState,
43
- getCurrentHomepageDesigner: this.getCurrentHomepageDesigner,
44
- getCurrentObjectPageDesigner: this.getCurrentObjectPageDesigner
45
- };
46
- }
47
- isOnPageDesigner() {
48
- return this.tabs().getActiveTab().type === "pageTemplate";
49
- }
50
- isOnHomepageDesigner() {
51
- if (!this.isOnPageDesigner())
52
- return false;
53
- const state = this.spbPageStateService.getCurrentState();
54
- if (!state)
55
- return false;
56
- return this.pageDesignerConfig().getDesignerConfig(state.designerType).templateType === "homepage";
57
- }
58
- isOnObjectPageDesigner() {
59
- if (!this.isOnPageDesigner())
60
- return false;
61
- const state = this.spbPageStateService.getCurrentState();
62
- if (!state)
63
- return false;
64
- return this.pageDesignerConfig().getDesignerConfig(state.designerType).templateType === "page";
65
- }
66
- };
67
- PageStateApiService = __decorate([
68
- Injectable()
69
- ], PageStateApiService);
70
- export { PageStateApiService };
@@ -1,34 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { getAngularJsInjectable } from "../../commons/angular-angularjs-utils";
9
- let PropertyApiService = class PropertyApiService {
10
- constructor() {
11
- this.propertyEditorConfigService = () => getAngularJsInjectable("spbPropertyEditorService");
12
- this.dataSourceValidatorService = () => getAngularJsInjectable("spbDataSourceValidatorService");
13
- this.registerCustomEditor = (selector, type, validatorFn, metadataFn) => {
14
- this.propertyEditorConfigService().registerCustomEditor(selector, type, validatorFn, metadataFn);
15
- };
16
- this.validateChildObjectDataSource = (propertyConfig, propertyKey, control) => {
17
- return this.dataSourceValidatorService().validateSubDocumentDataSource(propertyConfig, propertyKey, control);
18
- };
19
- this.getChildObjectMetadata = (propertyConfig, propertyKey, control) => {
20
- return this.dataSourceValidatorService().getSubDocumentMetadata(propertyConfig, propertyKey, control);
21
- };
22
- }
23
- getApi() {
24
- return {
25
- registerCustomEditor: this.registerCustomEditor,
26
- validateChildObjectDataSource: this.validateChildObjectDataSource,
27
- getChildObjectMetadata: this.getChildObjectMetadata
28
- };
29
- }
30
- };
31
- PropertyApiService = __decorate([
32
- Injectable()
33
- ], PropertyApiService);
34
- export { PropertyApiService };
@@ -1,40 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { getAngularJsInjectable, promiseWrap } from "../../commons/angular-angularjs-utils";
9
- let RefDataApiService = class RefDataApiService {
10
- constructor() {
11
- this.referenceDataAdmin = () => getAngularJsInjectable("fdhReferenceDataAdmin");
12
- this.getReferenceLists = () => {
13
- return this.referenceDataAdmin().getReferenceLists();
14
- };
15
- this.getReferenceHierarchies = () => {
16
- return this.referenceDataAdmin().getReferenceHierarchies();
17
- };
18
- this.getReferenceListByName = (name, includeArchived) => {
19
- // Negating includeArchived as referenceDataAdmin.getListByName handles this opposite to getHierarchyByName.
20
- const promise = this.referenceDataAdmin().getListByName(name, !includeArchived);
21
- return promise.catch(error => Promise.reject(error?.data?.message));
22
- };
23
- this.getReferenceHierarchyByName = (name, includeArchived) => {
24
- const promise = this.referenceDataAdmin().getHierarchyByName(name, includeArchived);
25
- return promise.catch(error => Promise.reject(error?.data?.message));
26
- };
27
- }
28
- getApi() {
29
- return {
30
- getReferenceLists: promiseWrap(this.getReferenceLists),
31
- getReferenceHierarchies: promiseWrap(this.getReferenceHierarchies),
32
- getReferenceList: promiseWrap(this.getReferenceListByName),
33
- getReferenceHierarchy: promiseWrap(this.getReferenceHierarchyByName)
34
- };
35
- }
36
- };
37
- RefDataApiService = __decorate([
38
- Injectable()
39
- ], RefDataApiService);
40
- export { RefDataApiService };
@@ -1,24 +0,0 @@
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 { Injectable } from "@angular/core";
8
- let ResourceApiService = class ResourceApiService {
9
- constructor(resourceService) {
10
- this.resourceService = resourceService;
11
- this.registerResourceBundle = (bundleName, resources) => {
12
- this.resourceService.addResourceBundle(bundleName, resources);
13
- };
14
- }
15
- getApi() {
16
- return {
17
- registerResourceBundle: this.registerResourceBundle
18
- };
19
- }
20
- };
21
- ResourceApiService = __decorate([
22
- Injectable()
23
- ], ResourceApiService);
24
- export { ResourceApiService };
@@ -1,111 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { each } from "lodash-es";
9
- import { getAngularJsInjectable } from "../../../commons/angular-angularjs-utils";
10
- import { SEARCH_SELECTION_ID, VisualizationTypes } from "../../../sand/search/search";
11
- import { zoneWrap } from "../../../commons/api-utils";
12
- let ClientSearchApiService = class ClientSearchApiService {
13
- constructor(ngZone, searchApiService, sandRestService, sandDoSearchService, sandSearchStorageService, sandMetadataService, sandDocumentInfoService, searchAndCreateWizardService) {
14
- this.ngZone = ngZone;
15
- this.searchApiService = searchApiService;
16
- this.sandRestService = sandRestService;
17
- this.sandDoSearchService = sandDoSearchService;
18
- this.sandSearchStorageService = sandSearchStorageService;
19
- this.sandMetadataService = sandMetadataService;
20
- this.sandDocumentInfoService = sandDocumentInfoService;
21
- this.searchAndCreateWizardService = searchAndCreateWizardService;
22
- this.performSearch = (query) => {
23
- return new Promise(resolve => {
24
- this.sandRestService.search(query).subscribe(result => {
25
- resolve(result);
26
- });
27
- });
28
- };
29
- this.navigateSearch = (queryText, visualizationName, mapFilters, queryMode) => {
30
- this.sandDoSearchService.doSearch(queryText, visualizationName, mapFilters, queryMode);
31
- };
32
- this.getCurrentSearchQuery = () => {
33
- return this.sandSearchStorageService.getCurrentSearchQuery();
34
- };
35
- this.createQueryStringFromModel = (queryModel) => {
36
- const sandQueryBuilderQueryService = getAngularJsInjectable("sandQueryBuilderQueryService");
37
- return this.sandMetadataService
38
- .getMetadata()
39
- .toPromise()
40
- .then(metadata => {
41
- return sandQueryBuilderQueryService.createQueryStringFromModel(queryModel, metadata);
42
- });
43
- };
44
- this.getQueryBuilderModel = (id) => {
45
- if (!id) {
46
- id = SEARCH_SELECTION_ID;
47
- }
48
- return this.sandSearchStorageService.getQueryBuilderModel(id);
49
- };
50
- this.setQueryBuilderModel = (queryModel, id) => {
51
- if (!id) {
52
- id = SEARCH_SELECTION_ID;
53
- }
54
- this.sandSearchStorageService.saveQueryBuilderModel(id, queryModel);
55
- };
56
- this.openAddObjectsToWorkspaceDialog = (visualizationName, objects, currentObject, networkData) => {
57
- this.sandDocumentSelectionDialogService = getAngularJsInjectable("sandDocumentSelectionDialogService");
58
- this.sandDocumentSelectionDialogService.openAddAllObjectsToWorkspaceDialog(visualizationName, currentObject, objects, networkData);
59
- };
60
- this.openAddImageToInsightsDialog = (imageData, contentType, height, width) => {
61
- this.sandDocumentSelectionDialogService = getAngularJsInjectable("sandDocumentSelectionDialogService");
62
- this.sandDocumentSelectionDialogService.openAddImageToInsightDialog(VisualizationTypes.Image, imageData, height ?? undefined, width ?? undefined, contentType);
63
- };
64
- this.addToNewWorkspace = (objectsToAdd, targetObjectType, targetObjectId, visualization, workspaceName, networkData) => {
65
- const worksheetService = getAngularJsInjectable("worksheetService");
66
- const sheetService = getAngularJsInjectable("sheetService");
67
- each(objectsToAdd, object => {
68
- this.sandDocumentInfoService.createUniqueKey(object);
69
- });
70
- const targetObject = {
71
- id: targetObjectId,
72
- type: targetObjectType,
73
- objectType: targetObjectType,
74
- isNewDocument: targetObjectId ? false : true
75
- };
76
- if (!targetObject.isNewDocument && !sheetService.getOpenDocument(targetObject.id, targetObject.type)) {
77
- throw Error(`Cannot add objects to workspace. Object of type ${targetObject.type} and id ${targetObject.id} is not open.`);
78
- }
79
- else {
80
- worksheetService.addToSheet(targetObject, undefined, objectsToAdd, visualization, networkData, workspaceName);
81
- }
82
- };
83
- this.openSearchAndCreateDialog = (wizardValues) => {
84
- const values = {
85
- ...wizardValues,
86
- searchFirst: true,
87
- initialCreateData: null
88
- };
89
- return this.searchAndCreateWizardService.launch(values).closeResult.toPromise();
90
- };
91
- }
92
- getApi() {
93
- return {
94
- ...this.searchApiService.getApi(),
95
- performSearch: this.performSearch,
96
- navigateSearch: zoneWrap(this.navigateSearch, this.ngZone),
97
- getCurrentSearchQuery: this.getCurrentSearchQuery,
98
- createQueryStringFromModel: this.createQueryStringFromModel,
99
- getQueryBuilderModel: this.getQueryBuilderModel,
100
- setQueryBuilderModel: this.setQueryBuilderModel,
101
- openAddObjectsToWorkspaceDialog: zoneWrap(this.openAddObjectsToWorkspaceDialog, this.ngZone),
102
- openAddImageToInsightsDialog: zoneWrap(this.openAddImageToInsightsDialog, this.ngZone),
103
- addToNewWorkspace: zoneWrap(this.addToNewWorkspace, this.ngZone),
104
- openSearchAndCreateDialog: zoneWrap(this.openSearchAndCreateDialog, this.ngZone)
105
- };
106
- }
107
- };
108
- ClientSearchApiService = __decorate([
109
- Injectable()
110
- ], ClientSearchApiService);
111
- export { ClientSearchApiService };
@@ -1,28 +0,0 @@
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 { Injectable } from "@angular/core";
8
- import { zoneWrap } from "../../commons/api-utils";
9
- let SearchApiService = class SearchApiService {
10
- constructor(sandQueryBuilderDialogService, ngZone) {
11
- this.sandQueryBuilderDialogService = sandQueryBuilderDialogService;
12
- this.ngZone = ngZone;
13
- this.openQueryBuilderDialog = (dialogTitle, submitButtonText, queryModel, enforceObjectType, restrictObjectTypes) => {
14
- return this.sandQueryBuilderDialogService
15
- .openQueryBuilderDialog(queryModel, dialogTitle, submitButtonText, enforceObjectType, restrictObjectTypes)
16
- .toPromise();
17
- };
18
- }
19
- getApi() {
20
- return {
21
- openQueryBuilderDialog: zoneWrap(this.openQueryBuilderDialog, this.ngZone)
22
- };
23
- }
24
- };
25
- SearchApiService = __decorate([
26
- Injectable()
27
- ], SearchApiService);
28
- export { SearchApiService };
@@ -1,39 +0,0 @@
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 { Injectable } from "@angular/core";
8
- /**
9
- * This service is an intermediary between the client API and the Network.
10
- * It keeps a record of network menu handlers registered via the client API.
11
- */
12
- let NetworkMenuHandlerService = class NetworkMenuHandlerService {
13
- constructor() {
14
- this.networkMenuHandlers = new Map();
15
- }
16
- /**
17
- * Call the registered callback function to modify/extend the context menu
18
- * @param menuType The type of menu
19
- * @param menu The menu object to be modified
20
- * @param workspaceClientId The Client ID of the current workspace
21
- */
22
- extendNetworkContextMenu(menuType, menu, workspaceClientId) {
23
- this.networkMenuHandlers.get(menuType)?.(menu, workspaceClientId);
24
- }
25
- /**
26
- * Register a callback function for the given menu type
27
- * @param menuType The type of menu: Node or Network
28
- * @param callback The callback function
29
- */
30
- registerNetworkMenuCallback(menuType, callback) {
31
- this.networkMenuHandlers.set(menuType, callback);
32
- }
33
- };
34
- NetworkMenuHandlerService = __decorate([
35
- Injectable({
36
- providedIn: "root"
37
- })
38
- ], NetworkMenuHandlerService);
39
- export { NetworkMenuHandlerService };