@esri/hub-common 9.25.7 → 9.26.2

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 (64) hide show
  1. package/dist/es2017/content/slugs.js +1 -1
  2. package/dist/es2017/content/slugs.js.map +1 -1
  3. package/dist/es2017/resources/_internal/_validate-url-helpers.js +231 -0
  4. package/dist/es2017/resources/_internal/_validate-url-helpers.js.map +1 -0
  5. package/dist/es2017/resources/index.js +1 -0
  6. package/dist/es2017/resources/index.js.map +1 -1
  7. package/dist/es2017/resources/validate-url.js +86 -0
  8. package/dist/es2017/resources/validate-url.js.map +1 -0
  9. package/dist/es2017/search/_internal/searchContentEntities.js +2 -0
  10. package/dist/es2017/search/_internal/searchContentEntities.js.map +1 -1
  11. package/dist/es2017/search/_searchContent.js +1 -0
  12. package/dist/es2017/search/_searchContent.js.map +1 -1
  13. package/dist/es2017/search/_searchGroups.js +1 -0
  14. package/dist/es2017/search/_searchGroups.js.map +1 -1
  15. package/dist/es2017/search/_searchUsers.js +1 -0
  16. package/dist/es2017/search/_searchUsers.js.map +1 -1
  17. package/dist/es2017/types.js +862 -0
  18. package/dist/es2017/types.js.map +1 -1
  19. package/dist/esm/content/slugs.js +1 -1
  20. package/dist/esm/content/slugs.js.map +1 -1
  21. package/dist/esm/resources/_internal/_validate-url-helpers.js +249 -0
  22. package/dist/esm/resources/_internal/_validate-url-helpers.js.map +1 -0
  23. package/dist/esm/resources/index.js +1 -0
  24. package/dist/esm/resources/index.js.map +1 -1
  25. package/dist/esm/resources/validate-url.js +103 -0
  26. package/dist/esm/resources/validate-url.js.map +1 -0
  27. package/dist/esm/search/_internal/searchContentEntities.js +2 -0
  28. package/dist/esm/search/_internal/searchContentEntities.js.map +1 -1
  29. package/dist/esm/search/_searchContent.js +1 -0
  30. package/dist/esm/search/_searchContent.js.map +1 -1
  31. package/dist/esm/search/_searchGroups.js +1 -0
  32. package/dist/esm/search/_searchGroups.js.map +1 -1
  33. package/dist/esm/search/_searchUsers.js +1 -0
  34. package/dist/esm/search/_searchUsers.js.map +1 -1
  35. package/dist/esm/types.js +862 -0
  36. package/dist/esm/types.js.map +1 -1
  37. package/dist/node/content/slugs.js +1 -1
  38. package/dist/node/content/slugs.js.map +1 -1
  39. package/dist/node/resources/_internal/_validate-url-helpers.js +247 -0
  40. package/dist/node/resources/_internal/_validate-url-helpers.js.map +1 -0
  41. package/dist/node/resources/index.js +1 -0
  42. package/dist/node/resources/index.js.map +1 -1
  43. package/dist/node/resources/validate-url.js +90 -0
  44. package/dist/node/resources/validate-url.js.map +1 -0
  45. package/dist/node/search/_internal/searchContentEntities.js +2 -0
  46. package/dist/node/search/_internal/searchContentEntities.js.map +1 -1
  47. package/dist/node/search/_searchContent.js +1 -0
  48. package/dist/node/search/_searchContent.js.map +1 -1
  49. package/dist/node/search/_searchGroups.js +1 -0
  50. package/dist/node/search/_searchGroups.js.map +1 -1
  51. package/dist/node/search/_searchUsers.js +1 -0
  52. package/dist/node/search/_searchUsers.js.map +1 -1
  53. package/dist/node/types.js +863 -0
  54. package/dist/node/types.js.map +1 -1
  55. package/dist/types/resources/_internal/_validate-url-helpers.d.ts +115 -0
  56. package/dist/types/resources/index.d.ts +1 -0
  57. package/dist/types/resources/validate-url.d.ts +8 -0
  58. package/dist/types/search/types.d.ts +1 -0
  59. package/dist/types/types.d.ts +225 -4
  60. package/dist/umd/common.umd.js +1223 -6
  61. package/dist/umd/common.umd.js.map +1 -1
  62. package/dist/umd/common.umd.min.js +1 -1
  63. package/dist/umd/common.umd.min.js.map +1 -1
  64. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /* @preserve
2
- * @esri/hub-common - v9.25.6 - Mon Apr 04 2022 23:16:31 GMT+0000 (Coordinated Universal Time)
2
+ * @esri/hub-common - v9.26.1 - Fri Apr 08 2022 17:54:59 GMT+0000 (Coordinated Universal Time)
3
3
  * Copyright (c) 2022 Environmental Systems Research Institute, Inc.
4
4
  * Apache-2.0
5
5
  */
@@ -7369,7 +7369,7 @@
7369
7369
  * @param {string} type - item's type
7370
7370
  * @returns {boolean}
7371
7371
  */
