@esri/hub-common 14.157.0 → 14.158.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.
Files changed (124) hide show
  1. package/dist/esm/content/_internal/computeProps.js +61 -0
  2. package/dist/esm/content/_internal/computeProps.js.map +1 -1
  3. package/dist/esm/content/_internal/fetchEditableContentEnrichments.js +55 -0
  4. package/dist/esm/content/_internal/fetchEditableContentEnrichments.js.map +1 -0
  5. package/dist/esm/content/_internal/fetchItemScheduleEnrichment.js +28 -0
  6. package/dist/esm/content/_internal/fetchItemScheduleEnrichment.js.map +1 -0
  7. package/dist/esm/content/edit.js +2 -1
  8. package/dist/esm/content/edit.js.map +1 -1
  9. package/dist/esm/content/{fetch.js → fetchContent.js} +2 -49
  10. package/dist/esm/content/fetchContent.js.map +1 -0
  11. package/dist/esm/content/fetchHubContent.js +26 -0
  12. package/dist/esm/content/fetchHubContent.js.map +1 -0
  13. package/dist/esm/content/index.js +3 -1
  14. package/dist/esm/content/index.js.map +1 -1
  15. package/dist/esm/content/modelToHubEditableContent.js +16 -0
  16. package/dist/esm/content/modelToHubEditableContent.js.map +1 -0
  17. package/dist/esm/content/types.js.map +1 -1
  18. package/dist/esm/core/fetchHubEntity.js +1 -1
  19. package/dist/esm/core/fetchHubEntity.js.map +1 -1
  20. package/dist/esm/downloads/_internal/_types.js +5 -8
  21. package/dist/esm/downloads/_internal/_types.js.map +1 -1
  22. package/dist/esm/downloads/_internal/canUseExportImageFlow.js +7 -1
  23. package/dist/esm/downloads/_internal/canUseExportImageFlow.js.map +1 -1
  24. package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js +77 -0
  25. package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js.map +1 -0
  26. package/dist/esm/downloads/_internal/file-url-fetchers/{fetchExportItemDownloadFileUrl.js → fetchExportItemDownloadFile.js} +6 -3
  27. package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js.map +1 -0
  28. package/dist/esm/downloads/_internal/file-url-fetchers/{fetchHubApiDownloadFileUrl.js → fetchHubApiDownloadFile.js} +6 -3
  29. package/dist/esm/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFile.js.map +1 -0
  30. package/dist/esm/downloads/_internal/format-fetchers/getCreateReplicaFormats.js +1 -0
  31. package/dist/esm/downloads/_internal/format-fetchers/getCreateReplicaFormats.js.map +1 -1
  32. package/dist/esm/downloads/_internal/format-fetchers/getExportImageFormats.js +16 -6
  33. package/dist/esm/downloads/_internal/format-fetchers/getExportImageFormats.js.map +1 -1
  34. package/dist/esm/downloads/canUseCreateReplica.js +1 -0
  35. package/dist/esm/downloads/canUseCreateReplica.js.map +1 -1
  36. package/dist/esm/downloads/canUseHubDownloadSystem.js +1 -0
  37. package/dist/esm/downloads/canUseHubDownloadSystem.js.map +1 -1
  38. package/dist/esm/downloads/{fetchDownloadFileUrl.js → fetchDownloadFile.js} +8 -8
  39. package/dist/esm/downloads/fetchDownloadFile.js.map +1 -0
  40. package/dist/esm/downloads/fetchDownloadFormats.js +2 -1
  41. package/dist/esm/downloads/fetchDownloadFormats.js.map +1 -1
  42. package/dist/esm/downloads/index.js +1 -1
  43. package/dist/esm/downloads/index.js.map +1 -1
  44. package/dist/esm/downloads/types.js +4 -4
  45. package/dist/esm/downloads/types.js.map +1 -1
  46. package/dist/esm/items/_enrichments.js.map +1 -1
  47. package/dist/node/content/_internal/computeProps.js +61 -0
  48. package/dist/node/content/_internal/computeProps.js.map +1 -1
  49. package/dist/node/content/_internal/fetchEditableContentEnrichments.js +59 -0
  50. package/dist/node/content/_internal/fetchEditableContentEnrichments.js.map +1 -0
  51. package/dist/node/content/_internal/fetchItemScheduleEnrichment.js +32 -0
  52. package/dist/node/content/_internal/fetchItemScheduleEnrichment.js.map +1 -0
  53. package/dist/node/content/edit.js +3 -2
  54. package/dist/node/content/edit.js.map +1 -1
  55. package/dist/node/content/{fetch.js → fetchContent.js} +2 -50
  56. package/dist/node/content/{fetch.js.map → fetchContent.js.map} +1 -1
  57. package/dist/node/content/fetchHubContent.js +29 -0
  58. package/dist/node/content/fetchHubContent.js.map +1 -0
  59. package/dist/node/content/index.js +3 -1
  60. package/dist/node/content/index.js.map +1 -1
  61. package/dist/node/content/modelToHubEditableContent.js +20 -0
  62. package/dist/node/content/modelToHubEditableContent.js.map +1 -0
  63. package/dist/node/content/types.js.map +1 -1
  64. package/dist/node/core/fetchHubEntity.js +12 -12
  65. package/dist/node/core/fetchHubEntity.js.map +1 -1
  66. package/dist/node/downloads/_internal/_types.js +5 -8
  67. package/dist/node/downloads/_internal/_types.js.map +1 -1
  68. package/dist/node/downloads/_internal/canUseExportImageFlow.js +7 -1
  69. package/dist/node/downloads/_internal/canUseExportImageFlow.js.map +1 -1
  70. package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js +81 -0
  71. package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.js.map +1 -0
  72. package/dist/node/downloads/_internal/file-url-fetchers/{fetchExportItemDownloadFileUrl.js → fetchExportItemDownloadFile.js} +8 -5
  73. package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.js.map +1 -0
  74. package/dist/node/downloads/_internal/file-url-fetchers/{fetchHubApiDownloadFileUrl.js → fetchHubApiDownloadFile.js} +8 -5
  75. package/dist/node/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFile.js.map +1 -0
  76. package/dist/node/downloads/_internal/format-fetchers/getCreateReplicaFormats.js +1 -0
  77. package/dist/node/downloads/_internal/format-fetchers/getCreateReplicaFormats.js.map +1 -1
  78. package/dist/node/downloads/_internal/format-fetchers/getExportImageFormats.js +16 -6
  79. package/dist/node/downloads/_internal/format-fetchers/getExportImageFormats.js.map +1 -1
  80. package/dist/node/downloads/canUseCreateReplica.js +1 -0
  81. package/dist/node/downloads/canUseCreateReplica.js.map +1 -1
  82. package/dist/node/downloads/canUseHubDownloadSystem.js +1 -0
  83. package/dist/node/downloads/canUseHubDownloadSystem.js.map +1 -1
  84. package/dist/node/downloads/{fetchDownloadFileUrl.js → fetchDownloadFile.js} +10 -10
  85. package/dist/node/downloads/fetchDownloadFile.js.map +1 -0
  86. package/dist/node/downloads/fetchDownloadFormats.js +2 -1
  87. package/dist/node/downloads/fetchDownloadFormats.js.map +1 -1
  88. package/dist/node/downloads/index.js +1 -1
  89. package/dist/node/downloads/index.js.map +1 -1
  90. package/dist/node/downloads/types.js +4 -4
  91. package/dist/node/downloads/types.js.map +1 -1
  92. package/dist/node/items/_enrichments.js.map +1 -1
  93. package/dist/types/content/_fetch.d.ts +1 -2
  94. package/dist/types/content/_internal/fetchEditableContentEnrichments.d.ts +16 -0
  95. package/dist/types/content/_internal/fetchItemScheduleEnrichment.d.ts +15 -0
  96. package/dist/types/content/fetchContent.d.ts +24 -0
  97. package/dist/types/content/fetchHubContent.d.ts +10 -0
  98. package/dist/types/content/index.d.ts +3 -1
  99. package/dist/types/content/modelToHubEditableContent.d.ts +12 -0
  100. package/dist/types/core/types/IHubEditableContent.d.ts +69 -0
  101. package/dist/types/downloads/_internal/_types.d.ts +2 -1
  102. package/dist/types/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.d.ts +10 -0
  103. package/dist/types/downloads/_internal/file-url-fetchers/{fetchExportItemDownloadFileUrl.d.ts → fetchExportItemDownloadFile.d.ts} +2 -2
  104. package/dist/types/downloads/_internal/file-url-fetchers/{fetchHubApiDownloadFileUrl.d.ts → fetchHubApiDownloadFile.d.ts} +2 -2
  105. package/dist/types/downloads/_internal/format-fetchers/getExportImageFormats.d.ts +3 -4
  106. package/dist/types/downloads/fetchDownloadFile.d.ts +8 -0
  107. package/dist/types/downloads/index.d.ts +1 -1
  108. package/dist/types/downloads/types.d.ts +19 -6
  109. package/dist/types/items/_enrichments.d.ts +6 -2
  110. package/package.json +1 -1
  111. package/dist/esm/content/fetch.js.map +0 -1
  112. package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js +0 -46
  113. package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js.map +0 -1
  114. package/dist/esm/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js.map +0 -1
  115. package/dist/esm/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js.map +0 -1
  116. package/dist/esm/downloads/fetchDownloadFileUrl.js.map +0 -1
  117. package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js +0 -50
  118. package/dist/node/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.js.map +0 -1
  119. package/dist/node/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFileUrl.js.map +0 -1
  120. package/dist/node/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFileUrl.js.map +0 -1
  121. package/dist/node/downloads/fetchDownloadFileUrl.js.map +0 -1
  122. package/dist/types/content/fetch.d.ts +0 -33
  123. package/dist/types/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFileUrl.d.ts +0 -12
  124. package/dist/types/downloads/fetchDownloadFileUrl.d.ts +0 -8
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchHubContent = void 0;
4
+ const fetchContent_1 = require("./fetchContent");
5
+ const fetchEditableContentEnrichments_1 = require("./_internal/fetchEditableContentEnrichments");
6
+ const compose_1 = require("./compose");
7
+ const set_prop_1 = require("../objects/set-prop");
8
+ const modelToHubEditableContent_1 = require("./modelToHubEditableContent");
9
+ /**
10
+ * fetch a content entity by identifier
11
+ * @param identifier
12
+ * @param requestOptions
13
+ * @returns content entity
14
+ */
15
+ exports.fetchHubContent = async (identifier, requestOptions, enrichments) => {
16
+ // NOTE: b/c we have to support slugs, we use fetchContent() to get the item
17
+ // by telling it to not fetch any enrichments. We then can fetch enrichments
18
+ // as needed after we have the item
19
+ const options = Object.assign(Object.assign({}, requestOptions), { enrichments: [] });
20
+ const { item } = await fetchContent_1.fetchContent(identifier, options);
21
+ const editableContentEnrichments = await fetchEditableContentEnrichments_1.fetchEditableContentEnrichments(item, requestOptions, enrichments);
22
+ // we must normalize the underlying item type to account
23
+ // for older items (e.g. sites that are type "Web Mapping
24
+ // Application") before we map the model to a Hub Entity
25
+ const type = compose_1.normalizeItemType(item);
26
+ set_prop_1.setProp("type", type, item);
27
+ return modelToHubEditableContent_1.modelToHubEditableContent({ item }, requestOptions, editableContentEnrichments);
28
+ };
29
+ //# sourceMappingURL=fetchHubContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchHubContent.js","sourceRoot":"","sources":["../../../src/content/fetchHubContent.ts"],"names":[],"mappings":";;;AAGA,iDAAoE;AACpE,iGAA8F;AAC9F,uCAA8C;AAC9C,kDAA8C;AAC9C,2EAAwE;AAExE;;;;;GAKG;AACU,QAAA,eAAe,GAAG,KAAK,EAClC,UAAkB,EAClB,cAA+B,EAC/B,WAAyC,EACX,EAAE;IAChC,4EAA4E;IAC5E,4EAA4E;IAC5E,mCAAmC;IACnC,MAAM,OAAO,GAAG,gCACX,cAAc,KACjB,WAAW,EAAE,EAAE,GACQ,CAAC;IAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,2BAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEzD,MAAM,0BAA0B,GAAG,MAAM,iEAA+B,CACtE,IAAI,EACJ,cAAc,EACd,WAAW,CACZ,CAAC;IAEF,wDAAwD;IACxD,yDAAyD;IACzD,wDAAwD;IACxD,MAAM,IAAI,GAAG,2BAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,kBAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAE5B,OAAO,qDAAyB,CAC9B,EAAE,IAAI,EAAE,EACR,cAAc,EACd,0BAA0B,CAC3B,CAAC;AACJ,CAAC,CAAC"}
@@ -6,7 +6,9 @@ tslib_1.__exportStar(require("./get-family"), exports);
6
6
  tslib_1.__exportStar(require("./compose"), exports);
