visualvault-api 2.0.0-beta.0 → 2.0.0-beta.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/LICENSE +12 -18
- package/README.md +148 -148
- package/dist/VVRestApi.cjs +378 -88
- package/dist/VVRestApi.cjs.map +1 -1
- package/dist/VVRestApi.d.cts +26 -11
- package/dist/VVRestApi.d.ts +26 -11
- package/dist/VVRestApi.js +378 -88
- package/dist/VVRestApi.js.map +1 -1
- package/dist/config.yml +36 -4
- package/dist/index.cjs +378 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +378 -88
- package/dist/index.js.map +1 -1
- package/package.json +74 -74
package/dist/index.cjs
CHANGED
|
@@ -608,12 +608,18 @@ var common_default = {
|
|
|
608
608
|
authorize: Authorize
|
|
609
609
|
};
|
|
610
610
|
|
|
611
|
-
// lib/docApi/
|
|
611
|
+
// lib/docApi/documentManager.js
|
|
612
612
|
init_cjs_shims();
|
|
613
|
-
var
|
|
613
|
+
var DocumentManager = class {
|
|
614
614
|
constructor(httpHelper) {
|
|
615
615
|
this._httpHelper = httpHelper;
|
|
616
616
|
}
|
|
617
|
+
async createDocument(data) {
|
|
618
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocApi.CreateDocument;
|
|
619
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
620
|
+
const opts = { method: "POST" };
|
|
621
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
622
|
+
}
|
|
617
623
|
async GetRevision(documentRevisionId) {
|
|
618
624
|
let resourceUri = this._httpHelper._config.ResourceUri.DocApi.GetRevision;
|
|
619
625
|
resourceUri = resourceUri.replace("{id}", documentRevisionId);
|
|
@@ -635,6 +641,13 @@ var DocumentInstanceManager = class {
|
|
|
635
641
|
const opts = { method: "PUT" };
|
|
636
642
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
637
643
|
}
|
|
644
|
+
async updateDocument(documentId, data) {
|
|
645
|
+
let resourceUri = this._httpHelper._config.ResourceUri.DocApi.UpdateDocument;
|
|
646
|
+
resourceUri = resourceUri.replace("{id}", documentId);
|
|
647
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
648
|
+
const opts = { method: "PUT" };
|
|
649
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
650
|
+
}
|
|
638
651
|
async search(criteriaList, searchFolders, excludeFolders, sortBy, sortDirection = "desc", page = 0, take = 15, archiveType = 0, roleSecurity = false) {
|
|
639
652
|
const url = this._httpHelper.getUrl(this._httpHelper._config.ResourceUri.DocApi.AdvancedSearch);
|
|
640
653
|
const data = {
|
|
@@ -671,7 +684,7 @@ var DocApi = class {
|
|
|
671
684
|
this.baseUrl = docApiConfig["apiUrl"] || null;
|
|
672
685
|
this.roleSecurity = docApiConfig["roleSecurity"] || false;
|
|
673
686
|
if (this.isEnabled) {
|
|
674
|
-
this.
|
|
687
|
+
this.documents = new DocumentManager(this._httpHelper);
|
|
675
688
|
}
|
|
676
689
|
}
|
|
677
690
|
};
|
|
@@ -730,9 +743,9 @@ var FormsApi_default = FormsApi;
|
|
|
730
743
|
// lib/ObjectsApi.js
|
|
731
744
|
init_cjs_shims();
|
|
732
745
|
|
|
733
|
-
// lib/objectsApi/
|
|
746
|
+
// lib/objectsApi/modelManager.js
|
|
734
747
|
init_cjs_shims();
|
|
735
|
-
var
|
|
748
|
+
var ModelManager = class {
|
|
736
749
|
constructor(httpHelper) {
|
|
737
750
|
this._httpHelper = httpHelper;
|
|
738
751
|
}
|
|
@@ -761,11 +774,11 @@ var ModelsManager = class {
|
|
|
761
774
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
762
775
|
}
|
|
763
776
|
};
|
|
764
|
-
var
|
|
777
|
+
var modelManager_default = ModelManager;
|
|
765
778
|
|
|
766
|
-
// lib/objectsApi/
|
|
779
|
+
// lib/objectsApi/objectManager.js
|
|
767
780
|
init_cjs_shims();
|
|
768
|
-
var
|
|
781
|
+
var ObjectManager = class {
|
|
769
782
|
constructor(httpHelper) {
|
|
770
783
|
this._httpHelper = httpHelper;
|
|
771
784
|
}
|
|
@@ -843,7 +856,7 @@ var ObjectsManager = class {
|
|
|
843
856
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
844
857
|
}
|
|
845
858
|
};
|
|
846
|
-
var
|
|
859
|
+
var objectManager_default = ObjectManager;
|
|
847
860
|
|
|
848
861
|
// lib/ObjectsApi.js
|
|
849
862
|
var import_js_yaml4 = __toESM(require("js-yaml"), 1);
|
|
@@ -862,8 +875,8 @@ var ObjectsApi = class {
|
|
|
862
875
|
this.isEnabled = objectsApiConfig["isEnabled"] || false;
|
|
863
876
|
this.baseUrl = objectsApiConfig["apiUrl"] || null;
|
|
864
877
|
if (this.isEnabled) {
|
|
865
|
-
this.models = new
|
|
866
|
-
this.objects = new
|
|
878
|
+
this.models = new modelManager_default(this._httpHelper);
|
|
879
|
+
this.objects = new objectManager_default(this._httpHelper);
|
|
867
880
|
}
|
|
868
881
|
}
|
|
869
882
|
};
|
|
@@ -972,6 +985,27 @@ var WorkflowManager = class {
|
|
|
972
985
|
};
|
|
973
986
|
var workflowManager_default = WorkflowManager;
|
|
974
987
|
|
|
988
|
+
// lib/studioApi/rolesAndPermissionsManager.js
|
|
989
|
+
init_cjs_shims();
|
|
990
|
+
var RolesAndPermissionsManager = class {
|
|
991
|
+
constructor(httpHelper) {
|
|
992
|
+
this._httpHelper = httpHelper;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Retrieves available features for the requesting user
|
|
996
|
+
* @param {object} params - Optional URL parameters to include in the request
|
|
997
|
+
*/
|
|
998
|
+
async getUserFeatures(params) {
|
|
999
|
+
var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.ResourceUserFeatures;
|
|
1000
|
+
var url = this._httpHelper.getUrl(resourceUri);
|
|
1001
|
+
var opts = { method: "GET" };
|
|
1002
|
+
var data = {};
|
|
1003
|
+
params = params || {};
|
|
1004
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
var rolesAndPermissionsManager_default = RolesAndPermissionsManager;
|
|
1008
|
+
|
|
975
1009
|
// lib/StudioApi.js
|
|
976
1010
|
var import_js_yaml5 = __toESM(require("js-yaml"), 1);
|
|
977
1011
|
var import_fs5 = __toESM(require("fs"), 1);
|
|
@@ -990,6 +1024,7 @@ var StudioApi = class {
|
|
|
990
1024
|
this.baseUrl = studioApiConfig["studioApiUrl"] || null;
|
|
991
1025
|
if (this.isEnabled) {
|
|
992
1026
|
this.workflow = new workflowManager_default(this._httpHelper);
|
|
1027
|
+
this.permissions = new rolesAndPermissionsManager_default(this._httpHelper);
|
|
993
1028
|
}
|
|
994
1029
|
}
|
|
995
1030
|
};
|
|
@@ -1511,6 +1546,30 @@ var GroupsManager = class {
|
|
|
1511
1546
|
const opts = { method: "GET" };
|
|
1512
1547
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1513
1548
|
}
|
|
1549
|
+
getGroupById(params, groupId) {
|
|
1550
|
+
const resourceUri = this._httpHelper._config.ResourceUri.GroupById.replace("{id}", groupId);
|
|
1551
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1552
|
+
const opts = { method: "GET" };
|
|
1553
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1554
|
+
}
|
|
1555
|
+
addGroup(params, formData) {
|
|
1556
|
+
const resourceUri = this._httpHelper._config.ResourceUri.AddGroup;
|
|
1557
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1558
|
+
const opts = { method: "POST" };
|
|
1559
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, formData);
|
|
1560
|
+
}
|
|
1561
|
+
updateGroup(params, groupId, formData) {
|
|
1562
|
+
const resourceUri = this._httpHelper._config.ResourceUri.UpdateGroup.replace("{id}", groupId);
|
|
1563
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1564
|
+
const opts = { method: "PUT" };
|
|
1565
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, formData);
|
|
1566
|
+
}
|
|
1567
|
+
deleteGroup(params, groupId) {
|
|
1568
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DeleteGroup.replace("{id}", groupId);
|
|
1569
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1570
|
+
const opts = { method: "DELETE" };
|
|
1571
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1572
|
+
}
|
|
1514
1573
|
getGroupsUsers(params, groupId) {
|
|
1515
1574
|
const resourceUri = this._httpHelper._config.ResourceUri.GroupsUsers.replace("{id}", groupId);
|
|
1516
1575
|
const url = this._httpHelper.getUrl(resourceUri);
|
|
@@ -1581,6 +1640,12 @@ var LibraryManager = class {
|
|
|
1581
1640
|
const opts = { method: "GET" };
|
|
1582
1641
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1583
1642
|
}
|
|
1643
|
+
getFolderByPath(params, folderPath) {
|
|
1644
|
+
const resourceUri = this._httpHelper._config.ResourceUri.Folders + "?folderpath=" + encodeURIComponent(folderPath);
|
|
1645
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1646
|
+
const opts = { method: "GET" };
|
|
1647
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1648
|
+
}
|
|
1584
1649
|
updateFolderIndexFieldOverrideSettings(folderId, fieldId, queryId, displayField, valueField, dropDownListId, required, defaultValue) {
|
|
1585
1650
|
const data = {
|
|
1586
1651
|
queryId,
|
|
@@ -1665,8 +1730,8 @@ var SitesManager = class {
|
|
|
1665
1730
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1666
1731
|
}
|
|
1667
1732
|
putSites(params, data, siteId) {
|
|
1668
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1669
|
-
const url = this._httpHelper.getUrl(resourceUri
|
|
1733
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
|
|
1734
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1670
1735
|
const opts = { method: "PUT" };
|
|
1671
1736
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1672
1737
|
}
|
|
@@ -1683,8 +1748,8 @@ var SitesManager = class {
|
|
|
1683
1748
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1684
1749
|
}
|
|
1685
1750
|
putGroups(params, data, siteId, grId) {
|
|
1686
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1687
|
-
const url = this._httpHelper.getUrl(resourceUri
|
|
1751
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteGroupById.replace("{siteId}", siteId).replace("{groupId}", grId);
|
|
1752
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1688
1753
|
const opts = { method: "PUT" };
|
|
1689
1754
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1690
1755
|
}
|
|
@@ -1698,6 +1763,28 @@ var SitesManager = class {
|
|
|
1698
1763
|
};
|
|
1699
1764
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
1700
1765
|
}
|
|
1766
|
+
getSiteById(params, siteId) {
|
|
1767
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
|
|
1768
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1769
|
+
const opts = { method: "GET" };
|
|
1770
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1771
|
+
}
|
|
1772
|
+
deleteSite(params, siteId) {
|
|
1773
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
|
|
1774
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1775
|
+
const opts = { method: "DELETE" };
|
|
1776
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1777
|
+
}
|
|
1778
|
+
changeGroupSite(params, groupId, newSiteId) {
|
|
1779
|
+
const resourceUri = this._httpHelper._config.ResourceUri.ChangeGroupSite;
|
|
1780
|
+
const data = {
|
|
1781
|
+
groupId,
|
|
1782
|
+
newSiteId
|
|
1783
|
+
};
|
|
1784
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1785
|
+
const opts = { method: "PUT" };
|
|
1786
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1787
|
+
}
|
|
1701
1788
|
};
|
|
1702
1789
|
|
|
1703
1790
|
// lib/vvRestApi/usersManager.js
|
|
@@ -1777,9 +1864,8 @@ var UsersManager = class {
|
|
|
1777
1864
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1778
1865
|
}
|
|
1779
1866
|
getCurrentUser() {
|
|
1780
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1781
|
-
const
|
|
1782
|
-
const url = baseUrl + "/api/v1" + resourceUri;
|
|
1867
|
+
const resourceUri = this._httpHelper._config.ResourceUri.UsersMe;
|
|
1868
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1783
1869
|
const opts = { method: "GET" };
|
|
1784
1870
|
const params = [];
|
|
1785
1871
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
@@ -2075,6 +2161,93 @@ var DocumentsManager = class {
|
|
|
2075
2161
|
};
|
|
2076
2162
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
2077
2163
|
}
|
|
2164
|
+
getDocumentWebDavUrl(documentId) {
|
|
2165
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWebDavUrl.replace("{id}", documentId);
|
|
2166
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2167
|
+
const opts = { method: "GET" };
|
|
2168
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2169
|
+
}
|
|
2170
|
+
getDocumentWopiUrl(documentId) {
|
|
2171
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWopiUrl.replace("{id}", documentId);
|
|
2172
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2173
|
+
const opts = { method: "GET" };
|
|
2174
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2175
|
+
}
|
|
2176
|
+
createDocumentZipFile(params, documentIds) {
|
|
2177
|
+
const resourceUri = this._httpHelper._config.ResourceUri.CreateDocumentZipFile;
|
|
2178
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2179
|
+
const opts = { method: "POST" };
|
|
2180
|
+
const data = { documentDhIds: documentIds };
|
|
2181
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2182
|
+
}
|
|
2183
|
+
getDocumentZipFileStatus(params, downloadKey) {
|
|
2184
|
+
const resourceUri = this._httpHelper._config.ResourceUri.GetDocumentZipFileStatus + `?downloadKey=${encodeURIComponent(downloadKey)}`;
|
|
2185
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2186
|
+
const opts = { method: "GET" };
|
|
2187
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2188
|
+
}
|
|
2189
|
+
getDocumentIndexFields(params, documentId) {
|
|
2190
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentIndexFields.replace("{id}", documentId);
|
|
2191
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2192
|
+
const opts = { method: "GET" };
|
|
2193
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2194
|
+
}
|
|
2195
|
+
getDocumentTypes(params) {
|
|
2196
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentTypes;
|
|
2197
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2198
|
+
const opts = { method: "GET" };
|
|
2199
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2200
|
+
}
|
|
2201
|
+
createDocumentType(params, name) {
|
|
2202
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentTypes;
|
|
2203
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2204
|
+
const opts = { method: "POST" };
|
|
2205
|
+
const data = { documentTypeName: name };
|
|
2206
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2207
|
+
}
|
|
2208
|
+
getSavedSearches(params) {
|
|
2209
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SavedSearches;
|
|
2210
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2211
|
+
const opts = { method: "GET" };
|
|
2212
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2213
|
+
}
|
|
2214
|
+
getDocumentFields(params) {
|
|
2215
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentFields;
|
|
2216
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2217
|
+
const opts = { method: "GET" };
|
|
2218
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2219
|
+
}
|
|
2220
|
+
getSavedSearchIndexFields(params, savedSearchId) {
|
|
2221
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SavedSearchIndexFields;
|
|
2222
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2223
|
+
const opts = { method: "GET" };
|
|
2224
|
+
const mergedParams = { ...params, savedSearchId };
|
|
2225
|
+
return this._httpHelper.doVvClientRequest(url, opts, mergedParams, null);
|
|
2226
|
+
}
|
|
2227
|
+
getLastDocuments(params) {
|
|
2228
|
+
const resourceUri = this._httpHelper._config.ResourceUri.LastDocuments;
|
|
2229
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2230
|
+
const opts = { method: "GET" };
|
|
2231
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2232
|
+
}
|
|
2233
|
+
getFrequentDocuments(params) {
|
|
2234
|
+
const resourceUri = this._httpHelper._config.ResourceUri.FrequentDocuments;
|
|
2235
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2236
|
+
const opts = { method: "GET" };
|
|
2237
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2238
|
+
}
|
|
2239
|
+
getSavedSearchDocuments(params, savedSearchId) {
|
|
2240
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SavedSearchDocuments.replace("{savedSearchId}", savedSearchId);
|
|
2241
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2242
|
+
const opts = { method: "GET" };
|
|
2243
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2244
|
+
}
|
|
2245
|
+
getDocumentDefaultLink(params, documentId) {
|
|
2246
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentDefaultAction.replace("{documentId}", documentId);
|
|
2247
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2248
|
+
const opts = { method: "GET" };
|
|
2249
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2250
|
+
}
|
|
2078
2251
|
};
|
|
2079
2252
|
|
|
2080
2253
|
// lib/vvRestApi/projectsManager.js
|
|
@@ -2115,6 +2288,70 @@ var IndexFieldsManager = class {
|
|
|
2115
2288
|
const opts = { method: "GET" };
|
|
2116
2289
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2117
2290
|
}
|
|
2291
|
+
getIndexField(params, id) {
|
|
2292
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
|
|
2293
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2294
|
+
const opts = { method: "GET" };
|
|
2295
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2296
|
+
}
|
|
2297
|
+
/**
|
|
2298
|
+
* Payload for creating/updating index fields.
|
|
2299
|
+
* @typedef {Object} IndexFieldData
|
|
2300
|
+
* @property {string} fieldType
|
|
2301
|
+
* @property {string} label
|
|
2302
|
+
* @property {string} [description]
|
|
2303
|
+
* @property {boolean} [required]
|
|
2304
|
+
* @property {?string} [connectionId]
|
|
2305
|
+
* @property {?string} [queryId]
|
|
2306
|
+
* @property {?string} [queryDisplayField]
|
|
2307
|
+
* @property {?string} [queryValueField]
|
|
2308
|
+
* @property {?string} [dropDownListId]
|
|
2309
|
+
* @property {?string} [defaultValue]
|
|
2310
|
+
*/
|
|
2311
|
+
/**
|
|
2312
|
+
* Create an index field
|
|
2313
|
+
* @param {Object} params - Query parameters
|
|
2314
|
+
* @param {IndexFieldData} data - Request body
|
|
2315
|
+
* @returns {Promise<string>}
|
|
2316
|
+
*/
|
|
2317
|
+
createIndexField(params, data) {
|
|
2318
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields;
|
|
2319
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2320
|
+
const opts = { method: "POST" };
|
|
2321
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Update an index field
|
|
2325
|
+
* @param {Object} params - Query parameters
|
|
2326
|
+
* @param {string} id - Index field id
|
|
2327
|
+
* @param {IndexFieldData} data - Request body
|
|
2328
|
+
* @returns {Promise<string>}
|
|
2329
|
+
*/
|
|
2330
|
+
updateIndexField(params, id, data) {
|
|
2331
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
|
|
2332
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2333
|
+
const opts = { method: "PUT" };
|
|
2334
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2335
|
+
}
|
|
2336
|
+
deleteIndexField(params, id) {
|
|
2337
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
|
|
2338
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2339
|
+
const opts = { method: "DELETE" };
|
|
2340
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2341
|
+
}
|
|
2342
|
+
moveIndexFieldAfter(params, sourceFieldId, destinationFieldId) {
|
|
2343
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/MoveIndexFieldAfter";
|
|
2344
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2345
|
+
const opts = { method: "POST" };
|
|
2346
|
+
const data = { sourceFieldId, destinationFieldId };
|
|
2347
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2348
|
+
}
|
|
2349
|
+
addIndexFieldToFolder(indexFieldId, folderId) {
|
|
2350
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFieldsFolder.replace("{id}", indexFieldId).replace("{folderId}", folderId);
|
|
2351
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2352
|
+
const opts = { method: "PUT" };
|
|
2353
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2354
|
+
}
|
|
2118
2355
|
};
|
|
2119
2356
|
|
|
2120
2357
|
// lib/vvRestApi/outsideProcessesManager.js
|
|
@@ -2201,6 +2438,12 @@ var ReportsManager = class {
|
|
|
2201
2438
|
constructor(httpHelper) {
|
|
2202
2439
|
this._httpHelper = httpHelper;
|
|
2203
2440
|
}
|
|
2441
|
+
getReports(params) {
|
|
2442
|
+
const resourceUri = this._httpHelper._config.ResourceUri.Reports;
|
|
2443
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2444
|
+
const opts = { method: "GET" };
|
|
2445
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2446
|
+
}
|
|
2204
2447
|
getReportPDF(reportId, params) {
|
|
2205
2448
|
const resourceUri = this._httpHelper._config.ResourceUri.ReportServerPDF.replace("{id}", reportId);
|
|
2206
2449
|
const url = this._httpHelper.getUrl(resourceUri);
|
|
@@ -2209,6 +2452,102 @@ var ReportsManager = class {
|
|
|
2209
2452
|
}
|
|
2210
2453
|
};
|
|
2211
2454
|
|
|
2455
|
+
// lib/vvRestApi/languageResourcesManager.js
|
|
2456
|
+
init_cjs_shims();
|
|
2457
|
+
var LanguageResourcesManager = class {
|
|
2458
|
+
constructor(httpHelper, baseUrl) {
|
|
2459
|
+
this._httpHelper = httpHelper;
|
|
2460
|
+
this._baseUrl = baseUrl;
|
|
2461
|
+
this._apiUrl = httpHelper._config.BaseApiUri;
|
|
2462
|
+
}
|
|
2463
|
+
getLanguageAreas(params) {
|
|
2464
|
+
const resourceUri = this._httpHelper._config.ResourceUri.LanguageAreas;
|
|
2465
|
+
const url = this._baseUrl + this._apiUrl + resourceUri;
|
|
2466
|
+
const opts = { method: "GET" };
|
|
2467
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2468
|
+
}
|
|
2469
|
+
getLanguages(params) {
|
|
2470
|
+
const resourceUri = this._httpHelper._config.ResourceUri.Languages;
|
|
2471
|
+
const url = this._baseUrl + this._apiUrl + resourceUri;
|
|
2472
|
+
const opts = { method: "GET" };
|
|
2473
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2474
|
+
}
|
|
2475
|
+
exportLanguages(params) {
|
|
2476
|
+
const resourceUri = this._httpHelper._config.ResourceUri.ExportLanguages;
|
|
2477
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2478
|
+
const opts = { method: "GETSTREAM" };
|
|
2479
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2480
|
+
}
|
|
2481
|
+
importLanguages(params, fileData, fileName) {
|
|
2482
|
+
const resourceUri = this._httpHelper._config.ResourceUri.ImportLanguages;
|
|
2483
|
+
const url = this._httpHelper.getUrl(resourceUri) + `?area=${params.area}&lang=${params.lang}`;
|
|
2484
|
+
const opts = { method: "POSTSTREAM" };
|
|
2485
|
+
const data = { fileName };
|
|
2486
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, data, fileData);
|
|
2487
|
+
}
|
|
2488
|
+
};
|
|
2489
|
+
|
|
2490
|
+
// lib/vvRestApi/dropdownListsManager.js
|
|
2491
|
+
init_cjs_shims();
|
|
2492
|
+
var DropdownListsManager = class {
|
|
2493
|
+
constructor(httpHelper) {
|
|
2494
|
+
this._httpHelper = httpHelper;
|
|
2495
|
+
}
|
|
2496
|
+
getDropDownLists(params) {
|
|
2497
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownLists;
|
|
2498
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2499
|
+
const opts = { method: "GET" };
|
|
2500
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2501
|
+
}
|
|
2502
|
+
getDropDownListById(params, listId) {
|
|
2503
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
|
|
2504
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2505
|
+
const opts = { method: "GET" };
|
|
2506
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2507
|
+
}
|
|
2508
|
+
getDropDownListItemsById(params, listId) {
|
|
2509
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsIdItems.replace("{id}", listId);
|
|
2510
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2511
|
+
const opts = { method: "GET" };
|
|
2512
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2513
|
+
}
|
|
2514
|
+
addDropDownList(params, ddName, ddDescription, ddItems) {
|
|
2515
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownLists;
|
|
2516
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2517
|
+
const opts = { method: "POST" };
|
|
2518
|
+
const data = {
|
|
2519
|
+
Name: ddName,
|
|
2520
|
+
Description: ddDescription,
|
|
2521
|
+
Items: ddItems
|
|
2522
|
+
};
|
|
2523
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2524
|
+
}
|
|
2525
|
+
deleteDropDownList(params, listId) {
|
|
2526
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
|
|
2527
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2528
|
+
const opts = { method: "DELETE" };
|
|
2529
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2530
|
+
}
|
|
2531
|
+
updateDropDownList(params, listId, ddName, ddDescription, items) {
|
|
2532
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
|
|
2533
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2534
|
+
const opts = { method: "PUT" };
|
|
2535
|
+
const data = {
|
|
2536
|
+
Name: ddName,
|
|
2537
|
+
Description: ddDescription,
|
|
2538
|
+
Items: items
|
|
2539
|
+
};
|
|
2540
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2541
|
+
}
|
|
2542
|
+
deleteDropDownListItem(params, listId, itemIds) {
|
|
2543
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsIdItems.replace("{id}", listId);
|
|
2544
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2545
|
+
const opts = { method: "DELETE" };
|
|
2546
|
+
const mergedParams = { ...params, itemIds };
|
|
2547
|
+
return this._httpHelper.doVvClientRequest(url, opts, mergedParams, null);
|
|
2548
|
+
}
|
|
2549
|
+
};
|
|
2550
|
+
|
|
2212
2551
|
// lib/VVRestApi.js
|
|
2213
2552
|
var debug5 = (0, import_debug5.default)("visualvault:api");
|
|
2214
2553
|
var __filename7 = (0, import_url6.fileURLToPath)(importMetaUrl);
|
|
@@ -2256,6 +2595,10 @@ var VVClient = class {
|
|
|
2256
2595
|
layouts;
|
|
2257
2596
|
/** @type {*} */
|
|
2258
2597
|
reports;
|
|
2598
|
+
/** @type {*} */
|
|
2599
|
+
languageResources;
|
|
2600
|
+
/** @type {*} */
|
|
2601
|
+
dropdownLists;
|
|
2259
2602
|
/**
|
|
2260
2603
|
* @param {*} sessionToken - Session token from authentication
|
|
2261
2604
|
*/
|
|
@@ -2284,66 +2627,13 @@ var VVClient = class {
|
|
|
2284
2627
|
this.securityMembers = new SecurityMembersManager(this._httpHelper);
|
|
2285
2628
|
this.layouts = new LayoutsManager(this._httpHelper);
|
|
2286
2629
|
this.reports = new ReportsManager(this._httpHelper);
|
|
2287
|
-
this.
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
throw new ReferenceError("Document Api not enabled");
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
});
|
|
2299
|
-
this._formsApi = null;
|
|
2300
|
-
Object.defineProperties(this, {
|
|
2301
|
-
formsApi: {
|
|
2302
|
-
get: function() {
|
|
2303
|
-
if (this._formsApi != null && this._formsApi.isEnabled && this._formsApi.baseUrl) {
|
|
2304
|
-
return this._formsApi;
|
|
2305
|
-
} else {
|
|
2306
|
-
throw new ReferenceError("Forms Api not enabled");
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
});
|
|
2311
|
-
this._objectsApi = null;
|
|
2312
|
-
Object.defineProperties(this, {
|
|
2313
|
-
objectsApi: {
|
|
2314
|
-
get: function() {
|
|
2315
|
-
if (this._objectsApi != null && this._objectsApi.isEnabled && this._objectsApi.baseUrl) {
|
|
2316
|
-
return this._objectsApi;
|
|
2317
|
-
} else {
|
|
2318
|
-
throw new ReferenceError("Objects Api not enabled");
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
});
|
|
2323
|
-
this._studioApi = null;
|
|
2324
|
-
Object.defineProperties(this, {
|
|
2325
|
-
studioApi: {
|
|
2326
|
-
get: function() {
|
|
2327
|
-
if (this._studioApi != null && this._studioApi.isEnabled && this._studioApi.baseUrl) {
|
|
2328
|
-
return this._studioApi;
|
|
2329
|
-
} else {
|
|
2330
|
-
throw new ReferenceError("Studio Api not enabled");
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
});
|
|
2335
|
-
this._notificationsApi = null;
|
|
2336
|
-
Object.defineProperties(this, {
|
|
2337
|
-
notificationsApi: {
|
|
2338
|
-
get: function() {
|
|
2339
|
-
if (this._notificationsApi != null && this._notificationsApi.isEnabled && this._notificationsApi.baseUrl) {
|
|
2340
|
-
return this._notificationsApi;
|
|
2341
|
-
} else {
|
|
2342
|
-
throw new ReferenceError("Notifications Api not enabled");
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
});
|
|
2630
|
+
this.languageResources = new LanguageResourcesManager(this._httpHelper, sessionToken.baseUrl);
|
|
2631
|
+
this.dropdownLists = new DropdownListsManager(this._httpHelper);
|
|
2632
|
+
this.docApi = null;
|
|
2633
|
+
this.formsApi = null;
|
|
2634
|
+
this.objectsApi = null;
|
|
2635
|
+
this.studioApi = null;
|
|
2636
|
+
this.notificationsApi = null;
|
|
2347
2637
|
}
|
|
2348
2638
|
async createDocApi(sessionToken) {
|
|
2349
2639
|
const docApiConfigResponse = JSON.parse(await this.configuration.getDocApiConfig());
|
|
@@ -2352,12 +2642,12 @@ var VVClient = class {
|
|
|
2352
2642
|
docApiSession.baseUrl = docApiConfigResponse.data["apiUrl"];
|
|
2353
2643
|
docApiSession.apiUrl = this.yamlConfig.DocApiUri;
|
|
2354
2644
|
if (docApiSession["tokenType"] == "jwt") {
|
|
2355
|
-
this.
|
|
2645
|
+
this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
|
|
2356
2646
|
} else if (this.users) {
|
|
2357
2647
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(docApiSession.audience));
|
|
2358
2648
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2359
2649
|
docApiSession.convertToJwt(jwtResponse["data"]);
|
|
2360
|
-
this.
|
|
2650
|
+
this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
|
|
2361
2651
|
}
|
|
2362
2652
|
}
|
|
2363
2653
|
}
|
|
@@ -2369,12 +2659,12 @@ var VVClient = class {
|
|
|
2369
2659
|
formsApiSession.baseUrl = formsApiConfigResponse.data["formsApiUrl"];
|
|
2370
2660
|
formsApiSession.apiUrl = this.yamlConfig.FormsApiUri;
|
|
2371
2661
|
if (formsApiSession["tokenType"] == "jwt") {
|
|
2372
|
-
this.
|
|
2662
|
+
this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
|
|
2373
2663
|
} else if (this.users) {
|
|
2374
2664
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(formsApiSession.audience));
|
|
2375
2665
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2376
2666
|
formsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2377
|
-
this.
|
|
2667
|
+
this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
|
|
2378
2668
|
}
|
|
2379
2669
|
}
|
|
2380
2670
|
}
|
|
@@ -2386,12 +2676,12 @@ var VVClient = class {
|
|
|
2386
2676
|
objectsApiSession.baseUrl = objectsApiConfigResponse.data["apiUrl"];
|
|
2387
2677
|
objectsApiSession.apiUrl = "";
|
|
2388
2678
|
if (objectsApiSession["tokenType"] == "jwt") {
|
|
2389
|
-
this.
|
|
2679
|
+
this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
|
|
2390
2680
|
} else if (this.users) {
|
|
2391
2681
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(objectsApiSession.audience));
|
|
2392
2682
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2393
2683
|
objectsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2394
|
-
this.
|
|
2684
|
+
this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
|
|
2395
2685
|
}
|
|
2396
2686
|
}
|
|
2397
2687
|
}
|
|
@@ -2403,12 +2693,12 @@ var VVClient = class {
|
|
|
2403
2693
|
studioApiSession.baseUrl = studioApiConfigResponse.data["studioApiUrl"];
|
|
2404
2694
|
studioApiSession.apiUrl = "";
|
|
2405
2695
|
if (studioApiSession["tokenType"] == "jwt") {
|
|
2406
|
-
this.
|
|
2696
|
+
this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
|
|
2407
2697
|
} else if (this.users) {
|
|
2408
2698
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(studioApiSession.audience));
|
|
2409
2699
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2410
2700
|
studioApiSession.convertToJwt(jwtResponse["data"]);
|
|
2411
|
-
this.
|
|
2701
|
+
this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
|
|
2412
2702
|
}
|
|
2413
2703
|
}
|
|
2414
2704
|
}
|
|
@@ -2420,12 +2710,12 @@ var VVClient = class {
|
|
|
2420
2710
|
notificationsApiSession.baseUrl = notificationsApiConfigResponse.data["apiUrl"];
|
|
2421
2711
|
notificationsApiSession.apiUrl = this.yamlConfig.NotificationsApiUri;
|
|
2422
2712
|
if (notificationsApiSession["tokenType"] == "jwt") {
|
|
2423
|
-
this.
|
|
2713
|
+
this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
|
|
2424
2714
|
} else if (this.users) {
|
|
2425
2715
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(notificationsApiSession.audience));
|
|
2426
2716
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2427
2717
|
notificationsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2428
|
-
this.
|
|
2718
|
+
this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
|
|
2429
2719
|
}
|
|
2430
2720
|
}
|
|
2431
2721
|
}
|