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.
@@ -604,12 +604,18 @@ var common_default = {
604
604
  authorize: Authorize
605
605
  };
606
606
 
607
- // lib/docApi/documentInstanceManager.js
607
+ // lib/docApi/documentManager.js
608
608
  init_cjs_shims();
609
- var DocumentInstanceManager = class {
609
+ var DocumentManager = class {
610
610
  constructor(httpHelper) {
611
611
  this._httpHelper = httpHelper;
612
612
  }
613
+ async createDocument(data) {
614
+ const resourceUri = this._httpHelper._config.ResourceUri.DocApi.CreateDocument;
615
+ const url = this._httpHelper.getUrl(resourceUri);
616
+ const opts = { method: "POST" };
617
+ return this._httpHelper.doVvClientRequest(url, opts, null, data);
618
+ }
613
619
  async GetRevision(documentRevisionId) {
614
620
  let resourceUri = this._httpHelper._config.ResourceUri.DocApi.GetRevision;
615
621
  resourceUri = resourceUri.replace("{id}", documentRevisionId);
@@ -631,6 +637,13 @@ var DocumentInstanceManager = class {
631
637
  const opts = { method: "PUT" };
632
638
  return this._httpHelper.doVvClientRequest(url, opts, null, data);
633
639
  }
640
+ async updateDocument(documentId, data) {
641
+ let resourceUri = this._httpHelper._config.ResourceUri.DocApi.UpdateDocument;
642
+ resourceUri = resourceUri.replace("{id}", documentId);
643
+ const url = this._httpHelper.getUrl(resourceUri);
644
+ const opts = { method: "PUT" };
645
+ return this._httpHelper.doVvClientRequest(url, opts, null, data);
646
+ }
634
647
  async search(criteriaList, searchFolders, excludeFolders, sortBy, sortDirection = "desc", page = 0, take = 15, archiveType = 0, roleSecurity = false) {
635
648
  const url = this._httpHelper.getUrl(this._httpHelper._config.ResourceUri.DocApi.AdvancedSearch);
636
649
  const data = {
@@ -667,7 +680,7 @@ var DocApi = class {
667
680
  this.baseUrl = docApiConfig["apiUrl"] || null;
668
681
  this.roleSecurity = docApiConfig["roleSecurity"] || false;
669
682
  if (this.isEnabled) {
670
- this.documentInstances = new DocumentInstanceManager(this._httpHelper);
683
+ this.documents = new DocumentManager(this._httpHelper);
671
684
  }
672
685
  }
673
686
  };
@@ -726,9 +739,9 @@ var FormsApi_default = FormsApi;
726
739
  // lib/ObjectsApi.js
727
740
  init_cjs_shims();
728
741
 
729
- // lib/objectsApi/modelsManager.js
742
+ // lib/objectsApi/modelManager.js
730
743
  init_cjs_shims();
731
- var ModelsManager = class {
744
+ var ModelManager = class {
732
745
  constructor(httpHelper) {
733
746
  this._httpHelper = httpHelper;
734
747
  }
@@ -757,11 +770,11 @@ var ModelsManager = class {
757
770
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
758
771
  }
759
772
  };
760
- var modelsManager_default = ModelsManager;
773
+ var modelManager_default = ModelManager;
761
774
 
762
- // lib/objectsApi/objectsManager.js
775
+ // lib/objectsApi/objectManager.js
763
776
  init_cjs_shims();
764
- var ObjectsManager = class {
777
+ var ObjectManager = class {
765
778
  constructor(httpHelper) {
766
779
  this._httpHelper = httpHelper;
767
780
  }
@@ -839,7 +852,7 @@ var ObjectsManager = class {
839
852
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
840
853
  }
841
854
  };
842
- var objectsManager_default = ObjectsManager;
855
+ var objectManager_default = ObjectManager;
843
856
 
844
857
  // lib/ObjectsApi.js
845
858
  var import_js_yaml4 = __toESM(require("js-yaml"), 1);
@@ -858,8 +871,8 @@ var ObjectsApi = class {
858
871
  this.isEnabled = objectsApiConfig["isEnabled"] || false;
859
872
  this.baseUrl = objectsApiConfig["apiUrl"] || null;
860
873
  if (this.isEnabled) {
861
- this.models = new modelsManager_default(this._httpHelper);
862
- this.objects = new objectsManager_default(this._httpHelper);
874
+ this.models = new modelManager_default(this._httpHelper);
875
+ this.objects = new objectManager_default(this._httpHelper);
863
876
  }
864
877
  }
865
878
  };
@@ -968,6 +981,27 @@ var WorkflowManager = class {
968
981
  };
969
982
  var workflowManager_default = WorkflowManager;
970
983
 
984
+ // lib/studioApi/rolesAndPermissionsManager.js
985
+ init_cjs_shims();
986
+ var RolesAndPermissionsManager = class {
987
+ constructor(httpHelper) {
988
+ this._httpHelper = httpHelper;
989
+ }
990
+ /**
991
+ * Retrieves available features for the requesting user
992
+ * @param {object} params - Optional URL parameters to include in the request
993
+ */
994
+ async getUserFeatures(params) {
995
+ var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.ResourceUserFeatures;
996
+ var url = this._httpHelper.getUrl(resourceUri);
997
+ var opts = { method: "GET" };
998
+ var data = {};
999
+ params = params || {};
1000
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
1001
+ }
1002
+ };
1003
+ var rolesAndPermissionsManager_default = RolesAndPermissionsManager;
1004
+
971
1005
  // lib/StudioApi.js
972
1006
  var import_js_yaml5 = __toESM(require("js-yaml"), 1);
973
1007
  var import_fs5 = __toESM(require("fs"), 1);
@@ -986,6 +1020,7 @@ var StudioApi = class {
986
1020
  this.baseUrl = studioApiConfig["studioApiUrl"] || null;
987
1021
  if (this.isEnabled) {
988
1022
  this.workflow = new workflowManager_default(this._httpHelper);
1023
+ this.permissions = new rolesAndPermissionsManager_default(this._httpHelper);
989
1024
  }
990
1025
  }
991
1026
  };
@@ -1507,6 +1542,30 @@ var GroupsManager = class {
1507
1542
  const opts = { method: "GET" };
1508
1543
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
1509
1544
  }
1545
+ getGroupById(params, groupId) {
1546
+ const resourceUri = this._httpHelper._config.ResourceUri.GroupById.replace("{id}", groupId);
1547
+ const url = this._httpHelper.getUrl(resourceUri);
1548
+ const opts = { method: "GET" };
1549
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
1550
+ }
1551
+ addGroup(params, formData) {
1552
+ const resourceUri = this._httpHelper._config.ResourceUri.AddGroup;
1553
+ const url = this._httpHelper.getUrl(resourceUri);
1554
+ const opts = { method: "POST" };
1555
+ return this._httpHelper.doVvClientRequest(url, opts, params, formData);
1556
+ }
1557
+ updateGroup(params, groupId, formData) {
1558
+ const resourceUri = this._httpHelper._config.ResourceUri.UpdateGroup.replace("{id}", groupId);
1559
+ const url = this._httpHelper.getUrl(resourceUri);
1560
+ const opts = { method: "PUT" };
1561
+ return this._httpHelper.doVvClientRequest(url, opts, params, formData);
1562
+ }
1563
+ deleteGroup(params, groupId) {
1564
+ const resourceUri = this._httpHelper._config.ResourceUri.DeleteGroup.replace("{id}", groupId);
1565
+ const url = this._httpHelper.getUrl(resourceUri);
1566
+ const opts = { method: "DELETE" };
1567
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
1568
+ }
1510
1569
  getGroupsUsers(params, groupId) {
1511
1570
  const resourceUri = this._httpHelper._config.ResourceUri.GroupsUsers.replace("{id}", groupId);
1512
1571
  const url = this._httpHelper.getUrl(resourceUri);
@@ -1577,6 +1636,12 @@ var LibraryManager = class {
1577
1636
  const opts = { method: "GET" };
1578
1637
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
1579
1638
  }
1639
+ getFolderByPath(params, folderPath) {
1640
+ const resourceUri = this._httpHelper._config.ResourceUri.Folders + "?folderpath=" + encodeURIComponent(folderPath);
1641
+ const url = this._httpHelper.getUrl(resourceUri);
1642
+ const opts = { method: "GET" };
1643
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
1644
+ }
1580
1645
  updateFolderIndexFieldOverrideSettings(folderId, fieldId, queryId, displayField, valueField, dropDownListId, required, defaultValue) {
1581
1646
  const data = {
1582
1647
  queryId,
@@ -1661,8 +1726,8 @@ var SitesManager = class {
1661
1726
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1662
1727
  }
1663
1728
  putSites(params, data, siteId) {
1664
- const resourceUri = this._httpHelper._config.ResourceUri.Sites;
1665
- const url = this._httpHelper.getUrl(resourceUri + "/" + siteId);
1729
+ const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
1730
+ const url = this._httpHelper.getUrl(resourceUri);
1666
1731
  const opts = { method: "PUT" };
1667
1732
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1668
1733
  }
@@ -1679,8 +1744,8 @@ var SitesManager = class {
1679
1744
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1680
1745
  }
1681
1746
  putGroups(params, data, siteId, grId) {
1682
- const resourceUri = this._httpHelper._config.ResourceUri.Groups.replace("{id}", siteId);
1683
- const url = this._httpHelper.getUrl(resourceUri + "/" + grId);
1747
+ const resourceUri = this._httpHelper._config.ResourceUri.SiteGroupById.replace("{siteId}", siteId).replace("{groupId}", grId);
1748
+ const url = this._httpHelper.getUrl(resourceUri);
1684
1749
  const opts = { method: "PUT" };
1685
1750
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1686
1751
  }
@@ -1694,6 +1759,28 @@ var SitesManager = class {
1694
1759
  };
1695
1760
  return this._httpHelper.doVvClientRequest(url, opts, null, data);
1696
1761
  }
1762
+ getSiteById(params, siteId) {
1763
+ const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
1764
+ const url = this._httpHelper.getUrl(resourceUri);
1765
+ const opts = { method: "GET" };
1766
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
1767
+ }
1768
+ deleteSite(params, siteId) {
1769
+ const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
1770
+ const url = this._httpHelper.getUrl(resourceUri);
1771
+ const opts = { method: "DELETE" };
1772
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
1773
+ }
1774
+ changeGroupSite(params, groupId, newSiteId) {
1775
+ const resourceUri = this._httpHelper._config.ResourceUri.ChangeGroupSite;
1776
+ const data = {
1777
+ groupId,
1778
+ newSiteId
1779
+ };
1780
+ const url = this._httpHelper.getUrl(resourceUri);
1781
+ const opts = { method: "PUT" };
1782
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
1783
+ }
1697
1784
  };
1698
1785
 
1699
1786
  // lib/vvRestApi/usersManager.js
@@ -1773,9 +1860,8 @@ var UsersManager = class {
1773
1860
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
1774
1861
  }
1775
1862
  getCurrentUser() {
1776
- const resourceUri = this._httpHelper._config.ResourceUri.UsersWhoAmI;
1777
- const baseUrl = this._httpHelper._sessionToken.baseUrl;
1778
- const url = baseUrl + "/api/v1" + resourceUri;
1863
+ const resourceUri = this._httpHelper._config.ResourceUri.UsersMe;
1864
+ const url = this._httpHelper.getUrl(resourceUri);
1779
1865
  const opts = { method: "GET" };
1780
1866
  const params = [];
1781
1867
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
@@ -2071,6 +2157,93 @@ var DocumentsManager = class {
2071
2157
  };
2072
2158
  return this._httpHelper.doVvClientRequest(url, opts, null, data);
2073
2159
  }
2160
+ getDocumentWebDavUrl(documentId) {
2161
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWebDavUrl.replace("{id}", documentId);
2162
+ const url = this._httpHelper.getUrl(resourceUri);
2163
+ const opts = { method: "GET" };
2164
+ return this._httpHelper.doVvClientRequest(url, opts, null, null);
2165
+ }
2166
+ getDocumentWopiUrl(documentId) {
2167
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWopiUrl.replace("{id}", documentId);
2168
+ const url = this._httpHelper.getUrl(resourceUri);
2169
+ const opts = { method: "GET" };
2170
+ return this._httpHelper.doVvClientRequest(url, opts, null, null);
2171
+ }
2172
+ createDocumentZipFile(params, documentIds) {
2173
+ const resourceUri = this._httpHelper._config.ResourceUri.CreateDocumentZipFile;
2174
+ const url = this._httpHelper.getUrl(resourceUri);
2175
+ const opts = { method: "POST" };
2176
+ const data = { documentDhIds: documentIds };
2177
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2178
+ }
2179
+ getDocumentZipFileStatus(params, downloadKey) {
2180
+ const resourceUri = this._httpHelper._config.ResourceUri.GetDocumentZipFileStatus + `?downloadKey=${encodeURIComponent(downloadKey)}`;
2181
+ const url = this._httpHelper.getUrl(resourceUri);
2182
+ const opts = { method: "GET" };
2183
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2184
+ }
2185
+ getDocumentIndexFields(params, documentId) {
2186
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentIndexFields.replace("{id}", documentId);
2187
+ const url = this._httpHelper.getUrl(resourceUri);
2188
+ const opts = { method: "GET" };
2189
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2190
+ }
2191
+ getDocumentTypes(params) {
2192
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentTypes;
2193
+ const url = this._httpHelper.getUrl(resourceUri);
2194
+ const opts = { method: "GET" };
2195
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2196
+ }
2197
+ createDocumentType(params, name) {
2198
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentTypes;
2199
+ const url = this._httpHelper.getUrl(resourceUri);
2200
+ const opts = { method: "POST" };
2201
+ const data = { documentTypeName: name };
2202
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2203
+ }
2204
+ getSavedSearches(params) {
2205
+ const resourceUri = this._httpHelper._config.ResourceUri.SavedSearches;
2206
+ const url = this._httpHelper.getUrl(resourceUri);
2207
+ const opts = { method: "GET" };
2208
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2209
+ }
2210
+ getDocumentFields(params) {
2211
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentFields;
2212
+ const url = this._httpHelper.getUrl(resourceUri);
2213
+ const opts = { method: "GET" };
2214
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2215
+ }
2216
+ getSavedSearchIndexFields(params, savedSearchId) {
2217
+ const resourceUri = this._httpHelper._config.ResourceUri.SavedSearchIndexFields;
2218
+ const url = this._httpHelper.getUrl(resourceUri);
2219
+ const opts = { method: "GET" };
2220
+ const mergedParams = { ...params, savedSearchId };
2221
+ return this._httpHelper.doVvClientRequest(url, opts, mergedParams, null);
2222
+ }
2223
+ getLastDocuments(params) {
2224
+ const resourceUri = this._httpHelper._config.ResourceUri.LastDocuments;
2225
+ const url = this._httpHelper.getUrl(resourceUri);
2226
+ const opts = { method: "GET" };
2227
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2228
+ }
2229
+ getFrequentDocuments(params) {
2230
+ const resourceUri = this._httpHelper._config.ResourceUri.FrequentDocuments;
2231
+ const url = this._httpHelper.getUrl(resourceUri);
2232
+ const opts = { method: "GET" };
2233
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2234
+ }
2235
+ getSavedSearchDocuments(params, savedSearchId) {
2236
+ const resourceUri = this._httpHelper._config.ResourceUri.SavedSearchDocuments.replace("{savedSearchId}", savedSearchId);
2237
+ const url = this._httpHelper.getUrl(resourceUri);
2238
+ const opts = { method: "GET" };
2239
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2240
+ }
2241
+ getDocumentDefaultLink(params, documentId) {
2242
+ const resourceUri = this._httpHelper._config.ResourceUri.DocumentDefaultAction.replace("{documentId}", documentId);
2243
+ const url = this._httpHelper.getUrl(resourceUri);
2244
+ const opts = { method: "GET" };
2245
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2246
+ }
2074
2247
  };
2075
2248
 
2076
2249
  // lib/vvRestApi/projectsManager.js
@@ -2111,6 +2284,70 @@ var IndexFieldsManager = class {
2111
2284
  const opts = { method: "GET" };
2112
2285
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
2113
2286
  }
2287
+ getIndexField(params, id) {
2288
+ const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
2289
+ const url = this._httpHelper.getUrl(resourceUri);
2290
+ const opts = { method: "GET" };
2291
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2292
+ }
2293
+ /**
2294
+ * Payload for creating/updating index fields.
2295
+ * @typedef {Object} IndexFieldData
2296
+ * @property {string} fieldType
2297
+ * @property {string} label
2298
+ * @property {string} [description]
2299
+ * @property {boolean} [required]
2300
+ * @property {?string} [connectionId]
2301
+ * @property {?string} [queryId]
2302
+ * @property {?string} [queryDisplayField]
2303
+ * @property {?string} [queryValueField]
2304
+ * @property {?string} [dropDownListId]
2305
+ * @property {?string} [defaultValue]
2306
+ */
2307
+ /**
2308
+ * Create an index field
2309
+ * @param {Object} params - Query parameters
2310
+ * @param {IndexFieldData} data - Request body
2311
+ * @returns {Promise<string>}
2312
+ */
2313
+ createIndexField(params, data) {
2314
+ const resourceUri = this._httpHelper._config.ResourceUri.IndexFields;
2315
+ const url = this._httpHelper.getUrl(resourceUri);
2316
+ const opts = { method: "POST" };
2317
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2318
+ }
2319
+ /**
2320
+ * Update an index field
2321
+ * @param {Object} params - Query parameters
2322
+ * @param {string} id - Index field id
2323
+ * @param {IndexFieldData} data - Request body
2324
+ * @returns {Promise<string>}
2325
+ */
2326
+ updateIndexField(params, id, data) {
2327
+ const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
2328
+ const url = this._httpHelper.getUrl(resourceUri);
2329
+ const opts = { method: "PUT" };
2330
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2331
+ }
2332
+ deleteIndexField(params, id) {
2333
+ const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/" + id;
2334
+ const url = this._httpHelper.getUrl(resourceUri);
2335
+ const opts = { method: "DELETE" };
2336
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2337
+ }
2338
+ moveIndexFieldAfter(params, sourceFieldId, destinationFieldId) {
2339
+ const resourceUri = this._httpHelper._config.ResourceUri.IndexFields + "/MoveIndexFieldAfter";
2340
+ const url = this._httpHelper.getUrl(resourceUri);
2341
+ const opts = { method: "POST" };
2342
+ const data = { sourceFieldId, destinationFieldId };
2343
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2344
+ }
2345
+ addIndexFieldToFolder(indexFieldId, folderId) {
2346
+ const resourceUri = this._httpHelper._config.ResourceUri.IndexFieldsFolder.replace("{id}", indexFieldId).replace("{folderId}", folderId);
2347
+ const url = this._httpHelper.getUrl(resourceUri);
2348
+ const opts = { method: "PUT" };
2349
+ return this._httpHelper.doVvClientRequest(url, opts, null, null);
2350
+ }
2114
2351
  };
2115
2352
 
2116
2353
  // lib/vvRestApi/outsideProcessesManager.js
@@ -2197,6 +2434,12 @@ var ReportsManager = class {
2197
2434
  constructor(httpHelper) {
2198
2435
  this._httpHelper = httpHelper;
2199
2436
  }
2437
+ getReports(params) {
2438
+ const resourceUri = this._httpHelper._config.ResourceUri.Reports;
2439
+ const url = this._httpHelper.getUrl(resourceUri);
2440
+ const opts = { method: "GET" };
2441
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2442
+ }
2200
2443
  getReportPDF(reportId, params) {
2201
2444
  const resourceUri = this._httpHelper._config.ResourceUri.ReportServerPDF.replace("{id}", reportId);
2202
2445
  const url = this._httpHelper.getUrl(resourceUri);
@@ -2205,6 +2448,102 @@ var ReportsManager = class {
2205
2448
  }
2206
2449
  };
2207
2450
 
2451
+ // lib/vvRestApi/languageResourcesManager.js
2452
+ init_cjs_shims();
2453
+ var LanguageResourcesManager = class {
2454
+ constructor(httpHelper, baseUrl) {
2455
+ this._httpHelper = httpHelper;
2456
+ this._baseUrl = baseUrl;
2457
+ this._apiUrl = httpHelper._config.BaseApiUri;
2458
+ }
2459
+ getLanguageAreas(params) {
2460
+ const resourceUri = this._httpHelper._config.ResourceUri.LanguageAreas;
2461
+ const url = this._baseUrl + this._apiUrl + resourceUri;
2462
+ const opts = { method: "GET" };
2463
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2464
+ }
2465
+ getLanguages(params) {
2466
+ const resourceUri = this._httpHelper._config.ResourceUri.Languages;
2467
+ const url = this._baseUrl + this._apiUrl + resourceUri;
2468
+ const opts = { method: "GET" };
2469
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2470
+ }
2471
+ exportLanguages(params) {
2472
+ const resourceUri = this._httpHelper._config.ResourceUri.ExportLanguages;
2473
+ const url = this._httpHelper.getUrl(resourceUri);
2474
+ const opts = { method: "GETSTREAM" };
2475
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2476
+ }
2477
+ importLanguages(params, fileData, fileName) {
2478
+ const resourceUri = this._httpHelper._config.ResourceUri.ImportLanguages;
2479
+ const url = this._httpHelper.getUrl(resourceUri) + `?area=${params.area}&lang=${params.lang}`;
2480
+ const opts = { method: "POSTSTREAM" };
2481
+ const data = { fileName };
2482
+ return this._httpHelper.doVvClientRequest(url, opts, null, data, fileData);
2483
+ }
2484
+ };
2485
+
2486
+ // lib/vvRestApi/dropdownListsManager.js
2487
+ init_cjs_shims();
2488
+ var DropdownListsManager = class {
2489
+ constructor(httpHelper) {
2490
+ this._httpHelper = httpHelper;
2491
+ }
2492
+ getDropDownLists(params) {
2493
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownLists;
2494
+ const url = this._httpHelper.getUrl(resourceUri);
2495
+ const opts = { method: "GET" };
2496
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2497
+ }
2498
+ getDropDownListById(params, listId) {
2499
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
2500
+ const url = this._httpHelper.getUrl(resourceUri);
2501
+ const opts = { method: "GET" };
2502
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2503
+ }
2504
+ getDropDownListItemsById(params, listId) {
2505
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsIdItems.replace("{id}", listId);
2506
+ const url = this._httpHelper.getUrl(resourceUri);
2507
+ const opts = { method: "GET" };
2508
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2509
+ }
2510
+ addDropDownList(params, ddName, ddDescription, ddItems) {
2511
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownLists;
2512
+ const url = this._httpHelper.getUrl(resourceUri);
2513
+ const opts = { method: "POST" };
2514
+ const data = {
2515
+ Name: ddName,
2516
+ Description: ddDescription,
2517
+ Items: ddItems
2518
+ };
2519
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2520
+ }
2521
+ deleteDropDownList(params, listId) {
2522
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
2523
+ const url = this._httpHelper.getUrl(resourceUri);
2524
+ const opts = { method: "DELETE" };
2525
+ return this._httpHelper.doVvClientRequest(url, opts, params, null);
2526
+ }
2527
+ updateDropDownList(params, listId, ddName, ddDescription, items) {
2528
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsId.replace("{id}", listId);
2529
+ const url = this._httpHelper.getUrl(resourceUri);
2530
+ const opts = { method: "PUT" };
2531
+ const data = {
2532
+ Name: ddName,
2533
+ Description: ddDescription,
2534
+ Items: items
2535
+ };
2536
+ return this._httpHelper.doVvClientRequest(url, opts, params, data);
2537
+ }
2538
+ deleteDropDownListItem(params, listId, itemIds) {
2539
+ const resourceUri = this._httpHelper._config.ResourceUri.DropDownListsIdItems.replace("{id}", listId);
2540
+ const url = this._httpHelper.getUrl(resourceUri);
2541
+ const opts = { method: "DELETE" };
2542
+ const mergedParams = { ...params, itemIds };
2543
+ return this._httpHelper.doVvClientRequest(url, opts, mergedParams, null);
2544
+ }
2545
+ };
2546
+
2208
2547
  // lib/VVRestApi.js
2209
2548
  var debug5 = (0, import_debug5.default)("visualvault:api");
2210
2549
  var __filename7 = (0, import_url6.fileURLToPath)(importMetaUrl);
@@ -2252,6 +2591,10 @@ var VVClient = class {
2252
2591
  layouts;
2253
2592
  /** @type {*} */
2254
2593
  reports;
2594
+ /** @type {*} */
2595
+ languageResources;
2596
+ /** @type {*} */
2597
+ dropdownLists;
2255
2598
  /**
2256
2599
  * @param {*} sessionToken - Session token from authentication
2257
2600
  */
@@ -2280,66 +2623,13 @@ var VVClient = class {
2280
2623
  this.securityMembers = new SecurityMembersManager(this._httpHelper);
2281
2624
  this.layouts = new LayoutsManager(this._httpHelper);
2282
2625
  this.reports = new ReportsManager(this._httpHelper);
2283
- this._docApi = null;
2284
- Object.defineProperties(this, {
2285
- docApi: {
2286
- get: function() {
2287
- if (this._docApi != null && this._docApi.isEnabled && this._docApi.baseUrl) {
2288
- return this._docApi;
2289
- } else {
2290
- throw new ReferenceError("Document Api not enabled");
2291
- }
2292
- }
2293
- }
2294
- });
2295
- this._formsApi = null;
2296
- Object.defineProperties(this, {
2297
- formsApi: {
2298
- get: function() {
2299
- if (this._formsApi != null && this._formsApi.isEnabled && this._formsApi.baseUrl) {
2300
- return this._formsApi;
2301
- } else {
2302
- throw new ReferenceError("Forms Api not enabled");
2303
- }
2304
- }
2305
- }
2306
- });
2307
- this._objectsApi = null;
2308
- Object.defineProperties(this, {
2309
- objectsApi: {
2310
- get: function() {
2311
- if (this._objectsApi != null && this._objectsApi.isEnabled && this._objectsApi.baseUrl) {
2312
- return this._objectsApi;
2313
- } else {
2314
- throw new ReferenceError("Objects Api not enabled");
2315
- }
2316
- }
2317
- }
2318
- });
2319
- this._studioApi = null;
2320
- Object.defineProperties(this, {
2321
- studioApi: {
2322
- get: function() {
2323
- if (this._studioApi != null && this._studioApi.isEnabled && this._studioApi.baseUrl) {
2324
- return this._studioApi;
2325
- } else {
2326
- throw new ReferenceError("Studio Api not enabled");
2327
- }
2328
- }
2329
- }
2330
- });
2331
- this._notificationsApi = null;
2332
- Object.defineProperties(this, {
2333
- notificationsApi: {
2334
- get: function() {
2335
- if (this._notificationsApi != null && this._notificationsApi.isEnabled && this._notificationsApi.baseUrl) {
2336
- return this._notificationsApi;
2337
- } else {
2338
- throw new ReferenceError("Notifications Api not enabled");
2339
- }
2340
- }
2341
- }
2342
- });
2626
+ this.languageResources = new LanguageResourcesManager(this._httpHelper, sessionToken.baseUrl);
2627
+ this.dropdownLists = new DropdownListsManager(this._httpHelper);
2628
+ this.docApi = null;
2629
+ this.formsApi = null;
2630
+ this.objectsApi = null;
2631
+ this.studioApi = null;
2632
+ this.notificationsApi = null;
2343
2633
  }
2344
2634
  async createDocApi(sessionToken) {
2345
2635
  const docApiConfigResponse = JSON.parse(await this.configuration.getDocApiConfig());
@@ -2348,12 +2638,12 @@ var VVClient = class {
2348
2638
  docApiSession.baseUrl = docApiConfigResponse.data["apiUrl"];
2349
2639
  docApiSession.apiUrl = this.yamlConfig.DocApiUri;
2350
2640
  if (docApiSession["tokenType"] == "jwt") {
2351
- this._docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
2641
+ this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
2352
2642
  } else if (this.users) {
2353
2643
  const jwtResponse = JSON.parse(await this.users.getUserJwt(docApiSession.audience));
2354
2644
  if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
2355
2645
  docApiSession.convertToJwt(jwtResponse["data"]);
2356
- this._docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
2646
+ this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
2357
2647
  }
2358
2648
  }
2359
2649
  }
@@ -2365,12 +2655,12 @@ var VVClient = class {
2365
2655
  formsApiSession.baseUrl = formsApiConfigResponse.data["formsApiUrl"];
2366
2656
  formsApiSession.apiUrl = this.yamlConfig.FormsApiUri;
2367
2657
  if (formsApiSession["tokenType"] == "jwt") {
2368
- this._formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
2658
+ this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
2369
2659
  } else if (this.users) {
2370
2660
  const jwtResponse = JSON.parse(await this.users.getUserJwt(formsApiSession.audience));
2371
2661
  if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
2372
2662
  formsApiSession.convertToJwt(jwtResponse["data"]);
2373
- this._formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
2663
+ this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
2374
2664
  }
2375
2665
  }
2376
2666
  }
@@ -2382,12 +2672,12 @@ var VVClient = class {
2382
2672
  objectsApiSession.baseUrl = objectsApiConfigResponse.data["apiUrl"];
2383
2673
  objectsApiSession.apiUrl = "";
2384
2674
  if (objectsApiSession["tokenType"] == "jwt") {
2385
- this._objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
2675
+ this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
2386
2676
  } else if (this.users) {
2387
2677
  const jwtResponse = JSON.parse(await this.users.getUserJwt(objectsApiSession.audience));
2388
2678
  if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
2389
2679
  objectsApiSession.convertToJwt(jwtResponse["data"]);
2390
- this._objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
2680
+ this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
2391
2681
  }
2392
2682
  }
2393
2683
  }
@@ -2399,12 +2689,12 @@ var VVClient = class {
2399
2689
  studioApiSession.baseUrl = studioApiConfigResponse.data["studioApiUrl"];
2400
2690
  studioApiSession.apiUrl = "";
2401
2691
  if (studioApiSession["tokenType"] == "jwt") {
2402
- this._studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
2692
+ this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
2403
2693
  } else if (this.users) {
2404
2694
  const jwtResponse = JSON.parse(await this.users.getUserJwt(studioApiSession.audience));
2405
2695
  if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
2406
2696
  studioApiSession.convertToJwt(jwtResponse["data"]);
2407
- this._studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
2697
+ this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
2408
2698
  }
2409
2699
  }
2410
2700
  }
@@ -2416,12 +2706,12 @@ var VVClient = class {
2416
2706
  notificationsApiSession.baseUrl = notificationsApiConfigResponse.data["apiUrl"];
2417
2707
  notificationsApiSession.apiUrl = this.yamlConfig.NotificationsApiUri;
2418
2708
  if (notificationsApiSession["tokenType"] == "jwt") {
2419
- this._notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
2709
+ this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
2420
2710
  } else if (this.users) {
2421
2711
  const jwtResponse = JSON.parse(await this.users.getUserJwt(notificationsApiSession.audience));
2422
2712
  if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
2423
2713
  notificationsApiSession.convertToJwt(jwtResponse["data"]);
2424
- this._notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
2714
+ this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
2425
2715
  }
2426
2716
  }
2427
2717
  }