@esri/hub-common 9.19.0 → 9.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/es2017/content/_internal.js +70 -0
  2. package/dist/es2017/content/_internal.js.map +1 -1
  3. package/dist/es2017/content/compose.js +4 -1
  4. package/dist/es2017/content/compose.js.map +1 -1
  5. package/dist/es2017/content/index.js.map +1 -1
  6. package/dist/es2017/core/types/IHubAdditionalResource.js +1 -0
  7. package/dist/es2017/core/types/IHubAdditionalResource.js.map +1 -0
  8. package/dist/es2017/projects/HubProjects.js +17 -18
  9. package/dist/es2017/projects/HubProjects.js.map +1 -1
  10. package/dist/es2017/search/_searchContent.js +18 -20
  11. package/dist/es2017/search/_searchContent.js.map +1 -1
  12. package/dist/es2017/search/_searchGroups.js +18 -19
  13. package/dist/es2017/search/_searchGroups.js.map +1 -1
  14. package/dist/es2017/search/_searchUsers.js +16 -16
  15. package/dist/es2017/search/_searchUsers.js.map +1 -1
  16. package/dist/es2017/sites/domains/index.js +1 -0
  17. package/dist/es2017/sites/domains/index.js.map +1 -1
  18. package/dist/es2017/sites/domains/remove-domains-by-site-id.js +20 -0
  19. package/dist/es2017/sites/domains/remove-domains-by-site-id.js.map +1 -0
  20. package/dist/esm/content/_internal.js +70 -0
  21. package/dist/esm/content/_internal.js.map +1 -1
  22. package/dist/esm/content/compose.js +4 -1
  23. package/dist/esm/content/compose.js.map +1 -1
  24. package/dist/esm/content/index.js.map +1 -1
  25. package/dist/esm/core/types/IHubAdditionalResource.js +1 -0
  26. package/dist/esm/core/types/IHubAdditionalResource.js.map +1 -0
  27. package/dist/esm/projects/HubProjects.js +16 -19
  28. package/dist/esm/projects/HubProjects.js.map +1 -1
  29. package/dist/esm/search/_searchContent.js +22 -26
  30. package/dist/esm/search/_searchContent.js.map +1 -1
  31. package/dist/esm/search/_searchGroups.js +20 -23
  32. package/dist/esm/search/_searchGroups.js.map +1 -1
  33. package/dist/esm/search/_searchUsers.js +17 -19
  34. package/dist/esm/search/_searchUsers.js.map +1 -1
  35. package/dist/esm/sites/domains/index.js +1 -0
  36. package/dist/esm/sites/domains/index.js.map +1 -1
  37. package/dist/esm/sites/domains/remove-domains-by-site-id.js +20 -0
  38. package/dist/esm/sites/domains/remove-domains-by-site-id.js.map +1 -0
  39. package/dist/node/content/_internal.js +71 -1
  40. package/dist/node/content/_internal.js.map +1 -1
  41. package/dist/node/content/compose.js +3 -0
  42. package/dist/node/content/compose.js.map +1 -1
  43. package/dist/node/content/index.js.map +1 -1
  44. package/dist/node/core/types/IHubAdditionalResource.js +3 -0
  45. package/dist/node/core/types/IHubAdditionalResource.js.map +1 -0
  46. package/dist/node/projects/HubProjects.js +17 -18
  47. package/dist/node/projects/HubProjects.js.map +1 -1
  48. package/dist/node/search/_searchContent.js +17 -19
  49. package/dist/node/search/_searchContent.js.map +1 -1
  50. package/dist/node/search/_searchGroups.js +17 -18
  51. package/dist/node/search/_searchGroups.js.map +1 -1
  52. package/dist/node/search/_searchUsers.js +15 -15
  53. package/dist/node/search/_searchUsers.js.map +1 -1
  54. package/dist/node/sites/domains/index.js +1 -0
  55. package/dist/node/sites/domains/index.js.map +1 -1
  56. package/dist/node/sites/domains/remove-domains-by-site-id.js +24 -0
  57. package/dist/node/sites/domains/remove-domains-by-site-id.js.map +1 -0
  58. package/dist/types/content/_internal.d.ts +44 -0
  59. package/dist/types/core/types/IHubAdditionalResource.d.ts +10 -0
  60. package/dist/types/core/types/IHubContent.d.ts +5 -1
  61. package/dist/types/projects/HubProjects.d.ts +1 -1
  62. package/dist/types/sites/domains/index.d.ts +1 -0
  63. package/dist/types/sites/domains/remove-domains-by-site-id.d.ts +8 -0
  64. package/dist/umd/common.umd.js +169 -101
  65. package/dist/umd/common.umd.js.map +1 -1
  66. package/dist/umd/common.umd.min.js +1 -1
  67. package/dist/umd/common.umd.min.js.map +1 -1
  68. package/package.json +1 -1
