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.js
CHANGED
|
@@ -577,12 +577,18 @@ var common_default = {
|
|
|
577
577
|
authorize: Authorize
|
|
578
578
|
};
|
|
579
579
|
|
|
580
|
-
// lib/docApi/
|
|
580
|
+
// lib/docApi/documentManager.js
|
|
581
581
|
init_esm_shims();
|
|
582
|
-
var
|
|
582
|
+
var DocumentManager = class {
|
|
583
583
|
constructor(httpHelper) {
|
|
584
584
|
this._httpHelper = httpHelper;
|
|
585
585
|
}
|
|
586
|
+
async createDocument(data) {
|
|
587
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocApi.CreateDocument;
|
|
588
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
589
|
+
const opts = { method: "POST" };
|
|
590
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
591
|
+
}
|
|
586
592
|
async GetRevision(documentRevisionId) {
|
|
587
593
|
let resourceUri = this._httpHelper._config.ResourceUri.DocApi.GetRevision;
|
|
588
594
|
resourceUri = resourceUri.replace("{id}", documentRevisionId);
|
|
@@ -604,6 +610,13 @@ var DocumentInstanceManager = class {
|
|
|
604
610
|
const opts = { method: "PUT" };
|
|
605
611
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
606
612
|
}
|
|
613
|
+
async updateDocument(documentId, data) {
|
|
614
|
+
let resourceUri = this._httpHelper._config.ResourceUri.DocApi.UpdateDocument;
|
|
615
|
+
resourceUri = resourceUri.replace("{id}", documentId);
|
|
616
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
617
|
+
const opts = { method: "PUT" };
|
|
618
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
619
|
+
}
|
|
607
620
|
async search(criteriaList, searchFolders, excludeFolders, sortBy, sortDirection = "desc", page = 0, take = 15, archiveType = 0, roleSecurity = false) {
|
|
608
621
|
const url = this._httpHelper.getUrl(this._httpHelper._config.ResourceUri.DocApi.AdvancedSearch);
|
|
609
622
|
const data = {
|
|
@@ -640,7 +653,7 @@ var DocApi = class {
|
|
|
640
653
|
this.baseUrl = docApiConfig["apiUrl"] || null;
|
|
641
654
|
this.roleSecurity = docApiConfig["roleSecurity"] || false;
|
|
642
655
|
if (this.isEnabled) {
|
|
643
|
-
this.
|
|
656
|
+
this.documents = new DocumentManager(this._httpHelper);
|
|
644
657
|
}
|
|
645
658
|
}
|
|
646
659
|
};
|
|
@@ -699,9 +712,9 @@ var FormsApi_default = FormsApi;
|
|
|
699
712
|
// lib/ObjectsApi.js
|
|
700
713
|
init_esm_shims();
|
|
701
714
|
|
|
702
|
-
// lib/objectsApi/
|
|
715
|
+
// lib/objectsApi/modelManager.js
|
|
703
716
|
init_esm_shims();
|
|
704
|
-
var
|
|
717
|
+
var ModelManager = class {
|
|
705
718
|
constructor(httpHelper) {
|
|
706
719
|
this._httpHelper = httpHelper;
|
|
707
720
|
}
|
|
@@ -730,11 +743,11 @@ var ModelsManager = class {
|
|
|
730
743
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
731
744
|
}
|
|
732
745
|
};
|
|
733
|
-
var
|
|
746
|
+
var modelManager_default = ModelManager;
|
|
734
747
|
|
|
735
|
-
// lib/objectsApi/
|
|
748
|
+
// lib/objectsApi/objectManager.js
|
|
736
749
|
init_esm_shims();
|
|
737
|
-
var
|
|
750
|
+
var ObjectManager = class {
|
|
738
751
|
constructor(httpHelper) {
|
|
739
752
|
this._httpHelper = httpHelper;
|
|
740
753
|
}
|
|
@@ -812,7 +825,7 @@ var ObjectsManager = class {
|
|
|
812
825
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
813
826
|
}
|
|
814
827
|
};
|
|
815
|
-
var
|
|
828
|
+
var objectManager_default = ObjectManager;
|
|
816
829
|
|
|
817
830
|
// lib/ObjectsApi.js
|
|
818
831
|
import yaml4 from "js-yaml";
|
|
@@ -831,8 +844,8 @@ var ObjectsApi = class {
|
|
|
831
844
|
this.isEnabled = objectsApiConfig["isEnabled"] || false;
|
|
832
845
|
this.baseUrl = objectsApiConfig["apiUrl"] || null;
|
|
833
846
|
if (this.isEnabled) {
|
|
834
|
-
this.models = new
|
|
835
|
-
this.objects = new
|
|
847
|
+
this.models = new modelManager_default(this._httpHelper);
|
|
848
|
+
this.objects = new objectManager_default(this._httpHelper);
|
|
836
849
|
}
|
|
837
850
|
}
|
|
838
851
|
};
|
|
@@ -941,6 +954,27 @@ var WorkflowManager = class {
|
|
|
941
954
|
};
|
|
942
955
|
var workflowManager_default = WorkflowManager;
|
|
943
956
|
|
|
957
|
+
// lib/studioApi/rolesAndPermissionsManager.js
|
|
958
|
+
init_esm_shims();
|
|
959
|
+
var RolesAndPermissionsManager = class {
|
|
960
|
+
constructor(httpHelper) {
|
|
961
|
+
this._httpHelper = httpHelper;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Retrieves available features for the requesting user
|
|
965
|
+
* @param {object} params - Optional URL parameters to include in the request
|
|
966
|
+
*/
|
|
967
|
+
async getUserFeatures(params) {
|
|
968
|
+
var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.ResourceUserFeatures;
|
|
969
|
+
var url = this._httpHelper.getUrl(resourceUri);
|
|
970
|
+
var opts = { method: "GET" };
|
|
971
|
+
var data = {};
|
|
972
|
+
params = params || {};
|
|
973
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
var rolesAndPermissionsManager_default = RolesAndPermissionsManager;
|
|
977
|
+
|
|
944
978
|
// lib/StudioApi.js
|
|
945
979
|
import yaml5 from "js-yaml";
|
|
946
980
|
import fs5 from "fs";
|
|
@@ -959,6 +993,7 @@ var StudioApi = class {
|
|
|
959
993
|
this.baseUrl = studioApiConfig["studioApiUrl"] || null;
|
|
960
994
|
if (this.isEnabled) {
|
|
961
995
|
this.workflow = new workflowManager_default(this._httpHelper);
|
|
996
|
+
this.permissions = new rolesAndPermissionsManager_default(this._httpHelper);
|
|
962
997
|
}
|
|
963
998
|
}
|
|
964
999
|
};
|
|
@@ -1480,6 +1515,30 @@ var GroupsManager = class {
|
|
|
1480
1515
|
const opts = { method: "GET" };
|
|
1481
1516
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1482
1517
|
}
|
|
1518
|
+
getGroupById(params, groupId) {
|
|
1519
|
+
const resourceUri = this._httpHelper._config.ResourceUri.GroupById.replace("{id}", groupId);
|
|
1520
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1521
|
+
const opts = { method: "GET" };
|
|
1522
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1523
|
+
}
|
|
1524
|
+
addGroup(params, formData) {
|
|
1525
|
+
const resourceUri = this._httpHelper._config.ResourceUri.AddGroup;
|
|
1526
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1527
|
+
const opts = { method: "POST" };
|
|
1528
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, formData);
|
|
1529
|
+
}
|
|
1530
|
+
updateGroup(params, groupId, formData) {
|
|
1531
|
+
const resourceUri = this._httpHelper._config.ResourceUri.UpdateGroup.replace("{id}", groupId);
|
|
1532
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1533
|
+
const opts = { method: "PUT" };
|
|
1534
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, formData);
|
|
1535
|
+
}
|
|
1536
|
+
deleteGroup(params, groupId) {
|
|
1537
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DeleteGroup.replace("{id}", groupId);
|
|
1538
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1539
|
+
const opts = { method: "DELETE" };
|
|
1540
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1541
|
+
}
|
|
1483
1542
|
getGroupsUsers(params, groupId) {
|
|
1484
1543
|
const resourceUri = this._httpHelper._config.ResourceUri.GroupsUsers.replace("{id}", groupId);
|
|
1485
1544
|
const url = this._httpHelper.getUrl(resourceUri);
|
|
@@ -1550,6 +1609,12 @@ var LibraryManager = class {
|
|
|
1550
1609
|
const opts = { method: "GET" };
|
|
1551
1610
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1552
1611
|
}
|
|
1612
|
+
getFolderByPath(params, folderPath) {
|
|
1613
|
+
const resourceUri = this._httpHelper._config.ResourceUri.Folders + "?folderpath=" + encodeURIComponent(folderPath);
|
|
1614
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1615
|
+
const opts = { method: "GET" };
|
|
1616
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1617
|
+
}
|
|
1553
1618
|
updateFolderIndexFieldOverrideSettings(folderId, fieldId, queryId, displayField, valueField, dropDownListId, required, defaultValue) {
|
|
1554
1619
|
const data = {
|
|
1555
1620
|
queryId,
|
|
@@ -1634,8 +1699,8 @@ var SitesManager = class {
|
|
|
1634
1699
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1635
1700
|
}
|
|
1636
1701
|
putSites(params, data, siteId) {
|
|
1637
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1638
|
-
const url = this._httpHelper.getUrl(resourceUri
|
|
1702
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
|
|
1703
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1639
1704
|
const opts = { method: "PUT" };
|
|
1640
1705
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1641
1706
|
}
|
|
@@ -1652,8 +1717,8 @@ var SitesManager = class {
|
|
|
1652
1717
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1653
1718
|
}
|
|
1654
1719
|
putGroups(params, data, siteId, grId) {
|
|
1655
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1656
|
-
const url = this._httpHelper.getUrl(resourceUri
|
|
1720
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteGroupById.replace("{siteId}", siteId).replace("{groupId}", grId);
|
|
1721
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1657
1722
|
const opts = { method: "PUT" };
|
|
1658
1723
|
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1659
1724
|
}
|
|
@@ -1667,6 +1732,28 @@ var SitesManager = class {
|
|
|
1667
1732
|
};
|
|
1668
1733
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
1669
1734
|
}
|
|
1735
|
+
getSiteById(params, siteId) {
|
|
1736
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
|
|
1737
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1738
|
+
const opts = { method: "GET" };
|
|
1739
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1740
|
+
}
|
|
1741
|
+
deleteSite(params, siteId) {
|
|
1742
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
|
|
1743
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1744
|
+
const opts = { method: "DELETE" };
|
|
1745
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1746
|
+
}
|
|
1747
|
+
changeGroupSite(params, groupId, newSiteId) {
|
|
1748
|
+
const resourceUri = this._httpHelper._config.ResourceUri.ChangeGroupSite;
|
|
1749
|
+
const data = {
|
|
1750
|
+
groupId,
|
|
1751
|
+
newSiteId
|
|
1752
|
+
};
|
|
1753
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1754
|
+
const opts = { method: "PUT" };
|
|
1755
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
1756
|
+
}
|
|
1670
1757
|
};
|
|
1671
1758
|
|
|
1672
1759
|
// lib/vvRestApi/usersManager.js
|
|
@@ -1746,9 +1833,8 @@ var UsersManager = class {
|
|
|
1746
1833
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1747
1834
|
}
|
|
1748
1835
|
getCurrentUser() {
|
|
1749
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1750
|
-
const
|
|
1751
|
-
const url = baseUrl + "/api/v1" + resourceUri;
|
|
1836
|
+
const resourceUri = this._httpHelper._config.ResourceUri.UsersMe;
|
|
1837
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1752
1838
|
const opts = { method: "GET" };
|
|
1753
1839
|
const params = [];
|
|
1754
1840
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
@@ -2044,6 +2130,93 @@ var DocumentsManager = class {
|
|
|
2044
2130
|
};
|
|
2045
2131
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
2046
2132
|
}
|
|
2133
|
+
getDocumentWebDavUrl(documentId) {
|
|
2134
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWebDavUrl.replace("{id}", documentId);
|
|
2135
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2136
|
+
const opts = { method: "GET" };
|
|
2137
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2138
|
+
}
|
|
2139
|
+
getDocumentWopiUrl(documentId) {
|
|
2140
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWopiUrl.replace("{id}", documentId);
|
|
2141
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2142
|
+
const opts = { method: "GET" };
|
|
2143
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2144
|
+
}
|
|
2145
|
+
createDocumentZipFile(params, documentIds) {
|
|
2146
|
+
const resourceUri = this._httpHelper._config.ResourceUri.CreateDocumentZipFile;
|
|
2147
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2148
|
+
const opts = { method: "POST" };
|
|
2149
|
+
const data = { documentDhIds: documentIds };
|
|
2150
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2151
|
+
}
|
|
2152
|
+
getDocumentZipFileStatus(params, downloadKey) {
|
|
2153
|
+
const resourceUri = this._httpHelper._config.ResourceUri.GetDocumentZipFileStatus + `?downloadKey=${encodeURIComponent(downloadKey)}`;
|
|
2154
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2155
|
+
const opts = { method: "GET" };
|
|
2156
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2157
|
+
}
|
|
2158
|
+
getDocumentIndexFields(params, documentId) {
|
|
2159
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentIndexFields.replace("{id}", documentId);
|
|
2160
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2161
|
+
const opts = { method: "GET" };
|
|
2162
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2163
|
+
}
|
|
2164
|
+
getDocumentTypes(params) {
|
|
2165
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentTypes;
|
|
2166
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2167
|
+
const opts = { method: "GET" };
|
|
2168
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2169
|
+
}
|
|
2170
|
+
createDocumentType(params, name) {
|
|
2171
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentTypes;
|
|
2172
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2173
|
+
const opts = { method: "POST" };
|
|
2174
|
+
const data = { documentTypeName: name };
|
|
2175
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2176
|
+
}
|
|
2177
|
+
getSavedSearches(params) {
|
|
2178
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SavedSearches;
|
|
2179
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2180
|
+
const opts = { method: "GET" };
|
|
2181
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2182
|
+
}
|
|
2183
|
+
getDocumentFields(params) {
|
|
2184
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentFields;
|
|
2185
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2186
|
+
const opts = { method: "GET" };
|
|
2187
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2188
|
+
}
|
|
2189
|
+
getSavedSearchIndexFields(params, savedSearchId) {
|
|
2190
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SavedSearchIndexFields;
|
|
2191
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2192
|
+
const opts = { method: "GET" };
|
|
2193
|
+
const mergedParams = { ...params, savedSearchId };
|
|
2194
|
+
return this._httpHelper.doVvClientRequest(url, opts, mergedParams, null);
|
|
2195
|
+
}
|
|
2196
|
+
getLastDocuments(params) {
|
|
2197
|
+
const resourceUri = this._httpHelper._config.ResourceUri.LastDocuments;
|
|
2198
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2199
|
+
const opts = { method: "GET" };
|
|
2200
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2201
|
+
}
|
|
2202
|
+
getFrequentDocuments(params) {
|
|
2203
|
+
const resourceUri = this._httpHelper._config.ResourceUri.FrequentDocuments;
|
|
2204
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2205
|
+
const opts = { method: "GET" };
|
|
2206
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2207
|
+
}
|
|
2208
|
+
getSavedSearchDocuments(params, savedSearchId) {
|
|
2209
|
+
const resourceUri = this._httpHelper._config.ResourceUri.SavedSearchDocuments.replace("{savedSearchId}", savedSearchId);
|
|
2210
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2211
|
+
const opts = { method: "GET" };
|
|
2212
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2213
|
+
}
|
|
2214
|
+
getDocumentDefaultLink(params, documentId) {
|
|
2215
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentDefaultAction.replace("{documentId}", documentId);
|
|
2216
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2217
|
+
const opts = { method: "GET" };
|
|
2218
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2219
|
+
}
|
|
2047
2220
|
};
|
|
2048
2221
|
|
|
2049
2222
|
// lib/vvRestApi/projectsManager.js
|
|
@@ -2084,6 +2257,70 @@ var IndexFieldsManager = class {
|
|
|
2084
2257
|
const opts = { method: "GET" };
|
|
2085
2258
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2086
2259
|
}
|
|
2260
|
+
getIndexField(params, id) {
|
|
2261
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
|
|
2262
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2263
|
+
const opts = { method: "GET" };
|
|
2264
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Payload for creating/updating index fields.
|
|
2268
|
+
* @typedef {Object} IndexFieldData
|
|
2269
|
+
* @property {string} fieldType
|
|
2270
|
+
* @property {string} label
|
|
2271
|
+
* @property {string} [description]
|
|
2272
|
+
* @property {boolean} [required]
|
|
2273
|
+
* @property {?string} [connectionId]
|
|
2274
|
+
* @property {?string} [queryId]
|
|
2275
|
+
* @property {?string} [queryDisplayField]
|
|
2276
|
+
* @property {?string} [queryValueField]
|
|
2277
|
+
* @property {?string} [dropDownListId]
|
|
2278
|
+
* @property {?string} [defaultValue]
|
|
2279
|
+
*/
|
|
2280
|
+
/**
|
|
2281
|
+
* Create an index field
|
|
2282
|
+
* @param {Object} params - Query parameters
|
|
2283
|
+
* @param {IndexFieldData} data - Request body
|
|
2284
|
+
* @returns {Promise<string>}
|
|
2285
|
+
*/
|
|
2286
|
+
createIndexField(params, data) {
|
|
2287
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields;
|
|
2288
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2289
|
+
const opts = { method: "POST" };
|
|
2290
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2291
|
+
}
|
|
2292
|
+
/**
|
|
2293
|
+
* Update an index field
|
|
2294
|
+
* @param {Object} params - Query parameters
|
|
2295
|
+
* @param {string} id - Index field id
|
|
2296
|
+
* @param {IndexFieldData} data - Request body
|
|
2297
|
+
* @returns {Promise<string>}
|
|
2298
|
+
*/
|
|
2299
|
+
updateIndexField(params, id, data) {
|
|
2300
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
|
|
2301
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2302
|
+
const opts = { method: "PUT" };
|
|
2303
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2304
|
+
}
|
|
2305
|
+
deleteIndexField(params, id) {
|
|
2306
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
|
|
2307
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2308
|
+
const opts = { method: "DELETE" };
|
|
2309
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2310
|
+
}
|
|
2311
|
+
moveIndexFieldAfter(params, sourceFieldId, destinationFieldId) {
|
|
2312
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/MoveIndexFieldAfter";
|
|
2313
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2314
|
+
const opts = { method: "POST" };
|
|
2315
|
+
const data = { sourceFieldId, destinationFieldId };
|
|
2316
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2317
|
+
}
|
|
2318
|
+
addIndexFieldToFolder(indexFieldId, folderId) {
|
|
2319
|
+
const resourceUri = this._httpHelper._config.ResourceUri.IndexFieldsFolder.replace("{id}", indexFieldId).replace("{folderId}", folderId);
|
|
2320
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2321
|
+
const opts = { method: "PUT" };
|
|
2322
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2323
|
+
}
|
|
2087
2324
|
};
|
|
2088
2325
|
|
|
2089
2326
|
// lib/vvRestApi/outsideProcessesManager.js
|
|
@@ -2170,6 +2407,12 @@ var ReportsManager = class {
|
|
|
2170
2407
|
constructor(httpHelper) {
|
|
2171
2408
|
this._httpHelper = httpHelper;
|
|
2172
2409
|
}
|
|
2410
|
+
getReports(params) {
|
|
2411
|
+
const resourceUri = this._httpHelper._config.ResourceUri.Reports;
|
|
2412
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2413
|
+
const opts = { method: "GET" };
|
|
2414
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2415
|
+
}
|
|
2173
2416
|
getReportPDF(reportId, params) {
|
|
2174
2417
|
const resourceUri = this._httpHelper._config.ResourceUri.ReportServerPDF.replace("{id}", reportId);
|
|
2175
2418
|
const url = this._httpHelper.getUrl(resourceUri);
|
|
@@ -2178,6 +2421,102 @@ var ReportsManager = class {
|
|
|
2178
2421
|
}
|
|
2179
2422
|
};
|
|
2180
2423
|
|
|
2424
|
+
// lib/vvRestApi/languageResourcesManager.js
|
|
2425
|
+
init_esm_shims();
|
|
2426
|
+
var LanguageResourcesManager = class {
|
|
2427
|
+
constructor(httpHelper, baseUrl) {
|
|
2428
|
+
this._httpHelper = httpHelper;
|
|
2429
|
+
this._baseUrl = baseUrl;
|
|
2430
|
+
this._apiUrl = httpHelper._config.BaseApiUri;
|
|
2431
|
+
}
|
|
2432
|
+
getLanguageAreas(params) {
|
|
2433
|
+
const resourceUri = this._httpHelper._config.ResourceUri.LanguageAreas;
|
|
2434
|
+
const url = this._baseUrl + this._apiUrl + resourceUri;
|
|
2435
|
+
const opts = { method: "GET" };
|
|
2436
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2437
|
+
}
|
|
2438
|
+
getLanguages(params) {
|
|
2439
|
+
const resourceUri = this._httpHelper._config.ResourceUri.Languages;
|
|
2440
|
+
const url = this._baseUrl + this._apiUrl + resourceUri;
|
|
2441
|
+
const opts = { method: "GET" };
|
|
2442
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2443
|
+
}
|
|
2444
|
+
exportLanguages(params) {
|
|
2445
|
+
const resourceUri = this._httpHelper._config.ResourceUri.ExportLanguages;
|
|
2446
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2447
|
+
const opts = { method: "GETSTREAM" };
|
|
2448
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2449
|
+
}
|
|
2450
|
+
importLanguages(params, fileData, fileName) {
|
|
2451
|
+
const resourceUri = this._httpHelper._config.ResourceUri.ImportLanguages;
|
|
2452
|
+
const url = this._httpHelper.getUrl(resourceUri) + `?area=${params.area}&lang=${params.lang}`;
|
|
2453
|
+
const opts = { method: "POSTSTREAM" };
|
|
2454
|
+
const data = { fileName };
|
|
2455
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, data, fileData);
|
|
2456
|
+
}
|
|
2457
|
+
};
|
|
2458
|
+
|
|
2459
|
+
// lib/vvRestApi/dropdownListsManager.js
|
|
2460
|
+
init_esm_shims();
|
|
2461
|
+
var DropdownListsManager = class {
|
|
2462
|
+
constructor(httpHelper) {
|
|
2463
|
+
this._httpHelper = httpHelper;
|
|
2464
|
+
}
|
|
2465
|
+
getDropDownLists(params) {
|
|
2466
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownLists;
|
|
2467
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2468
|
+
const opts = { method: "GET" };
|
|
2469
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2470
|
+
}
|
|
2471
|
+
getDropDownListById(params, listId) {
|
|
2472
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
|
|
2473
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2474
|
+
const opts = { method: "GET" };
|
|
2475
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2476
|
+
}
|
|
2477
|
+
getDropDownListItemsById(params, listId) {
|
|
2478
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsIdItems.replace("{id}", listId);
|
|
2479
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2480
|
+
const opts = { method: "GET" };
|
|
2481
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2482
|
+
}
|
|
2483
|
+
addDropDownList(params, ddName, ddDescription, ddItems) {
|
|
2484
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownLists;
|
|
2485
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2486
|
+
const opts = { method: "POST" };
|
|
2487
|
+
const data = {
|
|
2488
|
+
Name: ddName,
|
|
2489
|
+
Description: ddDescription,
|
|
2490
|
+
Items: ddItems
|
|
2491
|
+
};
|
|
2492
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2493
|
+
}
|
|
2494
|
+
deleteDropDownList(params, listId) {
|
|
2495
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
|
|
2496
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2497
|
+
const opts = { method: "DELETE" };
|
|
2498
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
2499
|
+
}
|
|
2500
|
+
updateDropDownList(params, listId, ddName, ddDescription, items) {
|
|
2501
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
|
|
2502
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2503
|
+
const opts = { method: "PUT" };
|
|
2504
|
+
const data = {
|
|
2505
|
+
Name: ddName,
|
|
2506
|
+
Description: ddDescription,
|
|
2507
|
+
Items: items
|
|
2508
|
+
};
|
|
2509
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
2510
|
+
}
|
|
2511
|
+
deleteDropDownListItem(params, listId, itemIds) {
|
|
2512
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsIdItems.replace("{id}", listId);
|
|
2513
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2514
|
+
const opts = { method: "DELETE" };
|
|
2515
|
+
const mergedParams = { ...params, itemIds };
|
|
2516
|
+
return this._httpHelper.doVvClientRequest(url, opts, mergedParams, null);
|
|
2517
|
+
}
|
|
2518
|
+
};
|
|
2519
|
+
|
|
2181
2520
|
// lib/VVRestApi.js
|
|
2182
2521
|
var debug5 = createDebug5("visualvault:api");
|
|
2183
2522
|
var __filename7 = fileURLToPath7(import.meta.url);
|
|
@@ -2225,6 +2564,10 @@ var VVClient = class {
|
|
|
2225
2564
|
layouts;
|
|
2226
2565
|
/** @type {*} */
|
|
2227
2566
|
reports;
|
|
2567
|
+
/** @type {*} */
|
|
2568
|
+
languageResources;
|
|
2569
|
+
/** @type {*} */
|
|
2570
|
+
dropdownLists;
|
|
2228
2571
|
/**
|
|
2229
2572
|
* @param {*} sessionToken - Session token from authentication
|
|
2230
2573
|
*/
|
|
@@ -2253,66 +2596,13 @@ var VVClient = class {
|
|
|
2253
2596
|
this.securityMembers = new SecurityMembersManager(this._httpHelper);
|
|
2254
2597
|
this.layouts = new LayoutsManager(this._httpHelper);
|
|
2255
2598
|
this.reports = new ReportsManager(this._httpHelper);
|
|
2256
|
-
this.
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
throw new ReferenceError("Document Api not enabled");
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
});
|
|
2268
|
-
this._formsApi = null;
|
|
2269
|
-
Object.defineProperties(this, {
|
|
2270
|
-
formsApi: {
|
|
2271
|
-
get: function() {
|
|
2272
|
-
if (this._formsApi != null && this._formsApi.isEnabled && this._formsApi.baseUrl) {
|
|
2273
|
-
return this._formsApi;
|
|
2274
|
-
} else {
|
|
2275
|
-
throw new ReferenceError("Forms Api not enabled");
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
});
|
|
2280
|
-
this._objectsApi = null;
|
|
2281
|
-
Object.defineProperties(this, {
|
|
2282
|
-
objectsApi: {
|
|
2283
|
-
get: function() {
|
|
2284
|
-
if (this._objectsApi != null && this._objectsApi.isEnabled && this._objectsApi.baseUrl) {
|
|
2285
|
-
return this._objectsApi;
|
|
2286
|
-
} else {
|
|
2287
|
-
throw new ReferenceError("Objects Api not enabled");
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
});
|
|
2292
|
-
this._studioApi = null;
|
|
2293
|
-
Object.defineProperties(this, {
|
|
2294
|
-
studioApi: {
|
|
2295
|
-
get: function() {
|
|
2296
|
-
if (this._studioApi != null && this._studioApi.isEnabled && this._studioApi.baseUrl) {
|
|
2297
|
-
return this._studioApi;
|
|
2298
|
-
} else {
|
|
2299
|
-
throw new ReferenceError("Studio Api not enabled");
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
});
|
|
2304
|
-
this._notificationsApi = null;
|
|
2305
|
-
Object.defineProperties(this, {
|
|
2306
|
-
notificationsApi: {
|
|
2307
|
-
get: function() {
|
|
2308
|
-
if (this._notificationsApi != null && this._notificationsApi.isEnabled && this._notificationsApi.baseUrl) {
|
|
2309
|
-
return this._notificationsApi;
|
|
2310
|
-
} else {
|
|
2311
|
-
throw new ReferenceError("Notifications Api not enabled");
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
});
|
|
2599
|
+
this.languageResources = new LanguageResourcesManager(this._httpHelper, sessionToken.baseUrl);
|
|
2600
|
+
this.dropdownLists = new DropdownListsManager(this._httpHelper);
|
|
2601
|
+
this.docApi = null;
|
|
2602
|
+
this.formsApi = null;
|
|
2603
|
+
this.objectsApi = null;
|
|
2604
|
+
this.studioApi = null;
|
|
2605
|
+
this.notificationsApi = null;
|
|
2316
2606
|
}
|
|
2317
2607
|
async createDocApi(sessionToken) {
|
|
2318
2608
|
const docApiConfigResponse = JSON.parse(await this.configuration.getDocApiConfig());
|
|
@@ -2321,12 +2611,12 @@ var VVClient = class {
|
|
|
2321
2611
|
docApiSession.baseUrl = docApiConfigResponse.data["apiUrl"];
|
|
2322
2612
|
docApiSession.apiUrl = this.yamlConfig.DocApiUri;
|
|
2323
2613
|
if (docApiSession["tokenType"] == "jwt") {
|
|
2324
|
-
this.
|
|
2614
|
+
this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
|
|
2325
2615
|
} else if (this.users) {
|
|
2326
2616
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(docApiSession.audience));
|
|
2327
2617
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2328
2618
|
docApiSession.convertToJwt(jwtResponse["data"]);
|
|
2329
|
-
this.
|
|
2619
|
+
this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
|
|
2330
2620
|
}
|
|
2331
2621
|
}
|
|
2332
2622
|
}
|
|
@@ -2338,12 +2628,12 @@ var VVClient = class {
|
|
|
2338
2628
|
formsApiSession.baseUrl = formsApiConfigResponse.data["formsApiUrl"];
|
|
2339
2629
|
formsApiSession.apiUrl = this.yamlConfig.FormsApiUri;
|
|
2340
2630
|
if (formsApiSession["tokenType"] == "jwt") {
|
|
2341
|
-
this.
|
|
2631
|
+
this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
|
|
2342
2632
|
} else if (this.users) {
|
|
2343
2633
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(formsApiSession.audience));
|
|
2344
2634
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2345
2635
|
formsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2346
|
-
this.
|
|
2636
|
+
this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
|
|
2347
2637
|
}
|
|
2348
2638
|
}
|
|
2349
2639
|
}
|
|
@@ -2355,12 +2645,12 @@ var VVClient = class {
|
|
|
2355
2645
|
objectsApiSession.baseUrl = objectsApiConfigResponse.data["apiUrl"];
|
|
2356
2646
|
objectsApiSession.apiUrl = "";
|
|
2357
2647
|
if (objectsApiSession["tokenType"] == "jwt") {
|
|
2358
|
-
this.
|
|
2648
|
+
this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
|
|
2359
2649
|
} else if (this.users) {
|
|
2360
2650
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(objectsApiSession.audience));
|
|
2361
2651
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2362
2652
|
objectsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2363
|
-
this.
|
|
2653
|
+
this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
|
|
2364
2654
|
}
|
|
2365
2655
|
}
|
|
2366
2656
|
}
|
|
@@ -2372,12 +2662,12 @@ var VVClient = class {
|
|
|
2372
2662
|
studioApiSession.baseUrl = studioApiConfigResponse.data["studioApiUrl"];
|
|
2373
2663
|
studioApiSession.apiUrl = "";
|
|
2374
2664
|
if (studioApiSession["tokenType"] == "jwt") {
|
|
2375
|
-
this.
|
|
2665
|
+
this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
|
|
2376
2666
|
} else if (this.users) {
|
|
2377
2667
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(studioApiSession.audience));
|
|
2378
2668
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2379
2669
|
studioApiSession.convertToJwt(jwtResponse["data"]);
|
|
2380
|
-
this.
|
|
2670
|
+
this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
|
|
2381
2671
|
}
|
|
2382
2672
|
}
|
|
2383
2673
|
}
|
|
@@ -2389,12 +2679,12 @@ var VVClient = class {
|
|
|
2389
2679
|
notificationsApiSession.baseUrl = notificationsApiConfigResponse.data["apiUrl"];
|
|
2390
2680
|
notificationsApiSession.apiUrl = this.yamlConfig.NotificationsApiUri;
|
|
2391
2681
|
if (notificationsApiSession["tokenType"] == "jwt") {
|
|
2392
|
-
this.
|
|
2682
|
+
this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
|
|
2393
2683
|
} else if (this.users) {
|
|
2394
2684
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(notificationsApiSession.audience));
|
|
2395
2685
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2396
2686
|
notificationsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2397
|
-
this.
|
|
2687
|
+
this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
|
|
2398
2688
|
}
|
|
2399
2689
|
}
|
|
2400
2690
|
}
|