@esri/hub-common 9.25.5 → 9.26.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/es2017/content/_internal.js +28 -1
- package/dist/es2017/content/_internal.js.map +1 -1
- package/dist/es2017/content/compose.js +27 -23
- package/dist/es2017/content/compose.js.map +1 -1
- package/dist/es2017/content/fetch.js +25 -5
- package/dist/es2017/content/fetch.js.map +1 -1
- package/dist/es2017/resources/_internal/_validate-url-helpers.js +231 -0
- package/dist/es2017/resources/_internal/_validate-url-helpers.js.map +1 -0
- package/dist/es2017/resources/index.js +1 -0
- package/dist/es2017/resources/index.js.map +1 -1
- package/dist/es2017/resources/validate-url.js +86 -0
- package/dist/es2017/resources/validate-url.js.map +1 -0
- package/dist/es2017/types.js +862 -0
- package/dist/es2017/types.js.map +1 -1
- package/dist/esm/content/_internal.js +28 -1
- package/dist/esm/content/_internal.js.map +1 -1
- package/dist/esm/content/compose.js +27 -23
- package/dist/esm/content/compose.js.map +1 -1
- package/dist/esm/content/fetch.js +29 -11
- package/dist/esm/content/fetch.js.map +1 -1
- package/dist/esm/resources/_internal/_validate-url-helpers.js +249 -0
- package/dist/esm/resources/_internal/_validate-url-helpers.js.map +1 -0
- package/dist/esm/resources/index.js +1 -0
- package/dist/esm/resources/index.js.map +1 -1
- package/dist/esm/resources/validate-url.js +103 -0
- package/dist/esm/resources/validate-url.js.map +1 -0
- package/dist/esm/types.js +862 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/node/content/_internal.js +28 -1
- package/dist/node/content/_internal.js.map +1 -1
- package/dist/node/content/compose.js +26 -22
- package/dist/node/content/compose.js.map +1 -1
- package/dist/node/content/fetch.js +23 -3
- package/dist/node/content/fetch.js.map +1 -1
- package/dist/node/resources/_internal/_validate-url-helpers.js +247 -0
- package/dist/node/resources/_internal/_validate-url-helpers.js.map +1 -0
- package/dist/node/resources/index.js +1 -0
- package/dist/node/resources/index.js.map +1 -1
- package/dist/node/resources/validate-url.js +90 -0
- package/dist/node/resources/validate-url.js.map +1 -0
- package/dist/node/types.js +863 -0
- package/dist/node/types.js.map +1 -1
- package/dist/types/content/_internal.d.ts +21 -3
- package/dist/types/resources/_internal/_validate-url-helpers.d.ts +115 -0
- package/dist/types/resources/index.d.ts +1 -0
- package/dist/types/resources/validate-url.d.ts +8 -0
- package/dist/types/types.d.ts +225 -4
- package/dist/umd/common.umd.js +1317 -35
- package/dist/umd/common.umd.js.map +1 -1
- package/dist/umd/common.umd.min.js +1 -1
- package/dist/umd/common.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/common.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/hub-common - v9.25.
|
|
2
|
+
* @esri/hub-common - v9.25.7 - Tue Apr 05 2022 18:29:14 GMT+0000 (Coordinated Universal Time)
|
|
3
3
|
* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
|
|
4
4
|
* Apache-2.0
|
|
5
5
|
*/
|
|
@@ -6172,6 +6172,26 @@
|
|
|
6172
6172
|
return request(layersUrl, requestOptions);
|
|
6173
6173
|
}
|
|
6174
6174
|
|
|
6175
|
+
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
|
|
6176
|
+
* Apache-2.0 */
|
|
6177
|
+
/**
|
|
6178
|
+
* ```js
|
|
6179
|
+
* import { getLayer } from '@esri/arcgis-rest-feature-layer';
|
|
6180
|
+
* //
|
|
6181
|
+
* getLayer({
|
|
6182
|
+
* url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/FeatureServer/0"
|
|
6183
|
+
* })
|
|
6184
|
+
* .then(response) // { name: "311", id: 0, ... }
|
|
6185
|
+
* ```
|
|
6186
|
+
* Layer (Feature Service) request. See the [REST Documentation](https://developers.arcgis.com/rest/services-reference/layer-feature-service-.htm) for more information.
|
|
6187
|
+
*
|
|
6188
|
+
* @param options - Options for the request.
|
|
6189
|
+
* @returns A Promise that will resolve with the addFeatures response.
|
|
6190
|
+
*/
|
|
6191
|
+
function getLayer(options) {
|
|
6192
|
+
return request(cleanUrl(options.url), options);
|
|
6193
|
+
}
|
|
6194
|
+
|
|
6175
6195
|
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
|
|
6176
6196
|
* Apache-2.0 */
|
|
6177
6197
|
/**
|
|
@@ -6711,6 +6731,33 @@
|
|
|
6711
6731
|
}
|
|
6712
6732
|
return result;
|
|
6713
6733
|
};
|
|
6734
|
+
/**
|
|
6735
|
+
* @private
|
|
6736
|
+
*
|
|
6737
|
+
* Contains fallback logic for determining a content's extent.
|
|
6738
|
+
*
|
|
6739
|
+
* The fallback priority is as follows:
|
|
6740
|
+
* 1) item's extent (if valid bbox)
|
|
6741
|
+
* 2) extent enrichment from the hub api (if coordinates are valid bbox)
|
|
6742
|
+
* 3) layer's extent (if spatial reference is 4326)
|
|
6743
|
+
*
|
|
6744
|
+
* If none of these conditions are met, undefined is returned.
|
|
6745
|
+
*
|
|
6746
|
+
* @param item
|
|
6747
|
+
* @param layer
|
|
6748
|
+
* @param extentEnrichment
|
|
6749
|
+
* @returns the correct extent in a bbox format, or undefined
|
|
6750
|
+
*/
|
|
6751
|
+
var determineExtent = function (item, extentEnrichment, layer) {
|
|
6752
|
+
var itemExtent = isBBox(item.extent) ? item.extent : undefined;
|
|
6753
|
+
var extentEnrichmentCoordinates = isBBox(extentEnrichment === null || extentEnrichment === void 0 ? void 0 : extentEnrichment.coordinates)
|
|
6754
|
+
? extentEnrichment.coordinates
|
|
6755
|
+
: undefined;
|
|
6756
|
+
var layerExtent = getProp(layer, "extent.spatialReference.wkid") === 4326
|
|
6757
|
+
? extentToBBox(layer.extent)
|
|
6758
|
+
: undefined;
|
|
6759
|
+
return itemExtent || extentEnrichmentCoordinates || layerExtent;
|
|
6760
|
+
};
|
|
6714
6761
|
|
|
6715
6762
|
var STANDARD_LICENSES = [
|
|
6716
6763
|
{
|
|
@@ -7042,17 +7089,18 @@
|
|
|
7042
7089
|
var layer = layers && layers.length === 1 ? layers[0] : undefined;
|
|
7043
7090
|
return layer && layer.capabilities.includes("Query") ? layer : undefined;
|
|
7044
7091
|
};
|
|
7045
|
-
var shouldUseLayerInfo = function (layer, layers,
|
|
7046
|
-
return (
|
|
7092
|
+
var shouldUseLayerInfo = function (item, layer, layers, requestOptions) {
|
|
7093
|
+
return (!isProxiedCSV(item, requestOptions) &&
|
|
7094
|
+
layer &&
|
|
7047
7095
|
layers &&
|
|
7048
7096
|
layers.length > 1 &&
|
|
7049
7097
|
// we use item info instead of layer info for single layer items
|
|
7050
|
-
!getLayerIdFromUrl(url));
|
|
7098
|
+
!getLayerIdFromUrl(item.url));
|
|
7051
7099
|
};
|
|
7052
7100
|
// this logic adapted from hub-indexer's determineName(), see
|
|
7053
7101
|
// https://github.com/ArcGIS/hub-indexer/blob/8f4dd6f928124c1f35dd02bc11bd996191ee1160/packages/duke/compose/common.js#L7-L34
|
|
7054
|
-
var getContentName = function (item, layer, layers) {
|
|
7055
|
-
return ((shouldUseLayerInfo(layer, layers,
|
|
7102
|
+
var getContentName = function (item, layer, layers, requestOptions) {
|
|
7103
|
+
return ((shouldUseLayerInfo(item, layer, layers, requestOptions)
|
|
7056
7104
|
? layer.name
|
|
7057
7105
|
: item.title || item.name) || "").replace(/_/g, " ");
|
|
7058
7106
|
};
|
|
@@ -7300,7 +7348,9 @@
|
|
|
7300
7348
|
var getProxyUrl = function (item, requestOptions) {
|
|
7301
7349
|
var result;
|
|
7302
7350
|
if (isProxiedCSV(item, requestOptions)) {
|
|
7303
|
-
|
|
7351
|
+
// Sometimes hubApiUrl includes /api/v3, sometimes it doesn't
|
|
7352
|
+
var baseUrl = getHubApiUrl(requestOptions).replace("/api/v3", "");
|
|
7353
|
+
result = baseUrl + "/datasets/" + item.id + "_0/FeatureServer/0";
|
|
7304
7354
|
}
|
|
7305
7355
|
return result;
|
|
7306
7356
|
};
|
|
@@ -7319,7 +7369,7 @@
|
|
|
7319
7369
|
* @param {string} type - item's type
|
|
7320
7370
|
* @returns {boolean}
|
|
7321
7371
|
*/
|
|
7322
|
-
var isFeatureService = function (type) {
|
|
7372
|
+
var isFeatureService$1 = function (type) {
|
|
7323
7373
|
return type && type.toLowerCase() === "feature service";
|
|
7324
7374
|
};
|
|
7325
7375
|
/**
|
|
@@ -7367,7 +7417,7 @@
|
|
|
7367
7417
|
// the Singlelayer typeKeyword, which I think is set when you create the item in AGO
|
|
7368
7418
|
// but have not verified that, nor that we should alway return '0' in that case
|
|
7369
7419
|
return (getLayerIdFromUrl(item.url) ||
|
|
7370
|
-
(isFeatureService(item.type) &&
|
|
7420
|
+
(isFeatureService$1(item.type) &&
|
|
7371
7421
|
item.typeKeywords &&
|
|
7372
7422
|
includes(item.typeKeywords, "Singlelayer") &&
|
|
7373
7423
|
"0"));
|
|
@@ -7429,7 +7479,7 @@
|
|
|
7429
7479
|
? // find the explicitly set layer id
|
|
7430
7480
|
layers.find(function (_layer) { return _layer.id === _layerId; })
|
|
7431
7481
|
: // for feature servers with a single layer always show the layer
|
|
7432
|
-
isFeatureService(item.type) && getOnlyQueryLayer(layers)));
|
|
7482
|
+
isFeatureService$1(item.type) && getOnlyQueryLayer(layers)));
|
|
7433
7483
|
};
|
|
7434
7484
|
/**
|
|
7435
7485
|
* determine if a layer is a layer view
|
|
@@ -7440,6 +7490,18 @@
|
|
|
7440
7490
|
var isLayerView = function (layer) {
|
|
7441
7491
|
return layer.isView;
|
|
7442
7492
|
};
|
|
7493
|
+
var determineHubId = function (item, layer, requestOptions) {
|
|
7494
|
+
// Proxied CSVs are one offs in that we don't index the proxied layer,
|
|
7495
|
+
// so we cannot append _0. Return item id instead.
|
|
7496
|
+
if (isProxiedCSV(item, requestOptions)) {
|
|
7497
|
+
return item.id;
|
|
7498
|
+
}
|
|
7499
|
+
return canUseHubApiForItem(item, requestOptions)
|
|
7500
|
+
? layer
|
|
7501
|
+
? item.id + "_" + layer.id
|
|
7502
|
+
: getItemHubId(item)
|
|
7503
|
+
: undefined;
|
|
7504
|
+
};
|
|
7443
7505
|
/**
|
|
7444
7506
|
* Compose a new content object out of an item, enrichments, and context
|
|
7445
7507
|
* @param item
|
|
@@ -7452,15 +7514,12 @@
|
|
|
7452
7514
|
// set common variables that we will use in the derived properties below
|
|
7453
7515
|
var layer = getItemLayer(item, layers, options === null || options === void 0 ? void 0 : options.layerId);
|
|
7454
7516
|
// NOTE: we only set hubId for public items in online
|
|
7455
|
-
var hubId =
|
|
7456
|
-
? layer
|
|
7457
|
-
? item.id + "_" + layer.id
|
|
7458
|
-
: getItemHubId(item)
|
|
7459
|
-
: undefined;
|
|
7517
|
+
var hubId = determineHubId(item, layer, requestOptions);
|
|
7460
7518
|
var identifier = slug || hubId || item.id;
|
|
7461
7519
|
// whether or not we should show layer info for name, description, etc
|
|
7462
|
-
var name = getContentName(item, layer, layers);
|
|
7463
|
-
var _layerDescription = shouldUseLayerInfo(layer, layers,
|
|
7520
|
+
var name = getContentName(item, layer, layers, requestOptions);
|
|
7521
|
+
var _layerDescription = shouldUseLayerInfo(item, layer, layers, requestOptions) &&
|
|
7522
|
+
layer.description;
|
|
7464
7523
|
// so much depends on type
|
|
7465
7524
|
var type = layer
|
|
7466
7525
|
? // use layer type (Feature Layer, Table, etc) for layer content
|
|
@@ -7539,15 +7598,8 @@
|
|
|
7539
7598
|
control: item.itemControl || "view",
|
|
7540
7599
|
};
|
|
7541
7600
|
},
|
|
7542
|
-
// TODO: do we want to add dataset extent logic as a getter here?
|
|
7543
7601
|
get extent() {
|
|
7544
|
-
return
|
|
7545
|
-
? // we fall back to the extent derived by the Hub API
|
|
7546
|
-
// which prefers layer or service extents and ultimately
|
|
7547
|
-
// falls back to the org's extent
|
|
7548
|
-
extent.coordinates
|
|
7549
|
-
: // prefer item extent
|
|
7550
|
-
item.extent;
|
|
7602
|
+
return determineExtent(item, extent, layer);
|
|
7551
7603
|
},
|
|
7552
7604
|
// would require us to do client-side projection of server/layer extent
|
|
7553
7605
|
get boundary() {
|
|
@@ -9026,31 +9078,45 @@
|
|
|
9026
9078
|
return ["Feature Layer", "Table"].includes(contentType);
|
|
9027
9079
|
};
|
|
9028
9080
|
var maybeFetchLayerEnrichments = function (itemAndEnrichments, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
9029
|
-
var item, data, layers, layer, layerEnrichments, _a;
|
|
9081
|
+
var item, data, layers, layer, layerUrl, getLayerOptions, layerEnrichments, _a;
|
|
9030
9082
|
return __generator(this, function (_b) {
|
|
9031
9083
|
switch (_b.label) {
|
|
9032
9084
|
case 0:
|
|
9033
|
-
item = itemAndEnrichments.item, data = itemAndEnrichments.data
|
|
9085
|
+
item = itemAndEnrichments.item, data = itemAndEnrichments.data;
|
|
9086
|
+
layers = itemAndEnrichments.layers;
|
|
9034
9087
|
layer = layers && getItemLayer(item, layers, options && options.layerId);
|
|
9035
|
-
if (!(layer &&
|
|
9088
|
+
if (!(layer && !layer.type)) return [3 /*break*/, 2];
|
|
9089
|
+
layerUrl = parseServiceUrl(item.url) + "/" + layer.id;
|
|
9090
|
+
getLayerOptions = Object.assign({ url: layerUrl }, options);
|
|
9091
|
+
return [4 /*yield*/, getLayer(getLayerOptions)];
|
|
9092
|
+
case 1:
|
|
9093
|
+
layer = _b.sent();
|
|
9094
|
+
layers = layers.map(function (unhydratedLayer) {
|
|
9095
|
+
return unhydratedLayer.id === layer.id ? layer : unhydratedLayer;
|
|
9096
|
+
});
|
|
9097
|
+
_b.label = 2;
|
|
9098
|
+
case 2:
|
|
9099
|
+
if (!(layer && isLayerView(layer) && !data)) return [3 /*break*/, 4];
|
|
9036
9100
|
// to store (at least part of) it's view definition in item data
|
|
9037
9101
|
// it seems that most do not, but until we have a reliable signal
|
|
9038
9102
|
// we just fetch the item data for all layer views
|
|
9039
9103
|
return [4 /*yield*/, fetchItemEnrichments(item, ["data"], options)];
|
|
9040
|
-
case
|
|
9104
|
+
case 3:
|
|
9041
9105
|
// to store (at least part of) it's view definition in item data
|
|
9042
9106
|
// it seems that most do not, but until we have a reliable signal
|
|
9043
9107
|
// we just fetch the item data for all layer views
|
|
9044
9108
|
_a = _b.sent();
|
|
9045
|
-
return [3 /*break*/,
|
|
9046
|
-
case
|
|
9109
|
+
return [3 /*break*/, 5];
|
|
9110
|
+
case 4:
|
|
9047
9111
|
_a = undefined;
|
|
9048
|
-
_b.label =
|
|
9049
|
-
case
|
|
9112
|
+
_b.label = 5;
|
|
9113
|
+
case 5:
|
|
9050
9114
|
layerEnrichments = _a;
|
|
9051
9115
|
return [2 /*return*/, __assign(__assign(__assign({}, itemAndEnrichments), layerEnrichments), {
|
|
9052
9116
|
// merge error arrays
|
|
9053
|
-
errors: maybeConcat([itemAndEnrichments.errors, layerEnrichments === null || layerEnrichments === void 0 ? void 0 : layerEnrichments.errors])
|
|
9117
|
+
errors: maybeConcat([itemAndEnrichments.errors, layerEnrichments === null || layerEnrichments === void 0 ? void 0 : layerEnrichments.errors]),
|
|
9118
|
+
// Also remove once we stop supporting ArcGIS Servers below version 10.5
|
|
9119
|
+
layers: layers })];
|
|
9054
9120
|
}
|
|
9055
9121
|
});
|
|
9056
9122
|
}); };
|
|
@@ -9061,6 +9127,10 @@
|
|
|
9061
9127
|
case 0: return [4 /*yield*/, getItem(itemId, options)];
|
|
9062
9128
|
case 1:
|
|
9063
9129
|
item = _a.sent();
|
|
9130
|
+
// The Hub Application expects the item url of proxied CSVs to point to the
|
|
9131
|
+
// proxying feature service. Stabbing it on here maintains that consistency
|
|
9132
|
+
// and also helps us fetch and calculate the correct reference layer
|
|
9133
|
+
item.url = getProxyUrl(item, options) || item.url;
|
|
9064
9134
|
enrichmentsToFetch = (options === null || options === void 0 ? void 0 : options.enrichments) || getContentEnrichments(item);
|
|
9065
9135
|
return [4 /*yield*/, fetchItemEnrichments(item, enrichmentsToFetch, options)];
|
|
9066
9136
|
case 2:
|
|
@@ -13205,6 +13275,1216 @@
|
|
|
13205
13275
|
}
|
|
13206
13276
|
}
|
|
13207
13277
|
|
|
13278
|
+
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
|
|
13279
|
+
* Apache-2.0 */
|
|
13280
|
+
/**
|
|
13281
|
+
* ENUM which defines File extensions.
|
|
13282
|
+
*/
|
|
13283
|
+
exports.FileExtension = void 0;
|
|
13284
|
+
(function (FileExtension) {
|
|
13285
|
+
FileExtension["aptx"] = "aptx";
|
|
13286
|
+
FileExtension["bpk"] = "bpk";
|
|
13287
|
+
FileExtension["csv"] = "csv";
|
|
13288
|
+
FileExtension["eaz"] = "eaz";
|
|
13289
|
+
FileExtension["esriaddin"] = "esriaddin";
|
|
13290
|
+
FileExtension["esriaddinx"] = "esriaddinx";
|
|
13291
|
+
FileExtension["doc"] = "doc";
|
|
13292
|
+
FileExtension["docx"] = "docx";
|
|
13293
|
+
FileExtension["dlpk"] = "dlpk";
|
|
13294
|
+
FileExtension["featurecollection"] = "featurecollection";
|
|
13295
|
+
FileExtension["geojson"] = "geojson";
|
|
13296
|
+
FileExtension["gcpk"] = "gcpk";
|
|
13297
|
+
FileExtension["gpk"] = "gpk";
|
|
13298
|
+
FileExtension["gpkg"] = "gpkg";
|
|
13299
|
+
FileExtension["gpkx"] = "gpkx";
|
|
13300
|
+
FileExtension["insightswbk"] = "insightswbk";
|
|
13301
|
+
FileExtension["ipynb"] = "ipynb";
|
|
13302
|
+
FileExtension["jpg"] = "jpg";
|
|
13303
|
+
FileExtension["jpeg"] = "jpeg";
|
|
13304
|
+
FileExtension["json"] = "json";
|
|
13305
|
+
FileExtension["key"] = "key";
|
|
13306
|
+
FileExtension["kml"] = "kml";
|
|
13307
|
+
FileExtension["kmz"] = "kmz";
|
|
13308
|
+
FileExtension["lpk"] = "lpk";
|
|
13309
|
+
FileExtension["lpkx"] = "lpkx";
|
|
13310
|
+
FileExtension["lyr"] = "lyr";
|
|
13311
|
+
FileExtension["lyrx"] = "lyrx";
|
|
13312
|
+
FileExtension["mapx"] = "mapx";
|
|
13313
|
+
FileExtension["mmpk"] = "mmpk";
|
|
13314
|
+
FileExtension["mpk"] = "mpk";
|
|
13315
|
+
FileExtension["mpkx"] = "mpkx";
|
|
13316
|
+
FileExtension["msd"] = "msd";
|
|
13317
|
+
FileExtension["mspk"] = "mspk";
|
|
13318
|
+
FileExtension["mxd"] = "mxd";
|
|
13319
|
+
FileExtension["ncfg"] = "ncfg";
|
|
13320
|
+
FileExtension["nmc"] = "nmc";
|
|
13321
|
+
FileExtension["nmf"] = "nmf";
|
|
13322
|
+
FileExtension["numbers"] = "numbers";
|
|
13323
|
+
FileExtension["pages"] = "pages";
|
|
13324
|
+
FileExtension["pagx"] = "pagx";
|
|
13325
|
+
FileExtension["parquet"] = "parquet";
|
|
13326
|
+
FileExtension["pdf"] = "pdf";
|
|
13327
|
+
FileExtension["pmf"] = "pmf";
|
|
13328
|
+
FileExtension["png"] = "png";
|
|
13329
|
+
FileExtension["ppkx"] = "ppkx";
|
|
13330
|
+
FileExtension["ppt"] = "ppt";
|
|
13331
|
+
FileExtension["pptx"] = "pptx";
|
|
13332
|
+
FileExtension["proconfigx"] = "proconfigx";
|
|
13333
|
+
FileExtension["rpk"] = "rpk";
|
|
13334
|
+
FileExtension["rptx"] = "rptx";
|
|
13335
|
+
FileExtension["sd"] = "sd";
|
|
13336
|
+
FileExtension["slpk"] = "slpk";
|
|
13337
|
+
FileExtension["spk"] = "spk";
|
|
13338
|
+
FileExtension["stylx"] = "stylx";
|
|
13339
|
+
FileExtension["surveyaddin"] = "surveyaddin";
|
|
13340
|
+
FileExtension["sxd"] = "sxd";
|
|
13341
|
+
FileExtension["tif"] = "tif";
|
|
13342
|
+
FileExtension["tiff"] = "tiff";
|
|
13343
|
+
FileExtension["tpk"] = "tpk";
|
|
13344
|
+
FileExtension["tpkx"] = "tpkx";
|
|
13345
|
+
FileExtension["vsd"] = "vsd";
|
|
13346
|
+
FileExtension["vtpk"] = "vtpk";
|
|
13347
|
+
FileExtension["wmpk"] = "wmpk";
|
|
13348
|
+
FileExtension["wpk"] = "wpk";
|
|
13349
|
+
FileExtension["xls"] = "xls";
|
|
13350
|
+
FileExtension["xml"] = "xml";
|
|
13351
|
+
FileExtension["xlsx"] = "xlsx";
|
|
13352
|
+
FileExtension["zip"] = "zip";
|
|
13353
|
+
FileExtension["3dd"] = "3dd";
|
|
13354
|
+
FileExtension["3vr"] = "3vr";
|
|
13355
|
+
FileExtension["3ws"] = "3ws";
|
|
13356
|
+
FileExtension["rft.json"] = "rft.json";
|
|
13357
|
+
FileExtension["rft.xml"] = "rft.xml";
|
|
13358
|
+
})(exports.FileExtension || (exports.FileExtension = {}));
|
|
13359
|
+
/**
|
|
13360
|
+
* ENUM which defines human readable Item Type names
|
|
13361
|
+
*/
|
|
13362
|
+
exports.ItemType = void 0;
|
|
13363
|
+
(function (ItemType) {
|
|
13364
|
+
ItemType["360 VR Experience"] = "360 VR Experience";
|
|
13365
|
+
ItemType["Apache Parquet"] = "Apache Parquet";
|
|
13366
|
+
ItemType["AppBuilder Widget Package"] = "AppBuilder Widget Package";
|
|
13367
|
+
ItemType["Desktop Add In"] = "Desktop Add In";
|
|
13368
|
+
ItemType["Explorer Add In"] = "Explorer Add In";
|
|
13369
|
+
ItemType["Explorer Map"] = "Explorer Map";
|
|
13370
|
+
ItemType["Explorer Layer"] = "Explorer Layer";
|
|
13371
|
+
ItemType["Windows Mobile Package"] = "Windows Mobile Package";
|
|
13372
|
+
ItemType["ArcGIS Pro Add In"] = "ArcGIS Pro Add In";
|
|
13373
|
+
ItemType["ArcGIS Pro Configuration"] = "ArcGIS Pro Configuration";
|
|
13374
|
+
ItemType["Globe Document"] = "Globe Document";
|
|
13375
|
+
ItemType["Map Document"] = "Map Document";
|
|
13376
|
+
ItemType["ArcPad Package"] = "ArcPad Package";
|
|
13377
|
+
ItemType["Published Map"] = "Published Map";
|
|
13378
|
+
ItemType["Scene Document"] = "Scene Document";
|
|
13379
|
+
ItemType["CityEngine Web Scene"] = "CityEngine Web Scene";
|
|
13380
|
+
ItemType["Code Sample"] = "Code Sample";
|
|
13381
|
+
ItemType["CSV Collection"] = "CSV Collection";
|
|
13382
|
+
ItemType["CSV"] = "CSV";
|
|
13383
|
+
ItemType["CAD Drawing"] = "CAD Drawing";
|
|
13384
|
+
ItemType["Deep Learning Package"] = "Deep Learning Package";
|
|
13385
|
+
ItemType["Desktop Application"] = "Desktop Application";
|
|
13386
|
+
ItemType["Desktop Application Template"] = "Desktop Application Template";
|
|
13387
|
+
ItemType["Desktop Style"] = "Desktop Style";
|
|
13388
|
+
ItemType["Earth Configuration"] = "Earth Configuration";
|
|
13389
|
+
ItemType["Feature Collection"] = "Feature Collection";
|
|
13390
|
+
ItemType["File Geodatabase"] = "File Geodatabase";
|
|
13391
|
+
ItemType["GeoJson"] = "GeoJson";
|
|
13392
|
+
ItemType["Geoprocessing Package"] = "Geoprocessing Package";
|
|
13393
|
+
ItemType["GeoPackage"] = "GeoPackage";
|
|
13394
|
+
ItemType["Geoprocessing Sample"] = "Geoprocessing Sample";
|
|
13395
|
+
ItemType["GML"] = "GML";
|
|
13396
|
+
ItemType["Image Collection"] = "Image Collection";
|
|
13397
|
+
ItemType["Image"] = "Image";
|
|
13398
|
+
ItemType["iWork Keynote"] = "iWork Keynote";
|
|
13399
|
+
ItemType["iWork Numbers"] = "iWork Numbers";
|
|
13400
|
+
ItemType["iWork Pages"] = "iWork Pages";
|
|
13401
|
+
ItemType["KML Collection"] = "KML Collection";
|
|
13402
|
+
ItemType["KML"] = "KML";
|
|
13403
|
+
ItemType["Layer"] = "Layer";
|
|
13404
|
+
ItemType["Layer Package"] = "Layer Package";
|
|
13405
|
+
ItemType["Layout"] = "Layout";
|
|
13406
|
+
ItemType["Locator Package"] = "Locator Package";
|
|
13407
|
+
ItemType["Map Package"] = "Map Package";
|
|
13408
|
+
ItemType["Map Template"] = "Map Template";
|
|
13409
|
+
ItemType["Microsoft Excel"] = "Microsoft Excel";
|
|
13410
|
+
ItemType["Microsoft Powerpoint"] = "Microsoft Powerpoint";
|
|
13411
|
+
ItemType["Visio Document"] = "Visio Document";
|
|
13412
|
+
ItemType["Microsoft Word"] = "Microsoft Word";
|
|
13413
|
+
ItemType["Mobile Basemap Package"] = "Mobile Basemap Package";
|
|
13414
|
+
ItemType["Mobile Map Package"] = "Mobile Map Package";
|
|
13415
|
+
ItemType["Mobile Scene Package"] = "Mobile Scene Package";
|
|
13416
|
+
ItemType["Notebook"] = "Notebook";
|
|
13417
|
+
ItemType["PDF"] = "PDF";
|
|
13418
|
+
ItemType["Pro Map"] = "Pro Map";
|
|
13419
|
+
ItemType["Pro Report"] = "Pro Report";
|
|
13420
|
+
ItemType["Project Package"] = "Project Package";
|
|
13421
|
+
ItemType["Project Template"] = "Project Template";
|
|
13422
|
+
ItemType["Raster function template"] = "Raster function template";
|
|
13423
|
+
ItemType["Rule Package"] = "Rule Package";
|
|
13424
|
+
ItemType["Scene Package"] = "Scene Package";
|
|
13425
|
+
ItemType["Service Definition"] = "Service Definition";
|
|
13426
|
+
ItemType["Shapefile"] = "Shapefile";
|
|
13427
|
+
ItemType["Survey123 Add In"] = "Survey123 Add In";
|
|
13428
|
+
ItemType["Tile Package"] = "Tile Package";
|
|
13429
|
+
ItemType["Vector Tile Package"] = "Vector Tile Package";
|
|
13430
|
+
ItemType["Workflow Manager Package"] = "Workflow Manager Package";
|
|
13431
|
+
ItemType["Document Link"] = "Document Link";
|
|
13432
|
+
ItemType["Feature Service"] = "Feature Service";
|
|
13433
|
+
ItemType["Geocoding Service"] = "Geocoding Service";
|
|
13434
|
+
ItemType["Geodata Service"] = "Geodata Service";
|
|
13435
|
+
ItemType["Geometry Service"] = "Geometry Service";
|
|
13436
|
+
ItemType["Geoprocessing Service"] = "Geoprocessing Service";
|
|
13437
|
+
ItemType["Geoenrichment Service"] = "Geoenrichment Service";
|
|
13438
|
+
ItemType["Globe Service"] = "Globe Service";
|
|
13439
|
+
ItemType["Image Service"] = "Image Service";
|
|
13440
|
+
ItemType["Map Service"] = "Map Service";
|
|
13441
|
+
ItemType["Network Analysis Service"] = "Network Analysis Service";
|
|
13442
|
+
ItemType["Vector Tile Service"] = "Vector Tile Service";
|
|
13443
|
+
ItemType["WFS"] = "WFS";
|
|
13444
|
+
ItemType["WMS"] = "WMS";
|
|
13445
|
+
ItemType["WMTS"] = "WMTS";
|
|
13446
|
+
ItemType["OGCFeatureServer"] = "OGCFeatureServer";
|
|
13447
|
+
ItemType["Scene Service"] = "Scene Service";
|
|
13448
|
+
ItemType["Stream Service"] = "Stream Service";
|
|
13449
|
+
ItemType["Workflow Manager Service"] = "Workflow Manager Service";
|
|
13450
|
+
ItemType["Web Mapping Application"] = "Web Mapping Application";
|
|
13451
|
+
ItemType["Mobile Application"] = "Mobile Application";
|
|
13452
|
+
ItemType["AppBuilder Extension"] = "AppBuilder Extension";
|
|
13453
|
+
ItemType["Google Drive"] = "Google Drive";
|
|
13454
|
+
ItemType["Dropbox"] = "Dropbox";
|
|
13455
|
+
ItemType["OneDrive"] = "OneDrive";
|
|
13456
|
+
ItemType["StoryMap"] = "StoryMap";
|
|
13457
|
+
ItemType["Dashboard"] = "Dashboard";
|
|
13458
|
+
ItemType["Hub Initiative"] = "Hub Initiative";
|
|
13459
|
+
ItemType["Hub Site Application"] = "Hub Site Application";
|
|
13460
|
+
ItemType["Web Experience"] = "Web Experience";
|
|
13461
|
+
ItemType["Insights Workbook Package"] = "Insights Workbook Package";
|
|
13462
|
+
ItemType["Application"] = "Application";
|
|
13463
|
+
ItemType["ArcGIS Explorer Application Configuration"] = "ArcGIS Explorer Application Configuration";
|
|
13464
|
+
ItemType["ArcMap Document"] = "ArcMap Document";
|
|
13465
|
+
ItemType["Layer File"] = "Layer File";
|
|
13466
|
+
ItemType["ogcFeature"] = "ogcFeature";
|
|
13467
|
+
ItemType["FeatureServer"] = "Feature Service";
|
|
13468
|
+
ItemType["GeocodeServer"] = "GeocodeServer";
|
|
13469
|
+
ItemType["GeoDataServer"] = "GeoDataServer";
|
|
13470
|
+
ItemType["GeometryServer"] = "GeometryServer";
|
|
13471
|
+
ItemType["GeoenrichmentServer"] = "GeoenrichmentServer";
|
|
13472
|
+
ItemType["GPServer"] = "GPServer";
|
|
13473
|
+
ItemType["GlobeServer"] = "GlobeServer";
|
|
13474
|
+
ItemType["ImageServer"] = "ImageServer";
|
|
13475
|
+
ItemType["MapServer"] = "MapServer";
|
|
13476
|
+
ItemType["NAServer"] = "NAServer";
|
|
13477
|
+
ItemType["ElevationServer"] = "ElevationServer";
|
|
13478
|
+
ItemType["VectorTileServer"] = "VectorTileServer";
|
|
13479
|
+
ItemType["Scene Server"] = "Scene Server";
|
|
13480
|
+
ItemType["StreamServer"] = "StreamServer";
|
|
13481
|
+
ItemType["WMServer"] = "WMServer";
|
|
13482
|
+
ItemType["TiledImageServer"] = "TiledImageServer";
|
|
13483
|
+
})(exports.ItemType || (exports.ItemType = {}));
|
|
13484
|
+
/**
|
|
13485
|
+
* Maps human readable file names to extensions IE Image === jpg, png, etc
|
|
13486
|
+
*/
|
|
13487
|
+
var addCreateItemTypes = {
|
|
13488
|
+
"360 VR Experience": {
|
|
13489
|
+
fileExt: [exports.FileExtension["3dd"]],
|
|
13490
|
+
type: exports.ItemType["360 VR Experience"],
|
|
13491
|
+
typeKeywords: [],
|
|
13492
|
+
},
|
|
13493
|
+
"Apache Parquet": {
|
|
13494
|
+
fileExt: [exports.FileExtension.parquet],
|
|
13495
|
+
type: exports.ItemType["Apache Parquet"],
|
|
13496
|
+
typeKeywords: [],
|
|
13497
|
+
},
|
|
13498
|
+
"AppBuilder Widget Package": {
|
|
13499
|
+
fileExt: [exports.FileExtension.zip],
|
|
13500
|
+
type: exports.ItemType["AppBuilder Widget Package"],
|
|
13501
|
+
typeKeywords: [],
|
|
13502
|
+
},
|
|
13503
|
+
"Desktop Add In": {
|
|
13504
|
+
fileExt: [exports.FileExtension.esriaddin],
|
|
13505
|
+
type: exports.ItemType["Desktop Add In"],
|
|
13506
|
+
typeKeywords: [
|
|
13507
|
+
"Tool",
|
|
13508
|
+
"Add In",
|
|
13509
|
+
"Desktop Add In",
|
|
13510
|
+
"ArcGIS Desktop",
|
|
13511
|
+
"ArcMap",
|
|
13512
|
+
"ArcGlobe",
|
|
13513
|
+
"ArcScene",
|
|
13514
|
+
"esriaddin",
|
|
13515
|
+
],
|
|
13516
|
+
},
|
|
13517
|
+
"Explorer Add In": {
|
|
13518
|
+
fileExt: [exports.FileExtension.eaz],
|
|
13519
|
+
type: exports.ItemType["Explorer Add In"],
|
|
13520
|
+
typeKeywords: [
|
|
13521
|
+
"Tool",
|
|
13522
|
+
"Add In",
|
|
13523
|
+
"Explorer Add In",
|
|
13524
|
+
"ArcGIS Explorer",
|
|
13525
|
+
"eaz",
|
|
13526
|
+
],
|
|
13527
|
+
},
|
|
13528
|
+
"Explorer Map": {
|
|
13529
|
+
fileExt: [exports.FileExtension.nmf],
|
|
13530
|
+
type: exports.ItemType["Explorer Map"],
|
|
13531
|
+
typeKeywords: [
|
|
13532
|
+
"Map",
|
|
13533
|
+
"Explorer Map",
|
|
13534
|
+
"Explorer Document",
|
|
13535
|
+
"2D",
|
|
13536
|
+
"3D",
|
|
13537
|
+
"ArcGIS Explorer",
|
|
13538
|
+
"nmf",
|
|
13539
|
+
],
|
|
13540
|
+
},
|
|
13541
|
+
"ArcGIS Explorer Application Configuration": {
|
|
13542
|
+
fileExt: [exports.FileExtension.ncfg],
|
|
13543
|
+
type: exports.ItemType["Explorer Map"],
|
|
13544
|
+
typeKeywords: [
|
|
13545
|
+
"Map",
|
|
13546
|
+
"Explorer Map",
|
|
13547
|
+
"Explorer Mapping Application",
|
|
13548
|
+
"2D",
|
|
13549
|
+
"3D",
|
|
13550
|
+
"ArcGIS Explorer",
|
|
13551
|
+
],
|
|
13552
|
+
},
|
|
13553
|
+
"Explorer Layer": {
|
|
13554
|
+
fileExt: [exports.FileExtension.nmc],
|
|
13555
|
+
type: exports.ItemType["Explorer Layer"],
|
|
13556
|
+
typeKeywords: ["Data", "Layer", "Explorer Layer", "ArcGIS Explorer", "nmc"],
|
|
13557
|
+
},
|
|
13558
|
+
"Windows Mobile Package": {
|
|
13559
|
+
fileExt: [exports.FileExtension.wmpk],
|
|
13560
|
+
type: exports.ItemType["Windows Mobile Package"],
|
|
13561
|
+
typeKeywords: [],
|
|
13562
|
+
},
|
|
13563
|
+
"ArcGIS Pro Add In": {
|
|
13564
|
+
fileExt: [exports.FileExtension.esriaddinx],
|
|
13565
|
+
type: exports.ItemType["ArcGIS Pro Add In"],
|
|
13566
|
+
typeKeywords: ["Tool", "Add In", "Pro Add In", "esriaddinx"],
|
|
13567
|
+
},
|
|
13568
|
+
"ArcGIS Pro Configuration": {
|
|
13569
|
+
fileExt: [exports.FileExtension.proconfigx],
|
|
13570
|
+
type: exports.ItemType["ArcGIS Pro Configuration"],
|
|
13571
|
+
typeKeywords: [],
|
|
13572
|
+
},
|
|
13573
|
+
"Globe Document": {
|
|
13574
|
+
fileExt: [exports.FileExtension["3dd"]],
|
|
13575
|
+
type: exports.ItemType["Globe Document"],
|
|
13576
|
+
typeKeywords: [
|
|
13577
|
+
"Map",
|
|
13578
|
+
"Globe Document",
|
|
13579
|
+
"3D",
|
|
13580
|
+
"ArcGlobe",
|
|
13581
|
+
"ArcGIS Server",
|
|
13582
|
+
"3dd",
|
|
13583
|
+
],
|
|
13584
|
+
},
|
|
13585
|
+
"Map Document": {
|
|
13586
|
+
fileExt: [exports.FileExtension.msd],
|
|
13587
|
+
type: exports.ItemType["Map Document"],
|
|
13588
|
+
typeKeywords: [
|
|
13589
|
+
"Map Document",
|
|
13590
|
+
"Map",
|
|
13591
|
+
"2D",
|
|
13592
|
+
"ArcMap",
|
|
13593
|
+
"ArcGIS Server",
|
|
13594
|
+
"msd",
|
|
13595
|
+
],
|
|
13596
|
+
},
|
|
13597
|
+
"ArcMap Document": {
|
|
13598
|
+
fileExt: [exports.FileExtension.mxd],
|
|
13599
|
+
type: exports.ItemType["Map Document"],
|
|
13600
|
+
typeKeywords: ["Map Document", "Map", "2D", "ArcMap", "ArcGIS Server"],
|
|
13601
|
+
},
|
|
13602
|
+
"ArcPad Package": {
|
|
13603
|
+
fileExt: [exports.FileExtension.zip],
|
|
13604
|
+
type: exports.ItemType["ArcPad Package"],
|
|
13605
|
+
typeKeywords: ["Map", "Layer", "Data"],
|
|
13606
|
+
},
|
|
13607
|
+
"Published Map": {
|
|
13608
|
+
fileExt: [exports.FileExtension.pmf],
|
|
13609
|
+
type: exports.ItemType["Published Map"],
|
|
13610
|
+
typeKeywords: [
|
|
13611
|
+
"Map",
|
|
13612
|
+
"Published Map",
|
|
13613
|
+
"2D",
|
|
13614
|
+
"ArcReader",
|
|
13615
|
+
"ArcMap",
|
|
13616
|
+
"ArcGIS Server",
|
|
13617
|
+
"pmf",
|
|
13618
|
+
],
|
|
13619
|
+
},
|
|
13620
|
+
"Scene Document": {
|
|
13621
|
+
fileExt: [exports.FileExtension.sxd],
|
|
13622
|
+
type: exports.ItemType["Scene Document"],
|
|
13623
|
+
typeKeywords: ["Map", "Scene Document", "3D", "ArcScene", "sxd"],
|
|
13624
|
+
},
|
|
13625
|
+
"CityEngine Web Scene": {
|
|
13626
|
+
fileExt: [exports.FileExtension["3ws"]],
|
|
13627
|
+
type: exports.ItemType["CityEngine Web Scene"],
|
|
13628
|
+
typeKeywords: ["3D", "Map", "Scene", "Web"],
|
|
13629
|
+
},
|
|
13630
|
+
"Code Sample": {
|
|
13631
|
+
fileExt: [exports.FileExtension.zip],
|
|
13632
|
+
type: exports.ItemType["Code Sample"],
|
|
13633
|
+
typeKeywords: ["Code", "Sample"],
|
|
13634
|
+
},
|
|
13635
|
+
"CSV Collection": {
|
|
13636
|
+
fileExt: [exports.FileExtension.zip],
|
|
13637
|
+
type: exports.ItemType["CSV Collection"],
|
|
13638
|
+
typeKeywords: [],
|
|
13639
|
+
},
|
|
13640
|
+
CSV: {
|
|
13641
|
+
fileExt: [exports.FileExtension.csv],
|
|
13642
|
+
type: exports.ItemType.CSV,
|
|
13643
|
+
typeKeywords: ["CSV"],
|
|
13644
|
+
},
|
|
13645
|
+
"CAD Drawing": {
|
|
13646
|
+
fileExt: [exports.FileExtension.zip],
|
|
13647
|
+
type: exports.ItemType["CAD Drawing"],
|
|
13648
|
+
typeKeywords: [],
|
|
13649
|
+
},
|
|
13650
|
+
"Deep Learning Package": {
|
|
13651
|
+
fileExt: [exports.FileExtension.zip, exports.FileExtension.dlpk],
|
|
13652
|
+
type: exports.ItemType["Deep Learning Package"],
|
|
13653
|
+
typeKeywords: ["Deep Learning", "Raster"],
|
|
13654
|
+
},
|
|
13655
|
+
"Desktop Application": {
|
|
13656
|
+
type: exports.ItemType["Desktop Application"],
|
|
13657
|
+
typeKeywords: ["Desktop Application"],
|
|
13658
|
+
},
|
|
13659
|
+
"Desktop Application Template": {
|
|
13660
|
+
fileExt: [exports.FileExtension.zip],
|
|
13661
|
+
type: exports.ItemType["Desktop Application Template"],
|
|
13662
|
+
typeKeywords: ["application", "template", "ArcGIS desktop"],
|
|
13663
|
+
},
|
|
13664
|
+
"Desktop Style": {
|
|
13665
|
+
fileExt: [exports.FileExtension.stylx],
|
|
13666
|
+
type: exports.ItemType["Desktop Style"],
|
|
13667
|
+
typeKeywords: ["ArcGIS Pro", "Symbology", "Style", "Symbols"],
|
|
13668
|
+
},
|
|
13669
|
+
"Earth Configuration": {
|
|
13670
|
+
fileExt: [exports.FileExtension.xml],
|
|
13671
|
+
type: exports.ItemType["Earth Configuration"],
|
|
13672
|
+
typeKeywords: ["ArcGIS Earth", "Earth", "Earth Configuration"],
|
|
13673
|
+
},
|
|
13674
|
+
"Feature Collection": {
|
|
13675
|
+
type: exports.ItemType["Feature Collection"],
|
|
13676
|
+
fileExt: [exports.FileExtension.featurecollection],
|
|
13677
|
+
typeKeywords: [],
|
|
13678
|
+
},
|
|
13679
|
+
"File Geodatabase": {
|
|
13680
|
+
fileExt: [exports.FileExtension.zip],
|
|
13681
|
+
type: exports.ItemType["File Geodatabase"],
|
|
13682
|
+
typeKeywords: [],
|
|
13683
|
+
},
|
|
13684
|
+
GeoJson: {
|
|
13685
|
+
fileExt: [exports.FileExtension.geojson, exports.FileExtension.json],
|
|
13686
|
+
type: exports.ItemType.GeoJson,
|
|
13687
|
+
typeKeywords: [
|
|
13688
|
+
"Coordinates Type",
|
|
13689
|
+
"CRS",
|
|
13690
|
+
"Feature",
|
|
13691
|
+
"FeatureCollection",
|
|
13692
|
+
"GeoJSON",
|
|
13693
|
+
"Geometry",
|
|
13694
|
+
"GeometryCollection",
|
|
13695
|
+
],
|
|
13696
|
+
},
|
|
13697
|
+
"Geoprocessing Package": {
|
|
13698
|
+
fileExt: [exports.FileExtension.gpk, exports.FileExtension.gpkx],
|
|
13699
|
+
type: exports.ItemType["Geoprocessing Package"],
|
|
13700
|
+
typeKeywords: [
|
|
13701
|
+
"ArcGIS Desktop",
|
|
13702
|
+
"ArcGlobe",
|
|
13703
|
+
"ArcMap",
|
|
13704
|
+
"ArcScene",
|
|
13705
|
+
"Geoprocessing Package",
|
|
13706
|
+
"gpk",
|
|
13707
|
+
"Model",
|
|
13708
|
+
"Result",
|
|
13709
|
+
"Script",
|
|
13710
|
+
"Sharing",
|
|
13711
|
+
"Tool",
|
|
13712
|
+
"Toolbox",
|
|
13713
|
+
],
|
|
13714
|
+
},
|
|
13715
|
+
GeoPackage: {
|
|
13716
|
+
fileExt: [exports.FileExtension.gpkg],
|
|
13717
|
+
type: exports.ItemType.GeoPackage,
|
|
13718
|
+
typeKeywords: ["Data", "GeoPackage", "gpkg"],
|
|
13719
|
+
},
|
|
13720
|
+
"Geoprocessing Sample": {
|
|
13721
|
+
fileExt: [exports.FileExtension.zip],
|
|
13722
|
+
type: exports.ItemType["Geoprocessing Sample"],
|
|
13723
|
+
typeKeywords: ["tool", "geoprocessing", "sample"],
|
|
13724
|
+
},
|
|
13725
|
+
GML: {
|
|
13726
|
+
fileExt: [exports.FileExtension.zip],
|
|
13727
|
+
type: exports.ItemType.GML,
|
|
13728
|
+
typeKeywords: [],
|
|
13729
|
+
},
|
|
13730
|
+
"Image Collection": {
|
|
13731
|
+
fileExt: [exports.FileExtension.zip],
|
|
13732
|
+
type: exports.ItemType["Image Collection"],
|
|
13733
|
+
typeKeywords: [],
|
|
13734
|
+
},
|
|
13735
|
+
Image: {
|
|
13736
|
+
fileExt: [
|
|
13737
|
+
exports.FileExtension.jpg,
|
|
13738
|
+
exports.FileExtension.jpeg,
|
|
13739
|
+
exports.FileExtension.png,
|
|
13740
|
+
exports.FileExtension.tif,
|
|
13741
|
+
exports.FileExtension.tiff,
|
|
13742
|
+
],
|
|
13743
|
+
type: exports.ItemType.Image,
|
|
13744
|
+
typeKeywords: ["Data", "Image"],
|
|
13745
|
+
},
|
|
13746
|
+
"iWork Keynote": {
|
|
13747
|
+
fileExt: [exports.FileExtension.key],
|
|
13748
|
+
type: exports.ItemType["iWork Keynote"],
|
|
13749
|
+
typeKeywords: ["Data", "Document", "Mac"],
|
|
13750
|
+
},
|
|
13751
|
+
"iWork Numbers": {
|
|
13752
|
+
fileExt: [exports.FileExtension.numbers],
|
|
13753
|
+
type: exports.ItemType["iWork Numbers"],
|
|
13754
|
+
typeKeywords: ["Data", "Document", "Mac"],
|
|
13755
|
+
},
|
|
13756
|
+
"iWork Pages": {
|
|
13757
|
+
fileExt: [exports.FileExtension.pages],
|
|
13758
|
+
type: exports.ItemType["iWork Pages"],
|
|
13759
|
+
typeKeywords: ["Data", "Document", "Mac"],
|
|
13760
|
+
},
|
|
13761
|
+
"KML Collection": {
|
|
13762
|
+
fileExt: [exports.FileExtension.zip],
|
|
13763
|
+
type: exports.ItemType["KML Collection"],
|
|
13764
|
+
typeKeywords: [],
|
|
13765
|
+
},
|
|
13766
|
+
KML: {
|
|
13767
|
+
type: exports.ItemType.KML,
|
|
13768
|
+
fileExt: [exports.FileExtension.kml, exports.FileExtension.kmz],
|
|
13769
|
+
typeKeywords: ["Data", "Map", "kml"],
|
|
13770
|
+
},
|
|
13771
|
+
Layer: {
|
|
13772
|
+
fileExt: [exports.FileExtension.lyr],
|
|
13773
|
+
type: exports.ItemType.Layer,
|
|
13774
|
+
typeKeywords: [
|
|
13775
|
+
"Data",
|
|
13776
|
+
"Layer",
|
|
13777
|
+
"ArcMap",
|
|
13778
|
+
"ArcGlobe",
|
|
13779
|
+
"ArcGIS Explorer",
|
|
13780
|
+
"lyr",
|
|
13781
|
+
],
|
|
13782
|
+
},
|
|
13783
|
+
"Layer File": {
|
|
13784
|
+
fileExt: [exports.FileExtension.lyrx],
|
|
13785
|
+
type: exports.ItemType.Layer,
|
|
13786
|
+
typeKeywords: ["ArcGIS Pro", "Layer", "Layer File"],
|
|
13787
|
+
},
|
|
13788
|
+
"Layer Package": {
|
|
13789
|
+
fileExt: [exports.FileExtension.lpk, exports.FileExtension.lpkx],
|
|
13790
|
+
type: exports.ItemType["Layer Package"],
|
|
13791
|
+
typeKeywords: [],
|
|
13792
|
+
},
|
|
13793
|
+
Layout: {
|
|
13794
|
+
fileExt: [exports.FileExtension.pagx],
|
|
13795
|
+
type: exports.ItemType.Layout,
|
|
13796
|
+
typeKeywords: ["ArcGIS Pro", "Layout", "Layout File", "pagx"],
|
|
13797
|
+
},
|
|
13798
|
+
"Locator Package": {
|
|
13799
|
+
fileExt: [exports.FileExtension.gcpk],
|
|
13800
|
+
type: exports.ItemType["Locator Package"],
|
|
13801
|
+
typeKeywords: [],
|
|
13802
|
+
},
|
|
13803
|
+
"Map Package": {
|
|
13804
|
+
fileExt: [exports.FileExtension.mpk, exports.FileExtension.mpkx],
|
|
13805
|
+
type: exports.ItemType["Map Package"],
|
|
13806
|
+
typeKeywords: [],
|
|
13807
|
+
},
|
|
13808
|
+
"Map Template": {
|
|
13809
|
+
fileExt: [exports.FileExtension.zip],
|
|
13810
|
+
type: exports.ItemType["Map Template"],
|
|
13811
|
+
typeKeywords: ["map", "ArcMap", "template", "ArcGIS desktop"],
|
|
13812
|
+
},
|
|
13813
|
+
"Microsoft Excel": {
|
|
13814
|
+
fileExt: [exports.FileExtension.xls, exports.FileExtension.xlsx],
|
|
13815
|
+
type: exports.ItemType["Microsoft Excel"],
|
|
13816
|
+
typeKeywords: ["Data", "Document", "Microsoft Excel"],
|
|
13817
|
+
},
|
|
13818
|
+
"Microsoft Powerpoint": {
|
|
13819
|
+
fileExt: [exports.FileExtension.ppt, exports.FileExtension.pptx],
|
|
13820
|
+
type: exports.ItemType["Microsoft Powerpoint"],
|
|
13821
|
+
typeKeywords: ["Data", "Document", "Microsoft Powerpoint"],
|
|
13822
|
+
},
|
|
13823
|
+
"Visio Document": {
|
|
13824
|
+
fileExt: [exports.FileExtension.vsd],
|
|
13825
|
+
type: exports.ItemType["Visio Document"],
|
|
13826
|
+
typeKeywords: ["Data", "Document", "Visio Document"],
|
|
13827
|
+
},
|
|
13828
|
+
"Microsoft Word": {
|
|
13829
|
+
fileExt: [exports.FileExtension.doc, exports.FileExtension.docx],
|
|
13830
|
+
type: exports.ItemType["Microsoft Word"],
|
|
13831
|
+
typeKeywords: ["Data", "Document"],
|
|
13832
|
+
},
|
|
13833
|
+
"Mobile Basemap Package": {
|
|
13834
|
+
fileExt: [exports.FileExtension.bpk],
|
|
13835
|
+
type: exports.ItemType["Mobile Basemap Package"],
|
|
13836
|
+
typeKeywords: [],
|
|
13837
|
+
},
|
|
13838
|
+
"Mobile Map Package": {
|
|
13839
|
+
fileExt: [exports.FileExtension.mmpk],
|
|
13840
|
+
type: exports.ItemType["Mobile Map Package"],
|
|
13841
|
+
typeKeywords: [],
|
|
13842
|
+
},
|
|
13843
|
+
"Mobile Scene Package": {
|
|
13844
|
+
fileExt: [exports.FileExtension.mspk],
|
|
13845
|
+
type: exports.ItemType["Mobile Scene Package"],
|
|
13846
|
+
typeKeywords: [],
|
|
13847
|
+
},
|
|
13848
|
+
Notebook: {
|
|
13849
|
+
fileExt: [exports.FileExtension.ipynb],
|
|
13850
|
+
type: exports.ItemType.Notebook,
|
|
13851
|
+
typeKeywords: ["Notebook", "Python"],
|
|
13852
|
+
},
|
|
13853
|
+
PDF: {
|
|
13854
|
+
fileExt: [exports.FileExtension.pdf],
|
|
13855
|
+
type: exports.ItemType.PDF,
|
|
13856
|
+
typeKeywords: ["Data", "Document", "PDF"],
|
|
13857
|
+
},
|
|
13858
|
+
"Pro Map": {
|
|
13859
|
+
fileExt: [exports.FileExtension.mapx],
|
|
13860
|
+
type: exports.ItemType["Pro Map"],
|
|
13861
|
+
typeKeywords: ["ArcGIS Pro", "Map", "Map File", "mapx"],
|
|
13862
|
+
},
|
|
13863
|
+
"Pro Report": {
|
|
13864
|
+
fileExt: [exports.FileExtension.rptx],
|
|
13865
|
+
type: exports.ItemType["Pro Report"],
|
|
13866
|
+
typeKeywords: [],
|
|
13867
|
+
},
|
|
13868
|
+
"Project Package": {
|
|
13869
|
+
fileExt: [exports.FileExtension.ppkx],
|
|
13870
|
+
type: exports.ItemType["Project Package"],
|
|
13871
|
+
typeKeywords: [],
|
|
13872
|
+
},
|
|
13873
|
+
"Project Template": {
|
|
13874
|
+
fileExt: [exports.FileExtension.aptx],
|
|
13875
|
+
type: exports.ItemType["Project Template"],
|
|
13876
|
+
typeKeywords: [],
|
|
13877
|
+
},
|
|
13878
|
+
"Raster function template": {
|
|
13879
|
+
fileExt: [exports.FileExtension["rft.json"], exports.FileExtension["rft.xml"]],
|
|
13880
|
+
type: exports.ItemType["Raster function template"],
|
|
13881
|
+
typeKeywords: [
|
|
13882
|
+
"Raster",
|
|
13883
|
+
"Functions",
|
|
13884
|
+
"Processing",
|
|
13885
|
+
"rft",
|
|
13886
|
+
"srf",
|
|
13887
|
+
"function template",
|
|
13888
|
+
"templates",
|
|
13889
|
+
"ArcGIS Pro",
|
|
13890
|
+
],
|
|
13891
|
+
},
|
|
13892
|
+
"Rule Package": {
|
|
13893
|
+
fileExt: [exports.FileExtension.rpk],
|
|
13894
|
+
type: exports.ItemType["Rule Package"],
|
|
13895
|
+
typeKeywords: [],
|
|
13896
|
+
},
|
|
13897
|
+
"Scene Package": {
|
|
13898
|
+
fileExt: [exports.FileExtension.slpk, exports.FileExtension.spk],
|
|
13899
|
+
type: exports.ItemType["Scene Package"],
|
|
13900
|
+
typeKeywords: [],
|
|
13901
|
+
},
|
|
13902
|
+
"Service Definition": {
|
|
13903
|
+
fileExt: [exports.FileExtension.sd],
|
|
13904
|
+
type: exports.ItemType["Service Definition"],
|
|
13905
|
+
typeKeywords: ["Data", "Service", "Service Definition"],
|
|
13906
|
+
},
|
|
13907
|
+
Shapefile: {
|
|
13908
|
+
fileExt: [exports.FileExtension.zip],
|
|
13909
|
+
type: exports.ItemType.Shapefile,
|
|
13910
|
+
typeKeywords: ["Data", "Layer", "shapefile"],
|
|
13911
|
+
},
|
|
13912
|
+
"Survey123 Add In": {
|
|
13913
|
+
fileExt: [exports.FileExtension.surveyaddin],
|
|
13914
|
+
type: exports.ItemType["Survey123 Add In"],
|
|
13915
|
+
typeKeywords: ["Add In", "Survey123 Add In", "Tool"],
|
|
13916
|
+
},
|
|
13917
|
+
"Tile Package": {
|
|
13918
|
+
fileExt: [exports.FileExtension.tpk, exports.FileExtension.tpkx],
|
|
13919
|
+
type: exports.ItemType["Tile Package"],
|
|
13920
|
+
typeKeywords: [],
|
|
13921
|
+
},
|
|
13922
|
+
"Vector Tile Package": {
|
|
13923
|
+
fileExt: [exports.FileExtension.vtpk],
|
|
13924
|
+
type: exports.ItemType["Vector Tile Package"],
|
|
13925
|
+
typeKeywords: [],
|
|
13926
|
+
},
|
|
13927
|
+
"Workflow Manager Package": {
|
|
13928
|
+
fileExt: [exports.FileExtension.wpk],
|
|
13929
|
+
type: exports.ItemType["Workflow Manager Package"],
|
|
13930
|
+
typeKeywords: [],
|
|
13931
|
+
},
|
|
13932
|
+
"Document Link": {
|
|
13933
|
+
type: exports.ItemType["Document Link"],
|
|
13934
|
+
typeKeywords: ["Data", "Document"],
|
|
13935
|
+
},
|
|
13936
|
+
"Feature Service": {
|
|
13937
|
+
type: exports.ItemType["Feature Service"],
|
|
13938
|
+
typeKeywords: [
|
|
13939
|
+
"ArcGIS Server",
|
|
13940
|
+
"Data",
|
|
13941
|
+
"Feature Access",
|
|
13942
|
+
"Feature Service",
|
|
13943
|
+
"Service",
|
|
13944
|
+
"Singlelayer",
|
|
13945
|
+
"Hosted Service",
|
|
13946
|
+
],
|
|
13947
|
+
},
|
|
13948
|
+
GeocodeServer: {
|
|
13949
|
+
type: exports.ItemType["Geocoding Service"],
|
|
13950
|
+
typeKeywords: [
|
|
13951
|
+
"ArcGIS Server",
|
|
13952
|
+
"Geocoding Service",
|
|
13953
|
+
"Locator Service",
|
|
13954
|
+
"Service",
|
|
13955
|
+
"Tool",
|
|
13956
|
+
"Service Proxy",
|
|
13957
|
+
],
|
|
13958
|
+
},
|
|
13959
|
+
GeoDataServer: {
|
|
13960
|
+
type: exports.ItemType["Geodata Service"],
|
|
13961
|
+
typeKeywords: ["Data", "Service", "Geodata Service", "ArcGIS Server"],
|
|
13962
|
+
},
|
|
13963
|
+
GeometryServer: {
|
|
13964
|
+
type: exports.ItemType["Geometry Service"],
|
|
13965
|
+
typeKeywords: ["Tool", "Service", "Geometry Service", "ArcGIS Server"],
|
|
13966
|
+
},
|
|
13967
|
+
GeoenrichmentServer: {
|
|
13968
|
+
type: exports.ItemType["Geoenrichment Service"],
|
|
13969
|
+
typeKeywords: ["Geoenrichment Service", "ArcGIS Server"],
|
|
13970
|
+
},
|
|
13971
|
+
GPServer: {
|
|
13972
|
+
type: exports.ItemType["Geoprocessing Service"],
|
|
13973
|
+
typeKeywords: ["Tool", "Service", "Geoprocessing Service", "ArcGIS Server"],
|
|
13974
|
+
},
|
|
13975
|
+
GlobeServer: {
|
|
13976
|
+
type: exports.ItemType["Globe Service"],
|
|
13977
|
+
typeKeywords: ["Data", "Service", "Globe Service", "ArcGIS Server"],
|
|
13978
|
+
},
|
|
13979
|
+
ImageServer: {
|
|
13980
|
+
type: exports.ItemType["Image Service"],
|
|
13981
|
+
typeKeywords: ["Data", "Service", "Image Service", "ArcGIS Server"],
|
|
13982
|
+
},
|
|
13983
|
+
MapServer: {
|
|
13984
|
+
type: exports.ItemType["Map Service"],
|
|
13985
|
+
typeKeywords: ["Data", "Service", "Map Service", "ArcGIS Server"],
|
|
13986
|
+
},
|
|
13987
|
+
NAServer: {
|
|
13988
|
+
type: exports.ItemType["Network Analysis Service"],
|
|
13989
|
+
typeKeywords: [
|
|
13990
|
+
"Tool",
|
|
13991
|
+
"Service",
|
|
13992
|
+
"Network Analysis Service",
|
|
13993
|
+
"ArcGIS Server",
|
|
13994
|
+
],
|
|
13995
|
+
},
|
|
13996
|
+
ElevationServer: {
|
|
13997
|
+
type: exports.ItemType["Image Service"],
|
|
13998
|
+
typeKeywords: ["Elevation 3D Layer"],
|
|
13999
|
+
},
|
|
14000
|
+
VectorTileServer: {
|
|
14001
|
+
type: exports.ItemType["Vector Tile Service"],
|
|
14002
|
+
typeKeywords: [],
|
|
14003
|
+
},
|
|
14004
|
+
WFS: {
|
|
14005
|
+
type: exports.ItemType.WFS,
|
|
14006
|
+
typeKeywords: ["Data", "Service", "Web Feature Service", "OGC"],
|
|
14007
|
+
},
|
|
14008
|
+
WMS: {
|
|
14009
|
+
type: exports.ItemType.WMS,
|
|
14010
|
+
typeKeywords: ["Data", "Service", "Web Map Service", "OGC"],
|
|
14011
|
+
},
|
|
14012
|
+
WMTS: {
|
|
14013
|
+
type: exports.ItemType.WMTS,
|
|
14014
|
+
typeKeywords: ["Data", "Service", "OGC"],
|
|
14015
|
+
},
|
|
14016
|
+
ogcFeature: {
|
|
14017
|
+
type: exports.ItemType.OGCFeatureServer,
|
|
14018
|
+
typeKeywords: [
|
|
14019
|
+
"Data",
|
|
14020
|
+
"Service",
|
|
14021
|
+
"Feature Service",
|
|
14022
|
+
"OGC",
|
|
14023
|
+
"OGC Feature Service",
|
|
14024
|
+
],
|
|
14025
|
+
},
|
|
14026
|
+
SceneServer: {
|
|
14027
|
+
type: exports.ItemType["Scene Service"],
|
|
14028
|
+
typeKeywords: ["Scene Service"],
|
|
14029
|
+
},
|
|
14030
|
+
StreamServer: {
|
|
14031
|
+
type: exports.ItemType["Stream Service"],
|
|
14032
|
+
typeKeywords: ["Data", "Service", "Stream Service", "ArcGIS Server"],
|
|
14033
|
+
},
|
|
14034
|
+
WMServer: {
|
|
14035
|
+
type: exports.ItemType["Workflow Manager Service"],
|
|
14036
|
+
typeKeywords: [
|
|
14037
|
+
"Workflow Manager",
|
|
14038
|
+
"ArcGIS Server",
|
|
14039
|
+
"WMServer",
|
|
14040
|
+
"Workflow",
|
|
14041
|
+
"JTX",
|
|
14042
|
+
"Job Tracking",
|
|
14043
|
+
],
|
|
14044
|
+
},
|
|
14045
|
+
TiledImageServer: {
|
|
14046
|
+
type: exports.ItemType["Image Service"],
|
|
14047
|
+
typeKeywords: ["Tiled Imagery"],
|
|
14048
|
+
},
|
|
14049
|
+
"Web Mapping Application": {
|
|
14050
|
+
type: exports.ItemType["Web Mapping Application"],
|
|
14051
|
+
typeKeywords: [
|
|
14052
|
+
"JavaScript",
|
|
14053
|
+
"Map",
|
|
14054
|
+
"Mapping Site",
|
|
14055
|
+
"Online Map",
|
|
14056
|
+
"Ready To Use",
|
|
14057
|
+
"Web AppBuilder",
|
|
14058
|
+
"Web Map (+ WAB2D or WAB3D)",
|
|
14059
|
+
],
|
|
14060
|
+
},
|
|
14061
|
+
"Mobile Application": {
|
|
14062
|
+
type: exports.ItemType["Mobile Application"],
|
|
14063
|
+
typeKeywords: ["ArcGIS Mobile Map", "Mobile Application"],
|
|
14064
|
+
},
|
|
14065
|
+
"AppBuilder Extension": {
|
|
14066
|
+
type: exports.ItemType["AppBuilder Extension"],
|
|
14067
|
+
typeKeywords: ["Widget", "App Builder"],
|
|
14068
|
+
},
|
|
14069
|
+
"Google Drive": {
|
|
14070
|
+
type: exports.ItemType["Google Drive"],
|
|
14071
|
+
typeKeywords: ["CSV", "Shapefile", "GeoJSON", "Excel", "FileGeodatabase"],
|
|
14072
|
+
},
|
|
14073
|
+
Dropbox: {
|
|
14074
|
+
type: exports.ItemType.Dropbox,
|
|
14075
|
+
typeKeywords: ["CSV", "Shapefile", "GeoJSON", "Excel", "FileGeodatabase"],
|
|
14076
|
+
},
|
|
14077
|
+
OneDrive: {
|
|
14078
|
+
type: exports.ItemType.OneDrive,
|
|
14079
|
+
typeKeywords: ["CSV", "Shapefile", "GeoJSON", "Excel", "FileGeodatabase"],
|
|
14080
|
+
},
|
|
14081
|
+
"Map Service": {
|
|
14082
|
+
type: exports.ItemType["Map Service"],
|
|
14083
|
+
typeKeywords: [
|
|
14084
|
+
"ArcGIS Server",
|
|
14085
|
+
"Data",
|
|
14086
|
+
"Map Service",
|
|
14087
|
+
"Service",
|
|
14088
|
+
"Hosted Service",
|
|
14089
|
+
],
|
|
14090
|
+
},
|
|
14091
|
+
StoryMap: {
|
|
14092
|
+
type: exports.ItemType.StoryMap,
|
|
14093
|
+
typeKeywords: [
|
|
14094
|
+
"arcgis-storymaps",
|
|
14095
|
+
"StoryMap",
|
|
14096
|
+
"Web Application (smstatusdraft or smsstatuspublished)",
|
|
14097
|
+
],
|
|
14098
|
+
},
|
|
14099
|
+
Dashboard: {
|
|
14100
|
+
type: exports.ItemType.Dashboard,
|
|
14101
|
+
typeKeywords: ["Dashboard", "Operations Dashboard"],
|
|
14102
|
+
},
|
|
14103
|
+
"Hub Initiative": {
|
|
14104
|
+
type: exports.ItemType["Hub Initiative"],
|
|
14105
|
+
typeKeywords: ["Hub", "hubInitiative", "OpenData"],
|
|
14106
|
+
},
|
|
14107
|
+
"Hub Site Application": {
|
|
14108
|
+
type: exports.ItemType["Hub Site Application"],
|
|
14109
|
+
typeKeywords: [
|
|
14110
|
+
"Hub",
|
|
14111
|
+
"hubSite",
|
|
14112
|
+
"hubSolution",
|
|
14113
|
+
"JavaScript",
|
|
14114
|
+
"Map",
|
|
14115
|
+
"Mapping Site",
|
|
14116
|
+
"Online Map",
|
|
14117
|
+
"OpenData",
|
|
14118
|
+
"Ready To Use",
|
|
14119
|
+
"selfConfigured",
|
|
14120
|
+
"Web Map",
|
|
14121
|
+
"Registered App",
|
|
14122
|
+
],
|
|
14123
|
+
},
|
|
14124
|
+
"Web Experience": {
|
|
14125
|
+
type: exports.ItemType["Web Experience"],
|
|
14126
|
+
typeKeywords: [
|
|
14127
|
+
"EXB Experience",
|
|
14128
|
+
"JavaScript",
|
|
14129
|
+
"Ready To Use Web Application",
|
|
14130
|
+
"Web Experience",
|
|
14131
|
+
"Web Mapping Application",
|
|
14132
|
+
"Web Page",
|
|
14133
|
+
"Web Site",
|
|
14134
|
+
],
|
|
14135
|
+
},
|
|
14136
|
+
"Insights Workbook Package": {
|
|
14137
|
+
type: exports.ItemType["Insights Workbook Package"],
|
|
14138
|
+
fileExt: [exports.FileExtension.insightswbk],
|
|
14139
|
+
typeKeywords: ["Insights", "Insights Workbook Package"],
|
|
14140
|
+
},
|
|
14141
|
+
};
|
|
14142
|
+
|
|
14143
|
+
var FEATURE_SERVICE_URL_REGEX = /(feature)server(\/|\/(\d+))?$/i;
|
|
14144
|
+
var SERVICE_URL_REGEX = /\/[a-zA-Z]+server(\/|\/(\d+))?$/i;
|
|
14145
|
+
/**
|
|
14146
|
+
* Feature service / Doc Links Should not have data urls. Let"s exclude them from that.
|
|
14147
|
+
*
|
|
14148
|
+
* @export
|
|
14149
|
+
* @param {string} itemType What type of item is it?
|
|
14150
|
+
* @return {*} {boolean}
|
|
14151
|
+
*/
|
|
14152
|
+
function shouldHaveDataUrl(itemType) {
|
|
14153
|
+
// Specifically we want to avoid FS / DL from having a data url.
|
|
14154
|
+
return !["Feature Service", "Document Link"].includes(itemType);
|
|
14155
|
+
}
|
|
14156
|
+
/**
|
|
14157
|
+
* Get the file name out of a url. Will return either the
|
|
14158
|
+
* hostname, or the pathname if it exists
|
|
14159
|
+
*
|
|
14160
|
+
* @export
|
|
14161
|
+
* @param {string} url Url to get a file name out of
|
|
14162
|
+
* @return {*} {string}
|
|
14163
|
+
*/
|
|
14164
|
+
function getFileName(url) {
|
|
14165
|
+
var filename;
|
|
14166
|
+
try {
|
|
14167
|
+
var parsed = new URL(url);
|
|
14168
|
+
// If the URL pathname exists, return its last segment,
|
|
14169
|
+
// otherwise return the hostname
|
|
14170
|
+
filename =
|
|
14171
|
+
parsed.pathname !== "/"
|
|
14172
|
+
? parsed.pathname.split("/").pop()
|
|
14173
|
+
: parsed.hostname;
|
|
14174
|
+
}
|
|
14175
|
+
catch (e) {
|
|
14176
|
+
throw new Error("Error getting file name from data url");
|
|
14177
|
+
}
|
|
14178
|
+
return filename;
|
|
14179
|
+
}
|
|
14180
|
+
/**
|
|
14181
|
+
* Is this a valid url?
|
|
14182
|
+
*
|
|
14183
|
+
* @param {string} url Url to validate
|
|
14184
|
+
* @return {*} {boolean}
|
|
14185
|
+
*/
|
|
14186
|
+
function isUrl(url) {
|
|
14187
|
+
// Use try / catch as a simple string "test" will cause new URL() to throw an error.
|
|
14188
|
+
try {
|
|
14189
|
+
var result = new URL(url);
|
|
14190
|
+
// Cast to bool.
|
|
14191
|
+
return !!result;
|
|
14192
|
+
}
|
|
14193
|
+
catch (e) {
|
|
14194
|
+
Logger.error("Error parsing data url");
|
|
14195
|
+
return false;
|
|
14196
|
+
}
|
|
14197
|
+
}
|
|
14198
|
+
/**
|
|
14199
|
+
* Tests if url string is a feature service / layer.
|
|
14200
|
+
*
|
|
14201
|
+
* @param {string} url URL to test
|
|
14202
|
+
* @return {*} {boolean}
|
|
14203
|
+
*/
|
|
14204
|
+
function isFeatureService(url) {
|
|
14205
|
+
return FEATURE_SERVICE_URL_REGEX.test(url);
|
|
14206
|
+
}
|
|
14207
|
+
/**
|
|
14208
|
+
* Tests if url string is a service (map, feature, image, etc)
|
|
14209
|
+
*
|
|
14210
|
+
* @param {string} url Url to test
|
|
14211
|
+
* @return {*} {boolean}
|
|
14212
|
+
*/
|
|
14213
|
+
function isService(url) {
|
|
14214
|
+
return SERVICE_URL_REGEX.test(url);
|
|
14215
|
+
}
|
|
14216
|
+
/**
|
|
14217
|
+
* Is the service a feature service AND is it a layer specifically
|
|
14218
|
+
*
|
|
14219
|
+
* @param {string} url
|
|
14220
|
+
* @return {*} {boolean}
|
|
14221
|
+
*/
|
|
14222
|
+
function isFeatureLayer(url) {
|
|
14223
|
+
var results = url.match(FEATURE_SERVICE_URL_REGEX);
|
|
14224
|
+
return results && !!results[3];
|
|
14225
|
+
}
|
|
14226
|
+
/**
|
|
14227
|
+
* Gets item title from url as a fall back
|
|
14228
|
+
*
|
|
14229
|
+
* @param {string} url item url
|
|
14230
|
+
* @return {*} {string}
|
|
14231
|
+
*/
|
|
14232
|
+
function getFeatureServiceTitle(url) {
|
|
14233
|
+
return url.match(/\/services\/(.+)\/(feature|map|image)server/i)[1];
|
|
14234
|
+
}
|
|
14235
|
+
/**
|
|
14236
|
+
* Gets item info out of a feature layer item.
|
|
14237
|
+
*
|
|
14238
|
+
* @export
|
|
14239
|
+
* @param {string} url Item URL
|
|
14240
|
+
* @param {{
|
|
14241
|
+
* name: string,
|
|
14242
|
+
* description: string,
|
|
14243
|
+
* extent: any
|
|
14244
|
+
* }} body Item body.
|
|
14245
|
+
* @return {*} {{
|
|
14246
|
+
* title: string,
|
|
14247
|
+
* description: string,
|
|
14248
|
+
* extent: any,
|
|
14249
|
+
* url: string
|
|
14250
|
+
* }}
|
|
14251
|
+
*/
|
|
14252
|
+
function getFeatureLayerItem(url, body) {
|
|
14253
|
+
return {
|
|
14254
|
+
title: body.name,
|
|
14255
|
+
description: body.description,
|
|
14256
|
+
extent: body.extent,
|
|
14257
|
+
url: url,
|
|
14258
|
+
};
|
|
14259
|
+
}
|
|
14260
|
+
/**
|
|
14261
|
+
* Gets item info out of a feature service response (which is not a specific layer)
|
|
14262
|
+
*
|
|
14263
|
+
* @export
|
|
14264
|
+
* @param {*} url
|
|
14265
|
+
* @param {*} body
|
|
14266
|
+
* @return {*}
|
|
14267
|
+
*/
|
|
14268
|
+
function getFeatureServiceItem(url, body) {
|
|
14269
|
+
var description = body.serviceDescription || body.description;
|
|
14270
|
+
var title = getFeatureServiceTitle(url);
|
|
14271
|
+
var extent = body.fullExtent || body.initialExtent;
|
|
14272
|
+
return { title: title, description: description, extent: extent, url: url };
|
|
14273
|
+
}
|
|
14274
|
+
/**
|
|
14275
|
+
* Ping a non FS url and return response status && headers
|
|
14276
|
+
*
|
|
14277
|
+
* @export
|
|
14278
|
+
* @param {string} url Non FS URL
|
|
14279
|
+
* @return {*} {Promise<{ ok: boolean, headers: Headers }>}
|
|
14280
|
+
*/
|
|
14281
|
+
function pingUrl(url) {
|
|
14282
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
14283
|
+
var response;
|
|
14284
|
+
return __generator(this, function (_a) {
|
|
14285
|
+
switch (_a.label) {
|
|
14286
|
+
case 0: return [4 /*yield*/, fetch(url, { method: "HEAD" })];
|
|
14287
|
+
case 1:
|
|
14288
|
+
response = _a.sent();
|
|
14289
|
+
return [2 /*return*/, {
|
|
14290
|
+
ok: response.ok,
|
|
14291
|
+
headers: response.headers,
|
|
14292
|
+
}];
|
|
14293
|
+
}
|
|
14294
|
+
});
|
|
14295
|
+
});
|
|
14296
|
+
}
|
|
14297
|
+
/**
|
|
14298
|
+
* Ping a FS URL and handle matters such as "hidden" success failures.
|
|
14299
|
+
*
|
|
14300
|
+
* @export
|
|
14301
|
+
* @param {string} url
|
|
14302
|
+
* @return {*} {Promise<{ ok: boolean, item?: any }>}
|
|
14303
|
+
*/
|
|
14304
|
+
function pingFeatureService(url) {
|
|
14305
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
14306
|
+
var parsed, response, body, getItem, item;
|
|
14307
|
+
return __generator(this, function (_a) {
|
|
14308
|
+
switch (_a.label) {
|
|
14309
|
+
case 0:
|
|
14310
|
+
parsed = new URL(url);
|
|
14311
|
+
parsed.searchParams.set("f", "json");
|
|
14312
|
+
return [4 /*yield*/, fetch(parsed.href)];
|
|
14313
|
+
case 1:
|
|
14314
|
+
response = _a.sent();
|
|
14315
|
+
if (!response.ok) {
|
|
14316
|
+
return [2 /*return*/, { ok: false }];
|
|
14317
|
+
}
|
|
14318
|
+
return [4 /*yield*/, response.json()];
|
|
14319
|
+
case 2:
|
|
14320
|
+
body = _a.sent();
|
|
14321
|
+
// Exit if the request returns an error
|
|
14322
|
+
if (body.error) {
|
|
14323
|
+
return [2 /*return*/, { ok: false }];
|
|
14324
|
+
}
|
|
14325
|
+
getItem = isFeatureLayer(url)
|
|
14326
|
+
? getFeatureLayerItem
|
|
14327
|
+
: getFeatureServiceItem;
|
|
14328
|
+
item = getItem(url, body);
|
|
14329
|
+
return [2 /*return*/, {
|
|
14330
|
+
ok: true,
|
|
14331
|
+
item: item,
|
|
14332
|
+
}];
|
|
14333
|
+
}
|
|
14334
|
+
});
|
|
14335
|
+
});
|
|
14336
|
+
}
|
|
14337
|
+
function detectDataTypeFromHeader(headers) {
|
|
14338
|
+
var contentType = headers.get("Content-Type");
|
|
14339
|
+
var dataType;
|
|
14340
|
+
if (!contentType) {
|
|
14341
|
+
return;
|
|
14342
|
+
}
|
|
14343
|
+
// Only get the "media-type"
|
|
14344
|
+
contentType = contentType.split(";").shift();
|
|
14345
|
+
if (contentType === "text/csv") {
|
|
14346
|
+
dataType = exports.ItemType.CSV;
|
|
14347
|
+
}
|
|
14348
|
+
else if (contentType === "application/vnd.ms-excel" ||
|
|
14349
|
+
contentType ===
|
|
14350
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
|
|
14351
|
+
dataType = exports.ItemType["Microsoft Excel"];
|
|
14352
|
+
}
|
|
14353
|
+
else if (contentType === "application/pdf") {
|
|
14354
|
+
dataType = exports.ItemType.PDF;
|
|
14355
|
+
}
|
|
14356
|
+
else if (contentType === "image/jpeg" ||
|
|
14357
|
+
contentType === "image/jpg" ||
|
|
14358
|
+
contentType === "image/png") {
|
|
14359
|
+
dataType = exports.ItemType.Image;
|
|
14360
|
+
}
|
|
14361
|
+
else if (contentType === "application/geo+json") {
|
|
14362
|
+
dataType = exports.ItemType.GeoJson;
|
|
14363
|
+
}
|
|
14364
|
+
return dataType;
|
|
14365
|
+
}
|
|
14366
|
+
function detectDataTypeFromExtension(url) {
|
|
14367
|
+
var contentType = url.toLowerCase().split(".").pop();
|
|
14368
|
+
var dataType;
|
|
14369
|
+
if (contentType === "csv") {
|
|
14370
|
+
dataType = exports.ItemType.CSV;
|
|
14371
|
+
}
|
|
14372
|
+
else if (contentType === "xls" || contentType === "xlsx") {
|
|
14373
|
+
dataType = exports.ItemType["Microsoft Excel"];
|
|
14374
|
+
}
|
|
14375
|
+
else if (contentType === "pdf") {
|
|
14376
|
+
dataType = exports.ItemType.PDF;
|
|
14377
|
+
}
|
|
14378
|
+
else if (contentType === "jpeg" ||
|
|
14379
|
+
contentType === "jpg" ||
|
|
14380
|
+
contentType === "png") {
|
|
14381
|
+
dataType = exports.ItemType.Image;
|
|
14382
|
+
}
|
|
14383
|
+
else if (contentType === "geojson") {
|
|
14384
|
+
dataType = exports.ItemType.GeoJson;
|
|
14385
|
+
}
|
|
14386
|
+
return dataType;
|
|
14387
|
+
}
|
|
14388
|
+
|
|
14389
|
+
/**
|
|
14390
|
+
* Takes in a URL and validates it based on valid url, type of item, etc
|
|
14391
|
+
*
|
|
14392
|
+
* @export
|
|
14393
|
+
* @param {string} url
|
|
14394
|
+
* @return {*} {Promise<any>}
|
|
14395
|
+
*/
|
|
14396
|
+
function validateUrl(url) {
|
|
14397
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
14398
|
+
var isFeatureServiceUrl, isServiceUrl, type, item, pingResult, _a;
|
|
14399
|
+
return __generator(this, function (_b) {
|
|
14400
|
+
switch (_b.label) {
|
|
14401
|
+
case 0:
|
|
14402
|
+
// If URL doesn't pass then exit out immediately.
|
|
14403
|
+
if (!isUrl(url)) {
|
|
14404
|
+
return [2 /*return*/, {
|
|
14405
|
+
pass: false,
|
|
14406
|
+
error: "invalidFormat",
|
|
14407
|
+
}];
|
|
14408
|
+
}
|
|
14409
|
+
isFeatureServiceUrl = isFeatureService(url);
|
|
14410
|
+
isServiceUrl = isService(url);
|
|
14411
|
+
if (isServiceUrl && !isFeatureServiceUrl) {
|
|
14412
|
+
return [2 /*return*/, {
|
|
14413
|
+
pass: false,
|
|
14414
|
+
error: "invalidFormat",
|
|
14415
|
+
}];
|
|
14416
|
+
}
|
|
14417
|
+
pingResult = {};
|
|
14418
|
+
_b.label = 1;
|
|
14419
|
+
case 1:
|
|
14420
|
+
_b.trys.push([1, 6, , 7]);
|
|
14421
|
+
if (!isFeatureServiceUrl) return [3 /*break*/, 3];
|
|
14422
|
+
return [4 /*yield*/, pingFeatureService(url)];
|
|
14423
|
+
case 2:
|
|
14424
|
+
_a = _b.sent();
|
|
14425
|
+
return [3 /*break*/, 5];
|
|
14426
|
+
case 3: return [4 /*yield*/, pingUrl(url)];
|
|
14427
|
+
case 4:
|
|
14428
|
+
_a = _b.sent();
|
|
14429
|
+
_b.label = 5;
|
|
14430
|
+
case 5:
|
|
14431
|
+
pingResult = _a;
|
|
14432
|
+
// return an error if the response is not okay
|
|
14433
|
+
if (!pingResult.ok) {
|
|
14434
|
+
return [2 /*return*/, {
|
|
14435
|
+
pass: false,
|
|
14436
|
+
error: "invalidUrl",
|
|
14437
|
+
}];
|
|
14438
|
+
}
|
|
14439
|
+
return [3 /*break*/, 7];
|
|
14440
|
+
case 6:
|
|
14441
|
+
_b.sent();
|
|
14442
|
+
// TODO: This is tricky. The fetch() API rejects when a network error
|
|
14443
|
+
// happens. This error can be a CORS error, or a 404 error, or a timeout
|
|
14444
|
+
// error. While an error like 404 does suggest a bad URL, the CORS occurs
|
|
14445
|
+
// because this is a front-end request and the file is likely accessible by
|
|
14446
|
+
// the server. Unfortunately, the error doesn't have any information about
|
|
14447
|
+
// underline failure type. For now, the network failure is ignored, so the
|
|
14448
|
+
// user can paste a URL from any domain and avoid the CORS issue.
|
|
14449
|
+
Logger.error("error requesting url");
|
|
14450
|
+
return [3 /*break*/, 7];
|
|
14451
|
+
case 7:
|
|
14452
|
+
// Use the metadata from the ping response if exists, otherwise guess the file
|
|
14453
|
+
// name from the URL
|
|
14454
|
+
if (pingResult.item) {
|
|
14455
|
+
item = pingResult.item;
|
|
14456
|
+
}
|
|
14457
|
+
else {
|
|
14458
|
+
item = { title: getFileName(url), url: url };
|
|
14459
|
+
}
|
|
14460
|
+
if (pingResult.headers) {
|
|
14461
|
+
type = detectDataTypeFromHeader(pingResult.headers);
|
|
14462
|
+
}
|
|
14463
|
+
if (isFeatureServiceUrl) {
|
|
14464
|
+
type = exports.ItemType["Feature Service"];
|
|
14465
|
+
}
|
|
14466
|
+
else if (!type) {
|
|
14467
|
+
// Guess the data type from the extension
|
|
14468
|
+
type = detectDataTypeFromExtension(url);
|
|
14469
|
+
}
|
|
14470
|
+
if (type) {
|
|
14471
|
+
item.type = type;
|
|
14472
|
+
}
|
|
14473
|
+
if (item.type && shouldHaveDataUrl(item.type)) {
|
|
14474
|
+
item.dataUrl = item.url;
|
|
14475
|
+
}
|
|
14476
|
+
return [2 /*return*/, {
|
|
14477
|
+
pass: true,
|
|
14478
|
+
// The type may or may not be true
|
|
14479
|
+
type: type,
|
|
14480
|
+
// fetched / calculated item
|
|
14481
|
+
item: item,
|
|
14482
|
+
}];
|
|
14483
|
+
}
|
|
14484
|
+
});
|
|
14485
|
+
});
|
|
14486
|
+
}
|
|
14487
|
+
|
|
13208
14488
|
/**
|
|
13209
14489
|
* Search the Hub API
|
|
13210
14490
|
*
|
|
@@ -15571,6 +16851,7 @@
|
|
|
15571
16851
|
exports._unprotectAndRemoveGroup = _unprotectAndRemoveGroup;
|
|
15572
16852
|
exports._unprotectAndRemoveItem = _unprotectAndRemoveItem;
|
|
15573
16853
|
exports.addContextToSlug = addContextToSlug;
|
|
16854
|
+
exports.addCreateItemTypes = addCreateItemTypes;
|
|
15574
16855
|
exports.addDays = addDays;
|
|
15575
16856
|
exports.addDomain = addDomain;
|
|
15576
16857
|
exports.addSiteDomains = addSiteDomains;
|
|
@@ -15729,7 +17010,7 @@
|
|
|
15729
17010
|
exports.isDomainUsedElsewhere = isDomainUsedElsewhere;
|
|
15730
17011
|
exports.isDownloadable = isDownloadable;
|
|
15731
17012
|
exports.isExtentCoordinateArray = isExtentCoordinateArray;
|
|
15732
|
-
exports.isFeatureService = isFeatureService;
|
|
17013
|
+
exports.isFeatureService = isFeatureService$1;
|
|
15733
17014
|
exports.isFieldworkerView = isFieldworkerView;
|
|
15734
17015
|
exports.isGuid = isGuid;
|
|
15735
17016
|
exports.isLayerView = isLayerView;
|
|
@@ -15803,6 +17084,7 @@
|
|
|
15803
17084
|
exports.upgradeProtocol = upgradeProtocol;
|
|
15804
17085
|
exports.upgradeSiteSchema = upgradeSiteSchema;
|
|
15805
17086
|
exports.uploadResourcesFromUrl = uploadResourcesFromUrl;
|
|
17087
|
+
exports.validateUrl = validateUrl;
|
|
15806
17088
|
exports.valueToMatchOptions = valueToMatchOptions;
|
|
15807
17089
|
exports.without = without;
|
|
15808
17090
|
exports.withoutByProp = withoutByProp;
|