@@ -13,6 +13,7 @@ import { IItem } from "@esri/arcgis-rest-portal";
13
13
  import { ISpatialReference } from "@esri/arcgis-rest-types";
14
14
  import { IHubContent } from "../core";
15
15
  import { IHubGeography, GeographyProvenance, IHubRequestOptions } from "../types";
16
+ import { IHubAdditionalResource } from "../core/types/IHubAdditionalResource";
16
17
  /**
17
18
  * Create a new content with updated boundary properties
18
19
  * @param content original content
@@ -65,6 +66,7 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
65
66
  hubActions?: object;
66
67
  layer?: Partial<ILayerDefinition>;
67
68
  isProxied?: boolean;
69
+ additionalResources?: IHubAdditionalResource[];
68
70
  itemCategories?: string[];
69
71
  normalizedType?: string;
70
72
  orgId?: string;
@@ -152,3 +154,45 @@ export declare function parseISODateString(isoString: string): {
152
154
  };
153
155
  export declare const getServerSpatialReference: (server: Partial<IFeatureServiceDefinition>, layer?: ILayerDefinition) => ISpatialReference;
154
156
  export declare const getItemSpatialReference: (item: IItem) => ISpatialReference;
157
+ /**
158
+ * Data model for additional resources that are extracted
159
+ * directly from formal item metadata (with no transformation)
160
+ */
161
+ interface IAGOAdditionalResource {
162
+ orName?: string;
163
+ linkage: string;
164
+ }
165
+ /**
166
+ * Extracts additional resources from the provided metadata
167
+ * and transforms them into a hub-friendly format.
168
+ *
169
+ * Returns null if no resources are available
170
+ *
171
+ * @param item
172
+ * @param metadata formal metadata
173
+ * @returns
174
+ */
175
+ export declare const getAdditionalResources: (item: IItem, metadata?: any, requestOptions?: IHubRequestOptions) => IHubAdditionalResource[];
176
+ /**
177
+ * Determines whether a raw additional resource (i.e. extracted out of formal
178
+ * metadata with no transformation) references the underlying service that backs
179
+ * the item.
180
+ *
181
+ * @param resource raw additional resource of an item
182
+ * @param item
183
+ * @returns
184
+ */
185
+ export declare const isDataSourceOfItem: (resource: IAGOAdditionalResource, item: IItem) => boolean;
186
+ /**
187
+ * Returns the url for an additional resource.
188
+ *
189
+ * Automatically appends auth token if token is available
190
+ * and resource points to the backing service of an item.
191
+ *
192
+ * @param resource raw additional resource of an item
193
+ * @param item
194
+ * @param requestOptions IHubRequestOptions, including authentication
195
+ * @returns
196
+ */
197
+ export declare const getAdditionalResourceUrl: (resource: IAGOAdditionalResource, item: IItem, requestOptions?: IHubRequestOptions) => string;
198
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Data model for additional resources that are pulled from formal item metadata
3
+ * and transformed into a hub-friendly interface
4
+ */
5
+ export interface IHubAdditionalResource {
6
+ name?: string;
7
+ url: string;
8
+ /** whether the url points to the service of the related item */
9
+ isDataSource: boolean;
10
+ }
@@ -1,8 +1,10 @@
1
1
  import { IItem, IGroup } from "@esri/arcgis-rest-portal";
