@esri/hub-common 14.121.2 → 14.122.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/ArcGISContextManager.js +2 -0
- package/dist/esm/ArcGISContextManager.js.map +1 -1
- package/dist/esm/content/_internal/ContentBusinessRules.js +6 -0
- package/dist/esm/content/_internal/ContentBusinessRules.js.map +1 -1
- package/dist/esm/content/_internal/computeProps.js +8 -1
- package/dist/esm/content/_internal/computeProps.js.map +1 -1
- package/dist/esm/content/_internal/internalContentUtils.js.map +1 -1
- package/dist/esm/content/fetch.js +2 -2
- package/dist/esm/content/fetch.js.map +1 -1
- package/dist/esm/core/types/ISystemStatus.js +1 -0
- package/dist/esm/core/types/ISystemStatus.js.map +1 -1
- package/dist/esm/downloads/_internal/_types.js +55 -0
- package/dist/esm/downloads/_internal/_types.js.map +1 -0
- package/dist/esm/downloads/_internal/canCreateExportItem.js +15 -0
- package/dist/esm/downloads/_internal/canCreateExportItem.js.map +1 -0
- package/dist/esm/downloads/_internal/canUseExportImageFlow.js +10 -0
- package/dist/esm/downloads/_internal/canUseExportImageFlow.js.map +1 -0
- package/dist/esm/downloads/_internal/canUseExportItemFlow.js +11 -0
- package/dist/esm/downloads/_internal/canUseExportItemFlow.js.map +1 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js +46 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js.map +1 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js +79 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js.map +1 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js +136 -0
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js +56 -0
- package/dist/esm/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/fetchExportItemFormats.js +28 -0
- package/dist/esm/downloads/_internal/format-fetchers/fetchExportItemFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getAllExportItemFormats.js +12 -0
- package/dist/esm/downloads/_internal/format-fetchers/getAllExportItemFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getCreateReplicaFormats.js +14 -0
- package/dist/esm/downloads/_internal/format-fetchers/getCreateReplicaFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getExportImageFormats.js +11 -0
- package/dist/esm/downloads/_internal/format-fetchers/getExportImageFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getHubDownloadApiFormats.js +18 -0
- package/dist/esm/downloads/_internal/format-fetchers/getHubDownloadApiFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/format-fetchers/getPagingJobFormats.js +10 -0
- package/dist/esm/downloads/_internal/format-fetchers/getPagingJobFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/getExportItemDataUrl.js +14 -0
- package/dist/esm/downloads/_internal/getExportItemDataUrl.js.map +1 -0
- package/dist/esm/downloads/build-existing-exports-portal-query.js +1 -37
- package/dist/esm/downloads/build-existing-exports-portal-query.js.map +1 -1
- package/dist/esm/downloads/canUseCreateReplica.js +13 -0
- package/dist/esm/downloads/canUseCreateReplica.js.map +1 -0
- package/dist/esm/downloads/canUseHubDownloadApi.js +15 -0
- package/dist/esm/downloads/canUseHubDownloadApi.js.map +1 -0
- package/dist/esm/downloads/fetchDownloadFileUrl.js +29 -0
- package/dist/esm/downloads/fetchDownloadFileUrl.js.map +1 -0
- package/dist/esm/downloads/fetchDownloadFormats.js +37 -0
- package/dist/esm/downloads/fetchDownloadFormats.js.map +1 -0
- package/dist/esm/downloads/index.js +5 -0
- package/dist/esm/downloads/index.js.map +1 -1
- package/dist/esm/downloads/types.js +97 -0
- package/dist/esm/downloads/types.js.map +1 -0
- package/dist/node/ArcGISContextManager.js +2 -0
- package/dist/node/ArcGISContextManager.js.map +1 -1
- package/dist/node/content/_internal/ContentBusinessRules.js +6 -0
- package/dist/node/content/_internal/ContentBusinessRules.js.map +1 -1
- package/dist/node/content/_internal/computeProps.js +7 -0
- package/dist/node/content/_internal/computeProps.js.map +1 -1
- package/dist/node/content/_internal/internalContentUtils.js.map +1 -1
- package/dist/node/content/fetch.js +2 -2
- package/dist/node/content/fetch.js.map +1 -1
- package/dist/node/core/types/ISystemStatus.js +1 -0
- package/dist/node/core/types/ISystemStatus.js.map +1 -1
- package/dist/node/downloads/_internal/_types.js +58 -0
- package/dist/node/downloads/_internal/_types.js.map +1 -0
- package/dist/node/downloads/_internal/canCreateExportItem.js +19 -0
- package/dist/node/downloads/_internal/canCreateExportItem.js.map +1 -0
- package/dist/node/downloads/_internal/canUseExportImageFlow.js +14 -0
- package/dist/node/downloads/_internal/canUseExportImageFlow.js.map +1 -0
- package/dist/node/downloads/_internal/canUseExportItemFlow.js +15 -0
- package/dist/node/downloads/_internal/canUseExportItemFlow.js.map +1 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js +50 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js.map +1 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js +83 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js.map +1 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js +140 -0
- package/dist/node/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js +60 -0
- package/dist/node/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/fetchExportItemFormats.js +32 -0
- package/dist/node/downloads/_internal/format-fetchers/fetchExportItemFormats.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getAllExportItemFormats.js +16 -0
- package/dist/node/downloads/_internal/format-fetchers/getAllExportItemFormats.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getCreateReplicaFormats.js +18 -0
- package/dist/node/downloads/_internal/format-fetchers/getCreateReplicaFormats.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getExportImageFormats.js +15 -0
- package/dist/node/downloads/_internal/format-fetchers/getExportImageFormats.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getHubDownloadApiFormats.js +22 -0
- package/dist/node/downloads/_internal/format-fetchers/getHubDownloadApiFormats.js.map +1 -0
- package/dist/node/downloads/_internal/format-fetchers/getPagingJobFormats.js +14 -0
- package/dist/node/downloads/_internal/format-fetchers/getPagingJobFormats.js.map +1 -0
- package/dist/node/downloads/_internal/getExportItemDataUrl.js +18 -0
- package/dist/node/downloads/_internal/getExportItemDataUrl.js.map +1 -0
- package/dist/node/downloads/build-existing-exports-portal-query.js +3 -39
- package/dist/node/downloads/build-existing-exports-portal-query.js.map +1 -1
- package/dist/node/downloads/canUseCreateReplica.js +17 -0
- package/dist/node/downloads/canUseCreateReplica.js.map +1 -0
- package/dist/node/downloads/canUseHubDownloadApi.js +19 -0
- package/dist/node/downloads/canUseHubDownloadApi.js.map +1 -0
- package/dist/node/downloads/fetchDownloadFileUrl.js +33 -0
- package/dist/node/downloads/fetchDownloadFileUrl.js.map +1 -0
- package/dist/node/downloads/fetchDownloadFormats.js +41 -0
- package/dist/node/downloads/fetchDownloadFormats.js.map +1 -0
- package/dist/node/downloads/index.js +5 -0
- package/dist/node/downloads/index.js.map +1 -1
- package/dist/node/downloads/types.js +101 -0
- package/dist/node/downloads/types.js.map +1 -0
- package/dist/types/content/_internal/ContentBusinessRules.d.ts +1 -1
- package/dist/types/content/_internal/internalContentUtils.d.ts +7 -0
- package/dist/types/core/types/IHubEditableContent.d.ts +10 -0
- package/dist/types/core/types/ISystemStatus.d.ts +1 -1
- package/dist/types/downloads/_internal/_types.d.ts +22 -0
- package/dist/types/downloads/_internal/canCreateExportItem.d.ts +13 -0
- package/dist/types/downloads/_internal/canUseExportImageFlow.d.ts +8 -0
- package/dist/types/downloads/_internal/canUseExportItemFlow.d.ts +8 -0
- package/dist/types/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.d.ts +12 -0
- package/dist/types/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.d.ts +20 -0
- package/dist/types/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.d.ts +16 -0
- package/dist/types/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.d.ts +26 -0
- package/dist/types/downloads/_internal/format-fetchers/fetchExportItemFormats.d.ts +25 -0
- package/dist/types/downloads/_internal/format-fetchers/getAllExportItemFormats.d.ts +6 -0
- package/dist/types/downloads/_internal/format-fetchers/getCreateReplicaFormats.d.ts +10 -0
- package/dist/types/downloads/_internal/format-fetchers/getExportImageFormats.d.ts +8 -0
- package/dist/types/downloads/_internal/format-fetchers/getHubDownloadApiFormats.d.ts +12 -0
- package/dist/types/downloads/_internal/format-fetchers/getPagingJobFormats.d.ts +7 -0
- package/dist/types/downloads/_internal/getExportItemDataUrl.d.ts +9 -0
- package/dist/types/downloads/build-existing-exports-portal-query.d.ts +0 -37
- package/dist/types/downloads/canUseCreateReplica.d.ts +7 -0
- package/dist/types/downloads/canUseHubDownloadApi.d.ts +9 -0
- package/dist/types/downloads/fetchDownloadFileUrl.d.ts +8 -0
- package/dist/types/downloads/fetchDownloadFormats.d.ts +7 -0
- package/dist/types/downloads/index.d.ts +5 -0
- package/dist/types/downloads/types.d.ts +152 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchDownloadFileUrl = void 0;
|
|
4
|
+
const HubError_1 = require("../HubError");
|
|
5
|
+
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
6
|
+
const canUseExportItemFlow_1 = require("./_internal/canUseExportItemFlow");
|
|
7
|
+
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
8
|
+
/**
|
|
9
|
+
* Fetches a download file URL for the given entity and format.
|
|
10
|
+
* @param options options to refine / filter the results of the fetchDownloadFileUrl operation
|
|
11
|
+
* @returns a promise that resolves with the download file URL
|
|
12
|
+
* @throws {ArcgisHubDownloadError} if the download file URL cannot be fetched for a well-known reason
|
|
13
|
+
*/
|
|
14
|
+
async function fetchDownloadFileUrl(options) {
|
|
15
|
+
// If the pollInterval is not set, default to 3 seconds
|
|
16
|
+
const withPollInterval = options.pollInterval == null ? Object.assign(Object.assign({}, options), { pollInterval: 3000 }) : options;
|
|
17
|
+
let fetchingFn;
|
|
18
|
+
if (canUseHubDownloadApi_1.canUseHubDownloadApi(withPollInterval.entity, withPollInterval.context)) {
|
|
19
|
+
fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchHubApiDownloadFileUrl"))).fetchHubApiDownloadFileUrl;
|
|
20
|
+
}
|
|
21
|
+
else if (canUseExportItemFlow_1.canUseExportItemFlow(withPollInterval.entity)) {
|
|
22
|
+
fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportItemDownloadFileUrl"))).fetchExportItemDownloadFileUrl;
|
|
23
|
+
}
|
|
24
|
+
else if (canUseExportImageFlow_1.canUseExportImageFlow(withPollInterval.entity)) {
|
|
25
|
+
fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportImageDownloadFileUrl"))).fetchExportImageDownloadFileUrl;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw new HubError_1.default("fetchDownloadFileUrl", "Downloads are not supported for this item in this environment");
|
|
29
|
+
}
|
|
30
|
+
return fetchingFn(withPollInterval);
|
|
31
|
+
}
|
|
32
|
+
exports.fetchDownloadFileUrl = fetchDownloadFileUrl;
|
|
33
|
+
//# sourceMappingURL=fetchDownloadFileUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchDownloadFileUrl.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFileUrl.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AAEnC,6EAA0E;AAC1E,2EAAwE;AACxE,iEAA8D;AAG9D;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CACxC,OAAqC;IAErC,uDAAuD;IACvD,MAAM,gBAAgB,GACpB,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,iCAAM,OAAO,KAAE,YAAY,EAAE,IAAI,IAAG,CAAC,CAAC,OAAO,CAAC;IAE9E,IAAI,UAAU,CAAC;IACf,IAAI,2CAAoB,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE;QAC3E,UAAU,GAAG,CACX,2CAAa,0DAA0D,EAAC,CACzE,CAAC,0BAA0B,CAAC;KAC9B;SAAM,IAAI,2CAAoB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACxD,UAAU,GAAG,CACX,2CACE,8DAA8D,EAC/D,CACF,CAAC,8BAA8B,CAAC;KAClC;SAAM,IAAI,6CAAqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzD,UAAU,GAAG,CACX,2CACE,+DAA+D,EAChE,CACF,CAAC,+BAA+B,CAAC;KACnC;SAAM;QACL,MAAM,IAAI,kBAAQ,CAChB,sBAAsB,EACtB,+DAA+D,CAChE,CAAC;KACH;IACD,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC;AA/BD,oDA+BC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchDownloadFormats = void 0;
|
|
4
|
+
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
5
|
+
const canUseExportItemFlow_1 = require("./_internal/canUseExportItemFlow");
|
|
6
|
+
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
7
|
+
/**
|
|
8
|
+
* Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
|
|
9
|
+
* @param options options to refine / filter the results of the fetchDownloadFormats operation
|
|
10
|
+
* @returns a promise that resolves with the download formats
|
|
11
|
+
*/
|
|
12
|
+
async function fetchDownloadFormats(options) {
|
|
13
|
+
const { entity, context, layers } = options;
|
|
14
|
+
// fetch base formats for the item
|
|
15
|
+
let baseFormats = [];
|
|
16
|
+
if (canUseHubDownloadApi_1.canUseHubDownloadApi(entity, context)) {
|
|
17
|
+
const { getHubDownloadApiFormats } = await Promise.resolve().then(() => require("./_internal/format-fetchers/getHubDownloadApiFormats"));
|
|
18
|
+
baseFormats = getHubDownloadApiFormats(entity);
|
|
19
|
+
}
|
|
20
|
+
else if (canUseExportItemFlow_1.canUseExportItemFlow(entity)) {
|
|
21
|
+
const { fetchExportItemFormats } = await Promise.resolve().then(() => require("./_internal/format-fetchers/fetchExportItemFormats"));
|
|
22
|
+
baseFormats = await fetchExportItemFormats(entity, context, layers);
|
|
23
|
+
}
|
|
24
|
+
else if (canUseExportImageFlow_1.canUseExportImageFlow(entity)) {
|
|
25
|
+
const { getExportImageFormats } = await Promise.resolve().then(() => require("./_internal/format-fetchers/getExportImageFormats"));
|
|
26
|
+
baseFormats = getExportImageFormats();
|
|
27
|
+
}
|
|
28
|
+
// add additional resource links as static formats
|
|
29
|
+
const additionalFormats = (entity.additionalResources || []).map(toStaticFormat);
|
|
30
|
+
// combine formats into single list
|
|
31
|
+
return [...baseFormats, ...additionalFormats];
|
|
32
|
+
}
|
|
33
|
+
exports.fetchDownloadFormats = fetchDownloadFormats;
|
|
34
|
+
function toStaticFormat(resource) {
|
|
35
|
+
return {
|
|
36
|
+
type: "static",
|
|
37
|
+
label: resource.name,
|
|
38
|
+
url: resource.url,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=fetchDownloadFormats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAC1E,2EAAwE;AACxE,iEAA8D;AAO9D;;;;GAIG;AACI,KAAK,UAAU,oBAAoB,CACxC,OAAqC;IAErC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC5C,kCAAkC;IAClC,IAAI,WAAW,GAAsB,EAAE,CAAC;IACxC,IAAI,2CAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACzC,MAAM,EAAE,wBAAwB,EAAE,GAAG,2CACnC,sDAAsD,EACvD,CAAC;QACF,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;KAChD;SAAM,IAAI,2CAAoB,CAAC,MAAM,CAAC,EAAE;QACvC,MAAM,EAAE,sBAAsB,EAAE,GAAG,2CACjC,oDAAoD,EACrD,CAAC;QACF,WAAW,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;KACrE;SAAM,IAAI,6CAAqB,CAAC,MAAM,CAAC,EAAE;QACxC,MAAM,EAAE,qBAAqB,EAAE,GAAG,2CAChC,mDAAmD,EACpD,CAAC;QACF,WAAW,GAAG,qBAAqB,EAAE,CAAC;KACvC;IAED,kDAAkD;IAClD,MAAM,iBAAiB,GAAG,CAAC,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,GAAG,CAC9D,cAAc,CACf,CAAC;IAEF,mCAAmC;IACnC,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC;AAChD,CAAC;AA9BD,oDA8BC;AAED,SAAS,cAAc,CACrB,QAAgC;IAEhC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ,CAAC,IAAI;QACpB,GAAG,EAAE,QAAQ,CAAC,GAAG;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./build-existing-exports-portal-query"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./fetchDownloadFileUrl"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./fetchDownloadFormats"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./canUseCreateReplica"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./canUseHubDownloadApi"), exports);
|
|
5
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/downloads/index.ts"],"names":[],"mappings":";;;AAAA,gFAAsD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/downloads/index.ts"],"names":[],"mappings":";;;AAAA,gFAAsD;AACtD,kDAAwB;AACxB,iEAAuC;AACvC,iEAAuC;AACvC,gEAAsC;AACtC,iEAAuC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcgisHubDownloadError = exports.DownloadOperationStatus = exports.ServiceDownloadFormat = exports.PORTAL_EXPORT_TYPES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This hash map was defined to support the previous implementation of the export item flow.
|
|
6
|
+
* We are currently working on a new implementation that will replace this hash map, but we
|
|
7
|
+
* need to keep this around for now to support the existing implementation.
|
|
8
|
+
*/
|
|
9
|
+
exports.PORTAL_EXPORT_TYPES = {
|
|
10
|
+
csv: {
|
|
11
|
+
name: "CSV",
|
|
12
|
+
itemTypes: ["CSV", "CSV Collection"],
|
|
13
|
+
supportsProjection: true,
|
|
14
|
+
},
|
|
15
|
+
kml: {
|
|
16
|
+
name: "KML",
|
|
17
|
+
itemTypes: ["KML", "KML Collection"],
|
|
18
|
+
supportsProjection: false,
|
|
19
|
+
},
|
|
20
|
+
shapefile: {
|
|
21
|
+
name: "Shapefile",
|
|
22
|
+
itemTypes: ["Shapefile"],
|
|
23
|
+
supportsProjection: true,
|
|
24
|
+
},
|
|
25
|
+
fileGeodatabase: {
|
|
26
|
+
name: "File Geodatabase",
|
|
27
|
+
itemTypes: ["File Geodatabase"],
|
|
28
|
+
supportsProjection: true,
|
|
29
|
+
},
|
|
30
|
+
geojson: {
|
|
31
|
+
name: "GeoJson",
|
|
32
|
+
itemTypes: ["GeoJson"],
|
|
33
|
+
supportsProjection: false,
|
|
34
|
+
},
|
|
35
|
+
excel: {
|
|
36
|
+
name: "Excel",
|
|
37
|
+
itemTypes: ["Microsoft Excel"],
|
|
38
|
+
supportsProjection: true,
|
|
39
|
+
},
|
|
40
|
+
featureCollection: {
|
|
41
|
+
name: "Feature Collection",
|
|
42
|
+
itemTypes: ["Feature Collection"],
|
|
43
|
+
supportsProjection: true,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Comprehensive enum of all the download formats that are supported by service-backed items across the ArcGIS platform.
|
|
48
|
+
*/
|
|
49
|
+
var ServiceDownloadFormat;
|
|
50
|
+
(function (ServiceDownloadFormat) {
|
|
51
|
+
// Image Service Formats
|
|
52
|
+
ServiceDownloadFormat["BIP"] = "bip";
|
|
53
|
+
ServiceDownloadFormat["BMP"] = "bmp";
|
|
54
|
+
ServiceDownloadFormat["BSQ"] = "bsq";
|
|
55
|
+
ServiceDownloadFormat["GIF"] = "gif";
|
|
56
|
+
ServiceDownloadFormat["JPG"] = "jpg";
|
|
57
|
+
ServiceDownloadFormat["JPG_PNG"] = "jpgpng";
|
|
58
|
+
ServiceDownloadFormat["LERC"] = "lerc";
|
|
59
|
+
ServiceDownloadFormat["PNG"] = "png";
|
|
60
|
+
ServiceDownloadFormat["PNG8"] = "png8";
|
|
61
|
+
ServiceDownloadFormat["PNG24"] = "png24";
|
|
62
|
+
ServiceDownloadFormat["PNG32"] = "png32";
|
|
63
|
+
ServiceDownloadFormat["TIFF"] = "tiff";
|
|
64
|
+
// Map & Feature Service Formats
|
|
65
|
+
ServiceDownloadFormat["CSV"] = "csv";
|
|
66
|
+
ServiceDownloadFormat["EXCEL"] = "excel";
|
|
67
|
+
ServiceDownloadFormat["FEATURE_COLLECTION"] = "featureCollection";
|
|
68
|
+
ServiceDownloadFormat["FILE_GDB"] = "filegdb";
|
|
69
|
+
ServiceDownloadFormat["GEOJSON"] = "geojson";
|
|
70
|
+
ServiceDownloadFormat["GEO_PACKAGE"] = "geoPackage";
|
|
71
|
+
ServiceDownloadFormat["JSON"] = "json";
|
|
72
|
+
ServiceDownloadFormat["KML"] = "kml";
|
|
73
|
+
ServiceDownloadFormat["SHAPEFILE"] = "shapefile";
|
|
74
|
+
ServiceDownloadFormat["SQLITE"] = "sqlite";
|
|
75
|
+
})(ServiceDownloadFormat = exports.ServiceDownloadFormat || (exports.ServiceDownloadFormat = {}));
|
|
76
|
+
/**
|
|
77
|
+
* Human-readable status of a download operation. Operation specific statuses
|
|
78
|
+
* should be converted to one of these statuses before being reported to the user.
|
|
79
|
+
*/
|
|
80
|
+
var DownloadOperationStatus;
|
|
81
|
+
(function (DownloadOperationStatus) {
|
|
82
|
+
DownloadOperationStatus["PENDING"] = "pending";
|
|
83
|
+
DownloadOperationStatus["PROCESSING"] = "processing";
|
|
84
|
+
DownloadOperationStatus["CONVERTING"] = "converting";
|
|
85
|
+
DownloadOperationStatus["COMPLETED"] = "completed";
|
|
86
|
+
DownloadOperationStatus["FAILED"] = "failed";
|
|
87
|
+
})(DownloadOperationStatus = exports.DownloadOperationStatus || (exports.DownloadOperationStatus = {}));
|
|
88
|
+
/**
|
|
89
|
+
* Error class for reporting well-known download errors that occur during the download process.
|
|
90
|
+
*/
|
|
91
|
+
class ArcgisHubDownloadError extends Error {
|
|
92
|
+
constructor(options) {
|
|
93
|
+
super(options.rawMessage);
|
|
94
|
+
this.name = "ArcgisHubDownloadError";
|
|
95
|
+
this.message = options.rawMessage;
|
|
96
|
+
this.messageId = options.messageId;
|
|
97
|
+
this.operation = options.operation;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.ArcgisHubDownloadError = ArcgisHubDownloadError;
|
|
101
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/downloads/types.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACU,QAAA,mBAAmB,GAAG;IACjC,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC;QACpC,kBAAkB,EAAE,IAAI;KACzB;IACD,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC;QACpC,kBAAkB,EAAE,KAAK;KAC1B;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,CAAC,WAAW,CAAC;QACxB,kBAAkB,EAAE,IAAI;KACzB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC,kBAAkB,CAAC;QAC/B,kBAAkB,EAAE,IAAI;KACzB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,CAAC,SAAS,CAAC;QACtB,kBAAkB,EAAE,KAAK;KAC1B;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,CAAC,iBAAiB,CAAC;QAC9B,kBAAkB,EAAE,IAAI;KACzB;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,CAAC,oBAAoB,CAAC;QACjC,kBAAkB,EAAE,IAAI;KACzB;CAOF,CAAC;AAKF;;GAEG;AACH,IAAY,qBA0BX;AA1BD,WAAY,qBAAqB;IAC/B,wBAAwB;IACxB,oCAAW,CAAA;IACX,oCAAW,CAAA;IACX,oCAAW,CAAA;IACX,oCAAW,CAAA;IACX,oCAAW,CAAA;IACX,2CAAkB,CAAA;IAClB,sCAAa,CAAA;IACb,oCAAW,CAAA;IACX,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,wCAAe,CAAA;IACf,sCAAa,CAAA;IAEb,gCAAgC;IAChC,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,iEAAwC,CAAA;IACxC,6CAAoB,CAAA;IACpB,4CAAmB,CAAA;IACnB,mDAA0B,CAAA;IAC1B,sCAAa,CAAA;IACb,oCAAW,CAAA;IACX,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;AACnB,CAAC,EA1BW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QA0BhC;AAqDD;;;GAGG;AACH,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,8CAAmB,CAAA;IACnB,oDAAyB,CAAA;IACzB,oDAAyB,CAAA;IACzB,kDAAuB,CAAA;IACvB,4CAAiB,CAAA;AACnB,CAAC,EANW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAMlC;AAoBD;;GAEG;AACH,MAAa,sBAAuB,SAAQ,KAAK;IAK/C,YAAY,OAAuC;QACjD,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACrC,CAAC;CACF;AAZD,wDAYC"}
|
|
@@ -8,7 +8,7 @@ export declare const ContentDefaultFeatures: IFeatureFlags;
|
|
|
8
8
|
* These define the requirements any user must meet to perform related actions
|
|
9
9
|
* @private
|
|
10
10
|
*/
|
|
11
|
-
export declare const ContentPermissions: readonly ["hub:content:create", "hub:content:delete", "hub:content:edit", "hub:content:view", "hub:content:canChangeAccess", "hub:content:workspace", "hub:content:workspace:overview", "hub:content:workspace:dashboard", "hub:content:workspace:details", "hub:content:workspace:discussion", "hub:content:workspace:settings", "hub:content:workspace:settings:schedule", "hub:content:workspace:collaborators", "hub:content:manage", "hub:content:canRecordDownloadErrors", "hub:content:downloads:displayErrors"];
|
|
11
|
+
export declare const ContentPermissions: readonly ["hub:content:create", "hub:content:delete", "hub:content:edit", "hub:content:view", "hub:content:canChangeAccess", "hub:content:workspace", "hub:content:workspace:overview", "hub:content:workspace:dashboard", "hub:content:workspace:details", "hub:content:workspace:discussion", "hub:content:workspace:settings", "hub:content:workspace:settings:schedule", "hub:content:workspace:collaborators", "hub:content:manage", "hub:content:canRecordDownloadErrors", "hub:content:downloads:displayErrors", "temp:hub:content:downloads:unifiedList"];
|
|
12
12
|
/**
|
|
13
13
|
* Content permission policies
|
|
14
14
|
* No need to specify license for permissions that are available to all licenses
|
|
@@ -53,6 +53,13 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
|
|
|
53
53
|
publisher?: {
|
|
54
54
|
name?: string;
|
|
55
55
|
username?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Derives proper IHubLocation given an ArcGIS Item. If no
|
|
58
|
+
* location (item.properties.location) is present, one will be
|
|
59
|
+
* constructed from the item's extent.
|
|
60
|
+
* @param item ArcGIS Item
|
|
61
|
+
* @returns IHubLocation
|
|
62
|
+
*/
|
|
56
63
|
nameSource: PublisherSource;
|
|
57
64
|
organization?: string;
|
|
58
65
|
orgId?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IWithPermissions, IWithSlug } from "../traits/index";
|
|
2
|
+
import { IHubAdditionalResource } from "./IHubAdditionalResource";
|
|
2
3
|
import { IHubItemEntity, IHubItemEntityEditor } from "./IHubItemEntity";
|
|
3
4
|
import { IHubSchedule } from "./IHubSchedule";
|
|
4
5
|
/**
|
|
@@ -15,6 +16,15 @@ export interface IHubEditableContent extends IHubItemEntity, IWithSlug, IWithPer
|
|
|
15
16
|
* capability enabled. This is a pre-requisite for Hosted Downloads to work.
|
|
16
17
|
*/
|
|
17
18
|
serverExtractCapability?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If the item represents a hosted feature service with "Extract enabled", shows the formats that
|
|
21
|
+
* can be extracted from the service via the "createReplica" operation.
|
|
22
|
+
*/
|
|
23
|
+
serverExtractFormats?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* links to additional resources specified in the formal item metadata
|
|
26
|
+
*/
|
|
27
|
+
additionalResources?: IHubAdditionalResource[];
|
|
18
28
|
/**
|
|
19
29
|
* The schedule at which the reharvest of the item will occur
|
|
20
30
|
*/
|
|
@@ -8,7 +8,7 @@ export declare type SystemStatus = "online" | "offline" | "maintenance" | "not-a
|
|
|
8
8
|
export declare type HubServiceStatus = {
|
|
9
9
|
[key in HubService]: SystemStatus;
|
|
10
10
|
};
|
|
11
|
-
declare const validServices: readonly ["portal", "discussions", "events", "metrics", "notifications", "hub-search", "domains"];
|
|
11
|
+
declare const validServices: readonly ["portal", "discussions", "events", "metrics", "notifications", "hub-search", "domains", "hub-downloads"];
|
|
12
12
|
export declare type HubService = (typeof validServices)[number];
|
|
13
13
|
/**
|
|
14
14
|
* Validate a Service
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ServiceDownloadFormat } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Formats supported by the /export endpoint of the Portal API.
|
|
4
|
+
*/
|
|
5
|
+
export declare const EXPORT_ITEM_FORMATS: readonly [ServiceDownloadFormat.CSV, ServiceDownloadFormat.KML, ServiceDownloadFormat.SHAPEFILE, ServiceDownloadFormat.FILE_GDB, ServiceDownloadFormat.GEOJSON, ServiceDownloadFormat.EXCEL, ServiceDownloadFormat.FEATURE_COLLECTION];
|
|
6
|
+
export declare type ExportItemFormat = (typeof EXPORT_ITEM_FORMATS)[number];
|
|
7
|
+
/**
|
|
8
|
+
* Formats supported by the /exportImage endpoint of Image Services.
|
|
9
|
+
*/
|
|
10
|
+
export declare const EXPORT_IMAGE_FORMATS: readonly [ServiceDownloadFormat.BIP, ServiceDownloadFormat.BMP, ServiceDownloadFormat.BSQ, ServiceDownloadFormat.GIF, ServiceDownloadFormat.JPG, ServiceDownloadFormat.JPG_PNG, ServiceDownloadFormat.LERC, ServiceDownloadFormat.PNG, ServiceDownloadFormat.PNG24, ServiceDownloadFormat.PNG32, ServiceDownloadFormat.PNG8, ServiceDownloadFormat.TIFF];
|
|
11
|
+
export declare type ExportImageFormat = (typeof EXPORT_IMAGE_FORMATS)[number];
|
|
12
|
+
/**
|
|
13
|
+
* Formats supported by the paging operation endpoint of the Hub Download API.
|
|
14
|
+
*/
|
|
15
|
+
export declare const HUB_PAGING_JOB_FORMATS: readonly [ServiceDownloadFormat.CSV, ServiceDownloadFormat.GEOJSON, ServiceDownloadFormat.KML, ServiceDownloadFormat.SHAPEFILE];
|
|
16
|
+
export declare type HubPagingJobFormat = (typeof HUB_PAGING_JOB_FORMATS)[number];
|
|
17
|
+
/**
|
|
18
|
+
* Known formats supported by the /createReplica endpoint of the Hub Download API.
|
|
19
|
+
* NOTE: this is may be incomplete and should be updated as needed.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CREATE_REPLICA_FORMATS: readonly [ServiceDownloadFormat.CSV, ServiceDownloadFormat.EXCEL, ServiceDownloadFormat.FEATURE_COLLECTION, ServiceDownloadFormat.FILE_GDB, ServiceDownloadFormat.GEOJSON, ServiceDownloadFormat.GEO_PACKAGE, ServiceDownloadFormat.JSON, ServiceDownloadFormat.SHAPEFILE, ServiceDownloadFormat.SQLITE];
|
|
22
|
+
export declare type CreateReplicaFormat = (typeof CREATE_REPLICA_FORMATS)[number];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* Determines if the current user can create an export item for the given entity.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This function is a placeholder. Various permissions and logic branches are not yet implemented.
|
|
8
|
+
*
|
|
9
|
+
* @param _entity
|
|
10
|
+
* @param _context
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function canCreateExportItem(_entity: IHubEditableContent, _context: IArcGISContext): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Determines if the export image flow can be used for the given entity.
|
|
5
|
+
* @param entity entity to check if export image flow can be used
|
|
6
|
+
* @returns whether the export image flow can be used
|
|
7
|
+
*/
|
|
8
|
+
export declare function canUseExportImageFlow(entity: IHubEditableContent): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Determines if the export item flow can be used for the given entity.
|
|
5
|
+
* @param entity entity to check if export item flow can be used
|
|
6
|
+
* @returns whether the export item flow can be used
|
|
7
|
+
*/
|
|
8
|
+
export declare function canUseExportItemFlow(entity: IHubEditableContent): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IFetchDownloadFileUrlOptions } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Fetches a download file url from an Image Service via the exportImage endpoint
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This function is incomplete and needs various parameters to be validated
|
|
7
|
+
* and implemented. It is a work in progress.
|
|
8
|
+
*
|
|
9
|
+
* @param options options for refining / filtering the resulting download file
|
|
10
|
+
* @returns a url to download the file
|
|
11
|
+
*/
|
|
12
|
+
export declare function fetchExportImageDownloadFileUrl(options: IFetchDownloadFileUrlOptions): Promise<string>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IFetchDownloadFileUrlOptions } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Fetches a download file url the Portal API via the item /export endpoint.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This function is incomplete and various permissions / branching paths need to be
|
|
7
|
+
* validated and implemented. It is a work in progress.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
10
|
+
* by calling the service's /createReplica endpoint directly in the future (i.e., once the Enterprise
|
|
11
|
+
* team achieves feature parity with the Online team's implementation).
|
|
12
|
+
*
|
|
13
|
+
* This is because The item /export endpoint can only be used on Hosted Feature Services
|
|
14
|
+
* with the "Extract" capability enabled, which means the service will also have the /createReplica
|
|
15
|
+
* endpoint available. As /createReplica is a more flexible operation, /export becomes obsolete.
|
|
16
|
+
*
|
|
17
|
+
* @param options options for refining / filtering the resulting download file
|
|
18
|
+
* @returns a url to download the file
|
|
19
|
+
*/
|
|
20
|
+
export declare function fetchExportItemDownloadFileUrl(options: IFetchDownloadFileUrlOptions): Promise<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IFetchDownloadFileUrlOptions } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Fetches a download file url from the Hub Download API
|
|
5
|
+
*
|
|
6
|
+
* NOTE: The Hub Download API only works with a certain subset of Feature and Map services
|
|
7
|
+
* and performs different operations (i.e., calling createReplica or paging the service's
|
|
8
|
+
* features) depending on the service type and capabilities.
|
|
9
|
+
*
|
|
10
|
+
* This function does it's best to abstract those differences and provide a consistent
|
|
11
|
+
* interface for downloading data from any service supported by the Hub Download API.
|
|
12
|
+
*
|
|
13
|
+
* @param options options for refining / filtering the resulting download file
|
|
14
|
+
* @returns a url to download the file
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchHubApiDownloadFileUrl(options: IFetchDownloadFileUrlOptions): Promise<string>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IStaticDownloadFormat } from "../../types";
|
|
2
|
+
import { IHubEditableContent } from "../../../core/types/IHubEditableContent";
|
|
3
|
+
import { IArcGISContext } from "../../../ArcGISContext";
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* Fetches an entity's available download formats that were previously created by the Portal API's item /export
|
|
7
|
+
* endpoint. This is useful for anonymous enterprise users who need to download data from a Hosted Feature Service,
|
|
8
|
+
* but do not have the privileges to create their own item export. As the exports have been previously created, they
|
|
9
|
+
* can be downloaded statically by anyone with the URL.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
14
|
+
* with using the formats defined the service's /createReplica endpoint directly in the future (i.e.,
|
|
15
|
+
* once the Enterprise team achieves feature parity with the Online team's implementation).
|
|
16
|
+
*
|
|
17
|
+
* This is because The item /export endpoint can only be used on Hosted Feature Services with the "Extract" capability
|
|
18
|
+
* enabled, which means the service will also have the /createReplica endpoint available. As /createReplica is a more
|
|
19
|
+
* flexible operation that can be invoked by anonymous users, /export becomes obsolete.
|
|
20
|
+
*
|
|
21
|
+
* @param entity Hosted Feature Service entity to fetch download formats for
|
|
22
|
+
* @param context ArcGIS application context
|
|
23
|
+
* @param layers target layers that the download will be filtered to
|
|
24
|
+
* @returns available download formats for the entity
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchAvailableExportItemFormats(entity: IHubEditableContent, context: IArcGISContext, layers: number[]): Promise<IStaticDownloadFormat[]>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../../ArcGISContext";
|
|
2
|
+
import { IHubEditableContent } from "../../../core/types/IHubEditableContent";
|
|
3
|
+
import { IDownloadFormat } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* Fetches an entity's available download formats. Owners of the entity can create all formats supported by
|
|
7
|
+
* the Portal API's item /export endpoint, while users that don't have privileges to the item /export endpoint
|
|
8
|
+
* can only download formats that were previously exported by the entity's owner.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
13
|
+
* with using the formats defined the service's /createReplica endpoint directly in the future (i.e.,
|
|
14
|
+
* once the Enterprise team achieves feature parity with the Online team's implementation).
|
|
15
|
+
*
|
|
16
|
+
* This is because The item /export endpoint can only be used on Hosted Feature Services with the "Extract" capability
|
|
17
|
+
* enabled, which means the service will also have the /createReplica endpoint available. As /createReplica is a more
|
|
18
|
+
* flexible operation that can be invoked by anonymous users, /export becomes obsolete.
|
|
19
|
+
*
|
|
20
|
+
* @param entity Hosted Feature Service entity to fetch download formats for
|
|
21
|
+
* @param context ArcGIS application context
|
|
22
|
+
* @param layers target layers that the download will be filtered to
|
|
23
|
+
* @returns available download formats for the entity
|
|
24
|
+
*/
|
|
25
|
+
export declare function fetchExportItemFormats(_entity: IHubEditableContent, _context: IArcGISContext, _layers?: number[]): Promise<IDownloadFormat[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IHubEditableContent } from "../../../core/types/IHubEditableContent";
|
|
2
|
+
import { IDynamicDownloadFormat } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* Returns all the download formats that are defined by the service's /createReplica endpoint.
|
|
6
|
+
*
|
|
7
|
+
* @param entity Hosted Feature Service entity to return download formats for
|
|
8
|
+
* @returns available download formats for the entity
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCreateReplicaFormats(entity: IHubEditableContent): IDynamicDownloadFormat[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IDynamicDownloadFormat } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Returns all the download formats that are exposed by Image Services via the /exportImage operation.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getExportImageFormats(): IDynamicDownloadFormat[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IDynamicDownloadFormat } from "../../types";
|
|
2
|
+
import { IHubEditableContent } from "../../../core/types/IHubEditableContent";
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* Returns all the formats that are available for download via the Hub Download API for a given entity.
|
|
6
|
+
* Formats will vary from entity to entity depending on actual operation that the Hub Download API will
|
|
7
|
+
* perform under the hood (e.g., hitting /createReplica or paging through the service's features).
|
|
8
|
+
*
|
|
9
|
+
* @param entity Service entity to return download formats for
|
|
10
|
+
* @returns available download formats for the entity
|
|
11
|
+
*/
|
|
12
|
+
export declare function getHubDownloadApiFormats(entity: IHubEditableContent): IDynamicDownloadFormat[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IDynamicDownloadFormat } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Returns all the download formats that are available for the Hub Download API's paging job operation.
|
|
5
|
+
* @returns available download formats for the paging job operation
|
|
6
|
+
*/
|
|
7
|
+
export declare function getPagingJobFormats(): IDynamicDownloadFormat[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IArcGISContext } from "../../ArcGISContext";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Generates a URL to download the data of an export item.
|
|
5
|
+
* @param exportItemId ID of the export item
|
|
6
|
+
* @param context ArcGIS application context
|
|
7
|
+
* @returns URL to download the data of the export item
|
|
8
|
+
*/
|
|
9
|
+
export declare function getExportItemDataUrl(exportItemId: string, context: IArcGISContext): string;
|
|
@@ -1,42 +1,5 @@
|
|
|
1
1
|
import { ISpatialReference } from "@esri/arcgis-rest-types";
|
|
2
2
|
export declare const WGS84_WKID = "4326";
|
|
3
|
-
export declare const PORTAL_EXPORT_TYPES: {
|
|
4
|
-
csv: {
|
|
5
|
-
name: string;
|
|
6
|
-
itemTypes: string[];
|
|
7
|
-
supportsProjection: boolean;
|
|
8
|
-
};
|
|
9
|
-
kml: {
|
|
10
|
-
name: string;
|
|
11
|
-
itemTypes: string[];
|
|
12
|
-
supportsProjection: boolean;
|
|
13
|
-
};
|
|
14
|
-
shapefile: {
|
|
15
|
-
name: string;
|
|
16
|
-
itemTypes: string[];
|
|
17
|
-
supportsProjection: boolean;
|
|
18
|
-
};
|
|
19
|
-
fileGeodatabase: {
|
|
20
|
-
name: string;
|
|
21
|
-
itemTypes: string[];
|
|
22
|
-
supportsProjection: boolean;
|
|
23
|
-
};
|
|
24
|
-
geojson: {
|
|
25
|
-
name: string;
|
|
26
|
-
itemTypes: string[];
|
|
27
|
-
supportsProjection: boolean;
|
|
28
|
-
};
|
|
29
|
-
excel: {
|
|
30
|
-
name: string;
|
|
31
|
-
itemTypes: string[];
|
|
32
|
-
supportsProjection: boolean;
|
|
33
|
-
};
|
|
34
|
-
featureCollection: {
|
|
35
|
-
name: string;
|
|
36
|
-
itemTypes: string[];
|
|
37
|
-
supportsProjection: boolean;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
3
|
interface IExistingExportsPortalQueryOptions {
|
|
41
4
|
layerId?: number | string;
|
|
42
5
|
onlyTypes?: string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IHubEditableContent } from "../core/types/IHubEditableContent";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether Hub can perform the /createReplica operation on a given service entity.
|
|
4
|
+
* @param entity entity to check
|
|
5
|
+
* @returns whether the /createReplica operation can be used
|
|
6
|
+
*/
|
|
7
|
+
export declare function canUseCreateReplica(entity: IHubEditableContent): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IArcGISContext } from "../ArcGISContext";
|
|
2
|
+
import { IHubEditableContent } from "../core/types/IHubEditableContent";
|
|
3
|
+
/**
|
|
4
|
+
* Determines if the Hub Download API can be used for the given entity.
|
|
5
|
+
* @param entity entity to check if Hub Download API can be used
|
|
6
|
+
* @param context ArcGIS context
|
|
7
|
+
* @returns whether the Hub Download API can be used
|
|
8
|
+
*/
|
|
9
|
+
export declare function canUseHubDownloadApi(entity: IHubEditableContent, context: IArcGISContext): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IFetchDownloadFileUrlOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches a download file URL for the given entity and format.
|
|
4
|
+
* @param options options to refine / filter the results of the fetchDownloadFileUrl operation
|
|
5
|
+
* @returns a promise that resolves with the download file URL
|
|
6
|
+
* @throws {ArcgisHubDownloadError} if the download file URL cannot be fetched for a well-known reason
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchDownloadFileUrl(options: IFetchDownloadFileUrlOptions): Promise<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IDownloadFormat, IFetchDownloadFormatsOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
|
|
4
|
+
* @param options options to refine / filter the results of the fetchDownloadFormats operation
|
|
5
|
+
* @returns a promise that resolves with the download formats
|
|
6
|
+
*/
|
|
7
|
+
export declare function fetchDownloadFormats(options: IFetchDownloadFormatsOptions): Promise<IDownloadFormat[]>;
|