@esri/hub-common 14.168.0 → 14.168.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/downloads/_internal/_types.js +0 -12
- package/dist/esm/downloads/_internal/_types.js.map +1 -1
- package/dist/esm/downloads/fetchDownloadFile.js +0 -4
- package/dist/esm/downloads/fetchDownloadFile.js.map +1 -1
- package/dist/esm/downloads/fetchDownloadFormats.js +0 -5
- package/dist/esm/downloads/fetchDownloadFormats.js.map +1 -1
- package/dist/node/downloads/_internal/_types.js +1 -13
- package/dist/node/downloads/_internal/_types.js.map +1 -1
- package/dist/node/downloads/fetchDownloadFile.js +0 -4
- package/dist/node/downloads/fetchDownloadFile.js.map +1 -1
- package/dist/node/downloads/fetchDownloadFormats.js +0 -5
- package/dist/node/downloads/fetchDownloadFormats.js.map +1 -1
- package/dist/types/downloads/_internal/_types.d.ts +0 -5
- package/package.json +2 -1
- package/dist/esm/downloads/_internal/canCreateExportItem.js +0 -15
- package/dist/esm/downloads/_internal/canCreateExportItem.js.map +0 -1
- package/dist/esm/downloads/_internal/canUseExportItemFlow.js +0 -11
- package/dist/esm/downloads/_internal/canUseExportItemFlow.js.map +0 -1
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js +0 -82
- package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js.map +0 -1
- package/dist/esm/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js +0 -56
- package/dist/esm/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js.map +0 -1
- package/dist/esm/downloads/_internal/format-fetchers/fetchExportItemFormats.js +0 -28
- package/dist/esm/downloads/_internal/format-fetchers/fetchExportItemFormats.js.map +0 -1
- package/dist/esm/downloads/_internal/format-fetchers/getAllExportItemFormats.js +0 -12
- package/dist/esm/downloads/_internal/format-fetchers/getAllExportItemFormats.js.map +0 -1
- package/dist/node/downloads/_internal/canCreateExportItem.js +0 -19
- package/dist/node/downloads/_internal/canCreateExportItem.js.map +0 -1
- package/dist/node/downloads/_internal/canUseExportItemFlow.js +0 -15
- package/dist/node/downloads/_internal/canUseExportItemFlow.js.map +0 -1
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js +0 -86
- package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js.map +0 -1
- package/dist/node/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js +0 -60
- package/dist/node/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js.map +0 -1
- package/dist/node/downloads/_internal/format-fetchers/fetchExportItemFormats.js +0 -32
- package/dist/node/downloads/_internal/format-fetchers/fetchExportItemFormats.js.map +0 -1
- package/dist/node/downloads/_internal/format-fetchers/getAllExportItemFormats.js +0 -16
- package/dist/node/downloads/_internal/format-fetchers/getAllExportItemFormats.js.map +0 -1
- package/dist/types/downloads/_internal/canCreateExportItem.d.ts +0 -13
- package/dist/types/downloads/_internal/canUseExportItemFlow.d.ts +0 -8
- package/dist/types/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.d.ts +0 -20
- package/dist/types/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.d.ts +0 -26
- package/dist/types/downloads/_internal/format-fetchers/fetchExportItemFormats.d.ts +0 -25
- package/dist/types/downloads/_internal/format-fetchers/getAllExportItemFormats.d.ts +0 -6
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { ServiceDownloadFormat } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Formats supported by the /export endpoint of the Portal API.
|
|
4
|
-
*/
|
|
5
|
-
export const EXPORT_ITEM_FORMATS = [
|
|
6
|
-
ServiceDownloadFormat.CSV,
|
|
7
|
-
ServiceDownloadFormat.KML,
|
|
8
|
-
ServiceDownloadFormat.SHAPEFILE,
|
|
9
|
-
ServiceDownloadFormat.FILE_GDB,
|
|
10
|
-
ServiceDownloadFormat.GEOJSON,
|
|
11
|
-
ServiceDownloadFormat.EXCEL,
|
|
12
|
-
ServiceDownloadFormat.FEATURE_COLLECTION,
|
|
13
|
-
];
|
|
14
2
|
/**
|
|
15
3
|
* Formats supported by the /exportImage endpoint of Image Services.
|
|
16
4
|
* Listed in the default order of appearance in the UI.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,4EAA4E;IAC5E,mFAAmF;IACnF,8BAA8B;IAE9B,qBAAqB,CAAC,GAAG;IACzB,qBAAqB,CAAC,GAAG;IACzB,qBAAqB,CAAC,IAAI;IAC1B,qBAAqB,CAAC,KAAK;IAC3B,qBAAqB,CAAC,KAAK;CAWnB,CAAC;AAGX;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,qBAAqB,CAAC,GAAG;IACzB,qBAAqB,CAAC,SAAS;IAC/B,qBAAqB,CAAC,OAAO;IAC7B,qBAAqB,CAAC,GAAG;CACjB,CAAC;AAGX;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,qBAAqB,CAAC,GAAG;IACzB,qBAAqB,CAAC,SAAS;IAC/B,qBAAqB,CAAC,OAAO;IAC7B,qBAAqB,CAAC,GAAG;IACzB,qBAAqB,CAAC,QAAQ;IAC9B,qBAAqB,CAAC,kBAAkB;IACxC,qBAAqB,CAAC,KAAK;IAC3B,qBAAqB,CAAC,WAAW;IACjC,qBAAqB,CAAC,MAAM;IAC5B,qBAAqB,CAAC,IAAI;CAClB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import HubError from "../HubError";
|
|
2
2
|
import { canUseExportImageFlow } from "./_internal/canUseExportImageFlow";
|
|
3
|
-
import { canUseExportItemFlow } from "./_internal/canUseExportItemFlow";
|
|
4
3
|
import { canUseHubDownloadApi } from "./canUseHubDownloadApi";
|
|
5
4
|
/**
|
|
6
5
|
* Fetches a download file URL for the given entity and format.
|
|
@@ -15,9 +14,6 @@ export async function fetchDownloadFile(options) {
|
|
|
15
14
|
if (canUseHubDownloadApi(withPollInterval.entity, withPollInterval.context)) {
|
|
16
15
|
fetchingFn = (await import("./_internal/file-url-fetchers/fetchHubApiDownloadFile")).fetchHubApiDownloadFile;
|
|
17
16
|
}
|
|
18
|
-
else if (canUseExportItemFlow(withPollInterval.entity)) {
|
|
19
|
-
fetchingFn = (await import("./_internal/file-url-fetchers/fetchExportItemDownloadFile")).fetchExportItemDownloadFile;
|
|
20
|
-
}
|
|
21
17
|
else if (canUseExportImageFlow(withPollInterval.entity)) {
|
|
22
18
|
fetchingFn = (await import("./_internal/file-url-fetchers/fetchExportImageDownloadFile")).fetchExportImageDownloadFile;
|
|
23
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAkC;IAElC,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,oBAAoB,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE;QAC3E,UAAU,GAAG,CACX,MAAM,MAAM,CAAC,uDAAuD,CAAC,CACtE,CAAC,uBAAuB,CAAC;KAC3B;SAAM,IAAI,qBAAqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzD,UAAU,GAAG,CACX,MAAM,MAAM,CAAC,4DAA4D,CAAC,CAC3E,CAAC,4BAA4B,CAAC;KAChC;SAAM;QACL,MAAM,IAAI,QAAQ,CAChB,mBAAmB,EACnB,+DAA+D,CAChE,CAAC;KACH;IACD,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { canUseExportImageFlow } from "./_internal/canUseExportImageFlow";
|
|
2
|
-
import { canUseExportItemFlow } from "./_internal/canUseExportItemFlow";
|
|
3
2
|
import { canUseHubDownloadApi } from "./canUseHubDownloadApi";
|
|
4
3
|
/**
|
|
5
4
|
* Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
|
|
@@ -14,10 +13,6 @@ export async function fetchDownloadFormats(options) {
|
|
|
14
13
|
const { getHubDownloadApiFormats } = await import("./getHubDownloadApiFormats");
|
|
15
14
|
baseFormats = getHubDownloadApiFormats(entity);
|
|
16
15
|
}
|
|
17
|
-
else if (canUseExportItemFlow(entity)) {
|
|
18
|
-
const { fetchExportItemFormats } = await import("./_internal/format-fetchers/fetchExportItemFormats");
|
|
19
|
-
baseFormats = await fetchExportItemFormats(entity, context, layers);
|
|
20
|
-
}
|
|
21
16
|
else if (canUseExportImageFlow(entity)) {
|
|
22
17
|
const { getExportImageFormats } = await import("./_internal/format-fetchers/getExportImageFormats");
|
|
23
18
|
baseFormats = getExportImageFormats(entity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D;;;;GAIG;AACH,MAAM,CAAC,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,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACzC,MAAM,EAAE,wBAAwB,EAAE,GAAG,MAAM,MAAM,CAC/C,4BAA4B,CAC7B,CAAC;QACF,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;KAChD;SAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE;QACxC,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAC5C,mDAAmD,CACpD,CAAC;QACF,WAAW,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;KAC7C;IAED,kDAAkD;IAClD,0DAA0D;IAC1D,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;AAED,SAAS,cAAc,CACrB,QAAgC;IAEhC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EACH,QAAQ,CAAC,IAAI;YACb,CAAC,QAAQ,CAAC,YAAY,IAAI,0BAA0B,CAAC,IAAI,+CAA+C;YACxG,uBAAuB;QACzB,GAAG,EAAE,QAAQ,CAAC,GAAG;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CREATE_REPLICA_FORMATS = exports.HUB_PAGING_JOB_FORMATS = exports.EXPORT_IMAGE_FORMATS =
|
|
3
|
+
exports.CREATE_REPLICA_FORMATS = exports.HUB_PAGING_JOB_FORMATS = exports.EXPORT_IMAGE_FORMATS = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
|
-
/**
|
|
6
|
-
* Formats supported by the /export endpoint of the Portal API.
|
|
7
|
-
*/
|
|
8
|
-
exports.EXPORT_ITEM_FORMATS = [
|
|
9
|
-
types_1.ServiceDownloadFormat.CSV,
|
|
10
|
-
types_1.ServiceDownloadFormat.KML,
|
|
11
|
-
types_1.ServiceDownloadFormat.SHAPEFILE,
|
|
12
|
-
types_1.ServiceDownloadFormat.FILE_GDB,
|
|
13
|
-
types_1.ServiceDownloadFormat.GEOJSON,
|
|
14
|
-
types_1.ServiceDownloadFormat.EXCEL,
|
|
15
|
-
types_1.ServiceDownloadFormat.FEATURE_COLLECTION,
|
|
16
|
-
];
|
|
17
5
|
/**
|
|
18
6
|
* Formats supported by the /exportImage endpoint of Image Services.
|
|
19
7
|
* Listed in the default order of appearance in the UI.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":";;;AAAA,oCAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":";;;AAAA,oCAAiD;AAEjD;;;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,GAAG;IACzB,6BAAqB,CAAC,QAAQ;IAC9B,6BAAqB,CAAC,kBAAkB;IACxC,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,WAAW;IACjC,6BAAqB,CAAC,MAAM;IAC5B,6BAAqB,CAAC,IAAI;CAClB,CAAC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchDownloadFile = void 0;
|
|
4
4
|
const HubError_1 = require("../HubError");
|
|
5
5
|
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
6
|
-
const canUseExportItemFlow_1 = require("./_internal/canUseExportItemFlow");
|
|
7
6
|
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
8
7
|
/**
|
|
9
8
|
* Fetches a download file URL for the given entity and format.
|
|
@@ -18,9 +17,6 @@ async function fetchDownloadFile(options) {
|
|
|
18
17
|
if (canUseHubDownloadApi_1.canUseHubDownloadApi(withPollInterval.entity, withPollInterval.context)) {
|
|
19
18
|
fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchHubApiDownloadFile"))).fetchHubApiDownloadFile;
|
|
20
19
|
}
|
|
21
|
-
else if (canUseExportItemFlow_1.canUseExportItemFlow(withPollInterval.entity)) {
|
|
22
|
-
fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportItemDownloadFile"))).fetchExportItemDownloadFile;
|
|
23
|
-
}
|
|
24
20
|
else if (canUseExportImageFlow_1.canUseExportImageFlow(withPollInterval.entity)) {
|
|
25
21
|
fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportImageDownloadFile"))).fetchExportImageDownloadFile;
|
|
26
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,6EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,6EAA0E;AAC1E,iEAA8D;AAG9D;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CACrC,OAAkC;IAElC,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,uDAAuD,EAAC,CACtE,CAAC,uBAAuB,CAAC;KAC3B;SAAM,IAAI,6CAAqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACzD,UAAU,GAAG,CACX,2CAAa,4DAA4D,EAAC,CAC3E,CAAC,4BAA4B,CAAC;KAChC;SAAM;QACL,MAAM,IAAI,kBAAQ,CAChB,mBAAmB,EACnB,+DAA+D,CAChE,CAAC;KACH;IACD,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC;AAvBD,8CAuBC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchDownloadFormats = void 0;
|
|
4
4
|
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
5
|
-
const canUseExportItemFlow_1 = require("./_internal/canUseExportItemFlow");
|
|
6
5
|
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
7
6
|
/**
|
|
8
7
|
* Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
|
|
@@ -17,10 +16,6 @@ async function fetchDownloadFormats(options) {
|
|
|
17
16
|
const { getHubDownloadApiFormats } = await Promise.resolve().then(() => require("./getHubDownloadApiFormats"));
|
|
18
17
|
baseFormats = getHubDownloadApiFormats(entity);
|
|
19
18
|
}
|
|
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
19
|
else if (canUseExportImageFlow_1.canUseExportImageFlow(entity)) {
|
|
25
20
|
const { getExportImageFormats } = await Promise.resolve().then(() => require("./_internal/format-fetchers/getExportImageFormats"));
|
|
26
21
|
baseFormats = getExportImageFormats(entity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAC1E,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,4BAA4B,EAC7B,CAAC;QACF,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;KAChD;SAAM,IAAI,6CAAqB,CAAC,MAAM,CAAC,EAAE;QACxC,MAAM,EAAE,qBAAqB,EAAE,GAAG,2CAChC,mDAAmD,EACpD,CAAC;QACF,WAAW,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;KAC7C;IAED,kDAAkD;IAClD,0DAA0D;IAC1D,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;AA1BD,oDA0BC;AAED,SAAS,cAAc,CACrB,QAAgC;IAEhC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EACH,QAAQ,CAAC,IAAI;YACb,CAAC,QAAQ,CAAC,YAAY,IAAI,0BAA0B,CAAC,IAAI,+CAA+C;YACxG,uBAAuB;QACzB,GAAG,EAAE,QAAQ,CAAC,GAAG;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
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
2
|
/**
|
|
8
3
|
* Formats supported by the /exportImage endpoint of Image Services.
|
|
9
4
|
* Listed in the default order of appearance in the UI.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/hub-common",
|
|
3
|
-
"version": "14.168.
|
|
3
|
+
"version": "14.168.2",
|
|
4
4
|
"description": "Common TypeScript types and utility functions for @esri/hub.js.",
|
|
5
5
|
"main": "dist/node/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@terraformer/arcgis": "^2.1.2",
|
|
16
|
+
"@types/arcgis-js-api": "~4.28.0",
|
|
16
17
|
"abab": "^2.0.5",
|
|
17
18
|
"adlib": "^3.0.8",
|
|
18
19
|
"ajv": "^6.12.6",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
* Determines if the current user can create an export item for the given entity.
|
|
4
|
-
*
|
|
5
|
-
* NOTE: This function is a placeholder. Various permissions and logic branches are not yet implemented.
|
|
6
|
-
*
|
|
7
|
-
* @param _entity
|
|
8
|
-
* @param _context
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export function canCreateExportItem(_entity, _context) {
|
|
12
|
-
// TODO: port over logic from the download-service
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=canCreateExportItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canCreateExportItem.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canCreateExportItem.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA4B,EAC5B,QAAwB;IAExB,kDAAkD;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isHostedFeatureServiceMainEntity } from "../../content/hostedServiceUtils";
|
|
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 function canUseExportItemFlow(entity) {
|
|
9
|
-
return isHostedFeatureServiceMainEntity(entity);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=canUseExportItemFlow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canUseExportItemFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canUseExportItemFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAGpF;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA2B;IAC9D,OAAO,gCAAgC,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { exportItem, getItemStatus, } from "@esri/arcgis-rest-portal";
|
|
2
|
-
import { DownloadOperationStatus, PORTAL_EXPORT_TYPES, ServiceDownloadFormat, } from "../../types";
|
|
3
|
-
import { getExportItemDataUrl } from "../getExportItemDataUrl";
|
|
4
|
-
import HubError from "../../../HubError";
|
|
5
|
-
import { getProp } from "../../../objects/get-prop";
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
* Fetches a download file url the Portal API via the item /export endpoint.
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This function is incomplete and various permissions / branching paths need to be
|
|
11
|
-
* validated and implemented. It is a work in progress.
|
|
12
|
-
*
|
|
13
|
-
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
14
|
-
* by calling the service's /createReplica endpoint directly in the future (i.e., once the Enterprise
|
|
15
|
-
* 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
|
|
18
|
-
* with the "Extract" capability enabled, which means the service will also have the /createReplica
|
|
19
|
-
* endpoint available. As /createReplica is a more flexible operation, /export becomes obsolete.
|
|
20
|
-
*
|
|
21
|
-
* @param options options for refining / filtering the resulting download file
|
|
22
|
-
* @returns a url to download the file
|
|
23
|
-
*/
|
|
24
|
-
export async function fetchExportItemDownloadFile(options) {
|
|
25
|
-
validateOptions(options);
|
|
26
|
-
const { entity, format, context, progressCallback, pollInterval } = options;
|
|
27
|
-
progressCallback && progressCallback(DownloadOperationStatus.PENDING);
|
|
28
|
-
const { exportItemId, jobId } = await exportItem({
|
|
29
|
-
id: entity.id,
|
|
30
|
-
exportFormat: getExportFormatParam(format),
|
|
31
|
-
exportParameters: getExportParameters(options),
|
|
32
|
-
authentication: context.hubRequestOptions.authentication,
|
|
33
|
-
});
|
|
34
|
-
await pollForJobCompletion(exportItemId, jobId, context, pollInterval, progressCallback);
|
|
35
|
-
// TODO: Once the job is completed, we still need to set the special typekeywords needed to find the item later.
|
|
36
|
-
// Also, I _think_ we can only do one layer at a time (at least with the current typeKeywords schema we're using)
|
|
37
|
-
progressCallback && progressCallback(DownloadOperationStatus.COMPLETED);
|
|
38
|
-
return {
|
|
39
|
-
type: "url",
|
|
40
|
-
href: getExportItemDataUrl(exportItemId, context),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function validateOptions(options) {
|
|
44
|
-
const { geometry, where } = options;
|
|
45
|
-
if (geometry) {
|
|
46
|
-
throw new HubError("fetchExportItemDownloadFileUrl", "Geometric filters are not supported for this type of download");
|
|
47
|
-
}
|
|
48
|
-
if (where) {
|
|
49
|
-
throw new HubError("fetchExportItemDownloadFileUrl", "Attribute filters are not supported for this type of download");
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function getExportFormatParam(format) {
|
|
53
|
-
const legacyFormat = getLegacyExportItemFormat(format);
|
|
54
|
-
return getProp(PORTAL_EXPORT_TYPES, `${legacyFormat}.name`);
|
|
55
|
-
}
|
|
56
|
-
function getLegacyExportItemFormat(format) {
|
|
57
|
-
return format === ServiceDownloadFormat.FILE_GDB ? "fileGeodatabase" : format;
|
|
58
|
-
}
|
|
59
|
-
function getExportParameters(options) {
|
|
60
|
-
const { layers } = options;
|
|
61
|
-
const result = {
|
|
62
|
-
layers: layers.map((id) => ({ id })),
|
|
63
|
-
};
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
async function pollForJobCompletion(exportedItemId, jobId, context, pollInterval, progressCallback) {
|
|
67
|
-
const { status } = await getItemStatus({
|
|
68
|
-
id: exportedItemId,
|
|
69
|
-
jobId,
|
|
70
|
-
jobType: "export",
|
|
71
|
-
authentication: context.hubRequestOptions.authentication,
|
|
72
|
-
});
|
|
73
|
-
if (status === "failed") {
|
|
74
|
-
throw new HubError("fetchExportItemDownloadFileUrl", "Export job failed");
|
|
75
|
-
}
|
|
76
|
-
if (status !== "completed") {
|
|
77
|
-
progressCallback && progressCallback(DownloadOperationStatus.PROCESSING);
|
|
78
|
-
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
79
|
-
return pollForJobCompletion(exportedItemId, jobId, context, pollInterval, progressCallback);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=fetchExportItemDownloadFile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchExportItemDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fet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WAAW,EAAE;QAC1B,gBAAgB,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QACzE,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,OAAO,oBAAoB,CACzB,cAAc,EACd,KAAK,EACL,OAAO,EACP,YAAY,EACZ,gBAAgB,CACjB,CAAC;KACH;AACH,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { buildExistingExportsPortalQuery } from "../../build-existing-exports-portal-query";
|
|
2
|
-
import { PORTAL_EXPORT_TYPES, ServiceDownloadFormat, } from "../../types";
|
|
3
|
-
import { searchItems } from "@esri/arcgis-rest-portal";
|
|
4
|
-
import { getExportItemDataUrl } from "../getExportItemDataUrl";
|
|
5
|
-
import HubError from "../../../HubError";
|
|
6
|
-
import { fetchAllPages } from "../../../items/fetch-all-pages";
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* Fetches an entity's available download formats that were previously created by the Portal API's item /export
|
|
10
|
-
* endpoint. This is useful for anonymous enterprise users who need to download data from a Hosted Feature Service,
|
|
11
|
-
* but do not have the privileges to create their own item export. As the exports have been previously created, they
|
|
12
|
-
* can be downloaded statically by anyone with the URL.
|
|
13
|
-
*
|
|
14
|
-
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
15
|
-
*
|
|
16
|
-
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
17
|
-
* with using the formats defined the service's /createReplica endpoint directly in the future (i.e.,
|
|
18
|
-
* once the Enterprise team achieves feature parity with the Online team's implementation).
|
|
19
|
-
*
|
|
20
|
-
* This is because The item /export endpoint can only be used on Hosted Feature Services with the "Extract" capability
|
|
21
|
-
* enabled, which means the service will also have the /createReplica endpoint available. As /createReplica is a more
|
|
22
|
-
* flexible operation that can be invoked by anonymous users, /export becomes obsolete.
|
|
23
|
-
*
|
|
24
|
-
* @param entity Hosted Feature Service entity to fetch download formats for
|
|
25
|
-
* @param context ArcGIS application context
|
|
26
|
-
* @param layers target layers that the download will be filtered to
|
|
27
|
-
* @returns available download formats for the entity
|
|
28
|
-
*/
|
|
29
|
-
export async function fetchAvailableExportItemFormats(entity, context, layers) {
|
|
30
|
-
if (layers.length > 1) {
|
|
31
|
-
throw new HubError("fetchAvailableExportItemFormats", "Multi-layer downloads are not supported for this item");
|
|
32
|
-
}
|
|
33
|
-
// NOTE: we _need_ to pass the spatialRefId otherwise we're going to default to 4326
|
|
34
|
-
// Dang it, we'll need to pass the layerId as well... should we support multiple layers?
|
|
35
|
-
const q = buildExistingExportsPortalQuery(entity.id, { layerId: layers[0] });
|
|
36
|
-
const exportItems = (await fetchAllPages(searchItems, Object.assign({ q }, context.requestOptions)));
|
|
37
|
-
// TODO: Do we need to worry about duplicates here?
|
|
38
|
-
return exportItems.map((item) => ({
|
|
39
|
-
type: "static",
|
|
40
|
-
label: null,
|
|
41
|
-
format: getExportItemFormat(item.type),
|
|
42
|
-
url: getExportItemDataUrl(item.id, context),
|
|
43
|
-
})); // TODO: change export formats to use the ServiceDownloadFormat type
|
|
44
|
-
}
|
|
45
|
-
function getExportItemFormat(itemType) {
|
|
46
|
-
const legacyExportItemFormat = Object.keys(PORTAL_EXPORT_TYPES).find((format) => {
|
|
47
|
-
return PORTAL_EXPORT_TYPES[format].itemTypes.includes(itemType);
|
|
48
|
-
});
|
|
49
|
-
return migrateExportItemFormat(legacyExportItemFormat);
|
|
50
|
-
}
|
|
51
|
-
function migrateExportItemFormat(format) {
|
|
52
|
-
return format === "fileGeodatabase"
|
|
53
|
-
? ServiceDownloadFormat.FILE_GDB
|
|
54
|
-
: format;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=fetchAvailableExportItemFormats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAvailableExportItemFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/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B,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAChC,CAAC,IAAI,CAAC,CAAC,MAA8B,EAAE,EAAE;QACxC,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC,CAA2B,CAAC;IAC7B,OAAO,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,uBAAuB,CAC9B,MAA8B;IAE9B,OAAO,MAAM,KAAK,iBAAiB;QACjC,CAAC,CAAC,qBAAqB,CAAC,QAAQ;QAChC,CAAC,CAAE,MAA2B,CAAC;AACnC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
* Fetches an entity's available download formats. Owners of the entity can create all formats supported by
|
|
4
|
-
* the Portal API's item /export endpoint, while users that don't have privileges to the item /export endpoint
|
|
5
|
-
* can only download formats that were previously exported by the entity's owner.
|
|
6
|
-
*
|
|
7
|
-
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
10
|
-
* with using the formats defined the service's /createReplica endpoint directly in the future (i.e.,
|
|
11
|
-
* once the Enterprise 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 with the "Extract" capability
|
|
14
|
-
* enabled, which means the service will also have the /createReplica endpoint available. As /createReplica is a more
|
|
15
|
-
* flexible operation that can be invoked by anonymous users, /export becomes obsolete.
|
|
16
|
-
*
|
|
17
|
-
* @param entity Hosted Feature Service entity to fetch download formats for
|
|
18
|
-
* @param context ArcGIS application context
|
|
19
|
-
* @param layers target layers that the download will be filtered to
|
|
20
|
-
* @returns available download formats for the entity
|
|
21
|
-
*/
|
|
22
|
-
export async function fetchExportItemFormats(_entity, _context, _layers) {
|
|
23
|
-
throw new Error("Not implemented");
|
|
24
|
-
// return canCreateExport(entity, context)
|
|
25
|
-
// ? getAllExportItemFormats()
|
|
26
|
-
// : fetchAvailableExportItemFormats(entity, context, layers);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=fetchExportItemFormats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchExportItemFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/fetchExportItemFormats.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAA4B,EAC5B,QAAwB,EACxB,OAAkB;IAElB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACnC,0CAA0C;IAC1C,gCAAgC;IAChC,gEAAgE;AAClE,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { EXPORT_ITEM_FORMATS } from "../_types";
|
|
2
|
-
/**
|
|
3
|
-
* @private
|
|
4
|
-
* Returns all the download formats that are available via the Portal API's item /export endpoint.
|
|
5
|
-
*/
|
|
6
|
-
export function getAllExportItemFormats() {
|
|
7
|
-
return EXPORT_ITEM_FORMATS.map((format) => ({
|
|
8
|
-
type: "dynamic",
|
|
9
|
-
format,
|
|
10
|
-
}));
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=getAllExportItemFormats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAllExportItemFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getAllExportItemFormats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,EAAE,SAAS;QACf,MAAM;KACP,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canCreateExportItem = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @private
|
|
6
|
-
* Determines if the current user can create an export item for the given entity.
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This function is a placeholder. Various permissions and logic branches are not yet implemented.
|
|
9
|
-
*
|
|
10
|
-
* @param _entity
|
|
11
|
-
* @param _context
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
function canCreateExportItem(_entity, _context) {
|
|
15
|
-
// TODO: port over logic from the download-service
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
exports.canCreateExportItem = canCreateExportItem;
|
|
19
|
-
//# sourceMappingURL=canCreateExportItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canCreateExportItem.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canCreateExportItem.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;GASG;AACH,SAAgB,mBAAmB,CACjC,OAA4B,EAC5B,QAAwB;IAExB,kDAAkD;IAClD,OAAO,IAAI,CAAC;AACd,CAAC;AAND,kDAMC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canUseExportItemFlow = void 0;
|
|
4
|
-
const hostedServiceUtils_1 = require("../../content/hostedServiceUtils");
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
* Determines if the export item flow can be used for the given entity.
|
|
8
|
-
* @param entity entity to check if export item flow can be used
|
|
9
|
-
* @returns whether the export item flow can be used
|
|
10
|
-
*/
|
|
11
|
-
function canUseExportItemFlow(entity) {
|
|
12
|
-
return hostedServiceUtils_1.isHostedFeatureServiceMainEntity(entity);
|
|
13
|
-
}
|
|
14
|
-
exports.canUseExportItemFlow = canUseExportItemFlow;
|
|
15
|
-
//# sourceMappingURL=canUseExportItemFlow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canUseExportItemFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canUseExportItemFlow.ts"],"names":[],"mappings":";;;AAAA,yEAAoF;AAGpF;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,MAA2B;IAC9D,OAAO,qDAAgC,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAFD,oDAEC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchExportItemDownloadFile = void 0;
|
|
4
|
-
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
-
const types_1 = require("../../types");
|
|
6
|
-
const getExportItemDataUrl_1 = require("../getExportItemDataUrl");
|
|
7
|
-
const HubError_1 = require("../../../HubError");
|
|
8
|
-
const get_prop_1 = require("../../../objects/get-prop");
|
|
9
|
-
/**
|
|
10
|
-
* @private
|
|
11
|
-
* Fetches a download file url the Portal API via the item /export endpoint.
|
|
12
|
-
*
|
|
13
|
-
* NOTE: This function is incomplete and various permissions / branching paths need to be
|
|
14
|
-
* validated and implemented. It is a work in progress.
|
|
15
|
-
*
|
|
16
|
-
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
17
|
-
* by calling the service's /createReplica endpoint directly in the future (i.e., once the Enterprise
|
|
18
|
-
* team achieves feature parity with the Online team's implementation).
|
|
19
|
-
*
|
|
20
|
-
* This is because The item /export endpoint can only be used on Hosted Feature Services
|
|
21
|
-
* with the "Extract" capability enabled, which means the service will also have the /createReplica
|
|
22
|
-
* endpoint available. As /createReplica is a more flexible operation, /export becomes obsolete.
|
|
23
|
-
*
|
|
24
|
-
* @param options options for refining / filtering the resulting download file
|
|
25
|
-
* @returns a url to download the file
|
|
26
|
-
*/
|
|
27
|
-
async function fetchExportItemDownloadFile(options) {
|
|
28
|
-
validateOptions(options);
|
|
29
|
-
const { entity, format, context, progressCallback, pollInterval } = options;
|
|
30
|
-
progressCallback && progressCallback(types_1.DownloadOperationStatus.PENDING);
|
|
31
|
-
const { exportItemId, jobId } = await arcgis_rest_portal_1.exportItem({
|
|
32
|
-
id: entity.id,
|
|
33
|
-
exportFormat: getExportFormatParam(format),
|
|
34
|
-
exportParameters: getExportParameters(options),
|
|
35
|
-
authentication: context.hubRequestOptions.authentication,
|
|
36
|
-
});
|
|
37
|
-
await pollForJobCompletion(exportItemId, jobId, context, pollInterval, progressCallback);
|
|
38
|
-
// TODO: Once the job is completed, we still need to set the special typekeywords needed to find the item later.
|
|
39
|
-
// Also, I _think_ we can only do one layer at a time (at least with the current typeKeywords schema we're using)
|
|
40
|
-
progressCallback && progressCallback(types_1.DownloadOperationStatus.COMPLETED);
|
|
41
|
-
return {
|
|
42
|
-
type: "url",
|
|
43
|
-
href: getExportItemDataUrl_1.getExportItemDataUrl(exportItemId, context),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.fetchExportItemDownloadFile = fetchExportItemDownloadFile;
|
|
47
|
-
function validateOptions(options) {
|
|
48
|
-
const { geometry, where } = options;
|
|
49
|
-
if (geometry) {
|
|
50
|
-
throw new HubError_1.default("fetchExportItemDownloadFileUrl", "Geometric filters are not supported for this type of download");
|
|
51
|
-
}
|
|
52
|
-
if (where) {
|
|
53
|
-
throw new HubError_1.default("fetchExportItemDownloadFileUrl", "Attribute filters are not supported for this type of download");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function getExportFormatParam(format) {
|
|
57
|
-
const legacyFormat = getLegacyExportItemFormat(format);
|
|
58
|
-
return get_prop_1.getProp(types_1.PORTAL_EXPORT_TYPES, `${legacyFormat}.name`);
|
|
59
|
-
}
|
|
60
|
-
function getLegacyExportItemFormat(format) {
|
|
61
|
-
return format === types_1.ServiceDownloadFormat.FILE_GDB ? "fileGeodatabase" : format;
|
|
62
|
-
}
|
|
63
|
-
function getExportParameters(options) {
|
|
64
|
-
const { layers } = options;
|
|
65
|
-
const result = {
|
|
66
|
-
layers: layers.map((id) => ({ id })),
|
|
67
|
-
};
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
async function pollForJobCompletion(exportedItemId, jobId, context, pollInterval, progressCallback) {
|
|
71
|
-
const { status } = await arcgis_rest_portal_1.getItemStatus({
|
|
72
|
-
id: exportedItemId,
|
|
73
|
-
jobId,
|
|
74
|
-
jobType: "export",
|
|
75
|
-
authentication: context.hubRequestOptions.authentication,
|
|
76
|
-
});
|
|
77
|
-
if (status === "failed") {
|
|
78
|
-
throw new HubError_1.default("fetchExportItemDownloadFileUrl", "Export job failed");
|
|
79
|
-
}
|
|
80
|
-
if (status !== "completed") {
|
|
81
|
-
progressCallback && progressCallback(types_1.DownloadOperationStatus.PROCESSING);
|
|
82
|
-
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
83
|
-
return pollForJobCompletion(exportedItemId, jobId, context, pollInterval, progressCallback);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=fetchExportItemDownloadFile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;;;;;;GAiBG;AACI,KAAK,UAAU,2BAA2B,CAC/C,OAAkC;IAElC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAC5E,gBAAgB,IAAI,gBAAgB,CAAC,+BAAuB,CA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mBAAmB,CAC1B,OAAkC;IAElC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,MAAM,GAAsB;QAChC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;KACrC,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,oBAAoB,CACjC,cAAsB,EACtB,KAAa,EACb,OAAuB,EACvB,YAAoB,EACpB,gBAA2C;IAE3C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kCAAa,CAAC;QACrC,EAAE,EAAE,cAAc;QAClB,KAAK;QACL,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE,OAAO,CAAC,iBAAiB,CAAC,cAAc;KACzD,CAAC,CAAC;IAEH,IAAI,MAAM,KAAK,QAAQ,EAAE;QACvB,MAAM,IAAI,kBAAQ,CAAC,gCAAgC,EAAE,mBAAmB,CAAC,CAAC;KAC3E;IAED,IAAI,MAAM,KAAK,WAAW,EAAE;QAC1B,gBAAgB,IAAI,gBAAgB,CAAC,+BAAuB,CAAC,UAAU,CAAC,CAAC;QACzE,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,OAAO,oBAAoB,CACzB,cAAc,EACd,KAAK,EACL,OAAO,EACP,YAAY,EACZ,gBAAgB,CACjB,CAAC;KACH;AACH,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAvailableExportItemFormats = void 0;
|
|
4
|
-
const build_existing_exports_portal_query_1 = require("../../build-existing-exports-portal-query");
|
|
5
|
-
const types_1 = require("../../types");
|
|
6
|
-
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
7
|
-
const getExportItemDataUrl_1 = require("../getExportItemDataUrl");
|
|
8
|
-
const HubError_1 = require("../../../HubError");
|
|
9
|
-
const fetch_all_pages_1 = require("../../../items/fetch-all-pages");
|
|
10
|
-
/**
|
|
11
|
-
* @private
|
|
12
|
-
* Fetches an entity's available download formats that were previously created by the Portal API's item /export
|
|
13
|
-
* endpoint. This is useful for anonymous enterprise users who need to download data from a Hosted Feature Service,
|
|
14
|
-
* but do not have the privileges to create their own item export. As the exports have been previously created, they
|
|
15
|
-
* can be downloaded statically by anyone with the URL.
|
|
16
|
-
*
|
|
17
|
-
* NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
|
|
18
|
-
*
|
|
19
|
-
* NOTE: This is a last resort approach for current Enterprise environments, but it will be replaced
|
|
20
|
-
* with using the formats defined the service's /createReplica endpoint directly in the future (i.e.,
|
|
21
|
-
* once the Enterprise team achieves feature parity with the Online team's implementation).
|
|
22
|
-
*
|
|
23
|
-
* This is because The item /export endpoint can only be used on Hosted Feature Services with the "Extract" capability
|
|
24
|
-
* enabled, which means the service will also have the /createReplica endpoint available. As /createReplica is a more
|
|
25
|
-
* flexible operation that can be invoked by anonymous users, /export becomes obsolete.
|
|
26
|
-
*
|
|
27
|
-
* @param entity Hosted Feature Service entity to fetch download formats for
|
|
28
|
-
* @param context ArcGIS application context
|
|
29
|
-
* @param layers target layers that the download will be filtered to
|
|
30
|
-
* @returns available download formats for the entity
|
|
31
|
-
*/
|
|
32
|
-
async function fetchAvailableExportItemFormats(entity, context, layers) {
|
|
33
|
-
if (layers.length > 1) {
|
|
34
|
-
throw new HubError_1.default("fetchAvailableExportItemFormats", "Multi-layer downloads are not supported for this item");
|
|
35
|
-
}
|
|
36
|
-
// NOTE: we _need_ to pass the spatialRefId otherwise we're going to default to 4326
|
|
37
|
-
// Dang it, we'll need to pass the layerId as well... should we support multiple layers?
|
|
38
|
-
const q = build_existing_exports_portal_query_1.buildExistingExportsPortalQuery(entity.id, { layerId: layers[0] });
|
|
39
|
-
const exportItems = (await fetch_all_pages_1.fetchAllPages(arcgis_rest_portal_1.searchItems, Object.assign({ q }, context.requestOptions)));
|
|
40
|
-
// TODO: Do we need to worry about duplicates here?
|
|
41
|
-
return exportItems.map((item) => ({
|
|
42
|
-
type: "static",
|
|
43
|
-
label: null,
|
|
44
|
-
format: getExportItemFormat(item.type),
|
|
45
|
-
url: getExportItemDataUrl_1.getExportItemDataUrl(item.id, context),
|
|
46
|
-
})); // TODO: change export formats to use the ServiceDownloadFormat type
|
|
47
|
-
}
|
|
48
|
-
exports.fetchAvailableExportItemFormats = fetchAvailableExportItemFormats;
|
|
49
|
-
function getExportItemFormat(itemType) {
|
|
50
|
-
const legacyExportItemFormat = Object.keys(types_1.PORTAL_EXPORT_TYPES).find((format) => {
|
|
51
|
-
return types_1.PORTAL_EXPORT_TYPES[format].itemTypes.includes(itemType);
|
|
52
|
-
});
|
|
53
|
-
return migrateExportItemFormat(legacyExportItemFormat);
|
|
54
|
-
}
|
|
55
|
-
function migrateExportItemFormat(format) {
|
|
56
|
-
return format === "fileGeodatabase"
|
|
57
|
-
? types_1.ServiceDownloadFormat.FILE_GDB
|
|
58
|
-
: format;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=fetchAvailableExportItemFormats.js.map
|
package/dist/node/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAvailableExportItemFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/fetchAvailableExportItemFormats.ts"],"names":[],"mappings":";;;AAAA,mGAA4F;AAC5F,uCAKqB;AACrB,iEAA8D;AAC9D,kEAA+D;AAG/D,gDAAyC;AACzC,oEAA+D;AAG/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,KAAK,UAAU,+BAA+B,CACnD,MAA2B,EAC3B,OAAuB,EACvB,MAAgB;IAEhB,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,E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
-
exports.fetchExportItemFormats = void 0;
|
|
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
|
-
async function fetchExportItemFormats(_entity, _context, _layers) {
|
|
26
|
-
throw new Error("Not implemented");
|
|
27
|
-
// return canCreateExport(entity, context)
|
|
28
|
-
// ? getAllExportItemFormats()
|
|
29
|
-
// : fetchAvailableExportItemFormats(entity, context, layers);
|
|
30
|
-
}
|
|
31
|
-
exports.fetchExportItemFormats = fetchExportItemFormats;
|
|
32
|
-
//# sourceMappingURL=fetchExportItemFormats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchExportItemFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/fetchExportItemFormats.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,KAAK,UAAU,sBAAsB,CAC1C,OAA4B,EAC5B,QAAwB,EACxB,OAAkB;IAElB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACnC,0CAA0C;IAC1C,gCAAgC;IAChC,gEAAgE;AAClE,CAAC;AATD,wDASC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAllExportItemFormats = void 0;
|
|
4
|
-
const _types_1 = require("../_types");
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
* Returns all the download formats that are available via the Portal API's item /export endpoint.
|
|
8
|
-
*/
|
|
9
|
-
function getAllExportItemFormats() {
|
|
10
|
-
return _types_1.EXPORT_ITEM_FORMATS.map((format) => ({
|
|
11
|
-
type: "dynamic",
|
|
12
|
-
format,
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
|
-
exports.getAllExportItemFormats = getAllExportItemFormats;
|
|
16
|
-
//# sourceMappingURL=getAllExportItemFormats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAllExportItemFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getAllExportItemFormats.ts"],"names":[],"mappings":";;;AACA,sCAAgD;AAEhD;;;GAGG;AACH,SAAgB,uBAAuB;IACrC,OAAO,4BAAmB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,EAAE,SAAS;QACf,MAAM;KACP,CAAC,CAAC,CAAC;AACN,CAAC;AALD,0DAKC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IFetchDownloadFileOptions, IFetchDownloadFileResponse } 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 fetchExportItemDownloadFile(options: IFetchDownloadFileOptions): Promise<IFetchDownloadFileResponse>;
|
|
@@ -1,26 +0,0 @@
|
|
|
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[]>;
|
|
@@ -1,25 +0,0 @@
|
|
|
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[]>;
|