2
2
  import { ILayerDefinition } from "@esri/arcgis-rest-feature-layer";
3
- import { Visibility, AccessControl, HubFamily, IActionLink, IStructuredLicense } from "../..";
3
+ import { AccessControl, HubFamily, IActionLink, Visibility } from "../../types";
4
+ import { IStructuredLicense } from "../../items/get-structured-license";
4
5
  import { IHubItemEntity } from ".";
5
6
  import { IHubContentEnrichments } from "./IHubContentEnrichments";
7
+ import { IHubAdditionalResource } from "./IHubAdditionalResource";
6
8
  /**
7
9
  * Data model for content
8
10
  */
@@ -73,6 +75,8 @@ export interface IHubContent extends IHubItemEntity, IHubContentEnrichments, IIt
73
75
  layer?: Partial<ILayerDefinition>;
74
76
  /** Whether or not the layer or table is actually a proxied CSV */
75
77
  isProxied?: boolean;
78
+ /** links to additional resources specified in the formal item metadata */
79
+ additionalResources?: IHubAdditionalResource[];
76
80
  itemCategories?: string[];
77
81
  normalizedType?: string;
78
82
  orgId?: string;
@@ -2,7 +2,7 @@ import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
2
  import { Filter, IHubSearchOptions, ISearchResponse } from "..";
3
3
  import { IRequestOptions } from "@esri/arcgis-rest-request";
4
4
  import { IHubProject } from "../core/types";
5
- export declare const HUB_PROJECT_ITEM_TYPE = "Web Mapping Application";
5
+ export declare const HUB_PROJECT_ITEM_TYPE = "Hub Project";
6
6
  /**
7
7
  * Create a new Hub Project item
8
8
  *
@@ -13,6 +13,7 @@ export * from "./is-domain-used-elsewhere";
13
13
  export * from "./is-valid-domain";
14
14
  export * from "./lookup-domain";
15
15
  export * from "./remove-domain";
16
+ export * from "./remove-domains-by-site-id";
16
17
  export * from "./update-domain";
17
18
  export * from "./_ensure-safe-domain-length";
18
19
  export * from "./ensure-unique-domain-name";
@@ -0,0 +1,8 @@
1
+ import { IHubRequestOptions } from "../../types";
2
+ /**
3
+ * Remove all domain entries by site id.
4
+ * User must be a member of the org that owns the domain entry.
5
+ * @param {int} domainSiteId of the domain entries to remove
6
+ * @param {IHubRequestOptions} hubRequestOptions`dom
7
+ */
8
+ export declare function removeDomainsBySiteId(domainSiteId: string, hubRequestOptions: IHubRequestOptions): Promise<any>;
@@ -1,5 +1,5 @@
1
1
  /* @preserve
2
- * @esri/hub-common - v9.18.0 - Tue Feb 22 2022 17:58:02 GMT+0000 (Coordinated Universal Time)
2
+ * @esri/hub-common - v9.21.0 - Mon Feb 28 2022 17:38:36 GMT+0000 (Coordinated Universal Time)
3
3
  * Copyright (c) 2022 Environmental Systems Research Institute, Inc.
4
4
  * Apache-2.0
5
5
  */
@@ -5963,6 +5963,26 @@
5963
5963
  })));
5964
5964
  }
5965
5965
 
