@esri/hub-common 14.157.0 → 14.159.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/esm/content/_internal/computeProps.js +61 -0
- package/dist/esm/content/_internal/computeProps.js.map +1 -1
- package/dist/esm/content/_internal/fetchEditableContentEnrichments.js +55 -0
- package/dist/esm/content/_internal/fetchEditableContentEnrichments.js.map +1 -0
- package/dist/esm/content/_internal/fetchItemScheduleEnrichment.js +28 -0
- package/dist/esm/content/_internal/fetchItemScheduleEnrichment.js.map +1 -0
- package/dist/esm/content/edit.js +2 -1
- package/dist/esm/content/edit.js.map +1 -1
- package/dist/esm/content/{fetch.js → fetchContent.js} +2 -49
- package/dist/esm/content/fetchContent.js.map +1 -0
- package/dist/esm/content/fetchHubContent.js +26 -0
- package/dist/esm/content/fetchHubContent.js.map +1 -0
- package/dist/esm/content/index.js +3 -1
- package/dist/esm/content/index.js.map +1 -1
- package/dist/esm/content/modelToHubEditableContent.js +16 -0
- package/dist/esm/content/modelToHubEditableContent.js.map +1 -0
- package/dist/esm/content/types.js.map +1 -1
- package/dist/esm/core/fetchHubEntity.js +1 -1
- package/dist/esm/core/fetchHubEntity.js.map +1 -1
- package/dist/esm/downloads/_internal/_types.js +5 -8
- package/dist/esm/downloads/_internal/_types.js.map +1 -1
- package/dist/esm/downloads/_internal/canUseExportImageFlow.js +7 -1
- package/dist/esm/downloads/_internal/canUseExportImageFlow.js.map +1 -1
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js +77 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js.map +1 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/{fetchExportItemDownloadFileUrl.js → fetchExportItemDownloadFile.js} +6 -3
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js.map +1 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/{fetchHubApiDownloadFileUrl.js → fetchHubApiDownloadFile.js} +6 -3
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFile.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getCreateReplicaFormats.js +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getCreateReplicaFormats.js.map +1 -1
- package/dist/esm/downloads/_internal/format-fetchers/getExportImageFormats.js +16 -6
- package/dist/esm/downloads/_internal/format-fetchers/getExportImageFormats.js.map +1 -1
- package/dist/esm/downloads/canUseCreateReplica.js +1 -0
- package/dist/esm/downloads/canUseCreateReplica.js.map +1 -1
- package/dist/esm/downloads/canUseHubDownloadSystem.js +1 -0
- package/dist/esm/downloads/canUseHubDownloadSystem.js.map +1 -1
- package/dist/esm/downloads/{fetchDownloadFileUrl.js → fetchDownloadFile.js} +8 -8
- package/dist/esm/downloads/fetchDownloadFile.js.map +1 -0
- package/dist/esm/downloads/fetchDownloadFormats.js +2 -1
- package/dist/esm/downloads/fetchDownloadFormats.js.map +1 -1
- package/dist/esm/downloads/index.js +1 -1
- package/dist/esm/downloads/index.js.map +1 -1
- package/dist/esm/downloads/types.js +4 -4
- package/dist/esm/downloads/types.js.map +1 -1
- package/dist/esm/events/_internal/PropertyMapper.js +0 -1
- package/dist/esm/events/_internal/PropertyMapper.js.map +1 -1
- package/dist/esm/events/_internal/getPropertyMap.js +8 -0
- package/dist/esm/events/_internal/getPropertyMap.js.map +1 -1
- package/dist/esm/events/api/orval/api/orval-events.js.map +1 -1
- package/dist/esm/items/_enrichments.js.map +1 -1
- package/dist/node/content/_internal/computeProps.js +61 -0
- package/dist/node/content/_internal/computeProps.js.map +1 -1
- package/dist/node/content/_internal/fetchEditableContentEnrichments.js +59 -0
- package/dist/node/content/_internal/fetchEditableContentEnrichments.js.map +1 -0
- package/dist/node/content/_internal/fetchItemScheduleEnrichment.js +32 -0
- package/dist/node/content/_internal/fetchItemScheduleEnrichment.js.map +1 -0
- package/dist/node/content/edit.js +3 -2
- package/dist/node/content/edit.js.map +1 -1
- package/dist/node/content/{fetch.js → fetchContent.js} +2 -50
- package/dist/node/content/{fetch.js.map → fetchContent.js.map} +1 -1
- package/dist/node/content/fetchHubContent.js +29 -0
- package/dist/node/content/fetchHubContent.js.map +1 -0
- package/dist/node/content/index.js +3 -1
- package/dist/node/content/index.js.map +1 -1
- package/dist/node/content/modelToHubEditableContent.js +20 -0
- package/dist/node/content/modelToHubEditableContent.js.map +1 -0
- package/dist/node/content/types.js.map +1 -1
- package/dist/node/core/fetchHubEntity.js +12 -12
- package/dist/node/core/fetchHubEntity.js.map +1 -1
- package/dist/node/downloads/_internal/_types.js +5 -8
- package/dist/node/downloads/_internal/_types.js.map +1 -1
- package/dist/node/downloads/_internal/canUseExportImageFlow.js +7 -1
- package/dist/node/downloads/_internal/canUseExportImageFlow.js.map +1 -1
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js +81 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js.map +1 -0
- package/dist/node/downloads/_internal/file-url-fetchers/{fetchExportItemDownloadFileUrl.js → fetchExportItemDownloadFile.js} +8 -5
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js.map +1 -0
- package/dist/node/downloads/_internal/file-url-fetchers/{fetchHubApiDownloadFileUrl.js → fetchHubApiDownloadFile.js} +8 -5
- package/dist/node/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFile.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getCreateReplicaFormats.js +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getCreateReplicaFormats.js.map +1 -1
- package/dist/node/downloads/_internal/format-fetchers/getExportImageFormats.js +16 -6
- package/dist/node/downloads/_internal/format-fetchers/getExportImageFormats.js.map +1 -1
- package/dist/node/downloads/canUseCreateReplica.js +1 -0
- package/dist/node/downloads/canUseCreateReplica.js.map +1 -1
- package/dist/node/downloads/canUseHubDownloadSystem.js +1 -0
- package/dist/node/downloads/canUseHubDownloadSystem.js.map +1 -1
- package/dist/node/downloads/{fetchDownloadFileUrl.js → fetchDownloadFile.js} +10 -10
- package/dist/node/downloads/fetchDownloadFile.js.map +1 -0
- package/dist/node/downloads/fetchDownloadFormats.js +2 -1
- package/dist/node/downloads/fetchDownloadFormats.js.map +1 -1
- package/dist/node/downloads/index.js +1 -1
- package/dist/node/downloads/index.js.map +1 -1
- package/dist/node/downloads/types.js +4 -4
- package/dist/node/downloads/types.js.map +1 -1
- package/dist/node/events/_internal/PropertyMapper.js +0 -1
- package/dist/node/events/_internal/PropertyMapper.js.map +1 -1
- package/dist/node/events/_internal/getPropertyMap.js +8 -0
- package/dist/node/events/_internal/getPropertyMap.js.map +1 -1
- package/dist/node/events/api/orval/api/orval-events.js.map +1 -1
- package/dist/node/items/_enrichments.js.map +1 -1
- package/dist/types/content/_fetch.d.ts +1 -2
- package/dist/types/content/_internal/fetchEditableContentEnrichments.d.ts +16 -0
- package/dist/types/content/_internal/fetchItemScheduleEnrichment.d.ts +15 -0
- package/dist/types/content/fetchContent.d.ts +24 -0
- package/dist/types/content/fetchHubContent.d.ts +10 -0
- package/dist/types/content/index.d.ts +3 -1
- package/dist/types/content/modelToHubEditableContent.d.ts +12 -0
- package/dist/types/core/types/IHubEditableContent.d.ts +69 -0
- package/dist/types/core/types/IHubEvent.d.ts +8 -0
- package/dist/types/downloads/_internal/_types.d.ts +2 -1
- package/dist/types/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.d.ts +10 -0
- package/dist/types/downloads/_internal/file-url-fetchers/{fetchExportItemDownloadFileUrl.d.ts → fetchExportItemDownloadFile.d.ts} +2 -2
- package/dist/types/downloads/_internal/file-url-fetchers/{fetchHubApiDownloadFileUrl.d.ts → fetchHubApiDownloadFile.d.ts} +2 -2
- package/dist/types/downloads/_internal/format-fetchers/getExportImageFormats.d.ts +3 -4
- package/dist/types/downloads/fetchDownloadFile.d.ts +8 -0
- package/dist/types/downloads/index.d.ts +1 -1
- package/dist/types/downloads/types.d.ts +19 -6
- package/dist/types/events/api/orval/api/orval-events.d.ts +176 -156
- package/dist/types/items/_enrichments.d.ts +6 -2
- package/package.json +1 -1
- package/dist/esm/content/fetch.js.map +0 -1
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js +0 -46
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js.map +0 -1
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js.map +0 -1
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js.map +0 -1
- package/dist/esm/downloads/fetchDownloadFileUrl.js.map +0 -1
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js +0 -50
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js.map +0 -1
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js.map +0 -1
- package/dist/node/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js.map +0 -1
- package/dist/node/downloads/fetchDownloadFileUrl.js.map +0 -1
- package/dist/types/content/fetch.d.ts +0 -33
- package/dist/types/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.d.ts +0 -12
- package/dist/types/downloads/fetchDownloadFileUrl.d.ts +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fetchContent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const arcgis_rest_feature_layer_1 = require("@esri/arcgis-rest-feature-layer");
|
|
6
6
|
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
@@ -11,12 +11,6 @@ const slugs_1 = require("./slugs");
|
|
|
11
11
|
const _fetch_1 = require("./_fetch");
|
|
12
12
|
const internalContentUtils_1 = require("./_internal/internalContentUtils");
|
|
13
13
|
const compose_1 = require("./compose");
|
|
14
|
-
const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
|
|
15
|
-
const getPropertyMap_1 = require("./_internal/getPropertyMap");
|
|
16
|
-
const computeProps_1 = require("./_internal/computeProps");
|
|
17
|
-
const objects_1 = require("../objects");
|
|
18
|
-
const manageSchedule_1 = require("./manageSchedule");
|
|
19
|
-
const urls_1 = require("../urls");
|
|
20
14
|
const hasFeatures = (contentType) => ["Feature Layer", "Table"].includes(contentType);
|
|
21
15
|
const maybeFetchLayerEnrichments = async (itemAndEnrichments, options) => {
|
|
22
16
|
const { item } = itemAndEnrichments;
|
|
@@ -146,46 +140,4 @@ exports.fetchContent = async (identifier, options) => {
|
|
|
146
140
|
: content.recordCount;
|
|
147
141
|
return content;
|
|
148
142
|
};
|
|
149
|
-
|
|
150
|
-
* fetch a content entity by identifier
|
|
151
|
-
* @param identifier
|
|
152
|
-
* @param requestOptions
|
|
153
|
-
* @returns content entity
|
|
154
|
-
*/
|
|
155
|
-
exports.fetchHubContent = async (identifier, requestOptions) => {
|
|
156
|
-
// NOTE: b/c we have to support slugs we use fetchContent() to get the item
|
|
157
|
-
// by telling it to not fetch any enrichments which we then fetch as needed after we have the item
|
|
158
|
-
const options = Object.assign(Object.assign({}, requestOptions), { enrichments: [] });
|
|
159
|
-
const { item, access } = await exports.fetchContent(identifier, options);
|
|
160
|
-
// we must normalize the underlying item type to account
|
|
161
|
-
// for older items (e.g. sites that are type "Web Mapping
|
|
162
|
-
// Application") before we map the model to a Hub Entity
|
|
163
|
-
const type = compose_1.normalizeItemType(item);
|
|
164
|
-
objects_1.setProp("type", type, item);
|
|
165
|
-
const model = { item };
|
|
166
|
-
const entityEnrichments = {};
|
|
167
|
-
const enrichmentKeys = ["metadata"];
|
|
168
|
-
urls_1.isMapOrFeatureServerUrl(item.url) && enrichmentKeys.push("server");
|
|
169
|
-
const itemAndServerEnrichments = await _enrichments_1.fetchItemEnrichments(item, enrichmentKeys, requestOptions);
|
|
170
|
-
entityEnrichments.metadata = itemAndServerEnrichments.metadata;
|
|
171
|
-
entityEnrichments.server = itemAndServerEnrichments.server;
|
|
172
|
-
// TODO: should we add scheduling to the fetchItemEnrichments() subsystem?
|
|
173
|
-
if (manageSchedule_1.isDownloadSchedulingAvailable(requestOptions, access)) {
|
|
174
|
-
try {
|
|
175
|
-
// fetch schedule and add it to enrichments if it exists in schedule API
|
|
176
|
-
entityEnrichments.schedule = (await manageSchedule_1.getSchedule(item.id, requestOptions)).schedule || { mode: "automatic" };
|
|
177
|
-
}
|
|
178
|
-
catch (error) {
|
|
179
|
-
/* tslint:disable no-console */
|
|
180
|
-
console.warn("Failed to fetch schedule for item", item.id, error);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return modelToHubEditableContent(model, requestOptions, entityEnrichments);
|
|
184
|
-
};
|
|
185
|
-
function modelToHubEditableContent(model, requestOptions, enrichments) {
|
|
186
|
-
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap_1.getPropertyMap());
|
|
187
|
-
const content = mapper.storeToEntity(model, {});
|
|
188
|
-
return computeProps_1.computeProps(model, content, requestOptions, enrichments);
|
|
189
|
-
}
|
|
190
|
-
exports.modelToHubEditableContent = modelToHubEditableContent;
|
|
191
|
-
//# sourceMappingURL=fetch.js.map
|
|
143
|
+
//# sourceMappingURL=fetchContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"fetchContent.js","sourceRoot":"","sources":["../../../src/content/fetchContent.ts"],"names":[],"mappings":";;;;AAAA,+EAIyC;AACzC,iEAAmD;AAEnD,wDAI+B;AAC/B,kCAAgC;AAChC,4CAA8C;AAC9C,mCAAmE;AACnE,qCAIkB;AAClB,2EAAuE;AACvE,uCAAsE;AAItE,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE,CAC1C,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAEn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AC,WAAW,CAAC;IAC1B,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchHubContent = void 0;
|
|
4
|
+
const fetchContent_1 = require("./fetchContent");
|
|
5
|
+
const fetchEditableContentEnrichments_1 = require("./_internal/fetchEditableContentEnrichments");
|
|
6
|
+
const compose_1 = require("./compose");
|
|
7
|
+
const set_prop_1 = require("../objects/set-prop");
|
|
8
|
+
const modelToHubEditableContent_1 = require("./modelToHubEditableContent");
|
|
9
|
+
/**
|
|
10
|
+
* fetch a content entity by identifier
|
|
11
|
+
* @param identifier
|
|
12
|
+
* @param requestOptions
|
|
13
|
+
* @returns content entity
|
|
14
|
+
*/
|
|
15
|
+
exports.fetchHubContent = async (identifier, requestOptions, enrichments) => {
|
|
16
|
+
// NOTE: b/c we have to support slugs, we use fetchContent() to get the item
|
|
17
|
+
// by telling it to not fetch any enrichments. We then can fetch enrichments
|
|
18
|
+
// as needed after we have the item
|
|
19
|
+
const options = Object.assign(Object.assign({}, requestOptions), { enrichments: [] });
|
|
20
|
+
const { item } = await fetchContent_1.fetchContent(identifier, options);
|
|
21
|
+
const editableContentEnrichments = await fetchEditableContentEnrichments_1.fetchEditableContentEnrichments(item, requestOptions, enrichments);
|
|
22
|
+
// we must normalize the underlying item type to account
|
|
23
|
+
// for older items (e.g. sites that are type "Web Mapping
|
|
24
|
+
// Application") before we map the model to a Hub Entity
|
|
25
|
+
const type = compose_1.normalizeItemType(item);
|
|
26
|
+
set_prop_1.setProp("type", type, item);
|
|
27
|
+
return modelToHubEditableContent_1.modelToHubEditableContent({ item }, requestOptions, editableContentEnrichments);
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=fetchHubContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchHubContent.js","sourceRoot":"","sources":["../../../src/content/fetchHubContent.ts"],"names":[],"mappings":";;;AAGA,iDAAoE;AACpE,iGAA8F;AAC9F,uCAA8C;AAC9C,kDAA8C;AAC9C,2EAAwE;AAExE;;;;;GAKG;AACU,QAAA,eAAe,GAAG,KAAK,EAClC,UAAkB,EAClB,cAA+B,EAC/B,WAAyC,EACX,EAAE;IAChC,4EAA4E;IAC5E,4EAA4E;IAC5E,mCAAmC;IACnC,MAAM,OAAO,GAAG,gCACX,cAAc,KACjB,WAAW,EAAE,EAAE,GACQ,CAAC;IAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,2BAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEzD,MAAM,0BAA0B,GAAG,MAAM,iEAA+B,CACtE,IAAI,EACJ,cAAc,EACd,WAAW,CACZ,CAAC;IAEF,wDAAwD;IACxD,yDAAyD;IACzD,wDAAwD;IACxD,MAAM,IAAI,GAAG,2BAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,kBAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAE5B,OAAO,qDAAyB,CAC9B,EAAE,IAAI,EAAE,EACR,cAAc,EACd,0BAA0B,CAC3B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -6,7 +6,9 @@ tslib_1.__exportStar(require("./get-family"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./compose"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./contentUtils"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./edit"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./
|
|
9
|
+
tslib_1.__exportStar(require("./fetchContent"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./fetchHubContent"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./modelToHubEditableContent"), exports);
|
|
10
12
|
tslib_1.__exportStar(require("./get-family"), exports);
|
|
11
13
|
tslib_1.__exportStar(require("./HubContent"), exports);
|
|
12
14
|
tslib_1.__exportStar(require("./search"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,yDAA+B;AAC/B,4DAAkC;AAClC,sEAA4C;AAC5C,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC;AACrC,gEAAsC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelToHubEditableContent = void 0;
|
|
4
|
+
const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
|
|
5
|
+
const getPropertyMap_1 = require("./_internal/getPropertyMap");
|
|
6
|
+
const computeProps_1 = require("./_internal/computeProps");
|
|
7
|
+
/**
|
|
8
|
+
* Converts an Imodel to a Hub editable content object
|
|
9
|
+
*
|
|
10
|
+
* @param model IModel to convert
|
|
11
|
+
* @param requestOptions
|
|
12
|
+
* @param enrichments hash of enrichments to apply to the content
|
|
13
|
+
*/
|
|
14
|
+
function modelToHubEditableContent(model, requestOptions, enrichments) {
|
|
15
|
+
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap_1.getPropertyMap());
|
|
16
|
+
const content = mapper.storeToEntity(model, {});
|
|
17
|
+
return computeProps_1.computeProps(model, content, requestOptions, enrichments);
|
|
18
|
+
}
|
|
19
|
+
exports.modelToHubEditableContent = modelToHubEditableContent;
|
|
20
|
+
//# sourceMappingURL=modelToHubEditableContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelToHubEditableContent.js","sourceRoot":"","sources":["../../../src/content/modelToHubEditableContent.ts"],"names":[],"mappings":";;;AAGA,qEAAkE;AAElE,+DAA4D;AAC5D,2DAAwD;AAExD;;;;;;GAMG;AACH,SAAgB,yBAAyB,CACvC,KAAa,EACb,cAA+B,EAC/B,WAAuC;IAEvC,MAAM,MAAM,GAAG,IAAI,+BAAc,CAC/B,+BAAc,EAAE,CACjB,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,CAAwB,CAAC;IACvE,OAAO,2BAAY,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC;AAVD,8DAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":";;;AAkBA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,gCAAa,CAAA;AACf,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchHubEntity = void 0;
|
|
4
4
|
const fetch_1 = require("../discussions/fetch");
|
|
5
|
-
const
|
|
5
|
+
const fetchHubContent_1 = require("../content/fetchHubContent");
|
|
6
6
|
const HubInitiatives_1 = require("../initiatives/HubInitiatives");
|
|
7
7
|
const HubPages_1 = require("../pages/HubPages");
|
|
8
|
-
const
|
|
8
|
+
const fetch_2 = require("../projects/fetch");
|
|
9
9
|
const HubSites_1 = require("../sites/HubSites");
|
|
10
|
-
const
|
|
10
|
+
const fetch_3 = require("../templates/fetch");
|
|
11
11
|
const HubGroups_1 = require("../groups/HubGroups");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
12
|
+
const fetch_4 = require("../initiative-templates/fetch");
|
|
13
|
+
const fetch_5 = require("../surveys/fetch");
|
|
14
|
+
const fetch_6 = require("../events/fetch");
|
|
15
15
|
const users_1 = require("../users");
|
|
16
16
|
/**
|
|
17
17
|
* Fetch a Hub entity by identifier (id or slug)
|
|
@@ -24,7 +24,7 @@ async function fetchHubEntity(type, identifier, context) {
|
|
|
24
24
|
let result;
|
|
25
25
|
switch (type) {
|
|
26
26
|
case "project":
|
|
27
|
-
result = await
|
|
27
|
+
result = await fetch_2.fetchProject(identifier, context.requestOptions);
|
|
28
28
|
break;
|
|
29
29
|
case "site":
|
|
30
30
|
result = await HubSites_1.fetchSite(identifier, context.hubRequestOptions);
|
|
@@ -39,22 +39,22 @@ async function fetchHubEntity(type, identifier, context) {
|
|
|
39
39
|
result = await HubPages_1.fetchPage(identifier, context.hubRequestOptions);
|
|
40
40
|
break;
|
|
41
41
|
case "content":
|
|
42
|
-
result = await
|
|
42
|
+
result = await fetchHubContent_1.fetchHubContent(identifier, context.requestOptions);
|
|
43
43
|
break;
|
|
44
44
|
case "template":
|
|
45
|
-
result = await
|
|
45
|
+
result = await fetch_3.fetchTemplate(identifier, context.requestOptions);
|
|
46
46
|
break;
|
|
47
47
|
case "group":
|
|
48
48
|
result = await HubGroups_1.fetchHubGroup(identifier, context.hubRequestOptions);
|
|
49
49
|
break;
|
|
50
50
|
case "survey":
|
|
51
|
-
result = await
|
|
51
|
+
result = await fetch_5.fetchSurvey(identifier, context.hubRequestOptions);
|
|
52
52
|
break;
|
|
53
53
|
case "event":
|
|
54
|
-
result = await
|
|
54
|
+
result = await fetch_6.fetchEvent(identifier, context.hubRequestOptions);
|
|
55
55
|
break;
|
|
56
56
|
case "initiativeTemplate":
|
|
57
|
-
result = await
|
|
57
|
+
result = await fetch_4.fetchInitiativeTemplate(identifier, context.requestOptions);
|
|
58
58
|
break;
|
|
59
59
|
case "user":
|
|
60
60
|
result =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchHubEntity.js","sourceRoot":"","sources":["../../../src/core/fetchHubEntity.ts"],"names":[],"mappings":";;;AAAA,gDAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"fetchHubEntity.js","sourceRoot":"","sources":["../../../src/core/fetchHubEntity.ts"],"names":[],"mappings":";;;AAAA,gDAAuD;AACvD,gEAA6D;AAC7D,kEAAgE;AAChE,gDAA8C;AAC9C,6CAAiD;AACjD,gDAA8C;AAC9C,8CAAmD;AAInD,mDAAoD;AACpD,yDAAwE;AACxE,4CAA+C;AAC/C,2CAA6C;AAC7C,oCAA8D;AAE9D;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAClC,IAAmB,EACnB,UAAkB,EAClB,OAAuB;IAEvB,IAAI,MAAiB,CAAC;IACtB,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,MAAM,GAAG,MAAM,oBAAY,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;YAChE,MAAM;QACR,KAAK,MAAM;YACT,MAAM,GAAG,MAAM,oBAAS,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAChE,MAAM;QACR,KAAK,YAAY;YACf,MAAM,GAAG,MAAM,gCAAe,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;YACnE,MAAM;QACR,KAAK,YAAY;YACf,MAAM,GAAG,MAAM,uBAAe,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACtE,MAAM;QACR,KAAK,MAAM;YACT,MAAM,GAAG,MAAM,oBAAS,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAChE,MAAM;QACR,KAAK,SAAS;YACZ,MAAM,GAAG,MAAM,iCAAe,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;YACnE,MAAM;QACR,KAAK,UAAU;YACb,MAAM,GAAG,MAAM,qBAAa,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;YACjE,MAAM;QACR,KAAK,OAAO;YACV,MAAM,GAAG,MAAM,yBAAa,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACpE,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,GAAG,MAAM,mBAAW,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAClE,MAAM;QACR,KAAK,OAAO;YACV,MAAM,GAAG,MAAM,kBAAU,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM;QACR,KAAK,oBAAoB;YACvB,MAAM,GAAG,MAAM,+BAAuB,CACpC,UAAU,EACV,OAAO,CAAC,cAAc,CACvB,CAAC;YACF,MAAM;QACR,KAAK,MAAM;YACT,MAAM;gBACJ,UAAU,KAAK,MAAM;oBACnB,CAAC,CAAC,4BAAoB,CAAC,OAAO,CAAC,WAAW,CAAC;oBAC3C,CAAC,CAAC,MAAM,oBAAY,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;KACnE;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAlDD,wCAkDC"}
|
|
@@ -16,20 +16,17 @@ exports.EXPORT_ITEM_FORMATS = [
|
|
|
16
16
|
];
|
|
17
17
|
/**
|
|
18
18
|
* Formats supported by the /exportImage endpoint of Image Services.
|
|
19
|
+
* Listed in the default order of appearance in the UI.
|
|
19
20
|
*/
|
|
20
21
|
exports.EXPORT_IMAGE_FORMATS = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
types_1.ServiceDownloadFormat.GIF,
|
|
22
|
+
// Temporary exclusion until we hammer out the details of how to support it.
|
|
23
|
+
// Unlike jpg or png, tiff downloads require exact geospatial parameters to be set.
|
|
24
|
+
// ServiceDownloadFormat.TIFF,
|
|
25
25
|
types_1.ServiceDownloadFormat.JPG,
|
|
26
|
-
types_1.ServiceDownloadFormat.JPG_PNG,
|
|
27
|
-
types_1.ServiceDownloadFormat.LERC,
|
|
28
26
|
types_1.ServiceDownloadFormat.PNG,
|
|
27
|
+
types_1.ServiceDownloadFormat.PNG8,
|
|
29
28
|
types_1.ServiceDownloadFormat.PNG24,
|
|
30
29
|
types_1.ServiceDownloadFormat.PNG32,
|
|
31
|
-
types_1.ServiceDownloadFormat.PNG8,
|
|
32
|
-
types_1.ServiceDownloadFormat.TIFF,
|
|
33
30
|
];
|
|
34
31
|
/**
|
|
35
32
|
* Formats supported by the paging operation endpoint of the Hub Download API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":";;;AAAA,oCAAiD;AAEjD;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,QAAQ;IAC9B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,kBAAkB;CAChC,CAAC;AAIX
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":";;;AAAA,oCAAiD;AAEjD;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,QAAQ;IAC9B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,kBAAkB;CAChC,CAAC;AAIX;;;GAGG;AACU,QAAA,oBAAoB,GAAG;IAClC,4EAA4E;IAC5E,mFAAmF;IACnF,8BAA8B;IAE9B,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,IAAI;IAC1B,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,KAAK;CAWnB,CAAC;AAGX;;;GAGG;AACU,QAAA,sBAAsB,GAAG;IACpC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,GAAG;CACjB,CAAC;AAGX;;;;GAIG;AACU,QAAA,sBAAsB,GAAG;IACpC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,QAAQ;IAC9B,6BAAqB,CAAC,kBAAkB;IACxC,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,WAAW;IACjC,6BAAqB,CAAC,MAAM;IAC5B,6BAAqB,CAAC,IAAI;IAC1B,6BAAqB,CAAC,GAAG;CACjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.canUseExportImageFlow = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
4
5
|
/**
|
|
5
6
|
* @private
|
|
6
7
|
* Determines if the export image flow can be used for the given entity.
|
|
@@ -8,7 +9,12 @@ exports.canUseExportImageFlow = void 0;
|
|
|
8
9
|
* @returns whether the export image flow can be used
|
|
9
10
|
*/
|
|
10
11
|
function canUseExportImageFlow(entity) {
|
|
11
|
-
|
|
12
|
+
const { type, typeKeywords = [] } = entity;
|
|
13
|
+
// Tiled Imagery services cannot be downloaded. This typeKeyword check
|
|
14
|
+
// is one way to distinguish between tiled and non-tiled imagery services.
|
|
15
|
+
// TODO: Consider checking item.url instead so reference items are also excluded.
|
|
16
|
+
return (type === types_1.ItemType["Image Service"] &&
|
|
17
|
+
!typeKeywords.includes("Tiled Imagery"));
|
|
12
18
|
}
|
|
13
19
|
exports.canUseExportImageFlow = canUseExportImageFlow;
|
|
14
20
|
//# sourceMappingURL=canUseExportImageFlow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canUseExportImageFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canUseExportImageFlow.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"canUseExportImageFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canUseExportImageFlow.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AAEvC;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,MAA2B;IAC/D,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAC3C,sEAAsE;IACtE,0EAA0E;IAC1E,iFAAiF;IACjF,OAAO,CACL,IAAI,KAAK,gBAAQ,CAAC,eAAe,CAAC;QAClC,CAAC,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,CACxC,CAAC;AACJ,CAAC;AATD,sDASC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchExportImageDownloadFile = void 0;
|
|
4
|
+
const arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
const HubError_1 = require("../../../HubError");
|
|
7
|
+
const get_prop_1 = require("../../../objects/get-prop");
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
*
|
|
11
|
+
* Fetches a download file url from an Image Service via the exportImage endpoint.
|
|
12
|
+
*
|
|
13
|
+
* @param options options for refining / filtering the resulting download file
|
|
14
|
+
* @returns a blob containing the download file
|
|
15
|
+
*/
|
|
16
|
+
async function fetchExportImageDownloadFile(options) {
|
|
17
|
+
validateOptions(options);
|
|
18
|
+
const { entity, format, context, progressCallback } = options;
|
|
19
|
+
progressCallback && progressCallback(types_1.DownloadOperationStatus.PENDING);
|
|
20
|
+
const extent = getExportImageExtent(options);
|
|
21
|
+
const { xmin, xmax, ymin, ymax } = extent;
|
|
22
|
+
// TODO: do we need to handle latestWkid as well?
|
|
23
|
+
const { wkid } = extent.spatialReference;
|
|
24
|
+
const requestOptions = Object.assign({}, context.requestOptions);
|
|
25
|
+
requestOptions.httpMethod = "GET";
|
|
26
|
+
requestOptions.params = {
|
|
27
|
+
bbox: `${xmin},${ymin},${xmax},${ymax}`,
|
|
28
|
+
bboxSR: `${wkid}`,
|
|
29
|
+
f: "image",
|
|
30
|
+
format,
|
|
31
|
+
mosaicRule: '{"ascending":true,"mosaicMethod":"esriMosaicNorthwest","mosaicOperation":"MT_FIRST"}',
|
|
32
|
+
};
|
|
33
|
+
// TODO: Figure out whether we want to leverage the server's maxImageWidth and maxImageHeight.
|
|
34
|
+
// While it results in higher quality images, it also creates a lot of variability in the result
|
|
35
|
+
// when we filter an image by extent.
|
|
36
|
+
//
|
|
37
|
+
// const { maxImageHeight, maxImageWidth } =
|
|
38
|
+
// getProp(entity, "extendedProps.server") || {};
|
|
39
|
+
// if (maxImageWidth && maxImageHeight) {
|
|
40
|
+
// requestOptions.params.size = `${maxImageWidth},${maxImageHeight}`;
|
|
41
|
+
// }
|
|
42
|
+
const blob = await arcgis_rest_request_1.request(`${entity.url}/exportImage`, requestOptions);
|
|
43
|
+
progressCallback && progressCallback(types_1.DownloadOperationStatus.COMPLETED);
|
|
44
|
+
return {
|
|
45
|
+
type: "blob",
|
|
46
|
+
blob,
|
|
47
|
+
filename: getBlobFilename(entity, format),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.fetchExportImageDownloadFile = fetchExportImageDownloadFile;
|
|
51
|
+
function validateOptions(options) {
|
|
52
|
+
const { geometry } = options;
|
|
53
|
+
if (geometry && geometry.type !== "extent") {
|
|
54
|
+
throw new HubError_1.default("fetchExportImageDownloadFileUrl", "Only extent geometric filters are supported for this type of download");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function getExportImageExtent(options) {
|
|
58
|
+
const { entity, geometry } = options;
|
|
59
|
+
const serverExtent = get_prop_1.getProp(entity, "extendedProps.server.extent");
|
|
60
|
+
// TODO: Factor in entity.extent if it exists AND is a valid 4326 bbox
|
|
61
|
+
let result = null;
|
|
62
|
+
if (geometry) {
|
|
63
|
+
result = geometry;
|
|
64
|
+
}
|
|
65
|
+
else if (serverExtent) {
|
|
66
|
+
result = serverExtent;
|
|
67
|
+
}
|
|
68
|
+
if (!result) {
|
|
69
|
+
throw new HubError_1.default("fetchExportImageDownloadFileUrl", "Extent required for this download operation");
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
function getBlobFilename(entity, format) {
|
|
74
|
+
const name = entity.name || get_prop_1.getProp(entity, "extendedProps.server.name");
|
|
75
|
+
const extension = format.includes(types_1.ServiceDownloadFormat.PNG)
|
|
76
|
+
? // NOTE: the png family of formats (png8, png24, etc.) share the same extension
|
|
77
|
+
types_1.ServiceDownloadFormat.PNG
|
|
78
|
+
: format;
|
|
79
|
+
return `${name}.${extension}`;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=fetchExportImageDownloadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchExportImageDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.ts"],"names":[],"mappings":";;;AAAA,mEAAoD;AACpD,uCAKqB;AACrB,gDAAyC;AACzC,wDAAoD;AAIpD;;;;;;;GAOG;AACI,KAAK,UAAU,4BAA4B,CAChD,OAAkC;IAElC,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzB,MAAM,EAAE,MAAM,EAA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,EAAE;QAC1C,MAAM,IAAI,kBAAQ,CAChB,iCAAiC,EACjC,uEAAuE,CACxE,CAAC;KACH;AACH,CAAC;AAED,SAAS,oBAAoB,CAC3B,OAAkC;IAElC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,YAAY,GAAG,kBAAO,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IAEpE,sEAAsE;IACtE,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,IAAI,QAAQ,EAAE;QACZ,MAAM,GAAG,QAAyB,CAAC;KACpC;SAAM,IAAI,YAAY,EAAE;QACvB,MAAM,GAAG,YAAY,CAAC;KACvB;IAED,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,kBAAQ,CAChB,iCAAiC,EACjC,6CAA6C,CAC9C,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,eAAe,CACtB,MAA2B,EAC3B,MAAyB;IAEzB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,kBAAO,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,6BAAqB,CAAC,GAAG,CAAC;QAC1D,CAAC,CAAC,+EAA+E;YAC/E,6BAAqB,CAAC,GAAG;QAC3B,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,GAAG,IAAI,IAAI,SAAS,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fetchExportItemDownloadFile = void 0;
|
|
4
4
|
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
5
|
const types_1 = require("../../types");
|
|
6
6
|
const getExportItemDataUrl_1 = require("../getExportItemDataUrl");
|
|
@@ -24,7 +24,7 @@ const get_prop_1 = require("../../../objects/get-prop");
|
|
|
24
24
|
* @param options options for refining / filtering the resulting download file
|
|
25
25
|
* @returns a url to download the file
|
|
26
26
|
*/
|
|
27
|
-
async function
|
|
27
|
+
async function fetchExportItemDownloadFile(options) {
|
|
28
28
|
validateOptions(options);
|
|
29
29
|
const { entity, format, context, progressCallback, pollInterval } = options;
|
|
30
30
|
progressCallback && progressCallback(types_1.DownloadOperationStatus.PENDING);
|
|
@@ -38,9 +38,12 @@ async function fetchExportItemDownloadFileUrl(options) {
|
|
|
38
38
|
// TODO: Once the job is completed, we still need to set the special typekeywords needed to find the item later.
|
|
39
39
|
// Also, I _think_ we can only do one layer at a time (at least with the current typeKeywords schema we're using)
|
|
40
40
|
progressCallback && progressCallback(types_1.DownloadOperationStatus.COMPLETED);
|
|
41
|
-
return
|
|
41
|
+
return {
|
|
42
|
+
type: "url",
|
|
43
|
+
href: getExportItemDataUrl_1.getExportItemDataUrl(exportItemId, context),
|
|
44
|
+
};
|
|
42
45
|
}
|
|
43
|
-
exports.
|
|
46
|
+
exports.fetchExportItemDownloadFile = fetchExportItemDownloadFile;
|
|
44
47
|
function validateOptions(options) {
|
|
45
48
|
const { geometry, where } = options;
|
|
46
49
|
if (geometry) {
|
|
@@ -80,4 +83,4 @@ async function pollForJobCompletion(exportedItemId, jobId, context, pollInterval
|
|
|
80
83
|
return pollForJobCompletion(exportedItemId, jobId, context, pollInterval, progressCallback);
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
|
-
//# sourceMappingURL=
|
|
86
|
+
//# sourceMappingURL=fetchExportItemDownloadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchExportItemDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.ts"],"names":[],"mappings":";;;AAAA,iEAKkC;AAClC,uCAQqB;AACrB,kEAA+D;AAC/D,gDAAyC;AAGzC,wDAAoD;AAEpD;;;;;;;;;;;;;;;;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strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fetchHubApiDownloadFile = void 0;
|
|
4
4
|
const HubError_1 = require("../../../HubError");
|
|
5
5
|
const get_prop_1 = require("../../../objects/get-prop");
|
|
6
6
|
const types_1 = require("../../types");
|
|
@@ -18,13 +18,13 @@ const types_1 = require("../../types");
|
|
|
18
18
|
* @param options options for refining / filtering the resulting download file
|
|
19
19
|
* @returns a url to download the file
|
|
20
20
|
*/
|
|
21
|
-
async function
|
|
21
|
+
async function fetchHubApiDownloadFile(options) {
|
|
22
22
|
validateOptions(options);
|
|
23
23
|
const requestUrl = getDownloadApiRequestUrl(options);
|
|
24
24
|
const { pollInterval, progressCallback } = options;
|
|
25
25
|
return pollDownloadApi(requestUrl, pollInterval, progressCallback);
|
|
26
26
|
}
|
|
27
|
-
exports.
|
|
27
|
+
exports.fetchHubApiDownloadFile = fetchHubApiDownloadFile;
|
|
28
28
|
function validateOptions(options) {
|
|
29
29
|
const { layers = [] } = options;
|
|
30
30
|
// The Hub Download API currently requires a target layer to be specified
|
|
@@ -90,7 +90,10 @@ async function pollDownloadApi(requestUrl, pollInterval, progressCallback) {
|
|
|
90
90
|
progressCallback && progressCallback(operationStatus, progressInPercent);
|
|
91
91
|
// Operation complete, return the download URL
|
|
92
92
|
if (resultUrl) {
|
|
93
|
-
return
|
|
93
|
+
return {
|
|
94
|
+
type: "url",
|
|
95
|
+
href: resultUrl,
|
|
96
|
+
};
|
|
94
97
|
}
|
|
95
98
|
// Operation still in progress, poll again
|
|
96
99
|
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
@@ -137,4 +140,4 @@ function toDownloadOperationStatus(status) {
|
|
|
137
140
|
return (createReplicaStatusMap[status] ||
|
|
138
141
|
pagingJobStatusMap[status]);
|
|
139
142
|
}
|
|
140
|
-
//# sourceMappingURL=
|
|
143
|
+
//# sourceMappingURL=fetchHubApiDownloadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchHubApiDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFile.ts"],"names":[],"mappings":";;;AAAA,gDAAyC;AACzC,wDAAoD;AACpD,uCAOqB;AAErB;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,uBAAuB,CAC3C,OAAkC;IAElC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IACnD,OAAO,eAAe,CAAC,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;AACrE,CAAC;AAPD,0DAOC;AAED,SAAS,eAAe,CAAC,OAAkC;IACzD,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAEhC,yEAAyE;IACzE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,MAAM,IAAI,kBAAQ,CAChB,4BAA4B,EAC5B,iCAAiC,CAClC,CAAC;KACH;IAED,+DAA+D;IAC/D,gEAAgE;IAChE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,MAAM,IAAI,kBAAQ,CAChB,4BAA4B,EAC5B,gDAAgD,CACjD,CAAC;KACH;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,wBAAwB,CAAC,OAAkC;IAClE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAErE,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC;QACvC,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC7B,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE;QACZ,MAAM,YAAY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B,GAAqD;QAC3E,OAAO,EAAE,+BAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,+BAAuB,CAAC,UAAU;QAC9C,UAAU,EAAE,+BAAuB,CAAC,UAAU;QAC9C,cAAc,EAAE,+BAAuB,CAAC,UAAU;QAClD,MAAM,EAAE,+BAAuB,CAAC,MAAM;QACtC,SAAS,EAAE,+BAAuB,CAAC,SAAS;KAC7C,CAAC;IAEF,OAAO,CACL,sBAAsB,CAAC,MAA6B,CAAC;QACrD,kBAAkB,CAAC,MAAyB,CAAC,CAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,7 @@ const _types_1 = require("../_types");
|
|
|
10
10
|
* @returns available download formats for the entity
|
|
11
11
|
*/
|
|
12
12
|
function getCreateReplicaFormats(entity) {
|
|
13
|
+
// TODO: Change to use `extendedProps.serverExtractFormats`
|
|
13
14
|
const allFormats = entity.serverExtractFormats || [];
|
|
14
15
|
// List recognized formats in the order they are defined in CREATE_REPLICA_FORMATS
|
|
15
16
|
const recognizedFormats = _types_1.CREATE_REPLICA_FORMATS.filter((format) => allFormats.includes(format));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCreateReplicaFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getCreateReplicaFormats.ts"],"names":[],"mappings":";;;AAEA,sCAAwE;AAExE;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,MAA2B;IAE3B,MAAM,UAAU,GAAG,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;IAErD,kFAAkF;IAClF,MAAM,iBAAiB,GACrB,+BAAsB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzE,mFAAmF;IACnF,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAC3C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,+BAAsB,CAAC,QAAQ,CAAC,MAA6B,CAAC,CAC5E,CAAC;IAEF,OAAO,CAAC,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,CAAC,CAAC,GAAG,CACvD,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;QACnB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,MAA6B;KACtC,CAAC,CACH,CAAC;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"getCreateReplicaFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getCreateReplicaFormats.ts"],"names":[],"mappings":";;;AAEA,sCAAwE;AAExE;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,MAA2B;IAE3B,2DAA2D;IAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;IAErD,kFAAkF;IAClF,MAAM,iBAAiB,GACrB,+BAAsB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzE,mFAAmF;IACnF,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAC3C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,+BAAsB,CAAC,QAAQ,CAAC,MAA6B,CAAC,CAC5E,CAAC;IAEF,OAAO,CAAC,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,CAAC,CAAC,GAAG,CACvD,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;QACnB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,MAA6B;KACtC,CAAC,CACH,CAAC;AACJ,CAAC;AArBD,0DAqBC"}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExportImageFormats = void 0;
|
|
4
|
+
const objects_1 = require("../../../objects");
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
const _types_1 = require("../_types");
|
|
4
7
|
/**
|
|
5
8
|
* @private
|
|
6
|
-
* Returns all the download formats that are exposed by Image
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
9
|
+
* Returns all the download formats that are exposed by an Image Service via the /exportImage operation.
|
|
9
10
|
*/
|
|
10
|
-
function getExportImageFormats() {
|
|
11
|
-
|
|
12
|
-
//
|
|
11
|
+
function getExportImageFormats(entity) {
|
|
12
|
+
const serverVersion = objects_1.getProp(entity, "extendedProps.server.currentVersion") || 0;
|
|
13
|
+
// NOTE: We have to imperatively exclude formats based on the server version
|
|
14
|
+
// because there is no other way to determine which formats are supported.
|
|
15
|
+
// See the EXPORT_IMAGE_FORMATS constant for notes on individual formats.
|
|
16
|
+
const supportedFormats = (serverVersion < 10.2
|
|
17
|
+
? _types_1.EXPORT_IMAGE_FORMATS.filter((f) => f !== types_1.ServiceDownloadFormat.PNG32)
|
|
18
|
+
: _types_1.EXPORT_IMAGE_FORMATS);
|
|
19
|
+
return supportedFormats.map((format) => ({
|
|
20
|
+
type: "dynamic",
|
|
21
|
+
format,
|
|
22
|
+
}));
|
|
13
23
|
}
|
|
14
24
|
exports.getExportImageFormats = getExportImageFormats;
|
|
15
25
|
//# sourceMappingURL=getExportImageFormats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExportImageFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getExportImageFormats.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getExportImageFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getExportImageFormats.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAC3C,uCAA4E;AAC5E,sCAAoE;AAEpE;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,MAA2B;IAE3B,MAAM,aAAa,GACjB,iBAAO,CAAC,MAAM,EAAE,qCAAqC,CAAC,IAAI,CAAC,CAAC;IAE9D,4EAA4E;IAC5E,0EAA0E;IAC1E,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,CACvB,aAAa,GAAG,IAAI;QAClB,CAAC,CAAC,6BAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,6BAAqB,CAAC,KAAK,CAAC;QACvE,CAAC,CAAC,6BAAoB,CACF,CAAC;IAEzB,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAyB,EAAE,EAAE,CAAC,CAAC;QAC1D,IAAI,EAAE,SAAS;QACf,MAAM;KACP,CAAC,CAAC,CAAC;AACN,CAAC;AAnBD,sDAmBC"}
|
|
@@ -11,6 +11,7 @@ function canUseCreateReplica(entity) {
|
|
|
11
11
|
// NOTE: We currently do not allow Hub to perform the /createReplica operation on enterprise / self-hosted
|
|
12
12
|
// feature services due to known limitations with the enterprise implementation of /createReplica.
|
|
13
13
|
// This is a temporary restriction until the enterprise implementation is improved.
|
|
14
|
+
// TODO: change to use `extendedProps.serverExtractCapability`
|
|
14
15
|
return hostedServiceUtils_1.isAGOFeatureServiceUrl(entity.url) && !!entity.serverExtractCapability;
|
|
15
16
|
}
|
|
16
17
|
exports.canUseCreateReplica = canUseCreateReplica;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canUseCreateReplica.js","sourceRoot":"","sources":["../../../src/downloads/canUseCreateReplica.ts"],"names":[],"mappings":";;;AAAA,sEAAuE;AAGvE;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,MAA2B;IAC7D,0GAA0G;IAC1G,kGAAkG;IAClG,mFAAmF;IACnF,OAAO,2CAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC;AAChF,CAAC;
|
|
1
|
+
{"version":3,"file":"canUseCreateReplica.js","sourceRoot":"","sources":["../../../src/downloads/canUseCreateReplica.ts"],"names":[],"mappings":";;;AAAA,sEAAuE;AAGvE;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,MAA2B;IAC7D,0GAA0G;IAC1G,kGAAkG;IAClG,mFAAmF;IACnF,8DAA8D;IAC9D,OAAO,2CAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC;AAChF,CAAC;AAND,kDAMC"}
|
|
@@ -5,6 +5,7 @@ const urls_1 = require("../urls");
|
|
|
5
5
|
function canUseHubDownloadSystem(entity) {
|
|
6
6
|
const isMapOrFeatureService = urls_1.isMapOrFeatureServerUrl(entity.url);
|
|
7
7
|
const isPublic = entity.access === "public";
|
|
8
|
+
// TODO: use `extendedProps.serverQueryCapability` instead
|
|
8
9
|
const isQueryEnabled = entity.serverQueryCapability;
|
|
9
10
|
return isMapOrFeatureService && isPublic && isQueryEnabled;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canUseHubDownloadSystem.js","sourceRoot":"","sources":["../../../src/downloads/canUseHubDownloadSystem.ts"],"names":[],"mappings":";;;AACA,kCAAkD;AAElD,SAAgB,uBAAuB,CAAC,MAA2B;IACjE,MAAM,qBAAqB,GAAG,8BAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC;IAC5C,MAAM,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;IACpD,OAAO,qBAAqB,IAAI,QAAQ,IAAI,cAAc,CAAC;AAC7D,CAAC;
|
|
1
|
+
{"version":3,"file":"canUseHubDownloadSystem.js","sourceRoot":"","sources":["../../../src/downloads/canUseHubDownloadSystem.ts"],"names":[],"mappings":";;;AACA,kCAAkD;AAElD,SAAgB,uBAAuB,CAAC,MAA2B;IACjE,MAAM,qBAAqB,GAAG,8BAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC;IAC5C,0DAA0D;IAC1D,MAAM,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;IACpD,OAAO,qBAAqB,IAAI,QAAQ,IAAI,cAAc,CAAC;AAC7D,CAAC;AAND,0DAMC"}
|