@esri/hub-common 9.9.0 → 9.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es2017/content/_internal.js +64 -0
- package/dist/es2017/content/_internal.js.map +1 -0
- package/dist/es2017/{content.js → content/index.js} +12 -20
- package/dist/es2017/content/index.js.map +1 -0
- package/dist/es2017/extent.js +49 -16
- package/dist/es2017/extent.js.map +1 -1
- package/dist/es2017/items/share-item-to-groups.js +6 -2
- package/dist/es2017/items/share-item-to-groups.js.map +1 -1
- package/dist/es2017/items/unshare-item-from-groups.js +7 -3
- package/dist/es2017/items/unshare-item-from-groups.js.map +1 -1
- package/dist/es2017/objects/deep-set.js +1 -1
- package/dist/es2017/objects/deep-set.js.map +1 -1
- package/dist/es2017/search/utils.js +1 -0
- package/dist/es2017/search/utils.js.map +1 -1
- package/dist/esm/content/_internal.js +65 -0
- package/dist/esm/content/_internal.js.map +1 -0
- package/dist/esm/{content.js → content/index.js} +12 -20
- package/dist/esm/content/index.js.map +1 -0
- package/dist/esm/extent.js +44 -11
- package/dist/esm/extent.js.map +1 -1
- package/dist/esm/items/share-item-to-groups.js +6 -2
- package/dist/esm/items/share-item-to-groups.js.map +1 -1
- package/dist/esm/items/unshare-item-from-groups.js +6 -2
- package/dist/esm/items/unshare-item-from-groups.js.map +1 -1
- package/dist/esm/objects/deep-set.js +1 -1
- package/dist/esm/objects/deep-set.js.map +1 -1
- package/dist/esm/search/utils.js +1 -0
- package/dist/esm/search/utils.js.map +1 -1
- package/dist/node/content/_internal.js +67 -0
- package/dist/node/content/_internal.js.map +1 -0
- package/dist/node/{content.js → content/index.js} +12 -20
- package/dist/node/content/index.js.map +1 -0
- package/dist/node/extent.js +50 -17
- package/dist/node/extent.js.map +1 -1
- package/dist/node/items/share-item-to-groups.js +5 -1
- package/dist/node/items/share-item-to-groups.js.map +1 -1
- package/dist/node/items/unshare-item-from-groups.js +6 -2
- package/dist/node/items/unshare-item-from-groups.js.map +1 -1
- package/dist/node/objects/deep-set.js +1 -1
- package/dist/node/objects/deep-set.js.map +1 -1
- package/dist/node/search/utils.js +1 -0
- package/dist/node/search/utils.js.map +1 -1
- package/dist/types/content/_internal.d.ts +91 -0
- package/dist/types/{content.d.ts → content/index.d.ts} +2 -2
- package/dist/types/extent.d.ts +11 -4
- package/dist/types/items/share-item-to-groups.d.ts +2 -1
- package/dist/types/items/unshare-item-from-groups.d.ts +2 -1
- package/dist/types/search/utils.d.ts +1 -0
- package/dist/types/types.d.ts +4 -1
- package/dist/umd/common.umd.js +113 -28
- 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 +2 -3
- package/LICENSE +0 -201
- package/dist/es2017/content.js.map +0 -1
- package/dist/esm/content.js.map +0 -1
- package/dist/node/content.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unshare-item-from-groups.js","sourceRoot":"","sources":["../../../src/items/unshare-item-from-groups.ts"],"names":[],"mappings":";;;AAAA,iEAIkC;AAGlC
|
|
1
|
+
{"version":3,"file":"unshare-item-from-groups.js","sourceRoot":"","sources":["../../../src/items/unshare-item-from-groups.ts"],"names":[],"mappings":";;;AAAA,iEAIkC;AAGlC;;;;;;GAMG;AACH,SAAgB,qBAAqB,CACnC,MAAc,EACd,MAAgB,EAChB,cAA+B,EAC/B,KAAc;IAEd,OAAO,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACrB,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CACvB,EAAE,EACF,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EACvB,cAAc,CACS,CAAC;QAC1B,IAAI,KAAK,EAAE;YACT,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;SACnB;QACD,OAAO,yCAAoB,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAnBD,sDAmBC"}
|
|
@@ -13,7 +13,7 @@ function deepSet(target, path, value = {}) {
|
|
|
13
13
|
let worker = target;
|
|
14
14
|
const lastIdx = parts.length - 1;
|
|
15
15
|
parts.forEach((p, idx) => {
|
|
16
|
-
if (!worker.hasOwnProperty(p) || worker[p]
|
|
16
|
+
if (!worker.hasOwnProperty(p) || worker[p] == null) {
|
|
17
17
|
if (idx === lastIdx) {
|
|
18
18
|
worker[p] = value;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-set.js","sourceRoot":"","sources":["../../../src/objects/deep-set.ts"],"names":[],"mappings":";;;AAAA,kCAAsC;AAEtC;;;;;GAKG;AACH,SAAgB,OAAO,CACrB,MAA2B,EAC3B,IAAY,EACZ,QAAa,EAAE;IAEf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"deep-set.js","sourceRoot":"","sources":["../../../src/objects/deep-set.ts"],"names":[],"mappings":";;;AAAA,kCAAsC;AAEtC;;;;;GAKG;AACH,SAAgB,OAAO,CACrB,MAA2B,EAC3B,IAAY,EACZ,QAAa,EAAE;IAEf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;YAClD,IAAI,GAAG,KAAK,OAAO,EAAE;gBACnB,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aACnB;iBAAM;gBACL,yBAAyB;gBACzB,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;aAChB;SACF;aAAM,IAAI,GAAG,KAAK,OAAO,EAAE;YAC1B,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC9D,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,kBAAW,CAAC,KAAK,CAAC,CAAC,CAAC;aAC1D;iBAAM;gBACL,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aACnB;SACF;QACD,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAzBD,0BAyBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/search/utils.ts"],"names":[],"mappings":";AAAA;gBACgB;;;AAEhB,6DAA4D;AAQ5D,kCAA8C;AAU9C
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/search/utils.ts"],"names":[],"mappings":";AAAA;gBACgB;;;AAEhB,6DAA4D;AAQ5D,kCAA8C;AAU9C;;;;GAIG;AACU,QAAA,WAAW,GAAmB;IACzC,MAAM,EAAE;QACN,KAAK,EAAE,eAAe;QACtB,GAAG,EAAE,wBAAwB;QAC7B,IAAI,EAAE,QAAQ;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,qBAAqB;QAC5B,GAAG,E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AAE;QAClB,YAAY,GAAG,GAAG,SAAS,oBAAoB,IAAI,CAAC,QAAQ,SAAS,IAAI,CAAC,SAAS,EAAE,CAAC;QACtF,IAAI,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE;YACrC,YAAY,GAAG,GAAG,YAAY,UAAU,KAAK,EAAE,CAAC;SACjD;KACF;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAbD,kDAaC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use this module for functions that do not need to be used by consumers (yet),
|
|
3
|
+
* but may be shared between hub.js modules, and/or need to be tested
|
|
4
|
+
* to get 100% coverage w/o writing cumbersome tests of higher level functions.
|
|
5
|
+
*
|
|
6
|
+
* Consuming will not be able to import these functions.
|
|
7
|
+
*
|
|
8
|
+
* It's probably a good pattern to add functions here first and then
|
|
9
|
+
* move them to index.ts only when they are needed by a consumer.
|
|
10
|
+
*/
|
|
11
|
+
import { BBox, IHubContent, IHubGeography, GeographyProvenance } from "../types";
|
|
12
|
+
/**
|
|
13
|
+
* Create a new content with updated boundary properties
|
|
14
|
+
* @param content original content
|
|
15
|
+
* @param boundary boundary provenance
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const setContentBoundary: (content: IHubContent, boundary: GeographyProvenance) => {
|
|
19
|
+
boundary: IHubGeography;
|
|
20
|
+
item: any;
|
|
21
|
+
hubId?: string;
|
|
22
|
+
permissions: {
|
|
23
|
+
visibility: "private" | "public" | "org";
|
|
24
|
+
control?: import("../types").AccessControl;
|
|
25
|
+
groups?: import("@esri/arcgis-rest-types").IGroup[];
|
|
26
|
+
};
|
|
27
|
+
family?: import("../types").HubFamily;
|
|
28
|
+
itemCategories?: string[];
|
|
29
|
+
normalizedType?: string;
|
|
30
|
+
publishedDate: Date;
|
|
31
|
+
publishedDateSource?: string;
|
|
32
|
+
updateFrequency?: string;
|
|
33
|
+
actionLinks?: import("../types").IActionLink[];
|
|
34
|
+
hubActions?: object;
|
|
35
|
+
metrics?: {
|
|
36
|
+
visibility: "private" | "public" | "org" | "updateGroups";
|
|
37
|
+
};
|
|
38
|
+
slug?: string;
|
|
39
|
+
portalDataUrl?: string;
|
|
40
|
+
groupIds?: string[];
|
|
41
|
+
errors?: import("../types").IEnrichmentErrorInfo[];
|
|
42
|
+
data?: {
|
|
43
|
+
[propName: string]: any;
|
|
44
|
+
};
|
|
45
|
+
server?: Partial<import("@esri/arcgis-rest-types").IFeatureServiceDefinition>;
|
|
46
|
+
layers?: Partial<import("@esri/arcgis-rest-types").ILayerDefinition>[];
|
|
47
|
+
layer?: Partial<import("@esri/arcgis-rest-types").ILayerDefinition>;
|
|
48
|
+
recordCount?: number;
|
|
49
|
+
orgId?: string;
|
|
50
|
+
org?: Partial<import("@esri/arcgis-rest-portal").IPortal>;
|
|
51
|
+
isDownloadable: boolean;
|
|
52
|
+
structuredLicense?: import("..").IStructuredLicense;
|
|
53
|
+
name: string;
|
|
54
|
+
summary?: string;
|
|
55
|
+
hubType: import("../types").HubType;
|
|
56
|
+
createdDate: Date;
|
|
57
|
+
createdDateSource?: string;
|
|
58
|
+
updatedDate: Date;
|
|
59
|
+
updatedDateSource?: string;
|
|
60
|
+
portalHomeUrl?: string;
|
|
61
|
+
portalApiUrl?: string;
|
|
62
|
+
thumbnailUrl?: string;
|
|
63
|
+
metadata?: any;
|
|
64
|
+
id: string;
|
|
65
|
+
owner: string;
|
|
66
|
+
tags: string[];
|
|
67
|
+
created: number;
|
|
68
|
+
modified: number;
|
|
69
|
+
numViews: number;
|
|
70
|
+
size: number;
|
|
71
|
+
protected?: boolean;
|
|
72
|
+
title: string;
|
|
73
|
+
type: string;
|
|
74
|
+
typeKeywords?: string[];
|
|
75
|
+
description?: string;
|
|
76
|
+
snippet?: string;
|
|
77
|
+
documentation?: string;
|
|
78
|
+
extent?: number[][];
|
|
79
|
+
categories?: string[];
|
|
80
|
+
spatialReference?: import("@esri/arcgis-rest-types").ISpatialReference;
|
|
81
|
+
culture?: string;
|
|
82
|
+
properties?: any;
|
|
83
|
+
url?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Create a new content with updated extent and derived properties like boundary
|
|
87
|
+
* @param content original content
|
|
88
|
+
* @param extent new extent
|
|
89
|
+
* @returns a new content with the updated extent and boundary
|
|
90
|
+
*/
|
|
91
|
+
export declare const setContentExtent: (content: IHubContent, extent: BBox) => IHubContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResourceObject } from "jsonapi-typescript";
|
|
2
2
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
3
|
-
import { HubType, HubFamily } from "
|
|
4
|
-
import { IHubContent, IModel } from "
|
|
3
|
+
import { HubType, HubFamily } from "../types";
|
|
4
|
+
import { IHubContent, IModel } from "../types";
|
|
5
5
|
/**
|
|
6
6
|
* JSONAPI dataset resource returned by the Hub API
|
|
7
7
|
*/
|
package/dist/types/extent.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IExtent } from "@esri/arcgis-rest-types";
|
|
2
|
-
import { IHubRequestOptions,
|
|
1
|
+
import { IExtent, IPolygon } from "@esri/arcgis-rest-types";
|
|
2
|
+
import { IHubRequestOptions, BBox } from "./types";
|
|
3
3
|
export declare function createExtent(xmin: number, ymin: number, xmax: number, ymax: number, wkid?: number): IExtent;
|
|
4
4
|
/**
|
|
5
5
|
* Turns an extent into a bbox
|
|
6
6
|
* @param envelope extent
|
|
7
7
|
*/
|
|
8
|
-
export declare function extentToBBox(envelope: IExtent):
|
|
8
|
+
export declare function extentToBBox(envelope: IExtent): BBox;
|
|
9
9
|
export declare const GLOBAL_EXTENT: IExtent;
|
|
10
10
|
/**
|
|
11
11
|
* Gets the geographic extent for an org
|
|
@@ -16,7 +16,13 @@ export declare function getGeographicOrgExtent(hubRequestOptions: IHubRequestOpt
|
|
|
16
16
|
* Get the default org extent as a bbox for use on item.extent
|
|
17
17
|
* @param {IHubRequestOptions} hubRequestOptions
|
|
18
18
|
*/
|
|
19
|
-
export declare function getOrgExtentAsBBox(hubRequestOptions: IHubRequestOptions): Promise<
|
|
19
|
+
export declare function getOrgExtentAsBBox(hubRequestOptions: IHubRequestOptions): Promise<BBox>;
|
|
20
|
+
/**
|
|
21
|
+
* checks if the extent is a valid BBox (2 element array of coordinate pair arrays)
|
|
22
|
+
* @param extent
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const isBBox: (extent: unknown) => boolean;
|
|
20
26
|
export declare function isExtentCoordinateArray(extent: object): boolean;
|
|
21
27
|
/**
|
|
22
28
|
* Check if the given extent is in a known format
|
|
@@ -24,3 +30,4 @@ export declare function isExtentCoordinateArray(extent: object): boolean;
|
|
|
24
30
|
* @return {Boolean} indicator
|
|
25
31
|
*/
|
|
26
32
|
export declare function isValidExtent(extent: object): boolean;
|
|
33
|
+
export declare const bBoxToPolygon: (bBox: BBox) => IPolygon;
|
|
@@ -3,6 +3,7 @@ import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
|
3
3
|
* Share an item to a set of groups
|
|
4
4
|
* @param {String} itemId Iten Id to share to the groups
|
|
5
5
|
* @param {Array} groups Array of group id's to which the item will be shared
|
|
6
|
+
* @param {String} owner optional Owner username to determine which endpoint to hit
|
|
6
7
|
* @param {*} requestOptions
|
|
7
8
|
*/
|
|
8
|
-
export declare function shareItemToGroups(itemId: string, groups: string[], requestOptions: IRequestOptions): Promise<import("@esri/arcgis-rest-portal").ISharingResponse[]>;
|
|
9
|
+
export declare function shareItemToGroups(itemId: string, groups: string[], requestOptions: IRequestOptions, owner?: string): Promise<import("@esri/arcgis-rest-portal").ISharingResponse[]>;
|
|
@@ -4,6 +4,7 @@ import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
|
4
4
|
* Unshare an item from a set of groups
|
|
5
5
|
* @param {String} itemId Item Id to unshare from groups
|
|
6
6
|
* @param {Array} groups Array of group id's from which the item will be unshared
|
|
7
|
+
* @param {String} owner optional Owner username to determine which endpoint to hit
|
|
7
8
|
* @param {IRequestOptions} requestOptions
|
|
8
9
|
*/
|
|
9
|
-
export declare function unshareItemFromGroups(itemId: string, groups: string[], requestOptions: IRequestOptions): Promise<ISharingResponse[]>;
|
|
10
|
+
export declare function unshareItemFromGroups(itemId: string, groups: string[], requestOptions: IRequestOptions, owner?: string): Promise<ISharingResponse[]>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ export interface IItemResource {
|
|
|
102
102
|
url: string;
|
|
103
103
|
name: string;
|
|
104
104
|
}
|
|
105
|
+
export declare type BBox = number[][];
|
|
105
106
|
export declare type IBBox = number[][];
|
|
106
107
|
export declare type IBatch = any[];
|
|
107
108
|
export declare type IBatchTransform = (value: any) => any;
|
|
@@ -139,6 +140,7 @@ export declare type Visibility = "private" | "org" | "public";
|
|
|
139
140
|
* User's access level to a Hub resource
|
|
140
141
|
*/
|
|
141
142
|
export declare type AccessControl = "view" | "edit" | "admin";
|
|
143
|
+
export declare type GeographyProvenance = "item" | "none" | "automatic";
|
|
142
144
|
/**
|
|
143
145
|
* Location of a Hub resource
|
|
144
146
|
*
|
|
@@ -148,6 +150,7 @@ export declare type AccessControl = "view" | "edit" | "admin";
|
|
|
148
150
|
export interface IHubGeography {
|
|
149
151
|
center?: [number, number];
|
|
150
152
|
geometry?: IGeometry;
|
|
153
|
+
provenance?: GeographyProvenance;
|
|
151
154
|
}
|
|
152
155
|
export declare type SearchableType = IItem | IGroup | IUser;
|
|
153
156
|
export declare type SearchFunction = (...args: any[]) => Promise<ISearchResult<SearchableType>>;
|
|
@@ -295,7 +298,7 @@ export interface IHubContent extends IHubResource, IItem {
|
|
|
295
298
|
/** The content's structured license info */
|
|
296
299
|
structuredLicense?: IStructuredLicense;
|
|
297
300
|
}
|
|
298
|
-
interface IActionLink {
|
|
301
|
+
export interface IActionLink {
|
|
299
302
|
/** Link title */
|
|
300
303
|
title: string;
|
|
301
304
|
/** Link URL */
|
package/dist/umd/common.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/hub-common - v9.
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @esri/hub-common - v9.10.1 - Thu Jan 06 2022 21:12:20 GMT+0000 (Coordinated Universal Time)
|
|
3
|
+
* Copyright (c) 2022 Environmental Systems Research Institute, Inc.
|
|
4
4
|
* Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
var worker = target;
|
|
529
529
|
var lastIdx = parts.length - 1;
|
|
530
530
|
parts.forEach(function (p, idx) {
|
|
531
|
-
if (!worker.hasOwnProperty(p) || worker[p]
|
|
531
|
+
if (!worker.hasOwnProperty(p) || worker[p] == null) {
|
|
532
532
|
if (idx === lastIdx) {
|
|
533
533
|
worker[p] = value;
|
|
534
534
|
}
|
|
@@ -5169,8 +5169,8 @@
|
|
|
5169
5169
|
ymax: ymax,
|
|
5170
5170
|
// type: 'extent',
|
|
5171
5171
|
spatialReference: {
|
|
5172
|
-
wkid: wkid
|
|
5173
|
-
}
|
|
5172
|
+
wkid: wkid,
|
|
5173
|
+
},
|
|
5174
5174
|
};
|
|
5175
5175
|
}
|
|
5176
5176
|
/**
|
|
@@ -5178,7 +5178,10 @@
|
|
|
5178
5178
|
* @param envelope extent
|
|
5179
5179
|
*/
|
|
5180
5180
|
function extentToBBox(envelope) {
|
|
5181
|
-
return [
|
|
5181
|
+
return [
|
|
5182
|
+
[envelope.xmin, envelope.ymin],
|
|
5183
|
+
[envelope.xmax, envelope.ymax],
|
|
5184
|
+
];
|
|
5182
5185
|
}
|
|
5183
5186
|
var GLOBAL_EXTENT = {
|
|
5184
5187
|
xmin: -180,
|
|
@@ -5186,8 +5189,8 @@
|
|
|
5186
5189
|
xmax: 180,
|
|
5187
5190
|
ymax: 90,
|
|
5188
5191
|
spatialReference: {
|
|
5189
|
-
wkid: 4326
|
|
5190
|
-
}
|
|
5192
|
+
wkid: 4326,
|
|
5193
|
+
},
|
|
5191
5194
|
};
|
|
5192
5195
|
/**
|
|
5193
5196
|
* Gets the geographic extent for an org
|
|
@@ -5208,7 +5211,7 @@
|
|
|
5208
5211
|
// geometry params...
|
|
5209
5212
|
var geometryParam = {
|
|
5210
5213
|
geometryType: "esriGeometryEnvelope",
|
|
5211
|
-
geometries: [orgExtent]
|
|
5214
|
+
geometries: [orgExtent],
|
|
5212
5215
|
};
|
|
5213
5216
|
var options = {
|
|
5214
5217
|
httpMethod: "POST",
|
|
@@ -5218,8 +5221,8 @@
|
|
|
5218
5221
|
transformation: "",
|
|
5219
5222
|
inSR: orgExtent.spatialReference.wkid,
|
|
5220
5223
|
outSR: 4326,
|
|
5221
|
-
f: "json"
|
|
5222
|
-
}
|
|
5224
|
+
f: "json",
|
|
5225
|
+
},
|
|
5223
5226
|
};
|
|
5224
5227
|
// add in auth if it's passed
|
|
5225
5228
|
if (hubRequestOptions.authentication) {
|
|
@@ -5234,8 +5237,8 @@
|
|
|
5234
5237
|
xmax: geom.xmax,
|
|
5235
5238
|
ymax: geom.ymax,
|
|
5236
5239
|
spatialReference: {
|
|
5237
|
-
wkid: 4326
|
|
5238
|
-
}
|
|
5240
|
+
wkid: 4326,
|
|
5241
|
+
},
|
|
5239
5242
|
};
|
|
5240
5243
|
})
|
|
5241
5244
|
.catch(function (ex) {
|
|
@@ -5251,10 +5254,21 @@
|
|
|
5251
5254
|
return extentToBBox(extent);
|
|
5252
5255
|
});
|
|
5253
5256
|
}
|
|
5254
|
-
|
|
5257
|
+
/**
|
|
5258
|
+
* checks if the extent is a valid BBox (2 element array of coordinate pair arrays)
|
|
5259
|
+
* @param extent
|
|
5260
|
+
* @returns
|
|
5261
|
+
*/
|
|
5262
|
+
var isBBox = function (extent) {
|
|
5255
5263
|
return (Array.isArray(extent) &&
|
|
5256
5264
|
Array.isArray(extent[0]) &&
|
|
5257
5265
|
Array.isArray(extent[1]));
|
|
5266
|
+
};
|
|
5267
|
+
function isExtentCoordinateArray(extent) {
|
|
5268
|
+
/* tslint:disable no-console */
|
|
5269
|
+
console.warn("DEPRECATED: use isBBox() instead");
|
|
5270
|
+
/* tslint:enable no-console */
|
|
5271
|
+
return isBBox(extent);
|
|
5258
5272
|
}
|
|
5259
5273
|
function isExtentJSON(extent) {
|
|
5260
5274
|
return ["xmin", "ymin", "xmax", "ymax"].every(function (key) { return typeof extent[key] === "number"; });
|
|
@@ -5268,6 +5282,25 @@
|
|
|
5268
5282
|
return (!!extent &&
|
|
5269
5283
|
[isExtentCoordinateArray, isExtentJSON].some(function (test) { return test(extent); }));
|
|
5270
5284
|
}
|
|
5285
|
+
var bBoxToPolygon = function (bBox) {
|
|
5286
|
+
var _a = bBox[0], xmin = _a[0], ymin = _a[1], _b = bBox[1], xmax = _b[0], ymax = _b[1];
|
|
5287
|
+
var rings = [
|
|
5288
|
+
[
|
|
5289
|
+
[xmin, ymin],
|
|
5290
|
+
[xmax, ymin],
|
|
5291
|
+
[xmax, ymax],
|
|
5292
|
+
[xmin, ymax],
|
|
5293
|
+
[xmin, ymin],
|
|
5294
|
+
],
|
|
5295
|
+
];
|
|
5296
|
+
var wkid = 4326;
|
|
5297
|
+
return {
|
|
5298
|
+
rings: rings,
|
|
5299
|
+
spatialReference: {
|
|
5300
|
+
wkid: wkid,
|
|
5301
|
+
},
|
|
5302
|
+
};
|
|
5303
|
+
};
|
|
5271
5304
|
|
|
5272
5305
|
var STANDARD_LICENSES = [
|
|
5273
5306
|
{
|
|
@@ -5564,6 +5597,56 @@
|
|
|
5564
5597
|
return isSingleAnchorTagRegex.test(rawLicense);
|
|
5565
5598
|
}
|
|
5566
5599
|
|
|
5600
|
+
/**
|
|
5601
|
+
* Use this module for functions that do not need to be used by consumers (yet),
|
|
5602
|
+
* but may be shared between hub.js modules, and/or need to be tested
|
|
5603
|
+
* to get 100% coverage w/o writing cumbersome tests of higher level functions.
|
|
5604
|
+
*
|
|
5605
|
+
* Consuming will not be able to import these functions.
|
|
5606
|
+
*
|
|
5607
|
+
* It's probably a good pattern to add functions here first and then
|
|
5608
|
+
* move them to index.ts only when they are needed by a consumer.
|
|
5609
|
+
*/
|
|
5610
|
+
/**
|
|
5611
|
+
* Create a new content with updated extent and derived properties like boundary
|
|
5612
|
+
* @param content original content
|
|
5613
|
+
* @param extent new extent
|
|
5614
|
+
* @returns a new content with the updated extent and boundary
|
|
5615
|
+
*/
|
|
5616
|
+
var setContentExtent = function (content, extent) {
|
|
5617
|
+
// update content's item and extent
|
|
5618
|
+
var item = __assign(__assign({}, content.item), { extent: extent });
|
|
5619
|
+
var updated = __assign(__assign({}, content), { item: item, extent: extent });
|
|
5620
|
+
// derive boundary from content properties
|
|
5621
|
+
var boundary = getContentBoundary(updated);
|
|
5622
|
+
return __assign(__assign({}, updated), { boundary: boundary });
|
|
5623
|
+
};
|
|
5624
|
+
var getContentBoundary = function (content) {
|
|
5625
|
+
var _a;
|
|
5626
|
+
var item = content.item;
|
|
5627
|
+
var extent = item.extent;
|
|
5628
|
+
var isValidItemExtent = isBBox(extent);
|
|
5629
|
+
// user specified provenance is stored in item.properties
|
|
5630
|
+
var provenance = ((_a = item.properties) === null || _a === void 0 ? void 0 : _a.boundary) ||
|
|
5631
|
+
// but we default to item if the item has an extent
|
|
5632
|
+
(isValidItemExtent ? "item" : undefined);
|
|
5633
|
+
var geometry;
|
|
5634
|
+
switch (provenance) {
|
|
5635
|
+
case "item":
|
|
5636
|
+
geometry = isValidItemExtent ? bBoxToPolygon(extent) : null;
|
|
5637
|
+
break;
|
|
5638
|
+
case "none":
|
|
5639
|
+
geometry = null;
|
|
5640
|
+
break;
|
|
5641
|
+
// TODO: handle other provenances
|
|
5642
|
+
}
|
|
5643
|
+
// TODO: derive and return center
|
|
5644
|
+
return {
|
|
5645
|
+
provenance: provenance,
|
|
5646
|
+
geometry: geometry,
|
|
5647
|
+
};
|
|
5648
|
+
};
|
|
5649
|
+
|
|
5567
5650
|
function collectionToFamily(collection) {
|
|
5568
5651
|
var overrides = {
|
|
5569
5652
|
other: "content",
|
|
@@ -5571,13 +5654,6 @@
|
|
|
5571
5654
|
};
|
|
5572
5655
|
return overrides[collection] || collection;
|
|
5573
5656
|
}
|
|
5574
|
-
function itemExtentToBoundary(extent) {
|
|
5575
|
-
return (extent &&
|
|
5576
|
-
extent.length && {
|
|
5577
|
-
// TODO: center?
|
|
5578
|
-
geometry: createExtent(extent[0][0], extent[0][1], extent[1][0], extent[1][1]),
|
|
5579
|
-
});
|
|
5580
|
-
}
|
|
5581
5657
|
var cache = {};
|
|
5582
5658
|
// TODO: remove this at next breaking version
|
|
5583
5659
|
/**
|
|
@@ -5977,7 +6053,6 @@
|
|
|
5977
6053
|
metrics: properties && properties.metrics,
|
|
5978
6054
|
isDownloadable: isDownloadable(item),
|
|
5979
6055
|
// default boundary from item.extent
|
|
5980
|
-
boundary: itemExtentToBoundary(item.extent),
|
|
5981
6056
|
license: { name: "Custom License", description: item.accessInformation },
|
|
5982
6057
|
// dates and sources we will enrich these later...
|
|
5983
6058
|
createdDate: createdDate,
|
|
@@ -5988,7 +6063,7 @@
|
|
|
5988
6063
|
updatedDateSource: "item.modified",
|
|
5989
6064
|
structuredLicense: getStructuredLicense(item.licenseInfo),
|
|
5990
6065
|
});
|
|
5991
|
-
return setContentType(content, item.type);
|
|
6066
|
+
return setContentExtent(setContentType(content, item.type), item.extent);
|
|
5992
6067
|
}
|
|
5993
6068
|
/**
|
|
5994
6069
|
* Convert a Hub API dataset resource to Hub Content
|
|
@@ -6031,9 +6106,7 @@
|
|
|
6031
6106
|
content.errors = errors;
|
|
6032
6107
|
// common enrichments
|
|
6033
6108
|
content.boundary = boundary;
|
|
6034
|
-
if (!
|
|
6035
|
-
extent &&
|
|
6036
|
-
isExtentCoordinateArray(extent.coordinates)) {
|
|
6109
|
+
if (!isBBox(item.extent) && extent && isBBox(extent.coordinates)) {
|
|
6037
6110
|
// we fall back to the extent derived by the API
|
|
6038
6111
|
// which prefers layer or service extents and ultimately
|
|
6039
6112
|
// falls back to the org's extent
|
|
@@ -6189,6 +6262,7 @@
|
|
|
6189
6262
|
// get family and normalized type based on new type
|
|
6190
6263
|
var normalizedType = normalizeItemType(__assign(__assign({}, content.item), { type: type }));
|
|
6191
6264
|
var family = getFamily(normalizedType);
|
|
6265
|
+
// TODO: don't we need to update content.item.type too?
|
|
6192
6266
|
var updated = __assign(__assign({}, content), { type: type, family: family, normalizedType: normalizedType });
|
|
6193
6267
|
// update the relative URL to the content
|
|
6194
6268
|
// which is based on type and family
|
|
@@ -7705,11 +7779,15 @@
|
|
|
7705
7779
|
* Share an item to a set of groups
|
|
7706
7780
|
* @param {String} itemId Iten Id to share to the groups
|
|
7707
7781
|
* @param {Array} groups Array of group id's to which the item will be shared
|
|
7782
|
+
* @param {String} owner optional Owner username to determine which endpoint to hit
|
|
7708
7783
|
* @param {*} requestOptions
|
|
7709
7784
|
*/
|
|
7710
|
-
function shareItemToGroups(itemId, groups, requestOptions) {
|
|
7785
|
+
function shareItemToGroups(itemId, groups, requestOptions, owner) {
|
|
7711
7786
|
return Promise.all(groups.map(function (groupId) {
|
|
7712
7787
|
var opt = Object.assign({}, { id: itemId, groupId: groupId }, requestOptions);
|
|
7788
|
+
if (owner) {
|
|
7789
|
+
opt.owner = owner;
|
|
7790
|
+
}
|
|
7713
7791
|
return shareItemWithGroup(opt);
|
|
7714
7792
|
}));
|
|
7715
7793
|
}
|
|
@@ -7735,11 +7813,15 @@
|
|
|
7735
7813
|
* Unshare an item from a set of groups
|
|
7736
7814
|
* @param {String} itemId Item Id to unshare from groups
|
|
7737
7815
|
* @param {Array} groups Array of group id's from which the item will be unshared
|
|
7816
|
+
* @param {String} owner optional Owner username to determine which endpoint to hit
|
|
7738
7817
|
* @param {IRequestOptions} requestOptions
|
|
7739
7818
|
*/
|
|
7740
|
-
function unshareItemFromGroups(itemId, groups, requestOptions) {
|
|
7819
|
+
function unshareItemFromGroups(itemId, groups, requestOptions, owner) {
|
|
7741
7820
|
return Promise.all(groups.map(function (groupId) {
|
|
7742
7821
|
var opt = Object.assign({}, { id: itemId, groupId: groupId }, requestOptions);
|
|
7822
|
+
if (owner) {
|
|
7823
|
+
opt.owner = owner;
|
|
7824
|
+
}
|
|
7743
7825
|
return unshareItemWithGroup(opt);
|
|
7744
7826
|
}));
|
|
7745
7827
|
}
|
|
@@ -8150,6 +8232,7 @@
|
|
|
8150
8232
|
/**
|
|
8151
8233
|
* Well known APIs
|
|
8152
8234
|
* Short-forms for specifying common APIs
|
|
8235
|
+
* We will likely deprecate this
|
|
8153
8236
|
*/
|
|
8154
8237
|
var SEARCH_APIS = {
|
|
8155
8238
|
arcgis: {
|
|
@@ -10735,6 +10818,7 @@
|
|
|
10735
10818
|
exports.arrayToObject = arrayToObject;
|
|
10736
10819
|
exports.atob = abab.atob;
|
|
10737
10820
|
exports.autoAddUsers = autoAddUsers;
|
|
10821
|
+
exports.bBoxToPolygon = bBoxToPolygon;
|
|
10738
10822
|
exports.batch = batch;
|
|
10739
10823
|
exports.btoa = abab.btoa;
|
|
10740
10824
|
exports.buildDraft = buildDraft;
|
|
@@ -10850,6 +10934,7 @@
|
|
|
10850
10934
|
exports.interpolate = interpolate;
|
|
10851
10935
|
exports.interpolateItemId = interpolateItemId;
|
|
10852
10936
|
exports.inviteUsers = inviteUsers;
|
|
10937
|
+
exports.isBBox = isBBox;
|
|
10853
10938
|
exports.isDomainForLegacySite = isDomainForLegacySite;
|
|
10854
10939
|
exports.isDomainUsedElsewhere = isDomainUsedElsewhere;
|
|
10855
10940
|
exports.isDownloadable = isDownloadable;
|