5966
+ /* Copyright (c) 2017-2019 Environmental Systems Research Institute, Inc.
5967
+ * Apache-2.0 */
5968
+ var serviceRegex = new RegExp(/.+(?:map|feature|image)server/i);
5969
+ /**
5970
+ * Return the service url. If not matched, returns what was passed in
5971
+ */
5972
+ function parseServiceUrl(url) {
5973
+ var match = url.match(serviceRegex);
5974
+ if (match) {
5975
+ return match[0];
5976
+ }
5977
+ else {
5978
+ return stripQueryString(url);
5979
+ }
5980
+ }
5981
+ function stripQueryString(url) {
5982
+ var stripped = url.split('?')[0];
5983
+ return cleanUrl(stripped);
5984
+ }
5985
+
5966
5986
  function createExtent(xmin, ymin, xmax, ymax, wkid) {
5967
5987
  if (wkid === void 0) { wkid = 4326; }
5968
5988
  return {
@@ -6330,26 +6350,65 @@
6330
6350
  : //
6331
6351
  { wkid: wkid };
6332
6352
  };
6333
-
6334
- /* Copyright (c) 2017-2019 Environmental Systems Research Institute, Inc.
6335
- * Apache-2.0 */
6336
- var serviceRegex = new RegExp(/.+(?:map|feature|image)server/i);
6337
6353
  /**
6338
- * Return the service url. If not matched, returns what was passed in
6354
+ * Extracts additional resources from the provided metadata
6355
+ * and transforms them into a hub-friendly format.
6356
+ *
6357
+ * Returns null if no resources are available
6358
+ *
6359
+ * @param item
6360
+ * @param metadata formal metadata
6361
+ * @returns
6339
6362
  */
6340
- function parseServiceUrl(url) {
6341
- var match = url.match(serviceRegex);
6342
- if (match) {
6343
- return match[0];
6363
+ var getAdditionalResources = function (item, metadata, requestOptions) {
6364
+ var rawResources = getProp(metadata, "metadata.distInfo.distTranOps.onLineSrc") || null;
6365
+ if (rawResources === null) {
6366
+ return null;
6344
6367
  }
6345
- else {
6346
- return stripQueryString(url);
6368
+ // Coerce to array since rawResources will be an object if only 1 resource is available
6369
+ rawResources = Array.isArray(rawResources) ? rawResources : [rawResources];
6370
+ return rawResources.map(function (resource) { return ({
6371
+ name: resource.orName,
6372
+ url: getAdditionalResourceUrl(resource, item, requestOptions),
6373
+ isDataSource: isDataSourceOfItem(resource, item),
6374
+ }); });
6375
+ };
6376
+ /**
6377
+ * Determines whether a raw additional resource (i.e. extracted out of formal
6378
+ * metadata with no transformation) references the underlying service that backs
6379
+ * the item.
6380
+ *
6381
+ * @param resource raw additional resource of an item
6382
+ * @param item
6383
+ * @returns
6384
+ */
6385
+ var isDataSourceOfItem = function (resource, item) {
6386
+ var serviceUrl = item.url && parseServiceUrl(item.url);
6387
+ return serviceUrl && resource.linkage.includes(serviceUrl);
6388
+ };
6389
+ /**
6390
+ * Returns the url for an additional resource.
6391
+ *
6392
+ * Automatically appends auth token if token is available
6393
+ * and resource points to the backing service of an item.
6394
+ *
6395
+ * @param resource raw additional resource of an item
6396
+ * @param item
6397
+ * @param requestOptions IHubRequestOptions, including authentication
6398
+ * @returns
6399
+ */
6400
+ var getAdditionalResourceUrl = function (resource, item, requestOptions) {
6401
+ var result = resource.linkage;
6402
+ var token = getProp(requestOptions, "authentication.token");
6403
+ if (token && isDataSourceOfItem(resource, item)) {
6404
+ var resUrl = new URL(resource.linkage);
6405
+ var params = new URLSearchParams(resUrl.search);
6406
+ params.set("token", token);
6407
+ resUrl.search = params.toString();
6408
+ result = resUrl.toString();
6347
6409
  }
6348
- }
6349
- function stripQueryString(url) {
6350
- var stripped = url.split('?')[0];
6351
- return cleanUrl(stripped);
6352
- }
6410
+ return result;
6411
+ };
6353
6412
 
6354
6413
  var STANDARD_LICENSES = [
6355
6414
  {
@@ -7259,6 +7318,9 @@
7259
7318
  console.warn("DEPRECATED: use family instead");
7260
7319
  /* tslint:enable no-console */
7261
7320
  return getFamily(type);
7321
+ },
7322
+ get additionalResources() {
7323
+ return getAdditionalResources(item, metadata);
7262
7324
  } });
7263
7325
  };
7264
7326
 
@@ -9710,14 +9772,14 @@
9710
9772
  return clone;
9711
9773
  }
