visualvault-api 2.0.0-beta.2 → 2.0.0

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/dist/index.js CHANGED
@@ -583,6 +583,12 @@ 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 DocumentManager = 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 = {
@@ -1502,6 +1515,30 @@ var GroupsManager = class {
1502
1515
  const opts = { method: "GET" };
1503
1516
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
1504
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
+ }
1505
1542
  getGroupsUsers(params, groupId) {
1506
1543
  const resourceUri = this._httpHelper._config.ResourceUri.GroupsUsers.replace("{id}", groupId);
1507
1544
  const url = this._httpHelper.getUrl(resourceUri);
@@ -1572,6 +1609,12 @@ var LibraryManager = class {
1572
1609
  const opts = { method: "GET" };
1573
1610
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
1574
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
+ }
1575
1618
  updateFolderIndexFieldOverrideSettings(folderId, fieldId, queryId, displayField, valueField, dropDownListId, required, defaultValue) {
1576
1619
  const data = {
1577
1620
  queryId,
@@ -1656,8 +1699,8 @@ var SitesManager = class {
1656
1699
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1657
1700
  }
1658
1701
  putSites(params, data, siteId) {
1659
- const resourceUri = this._httpHelper._config.ResourceUri.Sites;
1660
- const url = this._httpHelper.getUrl(resourceUri + "/" + siteId);
1702
+ const resourceUri = this._httpHelper._config.ResourceUri.SiteById.replace("{id}", siteId);
1703
+ const url = this._httpHelper.getUrl(resourceUri);
1661
1704
  const opts = { method: "PUT" };
1662
1705
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1663
1706
  }
@@ -1674,8 +1717,8 @@ var SitesManager = class {
1674
1717
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1675
1718
  }
1676
1719
  putGroups(params, data, siteId, grId) {
1677
- const resourceUri = this._httpHelper._config.ResourceUri.Groups.replace("{id}", siteId);
1678
- const url = this._httpHelper.getUrl(resourceUri + "/" + grId);
1720
+ const resourceUri = this._httpHelper._config.ResourceUri.SiteGroupById.replace("{siteId}", siteId).replace("{groupId}", grId);
1721
+ const url = this._httpHelper.getUrl(resourceUri);
1679
1722
  const opts = { method: "PUT" };
1680
1723
  return this._httpHelper.doVvClientRequest(url, opts, params, data);
1681
1724
  }
@@ -1689,6 +1732,28 @@ var SitesManager = class {
1689
1732
  };
1690
1733
  return this._httpHelper.doVvClientRequest(url, opts, null, data);
1691
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
+ }
1692
1757
  };
1693
1758
 
1694
1759
  // lib/vvRestApi/usersManager.js
@@ -2077,6 +2142,81 @@ var DocumentsManager = class {
2077
2142
  const opts = { method: "GET" };
2078
2143
  return this._httpHelper.doVvClientRequest(url, opts, null, null);
2079
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
+ }
2080
2220
  };
2081
2221
 
2082
2222
  // lib/vvRestApi/projectsManager.js
@@ -2117,6 +2257,70 @@ var IndexFieldsManager = class {
2117
2257
  const opts = { method: "GET" };
2118
2258
  return this._httpHelper.doVvClientRequest(url, opts, params, null);
2119
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
+ }
2120
2324
  };
2121
2325
 
2122
2326
  // lib/vvRestApi/outsideProcessesManager.js
@@ -2203,6 +2407,12 @@ var ReportsManager = class {
2203
2407
  constructor(httpHelper) {
2204
2408
  this._httpHelper = httpHelper;
2205
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
+ }
2206
2416
  getReportPDF(reportId, params) {
2207
2417
  const resourceUri = this._httpHelper._config.ResourceUri.ReportServerPDF.replace("{id}", reportId);
2208
2418
  const url = this._httpHelper.getUrl(resourceUri);
@@ -2211,6 +2421,102 @@ var ReportsManager = class {
2211
2421
  }
2212
2422
  };
2213
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
+
2214
2520
  // lib/VVRestApi.js
2215
2521
  var debug5 = createDebug5("visualvault:api");
2216
2522
  var __filename7 = fileURLToPath7(import.meta.url);
@@ -2258,6 +2564,10 @@ var VVClient = class {
2258
2564
  layouts;
2259
2565
  /** @type {*} */
2260
2566
  reports;
2567
+ /** @type {*} */
2568
+ languageResources;
2569
+ /** @type {*} */
2570
+ dropdownLists;
2261
2571
  /**
2262
2572
  * @param {*} sessionToken - Session token from authentication
2263
2573
  */
@@ -2286,6 +2596,8 @@ var VVClient = class {
2286
2596
  this.securityMembers = new SecurityMembersManager(this._httpHelper);
2287
2597
  this.layouts = new LayoutsManager(this._httpHelper);
2288
2598
  this.reports = new ReportsManager(this._httpHelper);
2599
+ this.languageResources = new LanguageResourcesManager(this._httpHelper, sessionToken.baseUrl);
2600
+ this.dropdownLists = new DropdownListsManager(this._httpHelper);
2289
2601
  this.docApi = null;
2290
2602
  this.formsApi = null;
2291
2603
  this.objectsApi = null;