7
7
  tslib_1.__exportStar(require("./contentUtils"), exports);
8
8
  tslib_1.__exportStar(require("./edit"), exports);
9
- tslib_1.__exportStar(require("./fetch"), exports);
9
+ tslib_1.__exportStar(require("./fetchContent"), exports);
10
+ tslib_1.__exportStar(require("./fetchHubContent"), exports);
11
+ tslib_1.__exportStar(require("./modelToHubEditableContent"), exports);
10
12
  tslib_1.__exportStar(require("./get-family"), exports);
11
13
  tslib_1.__exportStar(require("./HubContent"), exports);
12
14
  tslib_1.__exportStar(require("./search"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,kDAAwB;AACxB,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC;AACrC,gEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,yDAA+B;AAC/B,4DAAkC;AAClC,sEAA4C;AAC5C,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC;AACrC,gEAAsC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modelToHubEditableContent = void 0;
4
+ const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
5
+ const getPropertyMap_1 = require("./_internal/getPropertyMap");
6
+ const computeProps_1 = require("./_internal/computeProps");
7
+ /**
8
+ * Converts an Imodel to a Hub editable content object
9
+ *
10
+ * @param model IModel to convert
11
+ * @param requestOptions
12
+ * @param enrichments hash of enrichments to apply to the content
13
+ */
14
+ function modelToHubEditableContent(model, requestOptions, enrichments) {
15
+ const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap_1.getPropertyMap());
16
+ const content = mapper.storeToEntity(model, {});
17
+ return computeProps_1.computeProps(model, content, requestOptions, enrichments);
18
+ }
19
+ exports.modelToHubEditableContent = modelToHubEditableContent;
20
+ //# sourceMappingURL=modelToHubEditableContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelToHubEditableContent.js","sourceRoot":"","sources":["../../../src/content/modelToHubEditableContent.ts"],"names":[],"mappings":";;;AAGA,qEAAkE;AAElE,+DAA4D;AAC5D,2DAAwD;AAExD;;;;;;GAMG;AACH,SAAgB,yBAAyB,CACvC,KAAa,EACb,cAA+B,EAC/B,WAAuC;IAEvC,MAAM,MAAM,GAAG,IAAI,+BAAc,CAC/B,+BAAc,EAAE,CACjB,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,CAAwB,CAAC;IACvE,OAAO,2BAAY,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC;AAVD,8DAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,gCAAa,CAAA;AACf,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/content/types.ts"],"names":[],"mappings":";;;AAkBA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,gCAAa,CAAA;AACf,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchHubEntity = void 0;
4
4
  const fetch_1 = require("../discussions/fetch");
5
- const fetch_2 = require("../content/fetch");
5
+ const fetchHubContent_1 = require("../content/fetchHubContent");
6
6
  const HubInitiatives_1 = require("../initiatives/HubInitiatives");
7
7
  const HubPages_1 = require("../pages/HubPages");
8
- const fetch_3 = require("../projects/fetch");
8
+ const fetch_2 = require("../projects/fetch");
9
9
  const HubSites_1 = require("../sites/HubSites");
10
- const fetch_4 = require("../templates/fetch");
10
+ const fetch_3 = require("../templates/fetch");
11
11
  const HubGroups_1 = require("../groups/HubGroups");
12
- const fetch_5 = require("../initiative-templates/fetch");
13
- const fetch_6 = require("../surveys/fetch");
14
- const fetch_7 = require("../events/fetch");
12
+ const fetch_4 = require("../initiative-templates/fetch");
13
+ const fetch_5 = require("../surveys/fetch");
14
+ const fetch_6 = require("../events/fetch");
15
15
  const users_1 = require("../users");
16
16
  /**
17
17
  * Fetch a Hub entity by identifier (id or slug)
@@ -24,7 +24,7 @@ async function fetchHubEntity(type, identifier, context) {
24
24
  let result;
25
25
  switch (type) {
26
26
  case "project":
27
- result = await fetch_3.fetchProject(identifier, context.requestOptions);
27
+ result = await fetch_2.fetchProject(identifier, context.requestOptions);
28
28
  break;
29
29
  case "site":
30
30
  result = await HubSites_1.fetchSite(identifier, context.hubRequestOptions);
@@ -39,22 +39,22 @@ async function fetchHubEntity(type, identifier, context) {
39
39
  result = await HubPages_1.fetchPage(identifier, context.hubRequestOptions);
40
40
  break;
41
41
  case "content":
42
- result = await fetch_2.fetchHubContent(identifier, context.requestOptions);
42
+ result = await fetchHubContent_1.fetchHubContent(identifier, context.requestOptions);
43
43
  break;
44
44
  case "template":
45
- result = await fetch_4.fetchTemplate(identifier, context.requestOptions);
45
+ result = await fetch_3.fetchTemplate(identifier, context.requestOptions);
46
46
  break;
47
47
  case "group":
48
48
  result = await HubGroups_1.fetchHubGroup(identifier, context.hubRequestOptions);
49
49
  break;
50
50
  case "survey":
51
- result = await fetch_6.fetchSurvey(identifier, context.hubRequestOptions);
51
+ result = await fetch_5.fetchSurvey(identifier, context.hubRequestOptions);
52
52
  break;
53
53
  case "event":
54
- result = await fetch_7.fetchEvent(identifier, context.hubRequestOptions);
54
+ result = await fetch_6.fetchEvent(identifier, context.hubRequestOptions);
55
55
  break;
56
56
  case "initiativeTemplate":
57
- result = await fetch_5.fetchInitiativeTemplate(identifier, context.requestOptions);
57
+ result = await fetch_4.fetchInitiativeTemplate(identifier, context.requestOptions);
58
58
  break;
59
59
  case "user":
60
60
  result =
@@ -1 +1 @@
1
- {"version":3,"file":"fetchHubEntity.js","sourceRoot":"","sources":["../../../src/core/fetchHubEntity.ts"],"names":[],"mappings":";;;AAAA,gDAAuD;AACvD,4CAAmD;AACnD,kEAAgE;AAChE,gDAA8C;AAC9C,6CAAiD;AACjD,gDAA8C;AAC9C,8CAAmD;AAInD,mDAAoD;AACpD,yDAAwE;AACxE,4CAA+C;AAC/C,2CAA6C;AAC7C,oCAA8D;AAE9D;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAClC,IAAmB,EACnB,UAAkB,EAClB,OAAuB;IAEvB,IAAI,MAAiB,CAAC;IACtB,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,MAAM,GAAG,MAAM,oBAAY,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;YAChE,MAAM;QACR,KAAK,MAAM;YACT,MAAM,GAAG,MAAM,oBAAS,CAAC,UAAU,EAAE,OAAO,CA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AAM,yBAAa,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACpE,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,GAAG,MAAM,mBAAW,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAClE,MAAM;QACR,KAAK,OAAO;YACV,MAAM,GAAG,MAAM,kBAAU,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM;QACR,KAAK,oBAAoB;YACvB,MAAM,GAAG,MAAM,+BAAuB,CACpC,UAAU,EACV,OAAO,CAAC,cAAc,CACvB,CAAC;YACF,MAAM;QACR,KAAK,MAAM;YACT,MAAM;gBACJ,UAAU,KAAK,MAAM;oBACnB,CAAC,CAAC,4BAAoB,CAAC,OAAO,CAAC,WAAW,CAAC;oBAC3C,CAAC,CAAC,MAAM,oBAAY,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;KACnE;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAlDD,wCAkDC"}
@@ -16,20 +16,17 @@ exports.EXPORT_ITEM_FORMATS = [
16
16
  ];
17
17
  /**
18
18
  * Formats supported by the /exportImage endpoint of Image Services.
19
+ * Listed in the default order of appearance in the UI.
19
20
  */
20
21
  exports.EXPORT_IMAGE_FORMATS = [
21
- types_1.ServiceDownloadFormat.BIP,
22
- types_1.ServiceDownloadFormat.BMP,
23
- types_1.ServiceDownloadFormat.BSQ,
24
- types_1.ServiceDownloadFormat.GIF,
22
+ // Temporary exclusion until we hammer out the details of how to support it.
23
+ // Unlike jpg or png, tiff downloads require exact geospatial parameters to be set.
24
+ // ServiceDownloadFormat.TIFF,
25
25
  types_1.ServiceDownloadFormat.JPG,
26
- types_1.ServiceDownloadFormat.JPG_PNG,
27
- types_1.ServiceDownloadFormat.LERC,
28
26
  types_1.ServiceDownloadFormat.PNG,
27
+ types_1.ServiceDownloadFormat.PNG8,
29
28
  types_1.ServiceDownloadFormat.PNG24,
30
29
  types_1.ServiceDownloadFormat.PNG32,
31
- types_1.ServiceDownloadFormat.PNG8,
32
- types_1.ServiceDownloadFormat.TIFF,
33
30
  ];
34
31
  /**
35
32
  * Formats supported by the paging operation endpoint of the Hub Download API.
@@ -1 +1 @@
1
- {"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/_types.ts"],"names":[],"mappings":";;;AAAA,oCAAiD;AAEjD;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,QAAQ;IAC9B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,kBAAkB;CAChC,CAAC;AAIX;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,IAAI;IAC1B,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,KAAK;IAC3B,6BAAqB,CAAC,IAAI;IAC1B,6BAAqB,CAAC,IAAI;CAClB,CAAC;AAGX;;;GAGG;AACU,QAAA,sBAAsB,GAAG;IACpC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,GAAG;CACjB,CAAC;AAGX;;;;GAIG;AACU,QAAA,sBAAsB,GAAG;IACpC,6BAAqB,CAAC,GAAG;IACzB,6BAAqB,CAAC,SAAS;IAC/B,6BAAqB,CAAC,OAAO;IAC7B,6BAAqB,CAAC,QAAQ;IAC9B,6BAAqB,CAAC,kBAAkB;IACxC,6BAA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ict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.canUseExportImageFlow = void 0;
4
+ const types_1 = require("../../types");
4
5
  /**
5
6
  * @private
6
7
  * Determines if the export image flow can be used for the given entity.
@@ -8,7 +9,12 @@ exports.canUseExportImageFlow = void 0;
8
9
  * @returns whether the export image flow can be used
9
10
  */
10
11
  function canUseExportImageFlow(entity) {
11
- return entity.type === "Image Service";
12
+ const { type, typeKeywords = [] } = entity;
13
+ // Tiled Imagery services cannot be downloaded. This typeKeyword check
14
+ // is one way to distinguish between tiled and non-tiled imagery services.
15
+ // TODO: Consider checking item.url instead so reference items are also excluded.
16
+ return (type === types_1.ItemType["Image Service"] &&
17
+ !typeKeywords.includes("Tiled Imagery"));
12
18
  }
13
19
  exports.canUseExportImageFlow = canUseExportImageFlow;
14
20
  //# sourceMappingURL=canUseExportImageFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"canUseExportImageFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canUseExportImageFlow.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,MAA2B;IAC/D,OAAO,MAAM,CAAC,IAAI,KAAK,eAAe,CAAC;AACzC,CAAC;AAFD,sDAEC"}
1
+ {"version":3,"file":"canUseExportImageFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/canUseExportImageFlow.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AAEvC;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,MAA2B;IAC/D,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAC3C,sEAAsE;IACtE,0EAA0E;IAC1E,iFAAiF;IACjF,OAAO,CACL,IAAI,KAAK,gBAAQ,CAAC,eAAe,CAAC;QAClC,CAAC,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,CACxC,CAAC;AACJ,CAAC;AATD,sDASC"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchExportImageDownloadFile = void 0;
4
+ const arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
5
+ const types_1 = require("../../types");
6
+ const HubError_1 = require("../../../HubError");
7
+ const get_prop_1 = require("../../../objects/get-prop");
8
+ /**
9
+ * @private
10
+ *
11
+ * Fetches a download file url from an Image Service via the exportImage endpoint.
12
+ *
13
+ * @param options options for refining / filtering the resulting download file
14
+ * @returns a blob containing the download file
15
+ */
16
+ async function fetchExportImageDownloadFile(options) {
17
+ validateOptions(options);
18
+ const { entity, format, context, progressCallback } = options;
19
+ progressCallback && progressCallback(types_1.DownloadOperationStatus.PENDING);
20
+ const extent = getExportImageExtent(options);
21
+ const { xmin, xmax, ymin, ymax } = extent;
22
+ // TODO: do we need to handle latestWkid as well?
23
+ const { wkid } = extent.spatialReference;
24
+ const requestOptions = Object.assign({}, context.requestOptions);
25
+ requestOptions.httpMethod = "GET";
26
+ requestOptions.params = {
27
+ bbox: `${xmin},${ymin},${xmax},${ymax}`,
28
+ bboxSR: `${wkid}`,
29
+ f: "image",
30
+ format,
31
+ mosaicRule: '{"ascending":true,"mosaicMethod":"esriMosaicNorthwest","mosaicOperation":"MT_FIRST"}',
32
+ };
33
+ // TODO: Figure out whether we want to leverage the server's maxImageWidth and maxImageHeight.
34
+ // While it results in higher quality images, it also creates a lot of variability in the result
35
+ // when we filter an image by extent.
36
+ //
37
+ // const { maxImageHeight, maxImageWidth } =
38
+ // getProp(entity, "extendedProps.server") || {};
39
+ // if (maxImageWidth && maxImageHeight) {
40
+ // requestOptions.params.size = `${maxImageWidth},${maxImageHeight}`;
41
+ // }
42
+ const blob = await arcgis_rest_request_1.request(`${entity.url}/exportImage`, requestOptions);
43
+ progressCallback && progressCallback(types_1.DownloadOperationStatus.COMPLETED);
44
+ return {
45
+ type: "blob",
46
+ blob,
47
+ filename: getBlobFilename(entity, format),
48
+ };
49
+ }
50
+ exports.fetchExportImageDownloadFile = fetchExportImageDownloadFile;
51
+ function validateOptions(options) {
52
+ const { geometry } = options;
53
+ if (geometry && geometry.type !== "extent") {
54
+ throw new HubError_1.default("fetchExportImageDownloadFileUrl", "Only extent geometric filters are supported for this type of download");
55
+ }
56
+ }
57
+ function getExportImageExtent(options) {
58
+ const { entity, geometry } = options;
59
+ const serverExtent = get_prop_1.getProp(entity, "extendedProps.server.extent");
60
+ // TODO: Factor in entity.extent if it exists AND is a valid 4326 bbox
61
+ let result = null;
62
+ if (geometry) {
63
+ result = geometry;
64
+ }
65
+ else if (serverExtent) {
66
+ result = serverExtent;
67
+ }
68
+ if (!result) {
69
+ throw new HubError_1.default("fetchExportImageDownloadFileUrl", "Extent required for this download operation");
70
+ }
71
+ return result;
72
+ }
73
+ function getBlobFilename(entity, format) {
74
+ const name = entity.name || get_prop_1.getProp(entity, "extendedProps.server.name");
75
+ const extension = format.includes(types_1.ServiceDownloadFormat.PNG)
76
+ ? // NOTE: the png family of formats (png8, png24, etc.) share the same extension
77
+ types_1.ServiceDownloadFormat.PNG
78
+ : format;
79
+ return `${name}.${extension}`;
80
+ }
81
+ //# sourceMappingURL=fetchExportImageDownloadFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchExportImageDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fetchers/fetchExportImageDownloadFile.ts"],"names":[],"mappings":";;;AAAA,mEAAoD;AACpD,uCAKqB;AACrB,gDAAyC;AACzC,wDAAoD;AAIpD;;;;;;;GAOG;AACI,KAAK,UAAU,4BAA4B,CAChD,OAAkC;IAElC,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAC9D,gBAAgB,IAAI,gBAAgB,CAAC,+BAAuB,CAAC,OAAO,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC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ACrC,MAAM,YAAY,GAAG,kBAAO,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IAEpE,sEAAsE;IACtE,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,IAAI,QAAQ,EAAE;QACZ,MAAM,GAAG,QAAyB,CAAC;KACpC;SAAM,IAAI,YAAY,EAAE;QACvB,MAAM,GAAG,YAAY,CAAC;KACvB;IAED,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,kBAAQ,CAChB,iCAAiC,EACjC,6CAA6C,CAC9C,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,eAAe,CACtB,MAA2B,EAC3B,MAAyB;IAEzB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,kBAAO,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,6BAAqB,CAAC,GAAG,CAAC;QAC1D,CAAC,CAAC,+EAA+E;YAC/E,6BAAqB,CAAC,GAAG;QAC3B,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,GAAG,IAAI,IAAI,SAAS,EAAE,CAAC;AAChC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchExportItemDownloadFileUrl = void 0;
3
+ exports.fetchExportItemDownloadFile = void 0;
4
4
  const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
5
5
  const types_1 = require("../../types");
6
6
  const getExportItemDataUrl_1 = require("../getExportItemDataUrl");
@@ -24,7 +24,7 @@ const get_prop_1 = require("../../../objects/get-prop");
24
24
  * @param options options for refining / filtering the resulting download file
25
25
  * @returns a url to download the file
26
26
  */
27
- async function fetchExportItemDownloadFileUrl(options) {
27
+ async function fetchExportItemDownloadFile(options) {
28
28
  validateOptions(options);
29
29
  const { entity, format, context, progressCallback, pollInterval } = options;
30
30
  progressCallback && progressCallback(types_1.DownloadOperationStatus.PENDING);
@@ -38,9 +38,12 @@ async function fetchExportItemDownloadFileUrl(options) {
38
38
  // TODO: Once the job is completed, we still need to set the special typekeywords needed to find the item later.
39
39
  // Also, I _think_ we can only do one layer at a time (at least with the current typeKeywords schema we're using)
40
40
  progressCallback && progressCallback(types_1.DownloadOperationStatus.COMPLETED);
41
- return getExportItemDataUrl_1.getExportItemDataUrl(exportItemId, context);
41
+ return {
42
+ type: "url",
43
+ href: getExportItemDataUrl_1.getExportItemDataUrl(exportItemId, context),
44
+ };
42
45
  }
43
- exports.fetchExportItemDownloadFileUrl = fetchExportItemDownloadFileUrl;
46
+ exports.fetchExportItemDownloadFile = fetchExportItemDownloadFile;
44
47
  function validateOptions(options) {
45
48
  const { geometry, where } = options;
46
49
  if (geometry) {
@@ -80,4 +83,4 @@ async function pollForJobCompletion(exportedItemId, jobId, context, pollInterval
80
83
  return pollForJobCompletion(exportedItemId, jobId, context, pollInterval, progressCallback);
81
84
  }
82
85
  }
83
- //# sourceMappingURL=fetchExportItemDownloadFileUrl.js.map
86
+ //# sourceMappingURL=fetchExportItemDownloadFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchExportItemDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fetchers/fetchExportItemDownloadFile.ts"],"names":[],"mappings":";;;AAAA,iEAKkC;AAClC,uCAQqB;AACrB,kEAA+D;AAC/D,gDAAyC;AAGzC,wDAAoD;AAEpD;;;;;;;;;;;;;;;;;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,CAAC,OAAO,CAAC,CAAC;IACtE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,MAAM,+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,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,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchHubApiDownloadFileUrl = void 0;
3
+ exports.fetchHubApiDownloadFile = void 0;
4
4
  const HubError_1 = require("../../../HubError");
5
5
  const get_prop_1 = require("../../../objects/get-prop");
6
6
  const types_1 = require("../../types");
@@ -18,13 +18,13 @@ const types_1 = require("../../types");
18
18
  * @param options options for refining / filtering the resulting download file
19
19
  * @returns a url to download the file
20
20
  */
21
- async function fetchHubApiDownloadFileUrl(options) {
21
+ async function fetchHubApiDownloadFile(options) {
22
22
  validateOptions(options);
23
23
  const requestUrl = getDownloadApiRequestUrl(options);
24
24
  const { pollInterval, progressCallback } = options;
25
25
  return pollDownloadApi(requestUrl, pollInterval, progressCallback);
26
26
  }
27
- exports.fetchHubApiDownloadFileUrl = fetchHubApiDownloadFileUrl;
27
+ exports.fetchHubApiDownloadFile = fetchHubApiDownloadFile;
28
28
  function validateOptions(options) {
29
29
  const { layers = [] } = options;
30
30
  // The Hub Download API currently requires a target layer to be specified
@@ -90,7 +90,10 @@ async function pollDownloadApi(requestUrl, pollInterval, progressCallback) {
90
90
  progressCallback && progressCallback(operationStatus, progressInPercent);
91
91
  // Operation complete, return the download URL
92
92
  if (resultUrl) {
93
- return resultUrl;
93
+ return {
94
+ type: "url",
95
+ href: resultUrl,
96
+ };
94
97
  }
95
98
  // Operation still in progress, poll again
96
99
  await new Promise((resolve) => setTimeout(resolve, pollInterval));
@@ -137,4 +140,4 @@ function toDownloadOperationStatus(status) {
137
140
  return (createReplicaStatusMap[status] ||
138
141
  pagingJobStatusMap[status]);
139
142
  }
140
- //# sourceMappingURL=fetchHubApiDownloadFileUrl.js.map
143
+ //# sourceMappingURL=fetchHubApiDownloadFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchHubApiDownloadFile.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/file-url-fetchers/fetchHubApiDownloadFile.ts"],"names":[],"mappings":";;;AAAA,gDAAyC;AACzC,wDAAoD;AACpD,uCAOqB;AAErB;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,uBAAuB,CAC3C,OAAkC;IAElC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IACnD,OAAO,eAAe,CAAC,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;AACrE,CAAC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EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,yBAAyB,CAChC,MAA4B;IAE5B,gFAAgF;IAChF,MAAM,sBAAsB,GAGxB;QACF,wEAAwE;QACxE,OAAO,EAAE,+BAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,+BAAuB,CAAC,UAAU;QAC9C,aAAa,EAAE,+BAAuB,CAAC,UAAU;QACjD,iBAAiB,EAAE,+BAAuB,CAAC,UAAU;QACrD,SAAS,EAAE,+BAAuB,CAAC,SAAS;QAC5C,mBAAmB,EAAE,+BAAuB,CAAC,MAAM;QACnD,MAAM,EAAE,+BAAuB,CAAC,MAAM;QAEtC,mGAAmG;QACnG,mBAAmB,EAAE,+BAAuB,CAAC,UAAU;QACvD,aAAa,EAAE,+BAAuB,CAAC,UAAU;QACjD,aAAa,EAAE,+BAAuB,CAAC,UAAU;QACjD,iBAAiB,EAAE,+BAAuB,CAAC,UAAU;QACrD,iBAAiB,EAAE,+BAAuB,CAAC,UAAU;QACrD,oBAAoB,EAAE,+BAAuB,CAAC,UAAU;KACzD,CAAC;IAEF,2EAA2E;IAC3E,yEAAyE;IACzE,MAAM,kBAAkB,GAAqD;QAC3E,OAAO,EAAE,+BAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,+BAAuB,CAAC,UAAU;QAC9C,UAAU,EAAE,+BAAuB,CAAC,UAAU;QAC9C,cAAc,EAAE,+BAAuB,CAAC,UAAU;QAClD,MAAM,EAAE,+BAAuB,CAAC,MAAM;QACtC,SAAS,EAAE,+BAAuB,CAAC,SAAS;KAC7C,CAAC;IAEF,OAAO,CACL,sBAAsB,CAAC,MAA6B,CAAC;QACrD,kBAAkB,CAAC,MAAyB,CAAC,CAC9C,CAAC;AACJ,CAAC"}
@@ -10,6 +10,7 @@ const _types_1 = require("../_types");
10
10
  * @returns available download formats for the entity
11
11
  */
12
12
  function getCreateReplicaFormats(entity) {
13
+ // TODO: Change to use `extendedProps.serverExtractFormats`
13
14
  const allFormats = entity.serverExtractFormats || [];
14
15
  // List recognized formats in the order they are defined in CREATE_REPLICA_FORMATS
15
16
  const recognizedFormats = _types_1.CREATE_REPLICA_FORMATS.filter((format) => allFormats.includes(format));
@@ -1 +1 @@
1
- {"version":3,"file":"getCreateReplicaFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getCreateReplicaFormats.ts"],"names":[],"mappings":";;;AAEA,sCAAwE;AAExE;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,MAA2B;IAE3B,MAAM,UAAU,GAAG,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;IAErD,kFAAkF;IAClF,MAAM,iBAAiB,GACrB,+BAAsB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzE,mFAAmF;IACnF,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAC3C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,+BAAsB,CAAC,QAAQ,CAAC,MAA6B,CAAC,CAC5E,CAAC;IAEF,OAAO,CAAC,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,CAAC,CAAC,GAAG,CACvD,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;QACnB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,MAA6B;KACtC,CAAC,CACH,CAAC;AACJ,CAAC;AApBD,0DAoBC"}
1
+ {"version":3,"file":"getCreateReplicaFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getCreateReplicaFormats.ts"],"names":[],"mappings":";;;AAEA,sCAAwE;AAExE;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,MAA2B;IAE3B,2DAA2D;IAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,oBAAoB,IAAI,EAAE,CAAC;IAErD,kFAAkF;IAClF,MAAM,iBAAiB,GACrB,+BAAsB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzE,mFAAmF;IACnF,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAC3C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,+BAAsB,CAAC,QAAQ,CAAC,MAA6B,CAAC,CAC5E,CAAC;IAEF,OAAO,CAAC,GAAG,iBAAiB,EAAE,GAAG,mBAAmB,CAAC,CAAC,GAAG,CACvD,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;QACnB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,MAA6B;KACtC,CAAC,CACH,CAAC;AACJ,CAAC;AArBD,0DAqBC"}
@@ -1,15 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExportImageFormats = void 0;
4
+ const objects_1 = require("../../../objects");
5
+ const types_1 = require("../../types");
6
+ const _types_1 = require("../_types");
4
7
  /**
5
8
  * @private
6
- * Returns all the download formats that are exposed by Image Services via the /exportImage operation.
7
- *
8
- * NOTE: This function is a work-in-progress. Various permissions and logic branches are not yet implemented.
9
+ * Returns all the download formats that are exposed by an Image Service via the /exportImage operation.
9
10
  */
10
- function getExportImageFormats() {
11
- throw new Error("Not implemented");
12
- // return EXPORT_IMAGE_FORMATS.map((format) => ({ type: "dynamic", format }));
11
+ function getExportImageFormats(entity) {
12
+ const serverVersion = objects_1.getProp(entity, "extendedProps.server.currentVersion") || 0;
13
+ // NOTE: We have to imperatively exclude formats based on the server version
14
+ // because there is no other way to determine which formats are supported.
15
+ // See the EXPORT_IMAGE_FORMATS constant for notes on individual formats.
16
+ const supportedFormats = (serverVersion < 10.2
17
+ ? _types_1.EXPORT_IMAGE_FORMATS.filter((f) => f !== types_1.ServiceDownloadFormat.PNG32)
18
+ : _types_1.EXPORT_IMAGE_FORMATS);
19
+ return supportedFormats.map((format) => ({
20
+ type: "dynamic",
21
+ format,
22
+ }));
13
23
  }
14
24
  exports.getExportImageFormats = getExportImageFormats;
15
25
  //# sourceMappingURL=getExportImageFormats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getExportImageFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getExportImageFormats.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,qBAAqB;IACnC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACnC,8EAA8E;AAChF,CAAC;AAHD,sDAGC"}
1
+ {"version":3,"file":"getExportImageFormats.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/format-fetchers/getExportImageFormats.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAC3C,uCAA4E;AAC5E,sCAAoE;AAEpE;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,MAA2B;IAE3B,MAAM,aAAa,GACjB,iBAAO,CAAC,MAAM,EAAE,qCAAqC,CAAC,IAAI,CAAC,CAAC;IAE9D,4EAA4E;IAC5E,0EAA0E;IAC1E,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,CACvB,aAAa,GAAG,IAAI;QAClB,CAAC,CAAC,6BAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,6BAAqB,CAAC,KAAK,CAAC;QACvE,CAAC,CAAC,6BAAoB,CACF,CAAC;IAEzB,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAyB,EAAE,EAAE,CAAC,CAAC;QAC1D,IAAI,EAAE,SAAS;QACf,MAAM;KACP,CAAC,CAAC,CAAC;AACN,CAAC;AAnBD,sDAmBC"}
@@ -11,6 +11,7 @@ function canUseCreateReplica(entity) {
11
11
  // NOTE: We currently do not allow Hub to perform the /createReplica operation on enterprise / self-hosted
12
12
  // feature services due to known limitations with the enterprise implementation of /createReplica.
13
13
  // This is a temporary restriction until the enterprise implementation is improved.
14
+ // TODO: change to use `extendedProps.serverExtractCapability`
14
15
  return hostedServiceUtils_1.isAGOFeatureServiceUrl(entity.url) && !!entity.serverExtractCapability;
15
16
  }
16
17
  exports.canUseCreateReplica = canUseCreateReplica;
@@ -1 +1 @@
1
- {"version":3,"file":"canUseCreateReplica.js","sourceRoot":"","sources":["../../../src/downloads/canUseCreateReplica.ts"],"names":[],"mappings":";;;AAAA,sEAAuE;AAGvE;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,MAA2B;IAC7D,0GAA0G;IAC1G,kGAAkG;IAClG,mFAAmF;IACnF,OAAO,2CAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC;AAChF,CAAC;AALD,kDAKC"}
1
+ {"version":3,"file":"canUseCreateReplica.js","sourceRoot":"","sources":["../../../src/downloads/canUseCreateReplica.ts"],"names":[],"mappings":";;;AAAA,sEAAuE;AAGvE;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,MAA2B;IAC7D,0GAA0G;IAC1G,kGAAkG;IAClG,mFAAmF;IACnF,8DAA8D;IAC9D,OAAO,2CAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC;AAChF,CAAC;AAND,kDAMC"}
@@ -5,6 +5,7 @@ const urls_1 = require("../urls");
5
5
  function canUseHubDownloadSystem(entity) {
6
6
  const isMapOrFeatureService = urls_1.isMapOrFeatureServerUrl(entity.url);
7
7
  const isPublic = entity.access === "public";
8
+ // TODO: use `extendedProps.serverQueryCapability` instead
8
9
  const isQueryEnabled = entity.serverQueryCapability;
9
10
  return isMapOrFeatureService && isPublic && isQueryEnabled;
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"canUseHubDownloadSystem.js","sourceRoot":"","sources":["../../../src/downloads/canUseHubDownloadSystem.ts"],"names":[],"mappings":";;;AACA,kCAAkD;AAElD,SAAgB,uBAAuB,CAAC,MAA2B;IACjE,MAAM,qBAAqB,GAAG,8BAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC;IAC5C,MAAM,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;IACpD,OAAO,qBAAqB,IAAI,QAAQ,IAAI,cAAc,CAAC;AAC7D,CAAC;AALD,0DAKC"}
1
+ {"version":3,"file":"canUseHubDownloadSystem.js","sourceRoot":"","sources":["../../../src/downloads/canUseHubDownloadSystem.ts"],"names":[],"mappings":";;;AACA,kCAAkD;AAElD,SAAgB,uBAAuB,CAAC,MAA2B;IACjE,MAAM,qBAAqB,GAAG,8BAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC;IAC5C,0DAA0D;IAC1D,MAAM,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;IACpD,OAAO,qBAAqB,IAAI,QAAQ,IAAI,cAAc,CAAC;AAC7D,CAAC;AAND,0DAMC"}
@@ -1,33 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchDownloadFileUrl = void 0;
3
+ exports.fetchDownloadFile = void 0;
4
4
  const HubError_1 = require("../HubError");
5
5
  const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
6
6
  const canUseExportItemFlow_1 = require("./_internal/canUseExportItemFlow");
7
7
  const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
8
8
  /**
9
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
10
+ * @param options options to refine / filter the results of the fetchDownloadFile operation
11
+ * @returns a promise that resolves with a download file url or blob
12
12
  * @throws {ArcgisHubDownloadError} if the download file URL cannot be fetched for a well-known reason
13
13
  */
14
- async function fetchDownloadFileUrl(options) {
14
+ async function fetchDownloadFile(options) {
15
15
  // If the pollInterval is not set, default to 3 seconds
16
16
  const withPollInterval = options.pollInterval == null ? Object.assign(Object.assign({}, options), { pollInterval: 3000 }) : options;
17
17
  let fetchingFn;
18
18
  if (canUseHubDownloadApi_1.canUseHubDownloadApi(withPollInterval.entity, withPollInterval.context)) {
19
- fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchHubApiDownloadFileUrl"))).fetchHubApiDownloadFileUrl;
19
+ fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchHubApiDownloadFile"))).fetchHubApiDownloadFile;
20
20
  }
21
21
  else if (canUseExportItemFlow_1.canUseExportItemFlow(withPollInterval.entity)) {
22
- fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportItemDownloadFileUrl"))).fetchExportItemDownloadFileUrl;
22
+ fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportItemDownloadFile"))).fetchExportItemDownloadFile;
23
23
  }
24
24
  else if (canUseExportImageFlow_1.canUseExportImageFlow(withPollInterval.entity)) {
25
- fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportImageDownloadFileUrl"))).fetchExportImageDownloadFileUrl;
25
+ fetchingFn = (await Promise.resolve().then(() => require("./_internal/file-url-fetchers/fetchExportImageDownloadFile"))).fetchExportImageDownloadFile;
26
26
  }
27
27
  else {
28
- throw new HubError_1.default("fetchDownloadFileUrl", "Downloads are not supported for this item in this environment");
28
+ throw new HubError_1.default("fetchDownloadFile", "Downloads are not supported for this item in this environment");
29
29
  }
30
30
  return fetchingFn(withPollInterval);
31
31
  }
32
- exports.fetchDownloadFileUrl = fetchDownloadFileUrl;
33
- //# sourceMappingURL=fetchDownloadFileUrl.js.map
32
+ exports.fetchDownloadFile = fetchDownloadFile;
33
+ //# sourceMappingURL=fetchDownloadFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,6EAA0E;AAC1E,2EAAwE;AACxE,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,2CAAoB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QACxD,UAAU,GAAG,CACX,2CAAa,2DAA2D,EAAC,CAC1E,CAAC,2BAA2B,CAAC;KAC/B;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;AA3BD,8CA2BC"}
@@ -23,9 +23,10 @@ async function fetchDownloadFormats(options) {
23
23
  }
24
24
  else if (canUseExportImageFlow_1.canUseExportImageFlow(entity)) {
25
25
  const { getExportImageFormats } = await Promise.resolve().then(() => require("./_internal/format-fetchers/getExportImageFormats"));
26
- baseFormats = getExportImageFormats();
26
+ baseFormats = getExportImageFormats(entity);
27
27
  }
28
28
  // add additional resource links as static formats
29
+ // TODO: change to use `extendedProps.additionalResources`
29
30
  const additionalFormats = (entity.additionalResources || []).map(toStaticFormat);
30
31
  // combine formats into single list
31
32
  return [...baseFormats, ...additionalFormats];
@@ -1 +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,4BAA4B,EAC7B,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"}
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,4BAA4B,EAC7B,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,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;AA/BD,oDA+BC;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"}
@@ -3,7 +3,7 @@ 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
5
  tslib_1.__exportStar(require("./types"), exports);
6
- tslib_1.__exportStar(require("./fetchDownloadFileUrl"), exports);
6
+ tslib_1.__exportStar(require("./fetchDownloadFile"), exports);
7
7
  tslib_1.__exportStar(require("./fetchDownloadFormats"), exports);
8
8
  tslib_1.__exportStar(require("./canUseCreateReplica"), exports);
9
9
  tslib_1.__exportStar(require("./canUseHubDownloadSystem"), exports);
@@ -1 +1 @@
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,oEAA0C;AAC1C,iEAAuC;AACvC,qEAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/downloads/index.ts"],"names":[],"mappings":";;;AAAA,gFAAsD;AACtD,kDAAwB;AACxB,8DAAoC;AACpC,iEAAuC;AACvC,gEAAsC;AACtC,oEAA0C;AAC1C,iEAAuC;AACvC,qEAA2C"}
@@ -49,18 +49,18 @@ exports.PORTAL_EXPORT_TYPES = {
49
49
  var ServiceDownloadFormat;
50
50
  (function (ServiceDownloadFormat) {
51
51
  // Image Service Formats
52
- ServiceDownloadFormat["BIP"] = "bip";
53
52
  ServiceDownloadFormat["BMP"] = "bmp";
54
- ServiceDownloadFormat["BSQ"] = "bsq";
55
53
  ServiceDownloadFormat["GIF"] = "gif";
56
54
  ServiceDownloadFormat["JPG"] = "jpg";
57
55
  ServiceDownloadFormat["JPG_PNG"] = "jpgpng";
58
- ServiceDownloadFormat["LERC"] = "lerc";
59
56
  ServiceDownloadFormat["PNG"] = "png";
60
57
  ServiceDownloadFormat["PNG8"] = "png8";
61
58
  ServiceDownloadFormat["PNG24"] = "png24";
62
- ServiceDownloadFormat["PNG32"] = "png32";
63
59
  ServiceDownloadFormat["TIFF"] = "tiff";
60
+ ServiceDownloadFormat["PNG32"] = "png32";
61
+ ServiceDownloadFormat["BIP"] = "bip";
62
+ ServiceDownloadFormat["BSQ"] = "bsq";
63
+ ServiceDownloadFormat["LERC"] = "lerc";
64
64
  // Map & Feature Service Formats
65
65
  ServiceDownloadFormat["CSV"] = "csv";
66
66
  ServiceDownloadFormat["EXCEL"] = "excel";