9712
9774
 
9713
- var HUB_PROJECT_ITEM_TYPE = "Web Mapping Application";
9775
+ var HUB_PROJECT_ITEM_TYPE = "Hub Project";
9714
9776
  /**
9715
9777
  * Default values of a IHubProject
9716
9778
  */
9717
9779
  var DEFAULT_PROJECT = {
9718
9780
  name: "No title provided",
9719
9781
  tags: [],
9720
- typeKeywords: ["IHubProject", "HubProject"],
9782
+ typeKeywords: ["Hub Project"],
9721
9783
  status: "inactive",
9722
9784
  };
9723
9785
  /**
@@ -9927,7 +9989,7 @@
9927
9989
  function searchProjects(filter, options) {
9928
9990
  var _a;
9929
9991
  return __awaiter(this, void 0, void 0, function () {
9930
- var scopingFilter, projectFilter, expanded, so;
9992
+ var scopingFilter, projectFilter, expanded, so, props;
9931
9993
  return __generator(this, function (_b) {
9932
9994
  scopingFilter = {
9933
9995
  filterType: "content",
@@ -9943,22 +10005,19 @@
9943
10005
  so.countFields = options.aggregations.join(",");
9944
10006
  so.countSize = 200;
9945
10007
  }
9946
- // copy over various options
9947
- if (options.num) {
9948
- so.num = options.num;
9949
- }
9950
- if (options.sortField) {
9951
- so.sortField = options.sortField;
9952
- }
9953
- if (options.sortOrder) {
9954
- so.sortOrder = options.sortOrder;
9955
- }
9956
- if (options.site) {
9957
- so.site = cloneObject$1(options.site);
9958
- }
9959
- if (options.authentication) {
9960
- so.authentication = options.authentication;
9961
- }
10008
+ props = [
10009
+ "authentication",
10010
+ "num",
10011
+ "sortField",
10012
+ "sortOrder",
10013
+ "site",
10014
+ ];
10015
+ // copy the props over
10016
+ props.forEach(function (prop) {
10017
+ if (options.hasOwnProperty(prop)) {
10018
+ so[prop] = options[prop];
10019
+ }
10020
+ });
9962
10021
  return [2 /*return*/, searchPortalProjects(so)];
9963
10022
  });
9964
10023
  });
