@esri/hub-common 14.177.1 → 14.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/content/HubContent.js +5 -0
- package/dist/esm/content/HubContent.js.map +1 -1
- package/dist/esm/content/_internal/ContentSchema.js +5 -0
- package/dist/esm/content/_internal/ContentSchema.js.map +1 -1
- package/dist/esm/content/_internal/ContentUiSchemaSettings.js +5 -23
- package/dist/esm/content/_internal/ContentUiSchemaSettings.js.map +1 -1
- package/dist/esm/content/_internal/computeProps.js +1 -0
- package/dist/esm/content/_internal/computeProps.js.map +1 -1
- package/dist/esm/content/_internal/getDownloadsSection.js +135 -0
- package/dist/esm/content/_internal/getDownloadsSection.js.map +1 -0
- package/dist/esm/content/_internal/shouldShowDownloadsConfiguration.js +23 -0
- package/dist/esm/content/_internal/shouldShowDownloadsConfiguration.js.map +1 -0
- package/dist/esm/content/edit.js +40 -3
- package/dist/esm/content/edit.js.map +1 -1
- package/dist/esm/downloads/_internal/additional-resources/utils.js +23 -0
- package/dist/esm/downloads/_internal/additional-resources/utils.js.map +1 -0
- package/dist/esm/downloads/_internal/getDownloadConfigurationDisplayFormats.js +75 -0
- package/dist/esm/downloads/_internal/getDownloadConfigurationDisplayFormats.js.map +1 -0
- package/dist/esm/downloads/_internal/getDownloadFlow.js +26 -0
- package/dist/esm/downloads/_internal/getDownloadFlow.js.map +1 -0
- package/dist/esm/downloads/_internal/getDownloadFormatsByFlow.js +28 -0
- package/dist/esm/downloads/_internal/getDownloadFormatsByFlow.js.map +1 -0
- package/dist/esm/downloads/fetchDownloadFile.js +20 -0
- package/dist/esm/downloads/fetchDownloadFile.js.map +1 -1
- package/dist/esm/downloads/fetchDownloadFormats.js +4 -0
- package/dist/esm/downloads/fetchDownloadFormats.js.map +1 -1
- package/dist/esm/downloads/getDownloadConfiguration.js +52 -0
- package/dist/esm/downloads/getDownloadConfiguration.js.map +1 -0
- package/dist/esm/downloads/getDownloadFormats.js +59 -0
- package/dist/esm/downloads/getDownloadFormats.js.map +1 -0
- package/dist/esm/downloads/index.js +2 -0
- package/dist/esm/downloads/index.js.map +1 -1
- package/dist/esm/events/HubEvent.js +2 -2
- package/dist/esm/events/HubEvent.js.map +1 -1
- package/dist/esm/events/api/orval/api/orval-events.js.map +1 -1
- package/dist/esm/events/edit.js +6 -1
- package/dist/esm/events/edit.js.map +1 -1
- package/dist/node/content/HubContent.js +5 -0
- package/dist/node/content/HubContent.js.map +1 -1
- package/dist/node/content/_internal/ContentSchema.js +5 -0
- package/dist/node/content/_internal/ContentSchema.js.map +1 -1
- package/dist/node/content/_internal/ContentUiSchemaSettings.js +5 -23
- package/dist/node/content/_internal/ContentUiSchemaSettings.js.map +1 -1
- package/dist/node/content/_internal/computeProps.js +1 -0
- package/dist/node/content/_internal/computeProps.js.map +1 -1
- package/dist/node/content/_internal/getDownloadsSection.js +139 -0
- package/dist/node/content/_internal/getDownloadsSection.js.map +1 -0
- package/dist/node/content/_internal/shouldShowDownloadsConfiguration.js +27 -0
- package/dist/node/content/_internal/shouldShowDownloadsConfiguration.js.map +1 -0
- package/dist/node/content/edit.js +39 -2
- package/dist/node/content/edit.js.map +1 -1
- package/dist/node/downloads/_internal/additional-resources/utils.js +28 -0
- package/dist/node/downloads/_internal/additional-resources/utils.js.map +1 -0
- package/dist/node/downloads/_internal/getDownloadConfigurationDisplayFormats.js +79 -0
- package/dist/node/downloads/_internal/getDownloadConfigurationDisplayFormats.js.map +1 -0
- package/dist/node/downloads/_internal/getDownloadFlow.js +30 -0
- package/dist/node/downloads/_internal/getDownloadFlow.js.map +1 -0
- package/dist/node/downloads/_internal/getDownloadFormatsByFlow.js +32 -0
- package/dist/node/downloads/_internal/getDownloadFormatsByFlow.js.map +1 -0
- package/dist/node/downloads/fetchDownloadFile.js +20 -0
- package/dist/node/downloads/fetchDownloadFile.js.map +1 -1
- package/dist/node/downloads/fetchDownloadFormats.js +4 -0
- package/dist/node/downloads/fetchDownloadFormats.js.map +1 -1
- package/dist/node/downloads/getDownloadConfiguration.js +56 -0
- package/dist/node/downloads/getDownloadConfiguration.js.map +1 -0
- package/dist/node/downloads/getDownloadFormats.js +63 -0
- package/dist/node/downloads/getDownloadFormats.js.map +1 -0
- package/dist/node/downloads/index.js +2 -0
- package/dist/node/downloads/index.js.map +1 -1
- package/dist/node/events/HubEvent.js +2 -2
- package/dist/node/events/HubEvent.js.map +1 -1
- package/dist/node/events/api/orval/api/orval-events.js.map +1 -1
- package/dist/node/events/edit.js +7 -1
- package/dist/node/events/edit.js.map +1 -1
- package/dist/types/content/_internal/getDownloadsSection.d.ts +13 -0
- package/dist/types/content/_internal/shouldShowDownloadsConfiguration.d.ts +13 -0
- package/dist/types/core/types/IHubEditableContent.d.ts +57 -1
- package/dist/types/downloads/_internal/additional-resources/utils.d.ts +19 -0
- package/dist/types/downloads/_internal/getDownloadConfigurationDisplayFormats.d.ts +10 -0
- package/dist/types/downloads/_internal/getDownloadFlow.d.ts +11 -0
- package/dist/types/downloads/_internal/getDownloadFormatsByFlow.d.ts +11 -0
- package/dist/types/downloads/fetchDownloadFormats.d.ts +2 -0
- package/dist/types/downloads/getDownloadConfiguration.d.ts +11 -0
- package/dist/types/downloads/getDownloadFormats.d.ts +9 -0
- package/dist/types/downloads/index.d.ts +2 -0
- package/dist/types/events/api/orval/api/orval-events.d.ts +9 -1
- package/dist/types/events/edit.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.editorToContent = exports.deleteContent = exports.updateContent = exports.createContent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
6
|
// Note - we separate these imports so we can cleanly spy on things in tests
|
|
6
7
|
const models_1 = require("../models");
|
|
@@ -15,6 +16,9 @@ const hostedServiceUtils_1 = require("./hostedServiceUtils");
|
|
|
15
16
|
const manageSchedule_1 = require("./manageSchedule");
|
|
16
17
|
const internalContentUtils_1 = require("./_internal/internalContentUtils");
|
|
17
18
|
const objects_1 = require("../objects");
|
|
19
|
+
const getDownloadFlow_1 = require("../downloads/_internal/getDownloadFlow");
|
|
20
|
+
const getDownloadConfiguration_1 = require("../downloads/getDownloadConfiguration");
|
|
21
|
+
const shouldShowDownloadsConfiguration_1 = require("./_internal/shouldShowDownloadsConfiguration");
|
|
18
22
|
// TODO: move this to defaults?
|
|
19
23
|
const DEFAULT_CONTENT_MODEL = {
|
|
20
24
|
item: {
|
|
@@ -84,6 +88,22 @@ async function updateContent(content, requestOptions) {
|
|
|
84
88
|
// we are not attempting to handle "concurrent edit" conflict resolution
|
|
85
89
|
// but this is where we would apply that sort of logic
|
|
86
90
|
const modelToUpdate = mapper.entityToStore(content, model);
|
|
91
|
+
// NOTE: Product has asked that we display a _disabled_ downloads configuration for
|
|
92
|
+
// certain types of entities, but not allow users to change any settings. The following
|
|
93
|
+
// checks are in place to make sure we don't accidentally save configurations in
|
|
94
|
+
// situations where we shouldn't
|
|
95
|
+
const downloadFlow = getDownloadFlow_1.getDownloadFlow(content);
|
|
96
|
+
const updatedFormats = objects_1.getProp(content, "extendedProps.downloads.formats");
|
|
97
|
+
const isMainEntityExtractDisabled = hostedServiceUtils_1.isHostedFeatureServiceMainEntity(content) &&
|
|
98
|
+
downloadFlow !== "createReplica";
|
|
99
|
+
const wasDownloadsConfigurationDisplayed = shouldShowDownloadsConfiguration_1.shouldShowDownloadsConfiguration(content);
|
|
100
|
+
if (wasDownloadsConfigurationDisplayed && // whether the downloads configuration was displayed
|
|
101
|
+
downloadFlow && // whether the entity can be downloaded
|
|
102
|
+
updatedFormats && // whether download format configuration is present
|
|
103
|
+
!isMainEntityExtractDisabled) {
|
|
104
|
+
const updatedDownloadsConfiguration = util_1.cloneObject(content.extendedProps.downloads);
|
|
105
|
+
objects_1.setProp("item.properties.downloads", updatedDownloadsConfiguration, modelToUpdate, true);
|
|
106
|
+
}
|
|
87
107
|
// TODO: if we have resources disconnect them from the model for now.
|
|
88
108
|
// if (modelToUpdate.resources) {
|
|
89
109
|
// resources = configureBaseResources(
|
|
@@ -152,8 +172,25 @@ exports.deleteContent = deleteContent;
|
|
|
152
172
|
*/
|
|
153
173
|
function editorToContent(editor, portal) {
|
|
154
174
|
var _a;
|
|
155
|
-
//
|
|
156
|
-
const
|
|
175
|
+
// Clone the editor to prevent mutation
|
|
176
|
+
const clonedEditor = util_1.cloneObject(editor);
|
|
177
|
+
// Remove unneeded properties
|
|
178
|
+
delete clonedEditor.downloadFormats;
|
|
179
|
+
// Cast the editor to a content
|
|
180
|
+
const content = util_1.cloneObject(clonedEditor);
|
|
181
|
+
// Conditionally set the downloads configuration. We only want
|
|
182
|
+
// to set the configuration if the entity is actually downloadable
|
|
183
|
+
const downloadFlow = getDownloadFlow_1.getDownloadFlow(content);
|
|
184
|
+
if (downloadFlow && editor.downloadFormats) {
|
|
185
|
+
const downloadConfiguration = getDownloadConfiguration_1.getDownloadConfiguration(content);
|
|
186
|
+
// Convert the download format display objects to the stored format
|
|
187
|
+
const forStorage = editor.downloadFormats.map((format) => {
|
|
188
|
+
const { label } = format, rest = tslib_1.__rest(format, ["label"]);
|
|
189
|
+
return rest;
|
|
190
|
+
});
|
|
191
|
+
downloadConfiguration.formats = forStorage;
|
|
192
|
+
objects_1.setProp("extendedProps.downloads", downloadConfiguration, content, true);
|
|
193
|
+
}
|
|
157
194
|
// copy the location extent up one level
|
|
158
195
|
content.extent = (_a = editor.location) === null || _a === void 0 ? void 0 : _a.extent;
|
|
159
196
|
return content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/content/edit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/content/edit.ts"],"names":[],"mappings":";;;;AACA,iEAKkC;AAOlC,4EAA4E;AAC5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CAAC,OAAO,GAAG,UAAU,CAAC;QAC3C,iBAAO,CAAC,yBAAyB,EAAE,qBAAqB,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;KAC1E;IAED,wCAAwC;IACxC,OAAO,CAAC,MAAM,SAAG,MAAM,CAAC,QAAQ,0CAAE,MAAM,CAAC;IAEzC,OAAO,OAAO,CAAC;AACjB,CAAC;AA9BD,0CA8BC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAdditionalResourceIndex = exports.isAdditionalResourceConfiguration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* Determines if the given download format configuration is for
|
|
7
|
+
* an additional resource.
|
|
8
|
+
*
|
|
9
|
+
* @param config IDownloadFormatConfiguration
|
|
10
|
+
* @returns boolean
|
|
11
|
+
*/
|
|
12
|
+
function isAdditionalResourceConfiguration(config) {
|
|
13
|
+
return config.key.startsWith("additionalResource::");
|
|
14
|
+
}
|
|
15
|
+
exports.isAdditionalResourceConfiguration = isAdditionalResourceConfiguration;
|
|
16
|
+
/**
|
|
17
|
+
* @private
|
|
18
|
+
* Get's the index of the additional resource from the given
|
|
19
|
+
* download format configuration.
|
|
20
|
+
*
|
|
21
|
+
* @param config IDownloadFormatConfiguration
|
|
22
|
+
* @returns number - The index of the additional resource
|
|
23
|
+
*/
|
|
24
|
+
function getAdditionalResourceIndex(config) {
|
|
25
|
+
return parseInt(config.key.split("::")[1], 10);
|
|
26
|
+
}
|
|
27
|
+
exports.getAdditionalResourceIndex = getAdditionalResourceIndex;
|
|
28
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/downloads/_internal/additional-resources/utils.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,SAAgB,iCAAiC,CAC/C,MAAoC;IAEpC,OAAO,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;AACvD,CAAC;AAJD,8EAIC;AAED;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CACxC,MAAoC;IAEpC,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAJD,gEAIC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDownloadConfigurationDisplayFormats = void 0;
|
|
4
|
+
const content_1 = require("../../content");
|
|
5
|
+
const get_prop_1 = require("../../objects/get-prop");
|
|
6
|
+
const getDownloadConfiguration_1 = require("../getDownloadConfiguration");
|
|
7
|
+
const getCreateReplicaFormats_1 = require("./format-fetchers/getCreateReplicaFormats");
|
|
8
|
+
const getPagingJobFormats_1 = require("./format-fetchers/getPagingJobFormats");
|
|
9
|
+
const utils_1 = require("./additional-resources/utils");
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
* Returns configuration objects for each download format that should be displayed
|
|
13
|
+
* in the editing experience of a content entity. This function should not be used
|
|
14
|
+
* to calculate the download formats that should be present on the live UI.
|
|
15
|
+
* @param entity entity to get download format configurations for
|
|
16
|
+
* @returns download format configurations to display
|
|
17
|
+
*/
|
|
18
|
+
function getDownloadConfigurationDisplayFormats(entity) {
|
|
19
|
+
const configuration = getDownloadConfiguration_1.getDownloadConfiguration(entity);
|
|
20
|
+
const flowType = configuration.flowType;
|
|
21
|
+
let formats = configuration.formats;
|
|
22
|
+
// For feature or map services that don't meet the criteria to be downloaded (i.e., no flowType)
|
|
23
|
+
// Product wants to show paging formats as a preview of what _could_ be downloaded should
|
|
24
|
+
// the criteria be met.
|
|
25
|
+
if (!flowType && ["Feature Service", "Map Service"].includes(entity.type)) {
|
|
26
|
+
const pagingFormats = getPagingJobFormats_1.getPagingJobFormats().map((f) => {
|
|
27
|
+
return {
|
|
28
|
+
key: f.format,
|
|
29
|
+
hidden: false,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
// TODO: Should we just show paging formats as a preview or include additional resources?
|
|
33
|
+
formats = pagingFormats;
|
|
34
|
+
}
|
|
35
|
+
// For main entities of a hosted feature service with extract disabled, we want to display
|
|
36
|
+
// the list of createReplica formats as a preview of what _could_ be downloaded should
|
|
37
|
+
// the extract capability be enabled
|
|
38
|
+
if (content_1.isHostedFeatureServiceMainEntity(entity) &&
|
|
39
|
+
flowType !== "createReplica") {
|
|
40
|
+
const createReplicaFormats = getCreateReplicaFormats_1.getCreateReplicaFormats(entity).map((f) => {
|
|
41
|
+
return {
|
|
42
|
+
key: f.format,
|
|
43
|
+
hidden: false,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
formats = createReplicaFormats;
|
|
47
|
+
}
|
|
48
|
+
const additionalResources = get_prop_1.getProp(entity, "extendedProps.additionalResources") || [];
|
|
49
|
+
return formats.map((f) => utils_1.isAdditionalResourceConfiguration(f)
|
|
50
|
+
? toAdditionalResourceConfigurationDisplay(f, additionalResources)
|
|
51
|
+
: toDownloadFormatConfigurationDisplay(f));
|
|
52
|
+
}
|
|
53
|
+
exports.getDownloadConfigurationDisplayFormats = getDownloadConfigurationDisplayFormats;
|
|
54
|
+
// Converts a download format configuration storage object to a display object
|
|
55
|
+
// (i.e., adds appropriate labels, etc.)
|
|
56
|
+
function toDownloadFormatConfigurationDisplay(config) {
|
|
57
|
+
return Object.assign({ label: `{{shared.fields.download.format.${config.key}:translate}}` }, config);
|
|
58
|
+
}
|
|
59
|
+
// Converts an additional resource configuration storage object to a display object
|
|
60
|
+
// (i.e., adds appropriate labels, etc.)
|
|
61
|
+
function toAdditionalResourceConfigurationDisplay(config, additionalResources) {
|
|
62
|
+
const resourceIndex = utils_1.getAdditionalResourceIndex(config);
|
|
63
|
+
const { name, isDataSource } = additionalResources[resourceIndex];
|
|
64
|
+
let label;
|
|
65
|
+
// Prefer the name of the additional resource if it exists
|
|
66
|
+
if (name) {
|
|
67
|
+
label = `{{shared.fields.download.additionalResource|resourceName=${encodeURIComponent(name)}:translate}}`;
|
|
68
|
+
// If the additional resource is the data source...
|
|
69
|
+
}
|
|
70
|
+
else if (isDataSource) {
|
|
71
|
+
label = "{{shared.fields.download.dataSourceResource:translate}}";
|
|
72
|
+
// If the additional resource has no name...
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
label = "{{shared.fields.download.noTitleResource:translate}}";
|
|
76
|
+
}
|
|
77
|
+
return Object.assign({ label }, config);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=getDownloadConfigurationDisplayFormats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDownloadConfigurationDisplayFormats.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/getDownloadConfigurationDisplayFormats.ts"],"names":[],"mappings":";;;AAAA,2CAAiE;AAOjE,qDAAiD;AACjD,0EAAuE;AACvE,uFAAoF;AAEpF,+EAA4E;AAC5E,wDAGsC;AAEtC;;;;;;;GAOG;AACH,SAAgB,sCAAsC,CACpD,MAA2B;IAE3B,MAAM,aAAa,GAAG,mDAAwB,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;IACxC,IAAI,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;IAEpC,gGAAgG;IAChG,yFAAyF;IACzF,uBAAuB;IACvB,IAAI,CAAC,QAAQ,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACzE,MAAM,aAAa,GACjB,yCAAmB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC9B,OAAO;gBACL,GAAG,EAAE,CAAC,CAAC,MAAM;gBACb,MAAM,EAAE,KAAK;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CACL,cAAc,CAAC;QAChB,mDAAmD;KACpD;SAAM,IAAI,YAAY,EAAE;QACvB,KAAK,GAAG,yDAAyD,CAAC;QAClE,4CAA4C;KAC7C;SAAM;QACL,KAAK,GAAG,sDAAsD,CAAC;KAChE;IAED,uBACE,KAAK,IACF,MAAM,EACT;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDownloadFlow = void 0;
|
|
4
|
+
const canUseCreateReplica_1 = require("../canUseCreateReplica");
|
|
5
|
+
const canUseHubDownloadSystem_1 = require("../canUseHubDownloadSystem");
|
|
6
|
+
const canUseExportImageFlow_1 = require("./canUseExportImageFlow");
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
* Determines the download flow that will be used for the current entity.
|
|
10
|
+
* If the entity cannot be downloaded, returns null.
|
|
11
|
+
*
|
|
12
|
+
* @param entity the entity to get the download flow for
|
|
13
|
+
* @param isEnterprise whether the the download will be executed in an enterprise environment
|
|
14
|
+
* @returns the download flow that will be used for the current entity
|
|
15
|
+
*/
|
|
16
|
+
function getDownloadFlow(entity, isEnterprise) {
|
|
17
|
+
let downloadFlow = null;
|
|
18
|
+
if (canUseCreateReplica_1.canUseCreateReplica(entity)) {
|
|
19
|
+
downloadFlow = "createReplica";
|
|
20
|
+
}
|
|
21
|
+
else if (canUseHubDownloadSystem_1.canUseHubDownloadSystem(entity) && !isEnterprise) {
|
|
22
|
+
downloadFlow = "paging";
|
|
23
|
+
}
|
|
24
|
+
else if (canUseExportImageFlow_1.canUseExportImageFlow(entity)) {
|
|
25
|
+
downloadFlow = "exportImage";
|
|
26
|
+
}
|
|
27
|
+
return downloadFlow;
|
|
28
|
+
}
|
|
29
|
+
exports.getDownloadFlow = getDownloadFlow;
|
|
30
|
+
//# sourceMappingURL=getDownloadFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDownloadFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/getDownloadFlow.ts"],"names":[],"mappings":";;;AACA,gEAA6D;AAC7D,wEAAqE;AACrE,mEAAgE;AAEhE;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAC7B,MAA2B,EAC3B,YAAsB;IAEtB,IAAI,YAAY,GAAqB,IAAI,CAAC;IAC1C,IAAI,yCAAmB,CAAC,MAAM,CAAC,EAAE;QAC/B,YAAY,GAAG,eAAe,CAAC;KAChC;SAAM,IAAI,iDAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE;QAC3D,YAAY,GAAG,QAAQ,CAAC;KACzB;SAAM,IAAI,6CAAqB,CAAC,MAAM,CAAC,EAAE;QACxC,YAAY,GAAG,aAAa,CAAC;KAC9B;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAbD,0CAaC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDownloadFormatsByFlow = void 0;
|
|
4
|
+
const getCreateReplicaFormats_1 = require("./format-fetchers/getCreateReplicaFormats");
|
|
5
|
+
const getExportImageFormats_1 = require("./format-fetchers/getExportImageFormats");
|
|
6
|
+
const getPagingJobFormats_1 = require("./format-fetchers/getPagingJobFormats");
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
* Get the download formats for a given download flow and entity.
|
|
10
|
+
*
|
|
11
|
+
* @param downloadFlow DownloadFlowType
|
|
12
|
+
* @param entity IHubEditableContent
|
|
13
|
+
* @returns IDynamicDownloadFormat[]
|
|
14
|
+
*/
|
|
15
|
+
function getDownloadFormatsByFlow(downloadFlow, entity) {
|
|
16
|
+
let downloadFormats = [];
|
|
17
|
+
const actionsByFlow = {
|
|
18
|
+
createReplica: () => {
|
|
19
|
+
downloadFormats = getCreateReplicaFormats_1.getCreateReplicaFormats(entity);
|
|
20
|
+
},
|
|
21
|
+
paging: () => {
|
|
22
|
+
downloadFormats = getPagingJobFormats_1.getPagingJobFormats();
|
|
23
|
+
},
|
|
24
|
+
exportImage: () => {
|
|
25
|
+
downloadFormats = getExportImageFormats_1.getExportImageFormats(entity);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
actionsByFlow[downloadFlow] && actionsByFlow[downloadFlow]();
|
|
29
|
+
return downloadFormats;
|
|
30
|
+
}
|
|
31
|
+
exports.getDownloadFormatsByFlow = getDownloadFormatsByFlow;
|
|
32
|
+
//# sourceMappingURL=getDownloadFormatsByFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDownloadFormatsByFlow.js","sourceRoot":"","sources":["../../../../src/downloads/_internal/getDownloadFormatsByFlow.ts"],"names":[],"mappings":";;;AAKA,uFAAoF;AACpF,mFAAgF;AAChF,+EAA4E;AAE5E;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CACtC,YAA8B,EAC9B,MAA2B;IAE3B,IAAI,eAAe,GAA6B,EAAE,CAAC;IACnD,MAAM,aAAa,GAAyC;QAC1D,aAAa,EAAE,GAAG,EAAE;YAClB,eAAe,GAAG,iDAAuB,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,EAAE,GAAG,EAAE;YACX,eAAe,GAAG,yCAAmB,EAAE,CAAC;QAC1C,CAAC;QACD,WAAW,EAAE,GAAG,EAAE;YAChB,eAAe,GAAG,6CAAqB,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;KACF,CAAC;IACF,aAAa,CAAC,YAAY,CAAC,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC;IAC7D,OAAO,eAAe,CAAC;AACzB,CAAC;AAlBD,4DAkBC"}
|
|
@@ -4,6 +4,7 @@ exports.fetchDownloadFile = void 0;
|
|
|
4
4
|
const HubError_1 = require("../HubError");
|
|
5
5
|
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
6
6
|
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
7
|
+
const getDownloadFormats_1 = require("./getDownloadFormats");
|
|
7
8
|
/**
|
|
8
9
|
* Fetches a download file URL for the given entity and format.
|
|
9
10
|
* @param options options to refine / filter the results of the fetchDownloadFile operation
|
|
@@ -11,6 +12,8 @@ const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
|
11
12
|
* @throws {ArcgisHubDownloadError} if the download file URL cannot be fetched for a well-known reason
|
|
12
13
|
*/
|
|
13
14
|
async function fetchDownloadFile(options) {
|
|
15
|
+
// Make sure that format requested has been enabled for the entity
|
|
16
|
+
validateFormat(options);
|
|
14
17
|
// If the pollInterval is not set, default to 3 seconds
|
|
15
18
|
const withPollInterval = options.pollInterval == null ? Object.assign(Object.assign({}, options), { pollInterval: 3000 }) : options;
|
|
16
19
|
let fetchingFn;
|
|
@@ -26,4 +29,21 @@ async function fetchDownloadFile(options) {
|
|
|
26
29
|
return fetchingFn(withPollInterval);
|
|
27
30
|
}
|
|
28
31
|
exports.fetchDownloadFile = fetchDownloadFile;
|
|
32
|
+
/**
|
|
33
|
+
* Validates the format requested is enabled for the entity
|
|
34
|
+
* @param options options for the fetchDownloadFile operation
|
|
35
|
+
* @throws {HubError} if the format requested is not enabled for the entity
|
|
36
|
+
*/
|
|
37
|
+
function validateFormat(options) {
|
|
38
|
+
const { entity, context, format } = options;
|
|
39
|
+
const validServerFormats = getDownloadFormats_1.getDownloadFormats({
|
|
40
|
+
entity,
|
|
41
|
+
context,
|
|
42
|
+
})
|
|
43
|
+
.filter((f) => f.type === "dynamic")
|
|
44
|
+
.map((f) => f.format);
|
|
45
|
+
if (!validServerFormats.includes(format)) {
|
|
46
|
+
throw new HubError_1.default("fetchDownloadFile", `The following format is not enabled for the entity: ${format}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
29
49
|
//# sourceMappingURL=fetchDownloadFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,6EAA0E;AAC1E,iEAA8D;
|
|
1
|
+
{"version":3,"file":"fetchDownloadFile.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFile.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,6EAA0E;AAC1E,iEAA8D;AAC9D,6DAA0D;AAQ1D;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CACrC,OAAkC;IAElC,kEAAkE;IAClE,cAAc,CAAC,OAAO,CAAC,CAAC;IAExB,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;AA1BD,8CA0BC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,OAAkC;IACxD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,kBAAkB,GAA4B,uCAAkB,CAAC;QACrE,MAAM;QACN,OAAO;KACR,CAAC;SACC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;SACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,CAA4B,CAAC,MAAM,CAAC,CAAC;IACpD,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACxC,MAAM,IAAI,kBAAQ,CAChB,mBAAmB,EACnB,uDAAuD,MAAM,EAAE,CAChE,CAAC;KACH;AACH,CAAC"}
|
|
@@ -4,11 +4,15 @@ exports.fetchDownloadFormats = void 0;
|
|
|
4
4
|
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
5
5
|
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
6
6
|
/**
|
|
7
|
+
* DEPRECATED: This will be removed in the next breaking version. Use "getDownloadFormats()" instead.
|
|
8
|
+
*
|
|
7
9
|
* Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
|
|
8
10
|
* @param options options to refine / filter the results of the fetchDownloadFormats operation
|
|
9
11
|
* @returns a promise that resolves with the download formats
|
|
10
12
|
*/
|
|
11
13
|
async function fetchDownloadFormats(options) {
|
|
14
|
+
/* tslint:disable no-console */
|
|
15
|
+
console.warn(`"fetchDownloadFormats()" is deprecated. Please use "getDownloadFormats()"`);
|
|
12
16
|
const { entity, context, layers } = options;
|
|
13
17
|
// fetch base formats for the item
|
|
14
18
|
let baseFormats = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAC1E,iEAA8D;AAO9D
|
|
1
|
+
{"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAC1E,iEAA8D;AAO9D;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CACxC,OAAqC;IAErC,+BAA+B;IAC/B,OAAO,CAAC,IAAI,CACV,2EAA2E,CAC5E,CAAC;IAEF,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;AA/BD,oDA+BC;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"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDownloadConfiguration = void 0;
|
|
4
|
+
const get_prop_1 = require("../objects/get-prop");
|
|
5
|
+
const getDownloadFlow_1 = require("./_internal/getDownloadFlow");
|
|
6
|
+
const getDownloadFormatsByFlow_1 = require("./_internal/getDownloadFormatsByFlow");
|
|
7
|
+
/**
|
|
8
|
+
* Returns the download configuration for an entity at this moment in time.
|
|
9
|
+
*
|
|
10
|
+
* If no configuration exists, a default configuration is returned based on the entity's current download flow.
|
|
11
|
+
* If a configuration exists but is no longer valid, the default configuration will also be returned.
|
|
12
|
+
*
|
|
13
|
+
* @param entity entity to get download configuration for
|
|
14
|
+
* @returns the current download configuration for the entity
|
|
15
|
+
*/
|
|
16
|
+
function getDownloadConfiguration(entity) {
|
|
17
|
+
// TODO: account for enterprise environments
|
|
18
|
+
const downloadFlow = getDownloadFlow_1.getDownloadFlow(entity);
|
|
19
|
+
const serverFormats = getDownloadFormatsByFlow_1.getDownloadFormatsByFlow(downloadFlow, entity);
|
|
20
|
+
const additionalResources = get_prop_1.getProp(entity, "extendedProps.additionalResources") || [];
|
|
21
|
+
const existingConfiguration = get_prop_1.getProp(entity, "extendedProps.downloads");
|
|
22
|
+
// Base combined default formats
|
|
23
|
+
const combinedDefaultFormats = serverFormats.map((f) => {
|
|
24
|
+
return {
|
|
25
|
+
key: f.format,
|
|
26
|
+
hidden: false,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
additionalResources.forEach((f, idx) => {
|
|
30
|
+
combinedDefaultFormats.push({
|
|
31
|
+
key: `additionalResource::${idx}`,
|
|
32
|
+
hidden: false,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
const shouldUseExistingConfiguration = existingConfiguration && existingConfiguration.flowType === downloadFlow;
|
|
36
|
+
// Existing configuration matches the current flow
|
|
37
|
+
if (shouldUseExistingConfiguration) {
|
|
38
|
+
const missingDefaultFormats = combinedDefaultFormats.filter((f) => {
|
|
39
|
+
return !existingConfiguration.formats.find((df) => df.key === f.key);
|
|
40
|
+
});
|
|
41
|
+
const validConfiguredFormats = existingConfiguration.formats.filter((f) => {
|
|
42
|
+
return combinedDefaultFormats.find((df) => df.key === f.key);
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
flowType: downloadFlow,
|
|
46
|
+
formats: [...validConfiguredFormats, ...missingDefaultFormats],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// Existing configuration does not match the current flow
|
|
50
|
+
return {
|
|
51
|
+
flowType: downloadFlow,
|
|
52
|
+
formats: combinedDefaultFormats,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
exports.getDownloadConfiguration = getDownloadConfiguration;
|
|
56
|
+
//# sourceMappingURL=getDownloadConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDownloadConfiguration.js","sourceRoot":"","sources":["../../../src/downloads/getDownloadConfiguration.ts"],"names":[],"mappings":";;;AAMA,kDAA8C;AAC9C,iEAA8D;AAC9D,mFAAgF;AAEhF;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CACtC,MAA2B;IAE3B,4CAA4C;IAC5C,MAAM,YAAY,GAAG,iCAAe,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,mDAAwB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACrE,MAAM,mBAAmB,GACvB,kBAAO,CAAC,MAAM,EAAE,mCAAmC,CAAC,IAAI,EAAE,CAAC;IAC7D,MAAM,qBAAqB,GAAiC,kBAAO,CACjE,MAAM,EACN,yBAAyB,CAC1B,CAAC;IAEF,gCAAgC;IAChC,MAAM,sBAAsB,GAC1B,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAgC,EAAE;QACpD,OAAO;YACL,GAAG,EAAE,CAAC,CAAC,MAAM;YACb,MAAM,EAAE,KAAK;SACd,CAAC;IACJ,CAAC,CAAC,CAAC;IACL,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QACrC,sBAAsB,CAAC,IAAI,CAAC;YAC1B,GAAG,EAAE,uBAAuB,GAAG,EAAE;YACjC,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,8BAA8B,GAClC,qBAAqB,IAAI,qBAAqB,CAAC,QAAQ,KAAK,YAAY,CAAC;IAE3E,kDAAkD;IAClD,IAAI,8BAA8B,EAAE;QAClC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YAChE,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;QACH,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YACxE,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QACH,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,CAAC,GAAG,sBAAsB,EAAE,GAAG,qBAAqB,CAAC;SAC/D,CAAC;KACH;IAED,yDAAyD;IACzD,OAAO;QACL,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,sBAAsB;KAChC,CAAC;AACJ,CAAC;AAlDD,4DAkDC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDownloadFormats = void 0;
|
|
4
|
+
const get_prop_1 = require("../objects/get-prop");
|
|
5
|
+
const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
|
|
6
|
+
const getExportImageFormats_1 = require("./_internal/format-fetchers/getExportImageFormats");
|
|
7
|
+
const utils_1 = require("./_internal/additional-resources/utils");
|
|
8
|
+
const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
|
|
9
|
+
const getDownloadConfiguration_1 = require("./getDownloadConfiguration");
|
|
10
|
+
const getHubDownloadApiFormats_1 = require("./getHubDownloadApiFormats");
|
|
11
|
+
/**
|
|
12
|
+
* Gets available download formats / additional resources for the given entity in the order they have been configured.
|
|
13
|
+
* If a format has been configured to be hidden, it will not be included in the results.
|
|
14
|
+
*
|
|
15
|
+
* @param options options to refine / filter the results of the fetchDownloadFormats operation
|
|
16
|
+
* @returns The available download formats and additional resources
|
|
17
|
+
*/
|
|
18
|
+
function getDownloadFormats(options) {
|
|
19
|
+
const { entity, context } = options;
|
|
20
|
+
// get the base formats for the item
|
|
21
|
+
let baseFormats = [];
|
|
22
|
+
// TODO: use typescript to enforce a branch for each flow type
|
|
23
|
+
if (canUseHubDownloadApi_1.canUseHubDownloadApi(entity, context)) {
|
|
24
|
+
baseFormats = getHubDownloadApiFormats_1.getHubDownloadApiFormats(entity);
|
|
25
|
+
}
|
|
26
|
+
else if (canUseExportImageFlow_1.canUseExportImageFlow(entity)) {
|
|
27
|
+
baseFormats = getExportImageFormats_1.getExportImageFormats(entity);
|
|
28
|
+
}
|
|
29
|
+
// add additional resource links as static formats
|
|
30
|
+
const additionalResources = get_prop_1.getProp(entity, "extendedProps.additionalResources") || [];
|
|
31
|
+
const additionalFormats = additionalResources.map(toStaticFormat);
|
|
32
|
+
// Respect the order and visibility of the formats as configured for the entity
|
|
33
|
+
const downloadConfiguration = getDownloadConfiguration_1.getDownloadConfiguration(entity);
|
|
34
|
+
return downloadConfiguration.formats.reduce((acc, format) => {
|
|
35
|
+
if (!format.hidden) {
|
|
36
|
+
let includedFormat;
|
|
37
|
+
if (utils_1.isAdditionalResourceConfiguration(format)) {
|
|
38
|
+
const additionalResourceIndex = utils_1.getAdditionalResourceIndex(format);
|
|
39
|
+
includedFormat = additionalFormats[additionalResourceIndex];
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
baseFormats.forEach((baseFormat) => {
|
|
43
|
+
if (baseFormat.format === format.key) {
|
|
44
|
+
includedFormat = baseFormat;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
acc.push(includedFormat);
|
|
49
|
+
}
|
|
50
|
+
return acc;
|
|
51
|
+
}, []);
|
|
52
|
+
}
|
|
53
|
+
exports.getDownloadFormats = getDownloadFormats;
|
|
54
|
+
function toStaticFormat(resource) {
|
|
55
|
+
return {
|
|
56
|
+
type: "static",
|
|
57
|
+
label: resource.name ||
|
|
58
|
+
(resource.isDataSource && `{{dataSource:translate}}`) || // if the additional resource is the datasource
|
|
59
|
+
`{{noTitle:translate}}`,
|
|
60
|
+
url: resource.url,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=getDownloadFormats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/getDownloadFormats.ts"],"names":[],"mappings":";;;AACA,kDAA8C;AAC9C,6EAA0E;AAC1E,6FAA0F;AAC1F,kEAGgD;AAChD,iEAA8D;AAC9D,yEAAsE;AACtE,yEAAsE;AAQtE;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,OAAqC;IAErC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACpC,oCAAoC;IACpC,IAAI,WAAW,GAA6B,EAAE,CAAC;IAC/C,8DAA8D;IAC9D,IAAI,2CAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACzC,WAAW,GAAG,mDAAwB,CAAC,MAAM,CAAC,CAAC;KAChD;SAAM,IAAI,6CAAqB,CAAC,MAAM,CAAC,EAAE;QACxC,WAAW,GAAG,6CAAqB,CAAC,MAAM,CAAC,CAAC;KAC7C;IAED,kDAAkD;IAClD,MAAM,mBAAmB,GACvB,kBAAO,CAAC,MAAM,EAAE,mCAAmC,CAAC,IAAI,EAAE,CAAC;IAC7D,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAElE,+EAA+E;IAC/E,MAAM,qBAAqB,GAAG,mDAAwB,CAAC,MAAM,CAAC,CAAC;IAC/D,OAAO,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QAC1D,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,IAAI,cAAc,CAAC;YACnB,IAAI,yCAAiC,CAAC,MAAM,CAAC,EAAE;gBAC7C,MAAM,uBAAuB,GAAG,kCAA0B,CAAC,MAAM,CAAC,CAAC;gBACnE,cAAc,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;aAC7D;iBAAM;gBACL,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;oBACjC,IAAI,UAAU,CAAC,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE;wBACpC,cAAc,GAAG,UAAU,CAAC;qBAC7B;gBACH,CAAC,CAAC,CAAC;aACJ;YACD,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC1B;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AArCD,gDAqCC;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"}
|
|
@@ -9,4 +9,6 @@ tslib_1.__exportStar(require("./canUseCreateReplica"), exports);
|
|
|
9
9
|
tslib_1.__exportStar(require("./canUseHubDownloadSystem"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./canUseHubDownloadApi"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./getHubDownloadApiFormats"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./getDownloadConfiguration"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./getDownloadFormats"), exports);
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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"}
|
|
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;AAC3C,qEAA2C;AAC3C,+DAAqC"}
|
|
@@ -87,8 +87,8 @@ class HubEvent extends HubItemEntity_1.HubItemEntity {
|
|
|
87
87
|
if (this.isDestroyed) {
|
|
88
88
|
throw new Error("HubEvent is already destroyed.");
|
|
89
89
|
}
|
|
90
|
-
const {
|
|
91
|
-
await
|
|
90
|
+
const { deleteHubEvent } = await Promise.resolve().then(() => require("./edit"));
|
|
91
|
+
await deleteHubEvent(this.entity.id, this.context.hubRequestOptions);
|
|
92
92
|
this.isDestroyed = true;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HubEvent.js","sourceRoot":"","sources":["../../../src/events/HubEvent.ts"],"names":[],"mappings":";;;AACA,yDAAsD;AAKtD,mCAAqC;AACrC,yCAAqD;AAGrD,qEAAkE;AAClE,kCAAsC;AAEtC,2EAAwE;AACxE,+EAA4E;AAC5E,0CAAmC;AACnC,yCAA2C;AAE3C,+DAA4D;AAE5D;;;GAGG;AACH,MAAa,QACX,SAAQ,6BAAwB;IAGhC;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAwB,EAAE,OAAuB;QA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AAI,CAAC,OAAO,CACb,CAAc,CAAC;IAClB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,SAAS,CAAC,MAA2B;QACzC,MAAM,oBAAW,iBACf,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EACvB,IAAI,EAAE;gBACJ,MAAM,EAAE,MAAM,CAAC,WAAW,EAAiB;aAC5C,IACE,IAAI,CAAC,OAAO,CAAC,iBAAiB,EACjC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,OAAO,+BAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,eAAe,CACnB,SAAiB,EACjB,IAAqB;QAErB,mCAAmC;QACnC,OAAO,iCAAe,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACZ,gBAAsC,EAAE,EACxC,UAAoB,EAAE;QAEtB,MAAM,MAAM,GAAG,kBAAW,CAAC,IAAI,CAAC,MAAM,CAAoB,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,MAAuB;QACtC,MAAM,MAAM,GAAG,kBAAW,CAAC,MAAM,CAAc,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAvND,4BAuNC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orval-events.js","sourceRoot":"","sources":["../../../../../../src/events/api/orval/api/orval-events.ts"],"names":[],"mappings":";;;AAQA,oDAAgD;AAgBhD,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,yCAAqB,CAAA;IACrB,yCAAqB,CAAA;AACvB,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B;AA6ID,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AACD,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,4CAA+B,CAAA;IAC/B,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;AACzB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;
|
|
1
|
+
{"version":3,"file":"orval-events.js","sourceRoot":"","sources":["../../../../../../src/events/api/orval/api/orval-events.ts"],"names":[],"mappings":";;;AAQA,oDAAgD;AAgBhD,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,2CAAuB,CAAA;IACvB,yCAAqB,CAAA;IACrB,yCAAqB,CAAA;AACvB,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B;AA6ID,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AACD,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,4CAA+B,CAAA;IAC/B,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;AACzB,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAsID,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,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AAC;AAEW,QAAA,gBAAgB,GAAG,CAC9B,MAA+B,EAC/B,OAA8C,EAC9C,EAAE;IACF,OAAO,4BAAY,CACjB,EAAE,GAAG,EAAE,8BAA8B,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAC9D,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,eAAe,GAAG,CAC7B,EAAU,EACV,OAA8C,EAC9C,EAAE;IACF,OAAO,4BAAY,CACjB,EAAE,GAAG,EAAE,gCAAgC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAC5D,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,kBAAkB,GAAG,CAChC,EAAU,EACV,mBAAwC,EACxC,OAA8C,EAC9C,EAAE;IACF,OAAO,4BAAY,CACjB;QACE,GAAG,EAAE,gCAAgC,EAAE,EAAE;QACzC,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,mBAAmB;KAC1B,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,kBAAkB,GAAG,CAChC,EAAU,EACV,OAA8C,EAC9C,EAAE;IACF,OAAO,4BAAY,CACjB,EAAE,GAAG,EAAE,gCAAgC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAC/D,OAAO,CACR,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/node/events/edit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteHubEventRegistration = exports.createHubEventRegistration = exports.updateHubEvent = exports.createHubEvent = void 0;
|
|
3
|
+
exports.deleteHubEventRegistration = exports.createHubEventRegistration = exports.deleteHubEvent = exports.updateHubEvent = exports.createHubEvent = void 0;
|
|
4
4
|
const getPropertyMap_1 = require("./_internal/getPropertyMap");
|
|
5
5
|
const PropertyMapper_1 = require("./_internal/PropertyMapper");
|
|
6
6
|
const defaults_1 = require("./defaults");
|
|
@@ -89,6 +89,12 @@ async function updateHubEvent(partialEvent, requestOptions) {
|
|
|
89
89
|
return mapper.storeToEntity(model, {});
|
|
90
90
|
}
|
|
91
91
|
exports.updateHubEvent = updateHubEvent;
|
|
92
|
+
async function deleteHubEvent(id, requestOptions) {
|
|
93
|
+
// TODO: update `status` of event to `"removed"` when requestOptions.params.parementDelete is `true`
|
|
94
|
+
// instead of permanently deleting the event when we officially support recycle bin behavior
|
|
95
|
+
await events_1.deleteEvent(Object.assign({ eventId: id }, requestOptions));
|
|
96
|
+
}
|
|
97
|
+
exports.deleteHubEvent = deleteHubEvent;
|
|
92
98
|
/**
|
|
93
99
|
* @private
|
|
94
100
|
* Create an Event registration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/events/edit.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAC5D,+DAAiE;AACjE,yCAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/events/edit.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAC5D,+DAAiE;AACjE,yCAA8E;AAC9E,yCAIsB;AACtB,+BAMe;AAQf;;;;;;;;;GASG;AACI,KAAK,UAAU,cAAc,CAClC,YAAgC,EAChC,cAAkC;IAElC,MAAM,KAAK,mCAAQ,kCAAuB,EAAE,GAAK,YAAY,CAAE,CAAC;IAEhE,8EAA8E;IAC9E,8BAA8B;IAC9B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IAEhC,kEAAkE;IAElE,MAAM,MAAM,GAAG,IAAI,oCAAmB,CAAC,+BAAc,EAAE,CAAC,CAAC;IAEzD,IAAI,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,kCAAuB,EAAE,CAAC,CAAC;IAEnE,MAAM,IAAI,GAAG;QACX,MA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IAElC,OAAO,wBAAkB,iBAAG,IAAI,IAAK,cAAc,EAAG,CAAC;AACzD,CAAC;AALD,gEAKC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,0BAA0B,CAC9C,EAAU,EACV,cAAkC;IAElC,MAAM,wBAAkB,iBAAG,cAAc,EAAE,EAAE,IAAK,cAAc,EAAG,CAAC;AACtE,CAAC;AALD,gEAKC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IUiSchemaElement } from "../../core/schemas/types";
|
|
2
|
+
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* Constructs the downloads section for an IHubEditableContent entity.
|
|
6
|
+
* Due to numerous product requirements, the content and state of this section
|
|
7
|
+
* can vary greatly depending on the entity type and configuration.
|
|
8
|
+
*
|
|
9
|
+
* @param i18nScope translation scope
|
|
10
|
+
* @param entity entity to get the downloads section for
|
|
11
|
+
* @returns ui schema elements for the downloads section
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDownloadsSection(i18nScope: string, entity: IHubEditableContent): IUiSchemaElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IHubEditableContent } from "../../core/types/IHubEditableContent";
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* Determines if the downloads configuration should be shown for an entity.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: product has asked that the download configuration be shown for entities that _can_
|
|
7
|
+
* be downloaded, as well as certain entities that _cannot_ be downloaded currently, but
|
|
8
|
+
* could be downloaded with a change in item / service settings.
|
|
9
|
+
*
|
|
10
|
+
* @param entity entity to check
|
|
11
|
+
* @returns whether downloads configuration should be shown
|
|
12
|
+
*/
|
|
13
|
+
export declare function shouldShowDownloadsConfiguration(entity: IHubEditableContent): boolean;
|