@esri/hub-common 8.18.0 → 8.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es2017/api.js +5 -0
- package/dist/es2017/api.js.map +1 -1
- package/dist/es2017/content.js +341 -2
- package/dist/es2017/content.js.map +1 -1
- package/dist/es2017/downloads/build-existing-exports-portal-query.js +187 -0
- package/dist/es2017/downloads/build-existing-exports-portal-query.js.map +1 -0
- package/dist/es2017/downloads/index.js +2 -0
- package/dist/es2017/downloads/index.js.map +1 -0
- package/dist/es2017/index.js +2 -0
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/request.js +8 -5
- package/dist/es2017/request.js.map +1 -1
- package/dist/es2017/sites/domains/_get-domain-service-url.js.map +1 -1
- package/dist/es2017/sites/domains/ensure-unique-domain-name.js +2 -1
- package/dist/es2017/sites/domains/ensure-unique-domain-name.js.map +1 -1
- package/dist/es2017/sites/domains/is-valid-domain.js +2 -1
- package/dist/es2017/sites/domains/is-valid-domain.js.map +1 -1
- package/dist/es2017/util.js +8 -0
- package/dist/es2017/util.js.map +1 -1
- package/dist/esm/api.js +5 -0
- package/dist/esm/api.js.map +1 -1
- package/dist/esm/content.js +342 -2
- package/dist/esm/content.js.map +1 -1
- package/dist/esm/downloads/build-existing-exports-portal-query.js +187 -0
- package/dist/esm/downloads/build-existing-exports-portal-query.js.map +1 -0
- package/dist/esm/downloads/index.js +2 -0
- package/dist/esm/downloads/index.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/request.js +7 -4
- package/dist/esm/request.js.map +1 -1
- package/dist/esm/sites/domains/_get-domain-service-url.js.map +1 -1
- package/dist/esm/sites/domains/ensure-unique-domain-name.js +2 -1
- package/dist/esm/sites/domains/ensure-unique-domain-name.js.map +1 -1
- package/dist/esm/sites/domains/is-valid-domain.js +2 -1
- package/dist/esm/sites/domains/is-valid-domain.js.map +1 -1
- package/dist/esm/util.js +8 -0
- package/dist/esm/util.js.map +1 -1
- package/dist/node/api.js +5 -0
- package/dist/node/api.js.map +1 -1
- package/dist/node/content.js +346 -1
- package/dist/node/content.js.map +1 -1
- package/dist/node/downloads/build-existing-exports-portal-query.js +195 -0
- package/dist/node/downloads/build-existing-exports-portal-query.js.map +1 -0
- package/dist/node/downloads/index.js +5 -0
- package/dist/node/downloads/index.js.map +1 -0
- package/dist/node/index.js +4 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/request.js +8 -5
- package/dist/node/request.js.map +1 -1
- package/dist/node/sites/domains/_get-domain-service-url.js.map +1 -1
- package/dist/node/sites/domains/ensure-unique-domain-name.js +2 -1
- package/dist/node/sites/domains/ensure-unique-domain-name.js.map +1 -1
- package/dist/node/sites/domains/is-valid-domain.js +2 -1
- package/dist/node/sites/domains/is-valid-domain.js.map +1 -1
- package/dist/node/util.js +10 -1
- package/dist/node/util.js.map +1 -1
- package/dist/types/content.d.ts +61 -0
- package/dist/types/downloads/build-existing-exports-portal-query.d.ts +86 -0
- package/dist/types/downloads/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/sites/domains/_get-domain-service-url.d.ts +1 -1
- package/dist/types/types.d.ts +19 -7
- package/dist/types/util.d.ts +6 -0
- package/dist/umd/common.umd.js +2394 -1685
- 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 +5 -3
package/dist/es2017/api.js
CHANGED
|
@@ -12,6 +12,11 @@ import { _getHubUrlFromPortalHostname } from "./urls/_get-hub-url-from-portal-ho
|
|
|
12
12
|
* @returns the associated Hub API Url as a string.
|
|
13
13
|
*/
|
|
14
14
|
export function getHubApiUrl(urlOrObject) {
|
|
15
|
+
const hubApiUrl = urlOrObject && urlOrObject.hubApiUrl;
|
|
16
|
+
if (hubApiUrl) {
|
|
17
|
+
// this is request options w/ hubApiUrl already defined
|
|
18
|
+
return hubApiUrl;
|
|
19
|
+
}
|
|
15
20
|
return _getHubUrlFromPortalHostname(getPortalApiUrl(urlOrObject));
|
|
16
21
|
}
|
|
17
22
|
//# sourceMappingURL=api.js.map
|
package/dist/es2017/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAC1B,WAAoE;IAEpE,OAAO,4BAA4B,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAC1B,WAAoE;IAEpE,MAAM,SAAS,GACb,WAAW,IAAK,WAAkC,CAAC,SAAS,CAAC;IAC/D,IAAI,SAAS,EAAE;QACb,uDAAuD;QACvD,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,4BAA4B,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/es2017/content.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { collections } from "./collections";
|
|
2
|
-
import { categories } from "./categories";
|
|
2
|
+
import { categories as allCategories, isDownloadable } from "./categories";
|
|
3
|
+
import { createExtent, isExtentCoordinateArray } from "./extent";
|
|
3
4
|
import { includes, isGuid } from "./utils";
|
|
4
5
|
import { getProp } from "./objects";
|
|
6
|
+
import { getStructuredLicense } from "./items/get-structured-license";
|
|
7
|
+
import { getServiceTypeFromUrl } from "./urls";
|
|
8
|
+
function collectionToFamily(collection) {
|
|
9
|
+
const overrides = {
|
|
10
|
+
other: "content",
|
|
11
|
+
solution: "template",
|
|
12
|
+
};
|
|
13
|
+
return overrides[collection] || collection;
|
|
14
|
+
}
|
|
15
|
+
function itemExtentToBoundary(extent) {
|
|
16
|
+
return (extent &&
|
|
17
|
+
extent.length && {
|
|
18
|
+
// TODO: center?
|
|
19
|
+
geometry: createExtent(extent[0][0], extent[0][1], extent[1][0], extent[1][1]),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
5
22
|
const cache = {};
|
|
6
23
|
// TODO: remove this at next breaking version
|
|
7
24
|
/**
|
|
@@ -37,7 +54,7 @@ export function getCategory(itemType = "") {
|
|
|
37
54
|
*
|
|
38
55
|
*/
|
|
39
56
|
export function getTypes(category = "") {
|
|
40
|
-
return
|
|
57
|
+
return allCategories[category.toLowerCase()];
|
|
41
58
|
}
|
|
42
59
|
/**
|
|
43
60
|
* ```js
|
|
@@ -283,4 +300,326 @@ export function removeContextFromSlug(slug, context) {
|
|
|
283
300
|
return slug;
|
|
284
301
|
}
|
|
285
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Splits item category strings at slashes and discards the "Categories" keyword
|
|
305
|
+
*
|
|
306
|
+
* ```
|
|
307
|
+
* ["/Categories/Boundaries", "/Categories/Planning and cadastre/Property records", "/Categories/Structure"]
|
|
308
|
+
* ```
|
|
309
|
+
* Should end up being
|
|
310
|
+
* ```
|
|
311
|
+
* ["Boundaries", "Planning and cadastre", "Property records", "Structure"]
|
|
312
|
+
* ```
|
|
313
|
+
*
|
|
314
|
+
* @param categories - an array of strings
|
|
315
|
+
* @private
|
|
316
|
+
*/
|
|
317
|
+
export function parseItemCategories(categories) {
|
|
318
|
+
if (!categories)
|
|
319
|
+
return categories;
|
|
320
|
+
const exclude = ["categories", ""];
|
|
321
|
+
const parsed = categories.map((cat) => cat.split("/"));
|
|
322
|
+
const flattened = parsed.reduce((acc, arr, _) => [...acc, ...arr], []);
|
|
323
|
+
return flattened.filter((cat) => !includes(exclude, cat.toLowerCase()));
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* return the Hub family given an item's type
|
|
327
|
+
* @param type item type
|
|
328
|
+
* @returns Hub family
|
|
329
|
+
*/
|
|
330
|
+
export function getFamily(type) {
|
|
331
|
+
let family;
|
|
332
|
+
// override default behavior for the rows that are highlighted in yellow here:
|
|
333
|
+
// https://esriis.sharepoint.com/:x:/r/sites/ArcGISHub/_layouts/15/Doc.aspx?sourcedoc=%7BADA1C9DC-4F6C-4DE4-92C6-693EF9571CFA%7D&file=Hub%20Routes.xlsx&nav=MTBfe0VENEREQzI4LUZFMDctNEI0Ri04NjcyLThCQUE2MTA0MEZGRn1fezIwMTIwMEJFLTA4MEQtNEExRC05QzA4LTE5MTAzOUQwMEE1RH0&action=default&mobileredirect=true&cid=df1c874b-c367-4cea-bc13-7bebfad3f2ac
|
|
334
|
+
switch ((type || "").toLowerCase()) {
|
|
335
|
+
case "image service":
|
|
336
|
+
family = "dataset";
|
|
337
|
+
break;
|
|
338
|
+
case "feature service":
|
|
339
|
+
case "raster layer":
|
|
340
|
+
// TODO: check if feature service has > 1 layer first?
|
|
341
|
+
family = "map";
|
|
342
|
+
break;
|
|
343
|
+
case "microsoft excel":
|
|
344
|
+
family = "document";
|
|
345
|
+
break;
|
|
346
|
+
case "cad drawing":
|
|
347
|
+
case "feature collection template":
|
|
348
|
+
case "report template":
|
|
349
|
+
family = "content";
|
|
350
|
+
break;
|
|
351
|
+
default:
|
|
352
|
+
// by default derive from collection
|
|
353
|
+
family = collectionToFamily(getCollection(type));
|
|
354
|
+
}
|
|
355
|
+
return family;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* DEPRECATED: Use getFamily() instead.
|
|
359
|
+
*
|
|
360
|
+
* get the HubType for a given item or item type
|
|
361
|
+
*
|
|
362
|
+
* @param itemOrType an item or item.type
|
|
363
|
+
*/
|
|
364
|
+
export function getItemHubType(itemOrType) {
|
|
365
|
+
/* tslint:disable no-console */
|
|
366
|
+
console.warn("DEPRECATED: Use getFamily() instead. getItemHubType() will be removed at v9.0.0");
|
|
367
|
+
/* tslint:enable no-console */
|
|
368
|
+
if (typeof itemOrType === "string") {
|
|
369
|
+
itemOrType = { type: itemOrType };
|
|
370
|
+
}
|
|
371
|
+
const itemType = normalizeItemType(itemOrType);
|
|
372
|
+
// TODO: not all categories are Hub types, may need to validate
|
|
373
|
+
return getCollection(itemType);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Convert a Portal item to Hub content
|
|
377
|
+
*
|
|
378
|
+
* @param item Portal Item
|
|
379
|
+
* @returns Hub content
|
|
380
|
+
* @export
|
|
381
|
+
*/
|
|
382
|
+
export function itemToContent(item) {
|
|
383
|
+
const createdDate = new Date(item.created);
|
|
384
|
+
const createdDateSource = "item.created";
|
|
385
|
+
const properties = item.properties;
|
|
386
|
+
const normalizedType = normalizeItemType(item);
|
|
387
|
+
const content = Object.assign({}, item, {
|
|
388
|
+
// no server errors when fetching the item directly
|
|
389
|
+
errors: [],
|
|
390
|
+
// store a reference to the item
|
|
391
|
+
item,
|
|
392
|
+
// NOTE: this will overwrite any existing item.name, which is
|
|
393
|
+
// The file name of the item for file types. Read-only.
|
|
394
|
+
// presumably there to use as the default file name when downloading
|
|
395
|
+
// we don't store item.name in the Hub API and we use name for title
|
|
396
|
+
name: item.title,
|
|
397
|
+
family: getFamily(normalizedType),
|
|
398
|
+
// TODO: hubType is no longer used, remove it at next breaking change
|
|
399
|
+
hubType: getItemHubType(item),
|
|
400
|
+
normalizedType,
|
|
401
|
+
categories: parseItemCategories(item.categories),
|
|
402
|
+
itemCategories: item.categories,
|
|
403
|
+
// can we strip HTML from description, and do we need to trim it to a X chars?
|
|
404
|
+
summary: item.snippet || item.description,
|
|
405
|
+
publisher: {
|
|
406
|
+
name: item.owner,
|
|
407
|
+
username: item.owner,
|
|
408
|
+
},
|
|
409
|
+
permissions: {
|
|
410
|
+
visibility: item.access,
|
|
411
|
+
control: item.itemControl || "view",
|
|
412
|
+
},
|
|
413
|
+
// Hub app configuration metadata from item properties
|
|
414
|
+
actionLinks: properties && properties.links,
|
|
415
|
+
hubActions: properties && properties.actions,
|
|
416
|
+
metrics: properties && properties.metrics,
|
|
417
|
+
isDownloadable: isDownloadable(item),
|
|
418
|
+
// default boundary from item.extent
|
|
419
|
+
boundary: itemExtentToBoundary(item.extent),
|
|
420
|
+
license: { name: "Custom License", description: item.accessInformation },
|
|
421
|
+
// dates and sources we will enrich these later...
|
|
422
|
+
createdDate,
|
|
423
|
+
createdDateSource,
|
|
424
|
+
publishedDate: createdDate,
|
|
425
|
+
publishedDateSource: createdDateSource,
|
|
426
|
+
updatedDate: new Date(item.modified),
|
|
427
|
+
updatedDateSource: "item.modified",
|
|
428
|
+
structuredLicense: getStructuredLicense(item.licenseInfo),
|
|
429
|
+
});
|
|
430
|
+
return content;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Convert a Hub API dataset resource to Hub Content
|
|
434
|
+
*
|
|
435
|
+
* @param {DatasetResource} Dataset resource
|
|
436
|
+
* @returns {IHubContent} Hub content object
|
|
437
|
+
* @export
|
|
438
|
+
*/
|
|
439
|
+
export function datasetToContent(dataset) {
|
|
440
|
+
// extract item from dataset, create content, & store a reference to the item
|
|
441
|
+
const item = datasetToItem(dataset);
|
|
442
|
+
const content = itemToContent(item);
|
|
443
|
+
content.item = item;
|
|
444
|
+
// We remove these because the indexer doesn't actually
|
|
445
|
+
// preserve the original item categories so this attribute is invalid
|
|
446
|
+
delete content.itemCategories;
|
|
447
|
+
// overwrite hubId
|
|
448
|
+
content.hubId = dataset.id;
|
|
449
|
+
// overwrite or add enrichments from Hub API
|
|
450
|
+
const attributes = dataset.attributes;
|
|
451
|
+
const {
|
|
452
|
+
// common enrichments
|
|
453
|
+
errors, boundary, extent, metadata, modified, modifiedProvenance, slug, searchDescription, groupIds,
|
|
454
|
+
// map and feature server enrichments
|
|
455
|
+
server, layers,
|
|
456
|
+
// NOTE: the Hub API also returns the following server properties
|
|
457
|
+
// but we should be able to get them from the above server object
|
|
458
|
+
// currentVersion, capabilities, tileInfo, serviceSpatialReference
|
|
459
|
+
// maxRecordCount, supportedQueryFormats, etc
|
|
460
|
+
// feature and raster layer enrichments
|
|
461
|
+
layer, recordCount, statistics,
|
|
462
|
+
// NOTE: the Hub API also returns the following layer properties
|
|
463
|
+
// but we should be able to get them from the above layer object
|
|
464
|
+
// supportedQueryFormats, supportsAdvancedQueries, advancedQueryCapabilities, useStandardizedQueries
|
|
465
|
+
// geometryType, objectIdField, displayField, fields,
|
|
466
|
+
// org properties?
|
|
467
|
+
orgId, orgName, organization, orgExtent,
|
|
468
|
+
// NOTE: for layers and tables the Hub API returns the layer type
|
|
469
|
+
// ("Feature Layer", "Table", "Raster Layer") instead of the item type
|
|
470
|
+
type, } = attributes;
|
|
471
|
+
// use the type returned by the API (i.e. possibly layer.type)
|
|
472
|
+
content.type = type;
|
|
473
|
+
content.normalizedType = normalizeItemType(Object.assign(Object.assign({}, content.item), { type }));
|
|
474
|
+
content.family = getFamily(type);
|
|
475
|
+
// NOTE: we could throw or return if there are errors
|
|
476
|
+
// to prevent type errors trying to read properties below
|
|
477
|
+
content.errors = errors;
|
|
478
|
+
// common enrichments
|
|
479
|
+
content.boundary = boundary;
|
|
480
|
+
if (!isExtentCoordinateArray(item.extent) &&
|
|
481
|
+
extent &&
|
|
482
|
+
isExtentCoordinateArray(extent.coordinates)) {
|
|
483
|
+
// we fall back to the extent derived by the API
|
|
484
|
+
// which prefers layer or service extents and ultimately
|
|
485
|
+
// falls back to the org's extent
|
|
486
|
+
content.extent = extent.coordinates;
|
|
487
|
+
}
|
|
488
|
+
// setting this to null signals to enrichMetadata to skip this
|
|
489
|
+
content.metadata = metadata || null;
|
|
490
|
+
if (content.modified !== modified) {
|
|
491
|
+
// capture the enriched modified date
|
|
492
|
+
// NOTE: the item modified date is still available on content.item.modified
|
|
493
|
+
content.modified = modified;
|
|
494
|
+
content.updatedDate = new Date(modified);
|
|
495
|
+
content.updatedDateSource = modifiedProvenance;
|
|
496
|
+
}
|
|
497
|
+
content.slug = slug;
|
|
498
|
+
if (searchDescription) {
|
|
499
|
+
// overwrite default summary (from snippet) w/ search description
|
|
500
|
+
content.summary = searchDescription;
|
|
501
|
+
}
|
|
502
|
+
content.groupIds = groupIds;
|
|
503
|
+
// server enrichments
|
|
504
|
+
content.server = server;
|
|
505
|
+
content.layers = layers;
|
|
506
|
+
// layer enrichments
|
|
507
|
+
content.layer = layer;
|
|
508
|
+
content.recordCount = recordCount;
|
|
509
|
+
content.statistics = statistics;
|
|
510
|
+
// org enrichments
|
|
511
|
+
if (orgId) {
|
|
512
|
+
content.org = {
|
|
513
|
+
id: orgId,
|
|
514
|
+
name: orgName || organization,
|
|
515
|
+
extent: orgExtent,
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
return content;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Convert a Hub API dataset resource to a portal item
|
|
522
|
+
*
|
|
523
|
+
* @param {DatasetResource} Dataset resource
|
|
524
|
+
* @returns {IItem} portal item
|
|
525
|
+
* @export
|
|
526
|
+
*/
|
|
527
|
+
export function datasetToItem(dataset) {
|
|
528
|
+
if (!dataset) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const { id, attributes } = dataset;
|
|
532
|
+
if (!attributes) {
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
// parse item id
|
|
536
|
+
const { itemId } = parseDatasetId(id);
|
|
537
|
+
// read item properties from attributes
|
|
538
|
+
// NOTE: we attempt to read all item properties
|
|
539
|
+
// even though some may not be currently returned
|
|
540
|
+
const {
|
|
541
|
+
// start w/ item properties from
|
|
542
|
+
// https://developers.arcgis.com/rest/users-groups-and-items/item.htm
|
|
543
|
+
owner, orgId, created,
|
|
544
|
+
// the Hub API returns item.modified in attributes.itemModified (below)
|
|
545
|
+
modified,
|
|
546
|
+
// NOTE: we use attributes.name to store the title or the service/layer name
|
|
547
|
+
// but in Portal name is only used for file types to store the file name (read only)
|
|
548
|
+
name, title, type, typeKeywords, description, snippet, tags, thumbnail,
|
|
549
|
+
// the Hub API returns item.extent in attributes.itemExtent (below)
|
|
550
|
+
// extent,
|
|
551
|
+
categories, contentStatus,
|
|
552
|
+
// the Hub API doesn't currently return spatialReference
|
|
553
|
+
spatialReference,
|
|
554
|
+
// the Hub API doesn't currently return accessInformation
|
|
555
|
+
accessInformation, licenseInfo, culture, url, access,
|
|
556
|
+
// the Hub API doesn't currently return proxyFilter
|
|
557
|
+
proxyFilter, properties,
|
|
558
|
+
// the Hub API doesn't currently return appCategories, industries,
|
|
559
|
+
// languages, largeThumbnail, banner, screenshots, listed, ownerFolder
|
|
560
|
+
appCategories, industries, languages, largeThumbnail, banner, screenshots, listed, ownerFolder, size,
|
|
561
|
+
// the Hub API doesn't currently return protected
|
|
562
|
+
protected: isProtected, commentsEnabled,
|
|
563
|
+
// the Hub API doesn't currently return numComments, numRatings,
|
|
564
|
+
// avgRating, numViews, itemControl, scoreCompleteness
|
|
565
|
+
numComments, numRatings, avgRating, numViews, itemControl, scoreCompleteness,
|
|
566
|
+
// additional attributes we'll need
|
|
567
|
+
// to derive the above values when missing
|
|
568
|
+
itemExtent, itemModified, modifiedProvenance, serviceSpatialReference, } = attributes;
|
|
569
|
+
// layer datasets will get their type from the layer
|
|
570
|
+
// so we will need to derive the item type from the URL
|
|
571
|
+
const serviceType = url && getServiceTypeFromUrl(url);
|
|
572
|
+
// build and return an item from properties
|
|
573
|
+
// NOTE: we currently do NOT provide default values
|
|
574
|
+
// (i.e. null for scalar attributes, [] for arrays, etc)
|
|
575
|
+
// for attributes that are not returned by the Hub API
|
|
576
|
+
// this helps distinguish an item that comes from the API
|
|
577
|
+
// but forces all consumers to do handle missing properties
|
|
578
|
+
return {
|
|
579
|
+
id: itemId,
|
|
580
|
+
owner: owner,
|
|
581
|
+
orgId,
|
|
582
|
+
created: created,
|
|
583
|
+
// for feature layers, modified will usually come from the layer so
|
|
584
|
+
// we prefer itemModified, but fall back to modified if it came from the item
|
|
585
|
+
modified: (itemModified ||
|
|
586
|
+
(modifiedProvenance === "item.modified" && modified)),
|
|
587
|
+
title: (title || name),
|
|
588
|
+
type: serviceType || type,
|
|
589
|
+
typeKeywords,
|
|
590
|
+
description,
|
|
591
|
+
tags,
|
|
592
|
+
snippet,
|
|
593
|
+
thumbnail,
|
|
594
|
+
extent: itemExtent ||
|
|
595
|
+
/* istanbul ignore next: API should always return itemExtent, but we default to [] just in case */ [],
|
|
596
|
+
categories,
|
|
597
|
+
contentStatus,
|
|
598
|
+
spatialReference: spatialReference || serviceSpatialReference,
|
|
599
|
+
accessInformation,
|
|
600
|
+
licenseInfo,
|
|
601
|
+
culture,
|
|
602
|
+
url,
|
|
603
|
+
access,
|
|
604
|
+
size,
|
|
605
|
+
protected: isProtected,
|
|
606
|
+
proxyFilter,
|
|
607
|
+
properties,
|
|
608
|
+
appCategories,
|
|
609
|
+
industries,
|
|
610
|
+
languages,
|
|
611
|
+
largeThumbnail,
|
|
612
|
+
banner,
|
|
613
|
+
screenshots,
|
|
614
|
+
listed,
|
|
615
|
+
ownerFolder,
|
|
616
|
+
commentsEnabled,
|
|
617
|
+
numComments,
|
|
618
|
+
numRatings,
|
|
619
|
+
avgRating,
|
|
620
|
+
numViews,
|
|
621
|
+
itemControl,
|
|
622
|
+
scoreCompleteness,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
286
625
|
//# sourceMappingURL=content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/content.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO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QAC1B,mEAAmE;QACnE,6EAA6E;QAC7E,QAAQ,EAAE,CAAC,YAAY;YACrB,CAAC,kBAAkB,KAAK,eAAe,IAAI,QAAQ,CAAC,CAAW;QACjE,KAAK,EAAE,CAAC,KAAK,IAAI,IAAI,CAAW;QAChC,IAAI,EAAE,WAAW,IAAI,IAAI;QACzB,YAAY;QACZ,WAAW;QACX,IAAI;QACJ,OAAO;QACP,SAAS;QACT,MAAM,EACJ,UAAU;YACV,kGAAkG,CAAC,EAAE;QACvG,UAAU;QACV,aAAa;QACb,gBAAgB,EAAE,gBAAgB,IAAI,uBAAuB;QAC7D,iBAAiB;QACjB,WAAW;QACX,OAAO;QACP,GAAG;QACH,MAAM;QACN,IAAI;QACJ,SAAS,EAAE,WAAW;QACtB,WAAW;QACX,UAAU;QACV,aAAa;QACb,UAAU;QACV,SAAS;QACT,cAAc;QACd,MAAM;QACN,WAAW;QACX,MAAM;QACN,WAAW;QACX,eAAe;QACf,WAAW;QACX,UAAU;QACV,SAAS;QACT,QAAQ;QACR,WAAW;QACX,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { SearchQueryBuilder } from "@esri/arcgis-rest-portal";
|
|
2
|
+
import { btoa } from "abab";
|
|
3
|
+
import { flattenArray } from "../util";
|
|
4
|
+
export const WGS84_WKID = "4326";
|
|
5
|
+
export const PORTAL_EXPORT_TYPES = {
|
|
6
|
+
csv: {
|
|
7
|
+
name: "CSV",
|
|
8
|
+
itemTypes: ["CSV", "CSV Collection"],
|
|
9
|
+
supportsProjection: true,
|
|
10
|
+
},
|
|
11
|
+
kml: {
|
|
12
|
+
name: "KML",
|
|
13
|
+
itemTypes: ["KML", "KML Collection"],
|
|
14
|
+
supportsProjection: false,
|
|
15
|
+
},
|
|
16
|
+
shapefile: {
|
|
17
|
+
name: "Shapefile",
|
|
18
|
+
itemTypes: ["Shapefile"],
|
|
19
|
+
supportsProjection: true,
|
|
20
|
+
},
|
|
21
|
+
fileGeodatabase: {
|
|
22
|
+
name: "File Geodatabase",
|
|
23
|
+
itemTypes: ["File Geodatabase"],
|
|
24
|
+
supportsProjection: true,
|
|
25
|
+
},
|
|
26
|
+
geojson: {
|
|
27
|
+
name: "GeoJson",
|
|
28
|
+
itemTypes: ["GeoJson"],
|
|
29
|
+
supportsProjection: false,
|
|
30
|
+
},
|
|
31
|
+
excel: {
|
|
32
|
+
name: "Excel",
|
|
33
|
+
itemTypes: ["Microsoft Excel"],
|
|
34
|
+
supportsProjection: true,
|
|
35
|
+
},
|
|
36
|
+
featureCollection: {
|
|
37
|
+
name: "Feature Collection",
|
|
38
|
+
itemTypes: ["Feature Collection"],
|
|
39
|
+
supportsProjection: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Puts a spatial reference into a serialized format that can be used
|
|
44
|
+
* for item typeKeywords.
|
|
45
|
+
*
|
|
46
|
+
* **Note**: discards "latestWkid"
|
|
47
|
+
*
|
|
48
|
+
* In the past we used `JSON.stringify`, but that causes problems because
|
|
49
|
+
* it can include commas which are interpreted by the portal [update item call](https://developers.arcgis.com/rest/users-groups-and-items/update-item.htm)
|
|
50
|
+
* as being separate typekeywords. With `JSON.stringify`, equality was also
|
|
51
|
+
* dependent on the order of the properties in the spatial reference.
|
|
52
|
+
*
|
|
53
|
+
* Check https://developers.arcgis.com/web-map-specification/objects/spatialReference/
|
|
54
|
+
* for more details on what this object looks like.
|
|
55
|
+
*/
|
|
56
|
+
export function serializeSpatialReference(spatialReference) {
|
|
57
|
+
if (typeof spatialReference === "object") {
|
|
58
|
+
const { wkid, wkt } = spatialReference;
|
|
59
|
+
return wkid ? wkid + "" : btoa(wkt);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return spatialReference;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* spatialRefId can currently take the form of either a WKID string or a
|
|
67
|
+
* serialized ISpatialReference object.
|
|
68
|
+
*
|
|
69
|
+
* TODO - we shouldn't need this function. Instead, spatialRefId should
|
|
70
|
+
* always be consistent, maybe by using serializeSpatialReference
|
|
71
|
+
*
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
function parseSpatialRefId(spatialRefId) {
|
|
75
|
+
let _spatialRefId;
|
|
76
|
+
try {
|
|
77
|
+
_spatialRefId = JSON.parse(spatialRefId);
|
|
78
|
+
}
|
|
79
|
+
catch (_a) {
|
|
80
|
+
_spatialRefId = spatialRefId;
|
|
81
|
+
}
|
|
82
|
+
return _spatialRefId;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Builds the Portal API query string to search for exports from a given dataset
|
|
86
|
+
*
|
|
87
|
+
* @param itemId - The dataset ID
|
|
88
|
+
* @param options - A set of options including item types, layerId, and spatialRefId
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
export function buildExistingExportsPortalQuery(itemId, options) {
|
|
92
|
+
const { onlyTypes, layerId, spatialRefId } = maybeExtractOptions(options);
|
|
93
|
+
const formatInfos = Object.keys(PORTAL_EXPORT_TYPES).map((key) => PORTAL_EXPORT_TYPES[key]);
|
|
94
|
+
const noProjectionItemTypes = new Set(flattenArray(formatInfos
|
|
95
|
+
.filter((info) => !info.supportsProjection)
|
|
96
|
+
.map((info) => info.itemTypes)));
|
|
97
|
+
let types;
|
|
98
|
+
if (!onlyTypes) {
|
|
99
|
+
types = flattenArray(formatInfos.map((info) => info.itemTypes));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
types = onlyTypes;
|
|
103
|
+
}
|
|
104
|
+
const queryBuilder = new SearchQueryBuilder()
|
|
105
|
+
.startGroup()
|
|
106
|
+
.match(getExportItemTypeKeyword(itemId))
|
|
107
|
+
.in("typekeywords")
|
|
108
|
+
.and()
|
|
109
|
+
.match(getExportLayerTypeKeyword(layerId))
|
|
110
|
+
.in("typekeywords")
|
|
111
|
+
.endGroup()
|
|
112
|
+
.and()
|
|
113
|
+
.startGroup();
|
|
114
|
+
buildExportTypesClause(queryBuilder, {
|
|
115
|
+
types,
|
|
116
|
+
spatialRefId,
|
|
117
|
+
noProjectionItemTypes,
|
|
118
|
+
});
|
|
119
|
+
queryBuilder.endGroup();
|
|
120
|
+
return queryBuilder.toParam();
|
|
121
|
+
}
|
|
122
|
+
function maybeExtractOptions(options) {
|
|
123
|
+
if (options) {
|
|
124
|
+
return {
|
|
125
|
+
onlyTypes: options.onlyTypes,
|
|
126
|
+
layerId: options.layerId,
|
|
127
|
+
spatialRefId: options.spatialRefId,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
function buildExportTypesClause(builder, options) {
|
|
133
|
+
const { types, noProjectionItemTypes, spatialRefId } = options;
|
|
134
|
+
const getSpatialRefIdWithDefaults = (_spatialRefId, itemType) => {
|
|
135
|
+
let ret = WGS84_WKID;
|
|
136
|
+
if (_spatialRefId && !noProjectionItemTypes.has(itemType)) {
|
|
137
|
+
ret = _spatialRefId;
|
|
138
|
+
}
|
|
139
|
+
return ret;
|
|
140
|
+
};
|
|
141
|
+
const buildQueryForType = (type, _builder) => {
|
|
142
|
+
_builder
|
|
143
|
+
.startGroup()
|
|
144
|
+
.match(/\s/g.test(type) ? type : `"${type}"`) // temporary logic until https://github.com/Esri/arcgis-rest-js/issues/916 is resolved
|
|
145
|
+
.in("type")
|
|
146
|
+
.and()
|
|
147
|
+
.match(getSpatialRefTypeKeyword(getSpatialRefIdWithDefaults(spatialRefId, type)))
|
|
148
|
+
.in("typekeywords")
|
|
149
|
+
.endGroup();
|
|
150
|
+
};
|
|
151
|
+
types.forEach((type, i) => {
|
|
152
|
+
buildQueryForType(type, builder);
|
|
153
|
+
if (i < types.length - 1) {
|
|
154
|
+
builder.or();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Generates typekeyword for identifying which spatialRefId an export is
|
|
160
|
+
* @param spatialRefId - either a WKID, WKT, or stringified ISpatialReference
|
|
161
|
+
* @private
|
|
162
|
+
*/
|
|
163
|
+
export function getSpatialRefTypeKeyword(spatialRefId) {
|
|
164
|
+
const parsedSpatialReference = parseSpatialRefId(spatialRefId);
|
|
165
|
+
const serializedSpatialReference = serializeSpatialReference(parsedSpatialReference);
|
|
166
|
+
return `spatialRefId:${serializedSpatialReference}`;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Returns the keyword identifying exports by the item they originate from
|
|
170
|
+
* @param itemId - ID for the item from which the export originated
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
173
|
+
export function getExportItemTypeKeyword(itemId) {
|
|
174
|
+
return `exportItem:${itemId}`;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Returns the keyword identifying exports by the layer they originate from
|
|
178
|
+
* @param layerId - ID for the layer from which the export originated
|
|
179
|
+
* @private
|
|
180
|
+
*/
|
|
181
|
+
export function getExportLayerTypeKeyword(layerId) {
|
|
182
|
+
// NOTE - Layer Id's need to be padded with "0" so that /search results are predictable. Searches for typeKeywords:"exportLayer:1" don't work.
|
|
183
|
+
// See https://github.com/Esri/hub.js/pull/472 for more information.
|
|
184
|
+
// TODO - use `filter` when Enterprise Sites adds support.
|
|
185
|
+
return layerId ? `exportLayer:0${layerId}` : `exportLayer:null`;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=build-existing-exports-portal-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-existing-exports-portal-query.js","sourceRoot":"","sources":["../../../src/downloads/build-existing-exports-portal-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;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C;IAEF,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACxB,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO,CAAC,EAAE,EAAE,CAAC;SACd;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAAoB;IAC3D,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC/D,MAAM,0BAA0B,GAAG,yBAAyB,CAC1D,sBAAsB,CACvB,CAAC;IACF,OAAO,gBAAgB,0BAA0B,EAAE,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAc;IACrD,OAAO,cAAc,MAAM,EAAE,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAyB;IACjE,8IAA8I;IAC9I,oEAAoE;IACpE,0DAA0D;IAC1D,OAAO,OAAO,CAAC,CAAC,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/downloads/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
package/dist/es2017/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./api";
|
|
|
5
5
|
export * from "./auth";
|
|
6
6
|
export * from "./categories";
|
|
7
7
|
export * from "./content";
|
|
8
|
+
export * from "./downloads";
|
|
8
9
|
export * from "./extent";
|
|
9
10
|
export * from "./groups";
|
|
10
11
|
export * from "./items";
|
|
@@ -21,4 +22,5 @@ import OperationStack from "./OperationStack";
|
|
|
21
22
|
import OperationError from "./OperationError";
|
|
22
23
|
// Re-exports
|
|
23
24
|
export { OperationStack, OperationError };
|
|
25
|
+
export { btoa, atob } from "abab";
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
package/dist/es2017/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAE1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;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