@@ -11603,40 +11662,36 @@
11603
11662
  function _searchContent(filter, options) {
11604
11663
  var _a;
11605
11664
  return __awaiter(this, void 0, void 0, function () {
11606
- var expanded, api, searchPromise, so;
11665
+ var expanded, api, searchPromise, so_1, props;
11607
11666
  return __generator(this, function (_b) {
11608
11667
  expanded = expandContentFilter(filter);
11609
11668
  api = expandApi(options.api || "arcgis");
11610
11669
  // Portal Search
11611
11670
  if (api.type === "arcgis") {
11612
- so = serializeContentFilterForPortal(expanded);
11613
- // if we have auth, pass it forward
11614
- // otherwise set the portal property
11615
- if (options.authentication) {
11616
- so.authentication = options.authentication;
11617
- }
11618
- else {
11619
- so.portal = api.url + "/sharing/rest";
11671
+ so_1 = serializeContentFilterForPortal(expanded);
11672
+ props = [
11673
+ "authentication",
11674
+ "num",
11675
+ "sortField",
11676
+ "sortOrder",
11677
+ "site",
11678
+ ];
11679
+ // copy the props over
11680
+ props.forEach(function (prop) {
11681
+ if (options.hasOwnProperty(prop)) {
11682
+ so_1[prop] = options[prop];
11683
+ }
11684
+ });
11685
+ // If we don't have auth, ensure we have .portal
11686
+ if (!so_1.authentication) {
11687
+ so_1.portal = api.url + "/sharing/rest";
11620
11688
  }
11621
11689
  // Aggregations
11622
11690
  if ((_a = options.aggregations) === null || _a === void 0 ? void 0 : _a.length) {
11623
- so.countFields = options.aggregations.join(",");
11624
- so.countSize = 200;
11625
- }
11626
- // copy over various options
11627
- if (options.num) {
11628
- so.num = options.num;
11629
- }
11630
- if (options.sortField) {
11631
- so.sortField = options.sortField;
11691
+ so_1.countFields = options.aggregations.join(",");
11692
+ so_1.countSize = 200;
11632
11693
  }
11633
- if (options.sortOrder) {
11634
- so.sortOrder = options.sortOrder;
11635
- }
11636
- if (options.site) {
11637
- so.site = cloneObject$1(options.site);
11638
- }
11639
- searchPromise = searchPortal(so);
11694
+ searchPromise = searchPortal(so_1);
11640
11695
  }
11641
11696
  else {
11642
11697
  // Hub API Search
@@ -11708,33 +11763,30 @@
11708
11763
  */
11709
11764
  function _searchGroups(filter, options) {
11710
11765
  return __awaiter(this, void 0, void 0, function () {
11711
- var expanded, api, so;
11766
+ var expanded, api, so_1, props;
11712
11767
  return __generator(this, function (_a) {
11713
11768
  expanded = expandGroupFilter(filter);
11714
11769
  api = expandApi(options.api || "arcgis");
11715
11770
  if (api.type === "arcgis") {
11716
- so = serializeGroupFilterForPortal(expanded);
11717
- // if we have auth, pass it forward
11718
- // otherwise set the portal property
11719
- if (options.authentication) {
11720
- so.authentication = options.authentication;
11721
- }
11722
- else {
11723
- so.portal = api.url + "/sharing/rest";
11724
- }
11725
- if (options.num) {
11726
- so.num = options.num;
11727
- }
11728
- if (options.sortField) {
11729
- so.sortField = options.sortField;
11730
- }
11731
- if (options.sortOrder) {
11732
- so.sortOrder = options.sortOrder;
11733
- }
11734
- if (options.site) {
11735
- so.site = cloneObject$1(options.site);
11771
+ so_1 = serializeGroupFilterForPortal(expanded);
11772
+ props = [
11773
+ "authentication",
11774
+ "num",
11775
+ "sortField",
11776
+ "sortOrder",
11777
+ "site",
11778
+ ];
11779
+ // copy the props over
11780
+ props.forEach(function (prop) {
11781
+ if (options.hasOwnProperty(prop)) {
11782
+ so_1[prop] = options[prop];
11783
+ }
11784
+ });
11785
+ // If we don't have auth, ensure we have .portal
11786
+ if (!so_1.authentication) {
11787
+ so_1.portal = api.url + "/sharing/rest";
11736
11788
  }
11737
- return [2 /*return*/, searchPortalGroups(so)];
11789
+ return [2 /*return*/, searchPortalGroups(so_1)];
11738
11790
  }
11739
11791
  else {
11740
11792
  throw new Error("_searchGroups is not implemented for non-arcgis apis");
@@ -11795,7 +11847,7 @@
11795
11847
  */
11796
11848
  function _searchUsers(filter, options) {
11797
11849
  return __awaiter(this, void 0, void 0, function () {
11798
- var expanded, api, searchOptions;
11850
+ var expanded, api, searchOptions_1, props;
11799
11851
  return __generator(this, function (_a) {
11800
11852
  // JS Clients may not pass in authentication
11801
11853
  if (!options.authentication) {
@@ -11804,23 +11856,21 @@
11804
11856
  expanded = expandUserFilter(filter);
11805
11857
  api = expandApi(options.api || "arcgis");
11806
11858
  if (api.type === "arcgis") {
11807
- searchOptions = serializeUserFilterForPortal(expanded);
11808
- // carry the auth forward
11809
- searchOptions.authentication = options.authentication;
11810
- // TODO: Dry this up - typscript makes this... inconvenient
11811
- if (options.num) {
11812
- searchOptions.num = options.num;
11813
- }
11814
- if (options.sortField) {
11815
- searchOptions.sortField = options.sortField;
11816
- }
11817
- if (options.sortOrder) {
11818
- searchOptions.sortOrder = options.sortOrder;
11819
- }
11820
- if (options.site) {
11821
- searchOptions.site = cloneObject$1(options.site);
11822
- }
11823
- return [2 /*return*/, searchPortalUsers(searchOptions)];
11859
+ searchOptions_1 = serializeUserFilterForPortal(expanded);
11860
+ props = [
11861
+ "authentication",
11862
+ "num",
11863
+ "sortField",
11864
+ "sortOrder",
11865
+ "site",
11866
+ ];
11867
+ // copy the props over
11868
+ props.forEach(function (prop) {
11869
+ if (options.hasOwnProperty(prop)) {
11870
+ searchOptions_1[prop] = options[prop];
11871
+ }
11872
+ });
11873
+ return [2 /*return*/, searchPortalUsers(searchOptions_1)];
11824
11874
  }
11825
11875
  else {
11826
11876
  throw new Error("_searchUsers is not implemented for non-arcgis apis");
@@ -12176,6 +12226,23 @@
12176
12226
  return fetch(url, { method: "DELETE", headers: headers, mode: "cors" }).then(_checkStatusAndParseJson);
12177
12227
  }
12178
12228
 
12229
+ /**
12230
+ * Remove all domain entries by site id.
12231
+ * User must be a member of the org that owns the domain entry.
12232
+ * @param {int} domainSiteId of the domain entries to remove
12233
+ * @param {IHubRequestOptions} hubRequestOptions`dom
12234
+ */
12235
+ function removeDomainsBySiteId(domainSiteId, hubRequestOptions) {
12236
+ // TODO: Can remove this if no longer required
12237
+ if (hubRequestOptions.isPortal) {
12238
+ throw new Error("removeDomainsBySiteId is not available in ArcGIS Enterprise. Instead, edit the hubdomain typekeyword on the item");
12239
+ }
12240
+ var headers = _getAuthHeader(hubRequestOptions);
12241
+ headers["Content-Type"] = "application/json";
12242
+ var url = _getDomainServiceUrl(hubRequestOptions.hubApiUrl) + "/?siteId=" + domainSiteId;
12243
+ return fetch(url, { method: "DELETE", headers: headers, mode: "cors" }).then(_checkStatusAndParseJson);
12244
+ }
12245
+
12179
12246
  /**
12180
12247
  * Update an entry in the domain system
12181
12248
  * @param {IHubDomain} domainEntry Doman object to be updated
@@ -13250,6 +13317,7 @@
13250
13317
  exports.relativeDateToDateRange = relativeDateToDateRange;
13251
13318
  exports.removeContextFromSlug = removeContextFromSlug;
13252
13319
  exports.removeDomain = removeDomain;
13320
+ exports.removeDomainsBySiteId = removeDomainsBySiteId;
13253
13321
  exports.removeEmptyProps = removeEmptyProps;
13254
13322
  exports.replaceItemId = replaceItemId;
13255
13323
  exports.runRevertableTask = runRevertableTask;