7372
- var isFeatureService = function (type) {
7372
+ var isFeatureService$1 = function (type) {
7373
7373
  return type && type.toLowerCase() === "feature service";
7374
7374
  };
7375
7375
  /**
@@ -7417,7 +7417,7 @@
7417
7417
  // the Singlelayer typeKeyword, which I think is set when you create the item in AGO
7418
7418
  // but have not verified that, nor that we should alway return '0' in that case
7419
7419
  return (getLayerIdFromUrl(item.url) ||
7420
- (isFeatureService(item.type) &&
7420
+ (isFeatureService$1(item.type) &&
7421
7421
  item.typeKeywords &&
7422
7422
  includes(item.typeKeywords, "Singlelayer") &&
7423
7423
  "0"));
@@ -7479,7 +7479,7 @@
7479
7479
  ? // find the explicitly set layer id
7480
7480
  layers.find(function (_layer) { return _layer.id === _layerId; })
7481
7481
  : // for feature servers with a single layer always show the layer
7482
- isFeatureService(item.type) && getOnlyQueryLayer(layers)));
7482
+ isFeatureService$1(item.type) && getOnlyQueryLayer(layers)));
7483
7483
  };
7484
7484
  /**
7485
7485
  * determine if a layer is a layer view
@@ -7776,7 +7776,7 @@
7776
7776
  * @returns slug without context
7777
7777
  */
7778
7778
  function removeContextFromSlug(slug, context) {
7779
- if (context && slug.match(context + "::")) {
7779
+ if (context && slug.match("^" + context + "::")) {
7780
7780
  return slug.split(context + "::")[1];
7781
7781
  }
7782
7782
  else {
@@ -12422,7 +12422,9 @@
12422
12422
  "sortField",
12423
12423
  "sortOrder",
12424
12424
  "site",
12425
+ "start",
12425
12426
  ];
12427
+ // Include "start" here
12426
12428
  // copy the props over
12427
12429
  props.forEach(function (prop) {
12428
12430
  if (options.hasOwnProperty(prop)) {
@@ -13275,6 +13277,1216 @@
13275
13277
  }
13276
13278
  }
13277
13279
 
13280
+ /* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
13281
+ * Apache-2.0 */
13282
+ /**
13283
+ * ENUM which defines File extensions.
13284
+ */
13285
+ exports.FileExtension = void 0;
13286
+ (function (FileExtension) {
13287
+ FileExtension["aptx"] = "aptx";
13288
+ FileExtension["bpk"] = "bpk";
13289
+ FileExtension["csv"] = "csv";
13290
+ FileExtension["eaz"] = "eaz";
13291
+ FileExtension["esriaddin"] = "esriaddin";
13292
+ FileExtension["esriaddinx"] = "esriaddinx";
13293
+ FileExtension["doc"] = "doc";
13294
+ FileExtension["docx"] = "docx";
13295
+ FileExtension["dlpk"] = "dlpk";
13296
+ FileExtension["featurecollection"] = "featurecollection";
13297
+ FileExtension["geojson"] = "geojson";
13298
+ FileExtension["gcpk"] = "gcpk";
13299
+ FileExtension["gpk"] = "gpk";
13300
+ FileExtension["gpkg"] = "gpkg";
13301
+ FileExtension["gpkx"] = "gpkx";
13302
+ FileExtension["insightswbk"] = "insightswbk";
13303
+ FileExtension["ipynb"] = "ipynb";
13304
+ FileExtension["jpg"] = "jpg";
13305
+ FileExtension["jpeg"] = "jpeg";
13306
+ FileExtension["json"] = "json";
13307
+ FileExtension["key"] = "key";
13308
+ FileExtension["kml"] = "kml";
13309
+ FileExtension["kmz"] = "kmz";
13310
+ FileExtension["lpk"] = "lpk";
13311
+ FileExtension["lpkx"] = "lpkx";
13312
+ FileExtension["lyr"] = "lyr";
13313
+ FileExtension["lyrx"] = "lyrx";
13314
+ FileExtension["mapx"] = "mapx";
13315
+ FileExtension["mmpk"] = "mmpk";
13316
+ FileExtension["mpk"] = "mpk";
13317
+ FileExtension["mpkx"] = "mpkx";
13318
+ FileExtension["msd"] = "msd";
13319
+ FileExtension["mspk"] = "mspk";
13320
+ FileExtension["mxd"] = "mxd";
13321
+ FileExtension["ncfg"] = "ncfg";
13322
+ FileExtension["nmc"] = "nmc";
13323
+ FileExtension["nmf"] = "nmf";
13324
+ FileExtension["numbers"] = "numbers";
13325
+ FileExtension["pages"] = "pages";
13326
+ FileExtension["pagx"] = "pagx";
13327
+ FileExtension["parquet"] = "parquet";
13328
+ FileExtension["pdf"] = "pdf";
13329
+ FileExtension["pmf"] = "pmf";
13330
+ FileExtension["png"] = "png";
13331
+ FileExtension["ppkx"] = "ppkx";
13332
+ FileExtension["ppt"] = "ppt";
13333
+ FileExtension["pptx"] = "pptx";
13334
+ FileExtension["proconfigx"] = "proconfigx";
13335
+ FileExtension["rpk"] = "rpk";
13336
+ FileExtension["rptx"] = "rptx";
13337
+ FileExtension["sd"] = "sd";
13338
+ FileExtension["slpk"] = "slpk";
13339
+ FileExtension["spk"] = "spk";
13340
+ FileExtension["stylx"] = "stylx";
13341
+ FileExtension["surveyaddin"] = "surveyaddin";
13342
+ FileExtension["sxd"] = "sxd";
13343
+ FileExtension["tif"] = "tif";
13344
+ FileExtension["tiff"] = "tiff";
13345
+ FileExtension["tpk"] = "tpk";
13346
+ FileExtension["tpkx"] = "tpkx";
13347
+ FileExtension["vsd"] = "vsd";
13348
+ FileExtension["vtpk"] = "vtpk";
13349
+ FileExtension["wmpk"] = "wmpk";
13350
+ FileExtension["wpk"] = "wpk";
13351
+ FileExtension["xls"] = "xls";
13352
+ FileExtension["xml"] = "xml";
13353
+ FileExtension["xlsx"] = "xlsx";
13354
+ FileExtension["zip"] = "zip";
13355
+ FileExtension["3dd"] = "3dd";
13356
+ FileExtension["3vr"] = "3vr";
13357
+ FileExtension["3ws"] = "3ws";
13358
+ FileExtension["rft.json"] = "rft.json";
13359
+ FileExtension["rft.xml"] = "rft.xml";
13360
+ })(exports.FileExtension || (exports.FileExtension = {}));
13361
+ /**
13362
+ * ENUM which defines human readable Item Type names
13363
+ */
13364
+ exports.ItemType = void 0;
13365
+ (function (ItemType) {
13366
+ ItemType["360 VR Experience"] = "360 VR Experience";
13367
+ ItemType["Apache Parquet"] = "Apache Parquet";
13368
+ ItemType["AppBuilder Widget Package"] = "AppBuilder Widget Package";
13369
+ ItemType["Desktop Add In"] = "Desktop Add In";
13370
+ ItemType["Explorer Add In"] = "Explorer Add In";
13371
+ ItemType["Explorer Map"] = "Explorer Map";
13372
+ ItemType["Explorer Layer"] = "Explorer Layer";
13373
+ ItemType["Windows Mobile Package"] = "Windows Mobile Package";
13374
+ ItemType["ArcGIS Pro Add In"] = "ArcGIS Pro Add In";
13375
+ ItemType["ArcGIS Pro Configuration"] = "ArcGIS Pro Configuration";
13376
+ ItemType["Globe Document"] = "Globe Document";
13377
+ ItemType["Map Document"] = "Map Document";
13378
+ ItemType["ArcPad Package"] = "ArcPad Package";
13379
+ ItemType["Published Map"] = "Published Map";
13380
+ ItemType["Scene Document"] = "Scene Document";
13381
+ ItemType["CityEngine Web Scene"] = "CityEngine Web Scene";
13382
+ ItemType["Code Sample"] = "Code Sample";
13383
+ ItemType["CSV Collection"] = "CSV Collection";
13384
+ ItemType["CSV"] = "CSV";
13385
+ ItemType["CAD Drawing"] = "CAD Drawing";
13386
+ ItemType["Deep Learning Package"] = "Deep Learning Package";
13387
+ ItemType["Desktop Application"] = "Desktop Application";
13388
+ ItemType["Desktop Application Template"] = "Desktop Application Template";
13389
+ ItemType["Desktop Style"] = "Desktop Style";
13390
+ ItemType["Earth Configuration"] = "Earth Configuration";
13391
+ ItemType["Feature Collection"] = "Feature Collection";
13392
+ ItemType["File Geodatabase"] = "File Geodatabase";
13393
+ ItemType["GeoJson"] = "GeoJson";
13394
+ ItemType["Geoprocessing Package"] = "Geoprocessing Package";
13395
+ ItemType["GeoPackage"] = "GeoPackage";
13396
+ ItemType["Geoprocessing Sample"] = "Geoprocessing Sample";
13397
+ ItemType["GML"] = "GML";
13398
+ ItemType["Image Collection"] = "Image Collection";
13399
+ ItemType["Image"] = "Image";
13400
+ ItemType["iWork Keynote"] = "iWork Keynote";
13401
+ ItemType["iWork Numbers"] = "iWork Numbers";
13402
+ ItemType["iWork Pages"] = "iWork Pages";
13403
+ ItemType["KML Collection"] = "KML Collection";
13404
+ ItemType["KML"] = "KML";
13405
+ ItemType["Layer"] = "Layer";
13406
+ ItemType["Layer Package"] = "Layer Package";
13407
+ ItemType["Layout"] = "Layout";
13408
+ ItemType["Locator Package"] = "Locator Package";
13409
+ ItemType["Map Package"] = "Map Package";
13410
+ ItemType["Map Template"] = "Map Template";
13411
+ ItemType["Microsoft Excel"] = "Microsoft Excel";
13412
+ ItemType["Microsoft Powerpoint"] = "Microsoft Powerpoint";
13413
+ ItemType["Visio Document"] = "Visio Document";
13414
+ ItemType["Microsoft Word"] = "Microsoft Word";
13415
+ ItemType["Mobile Basemap Package"] = "Mobile Basemap Package";
13416
+ ItemType["Mobile Map Package"] = "Mobile Map Package";
13417
+ ItemType["Mobile Scene Package"] = "Mobile Scene Package";
13418
+ ItemType["Notebook"] = "Notebook";
13419
+ ItemType["PDF"] = "PDF";
13420
+ ItemType["Pro Map"] = "Pro Map";
13421
+ ItemType["Pro Report"] = "Pro Report";
13422
+ ItemType["Project Package"] = "Project Package";
13423
+ ItemType["Project Template"] = "Project Template";
13424
+ ItemType["Raster function template"] = "Raster function template";
13425
+ ItemType["Rule Package"] = "Rule Package";
13426
+ ItemType["Scene Package"] = "Scene Package";
13427
+ ItemType["Service Definition"] = "Service Definition";
13428
+ ItemType["Shapefile"] = "Shapefile";
13429
+ ItemType["Survey123 Add In"] = "Survey123 Add In";
13430
+ ItemType["Tile Package"] = "Tile Package";
13431
+ ItemType["Vector Tile Package"] = "Vector Tile Package";
13432
+ ItemType["Workflow Manager Package"] = "Workflow Manager Package";
13433
+ ItemType["Document Link"] = "Document Link";
13434
+ ItemType["Feature Service"] = "Feature Service";
13435
+ ItemType["Geocoding Service"] = "Geocoding Service";
13436
+ ItemType["Geodata Service"] = "Geodata Service";
13437
+ ItemType["Geometry Service"] = "Geometry Service";
13438
+ ItemType["Geoprocessing Service"] = "Geoprocessing Service";
13439
+ ItemType["Geoenrichment Service"] = "Geoenrichment Service";
13440
+ ItemType["Globe Service"] = "Globe Service";
13441
+ ItemType["Image Service"] = "Image Service";
13442
+ ItemType["Map Service"] = "Map Service";
13443
+ ItemType["Network Analysis Service"] = "Network Analysis Service";
13444
+ ItemType["Vector Tile Service"] = "Vector Tile Service";
13445
+ ItemType["WFS"] = "WFS";
13446
+ ItemType["WMS"] = "WMS";
13447
+ ItemType["WMTS"] = "WMTS";
13448
+ ItemType["OGCFeatureServer"] = "OGCFeatureServer";
13449
+ ItemType["Scene Service"] = "Scene Service";
13450
+ ItemType["Stream Service"] = "Stream Service";
13451
+ ItemType["Workflow Manager Service"] = "Workflow Manager Service";
13452
+ ItemType["Web Mapping Application"] = "Web Mapping Application";
13453
+ ItemType["Mobile Application"] = "Mobile Application";
13454
+ ItemType["AppBuilder Extension"] = "AppBuilder Extension";
13455
+ ItemType["Google Drive"] = "Google Drive";
13456
+ ItemType["Dropbox"] = "Dropbox";
13457
+ ItemType["OneDrive"] = "OneDrive";
13458
+ ItemType["StoryMap"] = "StoryMap";
13459
+ ItemType["Dashboard"] = "Dashboard";
13460
+ ItemType["Hub Initiative"] = "Hub Initiative";
13461
+ ItemType["Hub Site Application"] = "Hub Site Application";
13462
+ ItemType["Web Experience"] = "Web Experience";
13463
+ ItemType["Insights Workbook Package"] = "Insights Workbook Package";
13464
+ ItemType["Application"] = "Application";
13465
+ ItemType["ArcGIS Explorer Application Configuration"] = "ArcGIS Explorer Application Configuration";
13466
+ ItemType["ArcMap Document"] = "ArcMap Document";
13467
+ ItemType["Layer File"] = "Layer File";
13468
+ ItemType["ogcFeature"] = "ogcFeature";
13469
+ ItemType["FeatureServer"] = "Feature Service";
13470
+ ItemType["GeocodeServer"] = "GeocodeServer";
13471
+ ItemType["GeoDataServer"] = "GeoDataServer";
13472
+ ItemType["GeometryServer"] = "GeometryServer";
13473
+ ItemType["GeoenrichmentServer"] = "GeoenrichmentServer";
13474
+ ItemType["GPServer"] = "GPServer";
13475
+ ItemType["GlobeServer"] = "GlobeServer";
13476
+ ItemType["ImageServer"] = "ImageServer";
13477
+ ItemType["MapServer"] = "MapServer";
13478
+ ItemType["NAServer"] = "NAServer";
13479
+ ItemType["ElevationServer"] = "ElevationServer";
13480
+ ItemType["VectorTileServer"] = "VectorTileServer";
13481
+ ItemType["Scene Server"] = "Scene Server";
13482
+ ItemType["StreamServer"] = "StreamServer";
13483
+ ItemType["WMServer"] = "WMServer";
13484
+ ItemType["TiledImageServer"] = "TiledImageServer";
13485
+ })(exports.ItemType || (exports.ItemType = {}));
13486
+ /**
13487
+ * Maps human readable file names to extensions IE Image === jpg, png, etc
13488
+ */
13489
+ var addCreateItemTypes = {
13490
+ "360 VR Experience": {
13491
+ fileExt: [exports.FileExtension["3dd"]],
13492
+ type: exports.ItemType["360 VR Experience"],
13493
+ typeKeywords: [],
13494
+ },
13495
+ "Apache Parquet": {
13496
+ fileExt: [exports.FileExtension.parquet],
13497
+ type: exports.ItemType["Apache Parquet"],
13498
+ typeKeywords: [],
13499
+ },
13500
+ "AppBuilder Widget Package": {
13501
+ fileExt: [exports.FileExtension.zip],
13502
+ type: exports.ItemType["AppBuilder Widget Package"],
13503
+ typeKeywords: [],
13504
+ },
13505
+ "Desktop Add In": {
13506
+ fileExt: [exports.FileExtension.esriaddin],
13507
+ type: exports.ItemType["Desktop Add In"],
13508
+ typeKeywords: [
13509
+ "Tool",
13510
+ "Add In",
13511
+ "Desktop Add In",
13512
+ "ArcGIS Desktop",
13513
+ "ArcMap",
13514
+ "ArcGlobe",
13515
+ "ArcScene",
13516
+ "esriaddin",
13517
+ ],
13518
+ },
13519
+ "Explorer Add In": {
13520
+ fileExt: [exports.FileExtension.eaz],
13521
+ type: exports.ItemType["Explorer Add In"],
13522
+ typeKeywords: [
13523
+ "Tool",
13524
+ "Add In",
13525
+ "Explorer Add In",
13526
+ "ArcGIS Explorer",
13527
+ "eaz",
13528
+ ],
13529
+ },
13530
+ "Explorer Map": {
13531
+ fileExt: [exports.FileExtension.nmf],
13532
+ type: exports.ItemType["Explorer Map"],
13533
+ typeKeywords: [
13534
+ "Map",
13535
+ "Explorer Map",
13536
+ "Explorer Document",
13537
+ "2D",
13538
+ "3D",
13539
+ "ArcGIS Explorer",
13540
+ "nmf",
13541
+ ],
13542
+ },
13543
+ "ArcGIS Explorer Application Configuration": {
13544
+ fileExt: [exports.FileExtension.ncfg],
13545
+ type: exports.ItemType["Explorer Map"],
13546
+ typeKeywords: [
13547
+ "Map",
13548
+ "Explorer Map",
13549
+ "Explorer Mapping Application",
13550
+ "2D",
13551
+ "3D",
13552
+ "ArcGIS Explorer",
13553
+ ],
13554
+ },
13555
+ "Explorer Layer": {
13556
+ fileExt: [exports.FileExtension.nmc],
13557
+ type: exports.ItemType["Explorer Layer"],
13558
+ typeKeywords: ["Data", "Layer", "Explorer Layer", "ArcGIS Explorer", "nmc"],
13559
+ },
13560
+ "Windows Mobile Package": {
13561
+ fileExt: [exports.FileExtension.wmpk],
13562
+ type: exports.ItemType["Windows Mobile Package"],
13563
+ typeKeywords: [],
13564
+ },
13565
+ "ArcGIS Pro Add In": {
13566
+ fileExt: [exports.FileExtension.esriaddinx],
13567
+ type: exports.ItemType["ArcGIS Pro Add In"],
13568
+ typeKeywords: ["Tool", "Add In", "Pro Add In", "esriaddinx"],
13569
+ },
13570
+ "ArcGIS Pro Configuration": {
13571
+ fileExt: [exports.FileExtension.proconfigx],
13572
+ type: exports.ItemType["ArcGIS Pro Configuration"],
13573
+ typeKeywords: [],
13574
+ },
13575
+ "Globe Document": {
13576
+ fileExt: [exports.FileExtension["3dd"]],
13577
+ type: exports.ItemType["Globe Document"],
13578
+ typeKeywords: [
13579
+ "Map",
13580
+ "Globe Document",
13581
+ "3D",
13582
+ "ArcGlobe",
13583
+ "ArcGIS Server",
13584
+ "3dd",
13585
+ ],
13586
+ },
13587
+ "Map Document": {
13588
+ fileExt: [exports.FileExtension.msd],
13589
+ type: exports.ItemType["Map Document"],
13590
+ typeKeywords: [
13591
+ "Map Document",
13592
+ "Map",
13593
+ "2D",
13594
+ "ArcMap",
13595
+ "ArcGIS Server",
13596
+ "msd",
13597
+ ],
13598
+ },
13599
+ "ArcMap Document": {
13600
+ fileExt: [exports.FileExtension.mxd],
13601
+ type: exports.ItemType["Map Document"],
13602
+ typeKeywords: ["Map Document", "Map", "2D", "ArcMap", "ArcGIS Server"],
13603
+ },
13604
+ "ArcPad Package": {
13605
+ fileExt: [exports.FileExtension.zip],
13606
+ type: exports.ItemType["ArcPad Package"],
13607
+ typeKeywords: ["Map", "Layer", "Data"],
13608
+ },
13609
+ "Published Map": {
13610
+ fileExt: [exports.FileExtension.pmf],
13611
+ type: exports.ItemType["Published Map"],
13612
+ typeKeywords: [
13613
+ "Map",
13614
+ "Published Map",
13615
+ "2D",
13616
+ "ArcReader",
13617
+ "ArcMap",
13618
+ "ArcGIS Server",
13619
+ "pmf",
13620
+ ],
13621
+ },
13622
+ "Scene Document": {
13623
+ fileExt: [exports.FileExtension.sxd],
13624
+ type: exports.ItemType["Scene Document"],
13625
+ typeKeywords: ["Map", "Scene Document", "3D", "ArcScene", "sxd"],
13626
+ },
13627
+ "CityEngine Web Scene": {
13628
+ fileExt: [exports.FileExtension["3ws"]],
13629
+ type: exports.ItemType["CityEngine Web Scene"],
13630
+ typeKeywords: ["3D", "Map", "Scene", "Web"],
13631
+ },
13632
+ "Code Sample": {
13633
+ fileExt: [exports.FileExtension.zip],
13634
+ type: exports.ItemType["Code Sample"],
13635
+ typeKeywords: ["Code", "Sample"],
13636
+ },
13637
+ "CSV Collection": {
13638
+ fileExt: [exports.FileExtension.zip],
13639
+ type: exports.ItemType["CSV Collection"],
13640
+ typeKeywords: [],
13641
+ },
13642
+ CSV: {
13643
+ fileExt: [exports.FileExtension.csv],
13644
+ type: exports.ItemType.CSV,
13645
+ typeKeywords: ["CSV"],
13646
+ },
13647
+ "CAD Drawing": {
13648
+ fileExt: [exports.FileExtension.zip],
13649
+ type: exports.ItemType["CAD Drawing"],
13650
+ typeKeywords: [],
13651
+ },
13652
+ "Deep Learning Package": {
13653
+ fileExt: [exports.FileExtension.zip, exports.FileExtension.dlpk],
13654
+ type: exports.ItemType["Deep Learning Package"],
13655
+ typeKeywords: ["Deep Learning", "Raster"],
13656
+ },
13657
+ "Desktop Application": {
13658
+ type: exports.ItemType["Desktop Application"],
13659
+ typeKeywords: ["Desktop Application"],
13660
+ },
13661
+ "Desktop Application Template": {
13662
+ fileExt: [exports.FileExtension.zip],
13663
+ type: exports.ItemType["Desktop Application Template"],
13664
+ typeKeywords: ["application", "template", "ArcGIS desktop"],
13665
+ },
13666
+ "Desktop Style": {
13667
+ fileExt: [exports.FileExtension.stylx],
13668
+ type: exports.ItemType["Desktop Style"],
13669
+ typeKeywords: ["ArcGIS Pro", "Symbology", "Style", "Symbols"],
13670
+ },
13671
+ "Earth Configuration": {
13672
+ fileExt: [exports.FileExtension.xml],
13673
+ type: exports.ItemType["Earth Configuration"],
13674
+ typeKeywords: ["ArcGIS Earth", "Earth", "Earth Configuration"],
13675
+ },
13676
+ "Feature Collection": {
13677
+ type: exports.ItemType["Feature Collection"],
13678
+ fileExt: [exports.FileExtension.featurecollection],
13679
+ typeKeywords: [],
13680
+ },
13681
+ "File Geodatabase": {
13682
+ fileExt: [exports.FileExtension.zip],
13683
+ type: exports.ItemType["File Geodatabase"],
13684
+ typeKeywords: [],
13685
+ },
13686
+ GeoJson: {
13687
+ fileExt: [exports.FileExtension.geojson, exports.FileExtension.json],
13688
+ type: exports.ItemType.GeoJson,
13689
+ typeKeywords: [
13690
+ "Coordinates Type",
13691
+ "CRS",
13692
+ "Feature",
13693
+ "FeatureCollection",
13694
+ "GeoJSON",
13695
+ "Geometry",
13696
+ "GeometryCollection",
13697
+ ],
13698
+ },
13699
+ "Geoprocessing Package": {
13700
+ fileExt: [exports.FileExtension.gpk, exports.FileExtension.gpkx],
13701
+ type: exports.ItemType["Geoprocessing Package"],
13702
+ typeKeywords: [
13703
+ "ArcGIS Desktop",
13704
+ "ArcGlobe",
13705
+ "ArcMap",
13706
+ "ArcScene",
13707
+ "Geoprocessing Package",
13708
+ "gpk",
13709
+ "Model",
13710
+ "Result",
13711
+ "Script",
13712
+ "Sharing",
13713
+ "Tool",
13714
+ "Toolbox",
13715
+ ],
13716
+ },
13717
+ GeoPackage: {
13718
+ fileExt: [exports.FileExtension.gpkg],
13719
+ type: exports.ItemType.GeoPackage,
13720
+ typeKeywords: ["Data", "GeoPackage", "gpkg"],
13721
+ },
13722
+ "Geoprocessing Sample": {
13723
+ fileExt: [exports.FileExtension.zip],
13724
+ type: exports.ItemType["Geoprocessing Sample"],
13725
+ typeKeywords: ["tool", "geoprocessing", "sample"],
13726
+ },
13727
+ GML: {
13728
+ fileExt: [exports.FileExtension.zip],
13729
+ type: exports.ItemType.GML,
13730
+ typeKeywords: [],
13731
+ },
13732
+ "Image Collection": {
13733
+ fileExt: [exports.FileExtension.zip],
13734
+ type: exports.ItemType["Image Collection"],
13735
+ typeKeywords: [],
13736
+ },
13737
+ Image: {
13738
+ fileExt: [
13739
+ exports.FileExtension.jpg,
13740
+ exports.FileExtension.jpeg,
13741
+ exports.FileExtension.png,
13742
+ exports.FileExtension.tif,
13743
+ exports.FileExtension.tiff,
13744
+ ],
13745
+ type: exports.ItemType.Image,
13746
+ typeKeywords: ["Data", "Image"],
13747
+ },
13748
+ "iWork Keynote": {
13749
+ fileExt: [exports.FileExtension.key],
13750
+ type: exports.ItemType["iWork Keynote"],
13751
+ typeKeywords: ["Data", "Document", "Mac"],
13752
+ },
13753
+ "iWork Numbers": {
13754
+ fileExt: [exports.FileExtension.numbers],
13755
+ type: exports.ItemType["iWork Numbers"],
13756
+ typeKeywords: ["Data", "Document", "Mac"],
13757
+ },
13758
+ "iWork Pages": {
13759
+ fileExt: [exports.FileExtension.pages],
13760
+ type: exports.ItemType["iWork Pages"],
13761
+ typeKeywords: ["Data", "Document", "Mac"],
13762
+ },
13763
+ "KML Collection": {
13764
+ fileExt: [exports.FileExtension.zip],
13765
+ type: exports.ItemType["KML Collection"],
13766
+ typeKeywords: [],
13767
+ },
13768
+ KML: {
13769
+ type: exports.ItemType.KML,
13770
+ fileExt: [exports.FileExtension.kml, exports.FileExtension.kmz],
13771
+ typeKeywords: ["Data", "Map", "kml"],
13772
+ },
13773
+ Layer: {
13774
+ fileExt: [exports.FileExtension.lyr],
13775
+ type: exports.ItemType.Layer,
13776
+ typeKeywords: [
13777
+ "Data",
13778
+ "Layer",
13779
+ "ArcMap",
13780
+ "ArcGlobe",
13781
+ "ArcGIS Explorer",
13782
+ "lyr",
13783
+ ],
13784
+ },
13785
+ "Layer File": {
13786
+ fileExt: [exports.FileExtension.lyrx],
13787
+ type: exports.ItemType.Layer,
13788
+ typeKeywords: ["ArcGIS Pro", "Layer", "Layer File"],
13789
+ },
13790
+ "Layer Package": {
13791
+ fileExt: [exports.FileExtension.lpk, exports.FileExtension.lpkx],
13792
+ type: exports.ItemType["Layer Package"],
13793
+ typeKeywords: [],
13794
+ },
13795
+ Layout: {
13796
+ fileExt: [exports.FileExtension.pagx],
13797
+ type: exports.ItemType.Layout,
13798
+ typeKeywords: ["ArcGIS Pro", "Layout", "Layout File", "pagx"],
13799
+ },
13800
+ "Locator Package": {
13801
+ fileExt: [exports.FileExtension.gcpk],
13802
+ type: exports.ItemType["Locator Package"],
13803
+ typeKeywords: [],
13804
+ },
13805
+ "Map Package": {
13806
+ fileExt: [exports.FileExtension.mpk, exports.FileExtension.mpkx],
13807
+ type: exports.ItemType["Map Package"],
13808
+ typeKeywords: [],
13809
+ },
13810
+ "Map Template": {
13811
+ fileExt: [exports.FileExtension.zip],
13812
+ type: exports.ItemType["Map Template"],
13813
+ typeKeywords: ["map", "ArcMap", "template", "ArcGIS desktop"],
13814
+ },
13815
+ "Microsoft Excel": {
13816
+ fileExt: [exports.FileExtension.xls, exports.FileExtension.xlsx],
13817
+ type: exports.ItemType["Microsoft Excel"],
13818
+ typeKeywords: ["Data", "Document", "Microsoft Excel"],
13819
+ },
13820
+ "Microsoft Powerpoint": {
13821
+ fileExt: [exports.FileExtension.ppt, exports.FileExtension.pptx],
13822
+ type: exports.ItemType["Microsoft Powerpoint"],
13823
+ typeKeywords: ["Data", "Document", "Microsoft Powerpoint"],
13824
+ },
13825
+ "Visio Document": {
13826
+ fileExt: [exports.FileExtension.vsd],
13827
+ type: exports.ItemType["Visio Document"],
13828
+ typeKeywords: ["Data", "Document", "Visio Document"],
13829
+ },
13830
+ "Microsoft Word": {
13831
+ fileExt: [exports.FileExtension.doc, exports.FileExtension.docx],
13832
+ type: exports.ItemType["Microsoft Word"],
13833
+ typeKeywords: ["Data", "Document"],
13834
+ },
13835
+ "Mobile Basemap Package": {
13836
+ fileExt: [exports.FileExtension.bpk],
13837
+ type: exports.ItemType["Mobile Basemap Package"],
13838
+ typeKeywords: [],
13839
+ },
13840
+ "Mobile Map Package": {
13841
+ fileExt: [exports.FileExtension.mmpk],
13842
+ type: exports.ItemType["Mobile Map Package"],
13843
+ typeKeywords: [],
13844
+ },
13845
+ "Mobile Scene Package": {
13846
+ fileExt: [exports.FileExtension.mspk],
13847
+ type: exports.ItemType["Mobile Scene Package"],
13848
+ typeKeywords: [],
13849
+ },
13850
+ Notebook: {
13851
+ fileExt: [exports.FileExtension.ipynb],
13852
+ type: exports.ItemType.Notebook,
13853
+ typeKeywords: ["Notebook", "Python"],
13854
+ },
13855
+ PDF: {
13856
+ fileExt: [exports.FileExtension.pdf],
13857
+ type: exports.ItemType.PDF,
13858
+ typeKeywords: ["Data", "Document", "PDF"],
13859
+ },
13860
+ "Pro Map": {
13861
+ fileExt: [exports.FileExtension.mapx],
13862
+ type: exports.ItemType["Pro Map"],
13863
+ typeKeywords: ["ArcGIS Pro", "Map", "Map File", "mapx"],
13864
+ },
13865
+ "Pro Report": {
13866
+ fileExt: [exports.FileExtension.rptx],
13867
+ type: exports.ItemType["Pro Report"],
13868
+ typeKeywords: [],
13869
+ },
13870
+ "Project Package": {
13871
+ fileExt: [exports.FileExtension.ppkx],
13872
+ type: exports.ItemType["Project Package"],
13873
+ typeKeywords: [],
13874
+ },
13875
+ "Project Template": {
13876
+ fileExt: [exports.FileExtension.aptx],
13877
+ type: exports.ItemType["Project Template"],
13878
+ typeKeywords: [],
13879
+ },
13880
+ "Raster function template": {
13881
+ fileExt: [exports.FileExtension["rft.json"], exports.FileExtension["rft.xml"]],
13882
+ type: exports.ItemType["Raster function template"],
13883
+ typeKeywords: [
13884
+ "Raster",
13885
+ "Functions",
13886
+ "Processing",
13887
+ "rft",
13888
+ "srf",
13889
+ "function template",
13890
+ "templates",
13891
+ "ArcGIS Pro",
13892
+ ],
13893
+ },
13894
+ "Rule Package": {
13895
+ fileExt: [exports.FileExtension.rpk],
13896
+ type: exports.ItemType["Rule Package"],
13897
+ typeKeywords: [],
13898
+ },
13899
+ "Scene Package": {
13900
+ fileExt: [exports.FileExtension.slpk, exports.FileExtension.spk],
13901
+ type: exports.ItemType["Scene Package"],
13902
+ typeKeywords: [],
13903
+ },
13904
+ "Service Definition": {
13905
+ fileExt: [exports.FileExtension.sd],
13906
+ type: exports.ItemType["Service Definition"],
13907
+ typeKeywords: ["Data", "Service", "Service Definition"],
13908
+ },
13909
+ Shapefile: {
13910
+ fileExt: [exports.FileExtension.zip],
13911
+ type: exports.ItemType.Shapefile,
13912
+ typeKeywords: ["Data", "Layer", "shapefile"],
13913
+ },
13914
+ "Survey123 Add In": {
13915
+ fileExt: [exports.FileExtension.surveyaddin],
13916
+ type: exports.ItemType["Survey123 Add In"],
13917
+ typeKeywords: ["Add In", "Survey123 Add In", "Tool"],
13918
+ },
13919
+ "Tile Package": {
13920
+ fileExt: [exports.FileExtension.tpk, exports.FileExtension.tpkx],
13921
+ type: exports.ItemType["Tile Package"],
13922
+ typeKeywords: [],
13923
+ },
13924
+ "Vector Tile Package": {
13925
+ fileExt: [exports.FileExtension.vtpk],
13926
+ type: exports.ItemType["Vector Tile Package"],
13927
+ typeKeywords: [],
13928
+ },
13929
+ "Workflow Manager Package": {
13930
+ fileExt: [exports.FileExtension.wpk],
13931
+ type: exports.ItemType["Workflow Manager Package"],
13932
+ typeKeywords: [],
13933
+ },
13934
+ "Document Link": {
13935
+ type: exports.ItemType["Document Link"],
13936
+ typeKeywords: ["Data", "Document"],
13937
+ },
13938
+ "Feature Service": {
13939
+ type: exports.ItemType["Feature Service"],
13940
+ typeKeywords: [
13941
+ "ArcGIS Server",
13942
+ "Data",
13943
+ "Feature Access",
13944
+ "Feature Service",
13945
+ "Service",
13946
+ "Singlelayer",
13947
+ "Hosted Service",
13948
+ ],
13949
+ },
13950
+ GeocodeServer: {
13951
+ type: exports.ItemType["Geocoding Service"],
13952
+ typeKeywords: [
13953
+ "ArcGIS Server",
13954
+ "Geocoding Service",
13955
+ "Locator Service",
13956
+ "Service",
13957
+ "Tool",
13958
+ "Service Proxy",
13959
+ ],
13960
+ },
13961
+ GeoDataServer: {
13962
+ type: exports.ItemType["Geodata Service"],
13963
+ typeKeywords: ["Data", "Service", "Geodata Service", "ArcGIS Server"],
13964
+ },
13965
+ GeometryServer: {
13966
+ type: exports.ItemType["Geometry Service"],
13967
+ typeKeywords: ["Tool", "Service", "Geometry Service", "ArcGIS Server"],
13968
+ },
13969
+ GeoenrichmentServer: {
13970
+ type: exports.ItemType["Geoenrichment Service"],
13971
+ typeKeywords: ["Geoenrichment Service", "ArcGIS Server"],
13972
+ },
13973
+ GPServer: {
13974
+ type: exports.ItemType["Geoprocessing Service"],
13975
+ typeKeywords: ["Tool", "Service", "Geoprocessing Service", "ArcGIS Server"],
13976
+ },
13977
+ GlobeServer: {
13978
+ type: exports.ItemType["Globe Service"],
13979
+ typeKeywords: ["Data", "Service", "Globe Service", "ArcGIS Server"],
13980
+ },
13981
+ ImageServer: {
13982
+ type: exports.ItemType["Image Service"],
13983
+ typeKeywords: ["Data", "Service", "Image Service", "ArcGIS Server"],
13984
+ },
13985
+ MapServer: {
13986
+ type: exports.ItemType["Map Service"],
13987
+ typeKeywords: ["Data", "Service", "Map Service", "ArcGIS Server"],
13988
+ },
13989
+ NAServer: {
13990
+ type: exports.ItemType["Network Analysis Service"],
13991
+ typeKeywords: [
13992
+ "Tool",
13993
+ "Service",
13994
+ "Network Analysis Service",
13995
+ "ArcGIS Server",
13996
+ ],
13997
+ },
13998
+ ElevationServer: {
13999
+ type: exports.ItemType["Image Service"],
14000
+ typeKeywords: ["Elevation 3D Layer"],
14001
+ },
14002
+ VectorTileServer: {
14003
+ type: exports.ItemType["Vector Tile Service"],
14004
+ typeKeywords: [],
14005
+ },
14006
+ WFS: {
14007
+ type: exports.ItemType.WFS,
14008
+ typeKeywords: ["Data", "Service", "Web Feature Service", "OGC"],
14009
+ },
14010
+ WMS: {
14011
+ type: exports.ItemType.WMS,
14012
+ typeKeywords: ["Data", "Service", "Web Map Service", "OGC"],
14013
+ },
14014
+ WMTS: {
14015
+ type: exports.ItemType.WMTS,
14016
+ typeKeywords: ["Data", "Service", "OGC"],
14017
+ },
14018
+ ogcFeature: {
14019
+ type: exports.ItemType.OGCFeatureServer,
14020
+ typeKeywords: [
14021
+ "Data",
14022
+ "Service",
14023
+ "Feature Service",
14024
+ "OGC",
14025
+ "OGC Feature Service",
14026
+ ],
14027
+ },
14028
+ SceneServer: {
14029
+ type: exports.ItemType["Scene Service"],
14030
+ typeKeywords: ["Scene Service"],
14031
+ },
14032
+ StreamServer: {
14033
+ type: exports.ItemType["Stream Service"],
14034
+ typeKeywords: ["Data", "Service", "Stream Service", "ArcGIS Server"],
14035
+ },
14036
+ WMServer: {
14037
+ type: exports.ItemType["Workflow Manager Service"],
14038
+ typeKeywords: [
14039
+ "Workflow Manager",
14040
+ "ArcGIS Server",
14041
+ "WMServer",
14042
+ "Workflow",
14043
+ "JTX",
14044
+ "Job Tracking",
14045
+ ],
14046
+ },
14047
+ TiledImageServer: {
14048
+ type: exports.ItemType["Image Service"],
14049
+ typeKeywords: ["Tiled Imagery"],
14050
+ },
14051
+ "Web Mapping Application": {
14052
+ type: exports.ItemType["Web Mapping Application"],
14053
+ typeKeywords: [
14054
+ "JavaScript",
14055
+ "Map",
14056
+ "Mapping Site",
14057
+ "Online Map",
14058
+ "Ready To Use",
14059
+ "Web AppBuilder",
14060
+ "Web Map (+ WAB2D or WAB3D)",
14061
+ ],
14062
+ },
14063
+ "Mobile Application": {
14064
+ type: exports.ItemType["Mobile Application"],
14065
+ typeKeywords: ["ArcGIS Mobile Map", "Mobile Application"],
14066
+ },
14067
+ "AppBuilder Extension": {
14068
+ type: exports.ItemType["AppBuilder Extension"],
14069
+ typeKeywords: ["Widget", "App Builder"],
14070
+ },
14071
+ "Google Drive": {
14072
+ type: exports.ItemType["Google Drive"],
14073
+ typeKeywords: ["CSV", "Shapefile", "GeoJSON", "Excel", "FileGeodatabase"],
14074
+ },
14075
+ Dropbox: {
14076
+ type: exports.ItemType.Dropbox,
14077
+ typeKeywords: ["CSV", "Shapefile", "GeoJSON", "Excel", "FileGeodatabase"],
14078
+ },
14079
+ OneDrive: {
14080
+ type: exports.ItemType.OneDrive,
14081
+ typeKeywords: ["CSV", "Shapefile", "GeoJSON", "Excel", "FileGeodatabase"],
14082
+ },
14083
+ "Map Service": {
14084
+ type: exports.ItemType["Map Service"],
14085
+ typeKeywords: [
14086
+ "ArcGIS Server",
14087
+ "Data",
14088
+ "Map Service",
14089
+ "Service",
14090
+ "Hosted Service",
14091
+ ],
14092
+ },
14093
+ StoryMap: {
14094
+ type: exports.ItemType.StoryMap,
14095
+ typeKeywords: [
14096
+ "arcgis-storymaps",
14097
+ "StoryMap",
14098
+ "Web Application (smstatusdraft or smsstatuspublished)",
14099
+ ],
14100
+ },
14101
+ Dashboard: {
14102
+ type: exports.ItemType.Dashboard,
14103
+ typeKeywords: ["Dashboard", "Operations Dashboard"],
14104
+ },
14105
+ "Hub Initiative": {
14106
+ type: exports.ItemType["Hub Initiative"],
14107
+ typeKeywords: ["Hub", "hubInitiative", "OpenData"],
14108
+ },
14109
+ "Hub Site Application": {
14110
+ type: exports.ItemType["Hub Site Application"],
14111
+ typeKeywords: [
14112
+ "Hub",
14113
+ "hubSite",
14114
+ "hubSolution",
14115
+ "JavaScript",
14116
+ "Map",
14117
+ "Mapping Site",
14118
+ "Online Map",
14119
+ "OpenData",
14120
+ "Ready To Use",
14121
+ "selfConfigured",
14122
+ "Web Map",
14123
+ "Registered App",
14124
+ ],
14125
+ },
14126
+ "Web Experience": {
14127
+ type: exports.ItemType["Web Experience"],
14128
+ typeKeywords: [
14129
+ "EXB Experience",
14130
+ "JavaScript",
14131
+ "Ready To Use Web Application",
14132
+ "Web Experience",
14133
+ "Web Mapping Application",
14134
+ "Web Page",
14135
+ "Web Site",
14136
+ ],
14137
+ },
14138
+ "Insights Workbook Package": {
14139
+ type: exports.ItemType["Insights Workbook Package"],
14140
+ fileExt: [exports.FileExtension.insightswbk],
14141
+ typeKeywords: ["Insights", "Insights Workbook Package"],
14142
+ },
14143
+ };
14144
+
14145
+ var FEATURE_SERVICE_URL_REGEX = /(feature)server(\/|\/(\d+))?$/i;
14146
+ var SERVICE_URL_REGEX = /\/[a-zA-Z]+server(\/|\/(\d+))?$/i;
14147
+ /**
14148
+ * Feature service / Doc Links Should not have data urls. Let"s exclude them from that.
14149
+ *
14150
+ * @export
14151
+ * @param {string} itemType What type of item is it?
14152
+ * @return {*} {boolean}
14153
+ */
14154
+ function shouldHaveDataUrl(itemType) {
14155
+ // Specifically we want to avoid FS / DL from having a data url.
14156
+ return !["Feature Service", "Document Link"].includes(itemType);
14157
+ }
14158
+ /**
14159
+ * Get the file name out of a url. Will return either the
14160
+ * hostname, or the pathname if it exists
14161
+ *
14162
+ * @export
14163
+ * @param {string} url Url to get a file name out of
14164
+ * @return {*} {string}
14165
+ */
14166
+ function getFileName(url) {
14167
+ var filename;
14168
+ try {
14169
+ var parsed = new URL(url);
14170
+ // If the URL pathname exists, return its last segment,
14171
+ // otherwise return the hostname
14172
+ filename =
14173
+ parsed.pathname !== "/"
14174
+ ? parsed.pathname.split("/").pop()
14175
+ : parsed.hostname;
14176
+ }
14177
+ catch (e) {
14178
+ throw new Error("Error getting file name from data url");
14179
+ }
14180
+ return filename;
14181
+ }
14182
+ /**
14183
+ * Is this a valid url?
14184
+ *
14185
+ * @param {string} url Url to validate
14186
+ * @return {*} {boolean}
14187
+ */
14188
+ function isUrl(url) {
14189
+ // Use try / catch as a simple string "test" will cause new URL() to throw an error.
14190
+ try {
14191
+ var result = new URL(url);
14192
+ // Cast to bool.
14193
+ return !!result;
14194
+ }
14195
+ catch (e) {
14196
+ Logger.error("Error parsing data url");
14197
+ return false;
14198
+ }
14199
+ }
14200
+ /**
14201
+ * Tests if url string is a feature service / layer.
14202
+ *
14203
+ * @param {string} url URL to test
14204
+ * @return {*} {boolean}
14205
+ */
14206
+ function isFeatureService(url) {
14207
+ return FEATURE_SERVICE_URL_REGEX.test(url);
14208
+ }
14209
+ /**
14210
+ * Tests if url string is a service (map, feature, image, etc)
14211
+ *
14212
+ * @param {string} url Url to test
14213
+ * @return {*} {boolean}
14214
+ */
14215
+ function isService(url) {
14216
+ return SERVICE_URL_REGEX.test(url);
14217
+ }
14218
+ /**
14219
+ * Is the service a feature service AND is it a layer specifically
14220
+ *
14221
+ * @param {string} url
14222
+ * @return {*} {boolean}
14223
+ */
14224
+ function isFeatureLayer(url) {
14225
+ var results = url.match(FEATURE_SERVICE_URL_REGEX);
14226
+ return results && !!results[3];
14227
+ }
14228
+ /**
14229
+ * Gets item title from url as a fall back
14230
+ *
14231
+ * @param {string} url item url
14232
+ * @return {*} {string}
14233
+ */
14234
+ function getFeatureServiceTitle(url) {
14235
+ return url.match(/\/services\/(.+)\/(feature|map|image)server/i)[1];
14236
+ }
14237
+ /**
14238
+ * Gets item info out of a feature layer item.
14239
+ *
14240
+ * @export
14241
+ * @param {string} url Item URL
14242
+ * @param {{
14243
+ * name: string,
14244
+ * description: string,
14245
+ * extent: any
14246
+ * }} body Item body.
14247
+ * @return {*} {{
14248
+ * title: string,
14249
+ * description: string,
14250
+ * extent: any,
14251
+ * url: string
14252
+ * }}
14253
+ */
14254
+ function getFeatureLayerItem(url, body) {
14255
+ return {
14256
+ title: body.name,
14257
+ description: body.description,
14258
+ extent: body.extent,
14259
+ url: url,
14260
+ };
14261
+ }
14262
+ /**
14263
+ * Gets item info out of a feature service response (which is not a specific layer)
14264
+ *
14265
+ * @export
14266
+ * @param {*} url
14267
+ * @param {*} body
14268
+ * @return {*}
14269
+ */
14270
+ function getFeatureServiceItem(url, body) {
14271
+ var description = body.serviceDescription || body.description;
14272
+ var title = getFeatureServiceTitle(url);
14273
+ var extent = body.fullExtent || body.initialExtent;
14274
+ return { title: title, description: description, extent: extent, url: url };
14275
+ }
14276
+ /**
14277
+ * Ping a non FS url and return response status && headers
14278
+ *
14279
+ * @export
14280
+ * @param {string} url Non FS URL
14281
+ * @return {*} {Promise<{ ok: boolean, headers: Headers }>}
14282
+ */
14283
+ function pingUrl(url) {
14284
+ return __awaiter(this, void 0, void 0, function () {
14285
+ var response;
14286
+ return __generator(this, function (_a) {
14287
+ switch (_a.label) {
14288
+ case 0: return [4 /*yield*/, fetch(url, { method: "HEAD" })];
14289
+ case 1:
14290
+ response = _a.sent();
14291
+ return [2 /*return*/, {
14292
+ ok: response.ok,
14293
+ headers: response.headers,
14294
+ }];
14295
+ }
14296
+ });
14297
+ });
14298
+ }
14299
+ /**
14300
+ * Ping a FS URL and handle matters such as "hidden" success failures.
14301
+ *
14302
+ * @export
14303
+ * @param {string} url
14304
+ * @return {*} {Promise<{ ok: boolean, item?: any }>}
14305
+ */
14306
+ function pingFeatureService(url) {
14307
+ return __awaiter(this, void 0, void 0, function () {
14308
+ var parsed, response, body, getItem, item;
14309
+ return __generator(this, function (_a) {
14310
+ switch (_a.label) {
14311
+ case 0:
14312
+ parsed = new URL(url);
14313
+ parsed.searchParams.set("f", "json");
14314
+ return [4 /*yield*/, fetch(parsed.href)];
14315
+ case 1:
14316
+ response = _a.sent();
14317
+ if (!response.ok) {
14318
+ return [2 /*return*/, { ok: false }];
14319
+ }
14320
+ return [4 /*yield*/, response.json()];
14321
+ case 2:
14322
+ body = _a.sent();
14323
+ // Exit if the request returns an error
14324
+ if (body.error) {
14325
+ return [2 /*return*/, { ok: false }];
14326
+ }
14327
+ getItem = isFeatureLayer(url)
14328
+ ? getFeatureLayerItem
14329
+ : getFeatureServiceItem;
14330
+ item = getItem(url, body);
14331
+ return [2 /*return*/, {
14332
+ ok: true,
14333
+ item: item,
14334
+ }];
14335
+ }
14336
+ });
14337
+ });
14338
+ }
14339
+ function detectDataTypeFromHeader(headers) {
14340
+ var contentType = headers.get("Content-Type");
14341
+ var dataType;
14342
+ if (!contentType) {
14343
+ return;
14344
+ }
14345
+ // Only get the "media-type"
14346
+ contentType = contentType.split(";").shift();
14347
+ if (contentType === "text/csv") {
14348
+ dataType = exports.ItemType.CSV;
14349
+ }
14350
+ else if (contentType === "application/vnd.ms-excel" ||
14351
+ contentType ===
14352
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
14353
+ dataType = exports.ItemType["Microsoft Excel"];
14354
+ }
14355
+ else if (contentType === "application/pdf") {
14356
+ dataType = exports.ItemType.PDF;
14357
+ }
14358
+ else if (contentType === "image/jpeg" ||
14359
+ contentType === "image/jpg" ||
14360
+ contentType === "image/png") {
14361
+ dataType = exports.ItemType.Image;
14362
+ }
14363
+ else if (contentType === "application/geo+json") {
14364
+ dataType = exports.ItemType.GeoJson;
14365
+ }
14366
+ return dataType;
14367
+ }
14368
+ function detectDataTypeFromExtension(url) {
14369
+ var contentType = url.toLowerCase().split(".").pop();
14370
+ var dataType;
14371
+ if (contentType === "csv") {
14372
+ dataType = exports.ItemType.CSV;
14373
+ }
14374
+ else if (contentType === "xls" || contentType === "xlsx") {
14375
+ dataType = exports.ItemType["Microsoft Excel"];
14376
+ }
14377
+ else if (contentType === "pdf") {
14378
+ dataType = exports.ItemType.PDF;
14379
+ }
14380
+ else if (contentType === "jpeg" ||
14381
+ contentType === "jpg" ||
14382
+ contentType === "png") {
14383
+ dataType = exports.ItemType.Image;
14384
+ }
14385
+ else if (contentType === "geojson") {
14386
+ dataType = exports.ItemType.GeoJson;
14387
+ }
14388
+ return dataType;
14389
+ }
14390
+
14391
+ /**
14392
+ * Takes in a URL and validates it based on valid url, type of item, etc
14393
+ *
14394
+ * @export
14395
+ * @param {string} url
14396
+ * @return {*} {Promise<any>}
14397
+ */
14398
+ function validateUrl(url) {
14399
+ return __awaiter(this, void 0, void 0, function () {
14400
+ var isFeatureServiceUrl, isServiceUrl, type, item, pingResult, _a;
14401
+ return __generator(this, function (_b) {
14402
+ switch (_b.label) {
14403
+ case 0:
14404
+ // If URL doesn't pass then exit out immediately.
14405
+ if (!isUrl(url)) {
14406
+ return [2 /*return*/, {
14407
+ pass: false,
14408
+ error: "invalidFormat",
14409
+ }];
14410
+ }
14411
+ isFeatureServiceUrl = isFeatureService(url);
14412
+ isServiceUrl = isService(url);
14413
+ if (isServiceUrl && !isFeatureServiceUrl) {
14414
+ return [2 /*return*/, {
14415
+ pass: false,
14416
+ error: "invalidFormat",
14417
+ }];
14418
+ }
14419
+ pingResult = {};
14420
+ _b.label = 1;
14421
+ case 1:
14422
+ _b.trys.push([1, 6, , 7]);
14423
+ if (!isFeatureServiceUrl) return [3 /*break*/, 3];
14424
+ return [4 /*yield*/, pingFeatureService(url)];
14425
+ case 2:
14426
+ _a = _b.sent();
14427
+ return [3 /*break*/, 5];
14428
+ case 3: return [4 /*yield*/, pingUrl(url)];
14429
+ case 4:
14430
+ _a = _b.sent();
14431
+ _b.label = 5;
14432
+ case 5:
14433
+ pingResult = _a;
14434
+ // return an error if the response is not okay
14435
+ if (!pingResult.ok) {
14436
+ return [2 /*return*/, {
14437
+ pass: false,
14438
+ error: "invalidUrl",
14439
+ }];
14440
+ }
14441
+ return [3 /*break*/, 7];
14442
+ case 6:
14443
+ _b.sent();
14444
+ // TODO: This is tricky. The fetch() API rejects when a network error
14445
+ // happens. This error can be a CORS error, or a 404 error, or a timeout
14446
+ // error. While an error like 404 does suggest a bad URL, the CORS occurs
14447
+ // because this is a front-end request and the file is likely accessible by
14448
+ // the server. Unfortunately, the error doesn't have any information about
14449
+ // underline failure type. For now, the network failure is ignored, so the
14450
+ // user can paste a URL from any domain and avoid the CORS issue.
14451
+ Logger.error("error requesting url");
14452
+ return [3 /*break*/, 7];
14453
+ case 7:
14454
+ // Use the metadata from the ping response if exists, otherwise guess the file
14455
+ // name from the URL
14456
+ if (pingResult.item) {
14457
+ item = pingResult.item;
14458
+ }
14459
+ else {
14460
+ item = { title: getFileName(url), url: url };
14461
+ }
14462
+ if (pingResult.headers) {
14463
+ type = detectDataTypeFromHeader(pingResult.headers);
14464
+ }
14465
+ if (isFeatureServiceUrl) {
14466
+ type = exports.ItemType["Feature Service"];
14467
+ }
14468
+ else if (!type) {
14469
+ // Guess the data type from the extension
14470
+ type = detectDataTypeFromExtension(url);
14471
+ }
14472
+ if (type) {
14473
+ item.type = type;
14474
+ }
14475
+ if (item.type && shouldHaveDataUrl(item.type)) {
14476
+ item.dataUrl = item.url;
14477
+ }
14478
+ return [2 /*return*/, {
14479
+ pass: true,
14480
+ // The type may or may not be true
14481
+ type: type,
14482
+ // fetched / calculated item
14483
+ item: item,
14484
+ }];
14485
+ }
14486
+ });
14487
+ });
14488
+ }
14489
+
13278
14490
  /**
13279
14491
  * Search the Hub API
13280
14492
  *
@@ -13584,6 +14796,7 @@
13584
14796
  "sortField",
13585
14797
  "sortOrder",
13586
14798
  "site",
14799
+ "start",
13587
14800
  ];
13588
14801
  // copy the props over
13589
14802
  props.forEach(function (prop) {
@@ -13686,6 +14899,7 @@
13686
14899
  "sortField",
13687
14900
  "sortOrder",
13688
14901
  "site",
14902
+ "start",
13689
14903
  ];
13690
14904
  // copy the props over
13691
14905
  props.forEach(function (prop) {
@@ -13774,6 +14988,7 @@
13774
14988
  "sortField",
13775
14989
  "sortOrder",
13776
14990
  "site",
14991
+ "start",
13777
14992
  ];
13778
14993
  // copy the props over
13779
14994
  props.forEach(function (prop) {
@@ -15641,6 +16856,7 @@
15641
16856
  exports._unprotectAndRemoveGroup = _unprotectAndRemoveGroup;
15642
16857
  exports._unprotectAndRemoveItem = _unprotectAndRemoveItem;
15643
16858
  exports.addContextToSlug = addContextToSlug;
16859
+ exports.addCreateItemTypes = addCreateItemTypes;
15644
16860
  exports.addDays = addDays;
15645
16861
  exports.addDomain = addDomain;
15646
16862
  exports.addSiteDomains = addSiteDomains;
@@ -15799,7 +17015,7 @@
15799
17015
  exports.isDomainUsedElsewhere = isDomainUsedElsewhere;
15800
17016
  exports.isDownloadable = isDownloadable;
15801
17017
  exports.isExtentCoordinateArray = isExtentCoordinateArray;
15802
- exports.isFeatureService = isFeatureService;
17018
+ exports.isFeatureService = isFeatureService$1;
15803
17019
  exports.isFieldworkerView = isFieldworkerView;
15804
17020
  exports.isGuid = isGuid;
15805
17021
  exports.isLayerView = isLayerView;
@@ -15873,6 +17089,7 @@
15873
17089
  exports.upgradeProtocol = upgradeProtocol;
15874
17090
  exports.upgradeSiteSchema = upgradeSiteSchema;
15875
17091
  exports.uploadResourcesFromUrl = uploadResourcesFromUrl;
17092
+ exports.validateUrl = validateUrl;
15876
17093
  exports.valueToMatchOptions = valueToMatchOptions;
15877
17094
  exports.without = without;
15878
17095
  exports.withoutByProp = withoutByProp;