@esri/solution-storymap 4.1.2-alpha.0 → 5.0.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/cjs/classic-storymap-processor.d.ts +24 -24
- package/dist/cjs/classic-storymap-processor.js +68 -68
- package/dist/cjs/helpers/convert-storymap-to-template.d.ts +24 -24
- package/dist/cjs/helpers/convert-storymap-to-template.js +98 -98
- package/dist/cjs/helpers/create-storymap-model-from-template.d.ts +22 -22
- package/dist/cjs/helpers/create-storymap-model-from-template.js +42 -42
- package/dist/cjs/helpers/create-storymap.d.ts +25 -25
- package/dist/cjs/helpers/create-storymap.js +111 -111
- package/dist/cjs/helpers/get-portal-env.d.ts +17 -17
- package/dist/cjs/helpers/get-portal-env.js +18 -18
- package/dist/cjs/helpers/get-storymap-base-url.d.ts +23 -23
- package/dist/cjs/helpers/get-storymap-base-url.js +25 -25
- package/dist/cjs/helpers/get-storymap-dependencies.d.ts +23 -23
- package/dist/cjs/helpers/get-storymap-dependencies.js +35 -35
- package/dist/cjs/helpers/get-storymap-subdomain.d.ts +17 -17
- package/dist/cjs/helpers/get-storymap-subdomain.js +19 -19
- package/dist/cjs/helpers/remap-webmap-keys.d.ts +24 -24
- package/dist/cjs/helpers/remap-webmap-keys.js +43 -43
- package/dist/cjs/index.d.ts +23 -23
- package/dist/cjs/index.js +28 -28
- package/dist/cjs/storymap-processor.d.ts +40 -40
- package/dist/cjs/storymap-processor.js +140 -140
- package/dist/esm/classic-storymap-processor.d.ts +24 -24
- package/dist/esm/classic-storymap-processor.js +61 -61
- package/dist/esm/helpers/convert-storymap-to-template.d.ts +24 -24
- package/dist/esm/helpers/convert-storymap-to-template.js +94 -94
- package/dist/esm/helpers/create-storymap-model-from-template.d.ts +22 -22
- package/dist/esm/helpers/create-storymap-model-from-template.js +38 -38
- package/dist/esm/helpers/create-storymap.d.ts +25 -25
- package/dist/esm/helpers/create-storymap.js +107 -107
- package/dist/esm/helpers/get-portal-env.d.ts +17 -17
- package/dist/esm/helpers/get-portal-env.js +14 -14
- package/dist/esm/helpers/get-storymap-base-url.d.ts +23 -23
- package/dist/esm/helpers/get-storymap-base-url.js +21 -21
- package/dist/esm/helpers/get-storymap-dependencies.d.ts +23 -23
- package/dist/esm/helpers/get-storymap-dependencies.js +31 -31
- package/dist/esm/helpers/get-storymap-subdomain.d.ts +17 -17
- package/dist/esm/helpers/get-storymap-subdomain.js +15 -15
- package/dist/esm/helpers/remap-webmap-keys.d.ts +24 -24
- package/dist/esm/helpers/remap-webmap-keys.js +39 -39
- package/dist/esm/index.d.ts +23 -23
- package/dist/esm/index.js +23 -23
- package/dist/esm/storymap-processor.d.ts +40 -40
- package/dist/esm/storymap-processor.js +134 -134
- package/package.json +3 -3
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @license
|
|
3
|
-
* Copyright 2020 Esri
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.createStoryMap = void 0;
|
|
19
|
-
// TODO ENSURE THIS CREATES IN THE TARGET FOLDER
|
|
20
|
-
const hub_common_1 = require("@esri/hub-common");
|
|
21
|
-
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
22
|
-
/**
|
|
23
|
-
* Create a StoryMap from an interpolated template
|
|
24
|
-
*
|
|
25
|
-
* @param model
|
|
26
|
-
* @param options
|
|
27
|
-
* @param authentication
|
|
28
|
-
*/
|
|
29
|
-
function createStoryMap(model, folderId, options, authentication) {
|
|
30
|
-
// create an array to hold well-known resources
|
|
31
|
-
// that we have to generate from the passed in model
|
|
32
|
-
const resources = [];
|
|
33
|
-
// For unknown reasons we can not seem to spy on createItemInFolder
|
|
34
|
-
// so we will create-then-move for now
|
|
35
|
-
const createOptions = {
|
|
36
|
-
// need to serialize
|
|
37
|
-
item: (0, hub_common_1.serializeModel)(model),
|
|
38
|
-
authentication
|
|
39
|
-
};
|
|
40
|
-
/* istanbul ignore else */
|
|
41
|
-
if (model.item.thumbnail) {
|
|
42
|
-
createOptions.params = {
|
|
43
|
-
// Pass thumbnail file in via params because item property is serialized, which discards a blob
|
|
44
|
-
thumbnail: model.item.thumbnail
|
|
45
|
-
};
|
|
46
|
-
delete createOptions.item.thumbnail;
|
|
47
|
-
}
|
|
48
|
-
// Create the item
|
|
49
|
-
return (0, arcgis_rest_portal_1.createItem)(createOptions)
|
|
50
|
-
.then((createResponse) => {
|
|
51
|
-
// hold the id in the model
|
|
52
|
-
model.item.id = createResponse.id;
|
|
53
|
-
// and re-interpolate the item id
|
|
54
|
-
model = (0, hub_common_1.interpolateItemId)(model);
|
|
55
|
-
// Compute the item url based on current environment
|
|
56
|
-
// Storymaps store draft data in a timestamped resource attached to the item
|
|
57
|
-
// We'll just use the published data for the first "draft"
|
|
58
|
-
resources.push({
|
|
59
|
-
name: model.properties.draftFileName,
|
|
60
|
-
file: (0, hub_common_1.stringToBlob)(JSON.stringify(model.data))
|
|
61
|
-
});
|
|
62
|
-
resources.push({
|
|
63
|
-
name: "oembed.json",
|
|
64
|
-
file: (0, hub_common_1.stringToBlob)(JSON.stringify(model.properties.oembed))
|
|
65
|
-
});
|
|
66
|
-
resources.push({
|
|
67
|
-
name: "oembed.xml",
|
|
68
|
-
file: (0, hub_common_1.stringToBlob)(model.properties.oembedXML)
|
|
69
|
-
});
|
|
70
|
-
// remove the properties hash now that we've gotten what we need
|
|
71
|
-
delete model.properties;
|
|
72
|
-
// update the item with the newly re-interpolated model
|
|
73
|
-
return Promise.all([
|
|
74
|
-
(0, arcgis_rest_portal_1.updateItem)({
|
|
75
|
-
item: (0, hub_common_1.serializeModel)(model),
|
|
76
|
-
authentication
|
|
77
|
-
}),
|
|
78
|
-
authentication.getUsername()
|
|
79
|
-
]);
|
|
80
|
-
})
|
|
81
|
-
.then((responses) => {
|
|
82
|
-
const username = responses[1];
|
|
83
|
-
// add the resources
|
|
84
|
-
const failSafeAddItemResource = (0, hub_common_1.failSafe)(arcgis_rest_portal_1.addItemResource, {
|
|
85
|
-
success: true
|
|
86
|
-
});
|
|
87
|
-
const resourcePromises = resources.map(resource => {
|
|
88
|
-
return failSafeAddItemResource({
|
|
89
|
-
id: model.item.id,
|
|
90
|
-
owner: username,
|
|
91
|
-
resource: resource.file,
|
|
92
|
-
name: resource.name,
|
|
93
|
-
authentication
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
// Fire and forget as these are not critical-path
|
|
97
|
-
return Promise.all(resourcePromises);
|
|
98
|
-
})
|
|
99
|
-
.then(() => {
|
|
100
|
-
// Move it
|
|
101
|
-
return (0, arcgis_rest_portal_1.moveItem)({
|
|
102
|
-
itemId: model.item.id,
|
|
103
|
-
folderId,
|
|
104
|
-
authentication
|
|
105
|
-
});
|
|
106
|
-
})
|
|
107
|
-
.then(() => {
|
|
108
|
-
return model;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
exports.createStoryMap = createStoryMap;
|
|
1
|
+
"use strict";
|
|
2
|
+
/** @license
|
|
3
|
+
* Copyright 2020 Esri
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.createStoryMap = void 0;
|
|
19
|
+
// TODO ENSURE THIS CREATES IN THE TARGET FOLDER
|
|
20
|
+
const hub_common_1 = require("@esri/hub-common");
|
|
21
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
22
|
+
/**
|
|
23
|
+
* Create a StoryMap from an interpolated template
|
|
24
|
+
*
|
|
25
|
+
* @param model
|
|
26
|
+
* @param options
|
|
27
|
+
* @param authentication
|
|
28
|
+
*/
|
|
29
|
+
function createStoryMap(model, folderId, options, authentication) {
|
|
30
|
+
// create an array to hold well-known resources
|
|
31
|
+
// that we have to generate from the passed in model
|
|
32
|
+
const resources = [];
|
|
33
|
+
// For unknown reasons we can not seem to spy on createItemInFolder
|
|
34
|
+
// so we will create-then-move for now
|
|
35
|
+
const createOptions = {
|
|
36
|
+
// need to serialize
|
|
37
|
+
item: (0, hub_common_1.serializeModel)(model),
|
|
38
|
+
authentication
|
|
39
|
+
};
|
|
40
|
+
/* istanbul ignore else */
|
|
41
|
+
if (model.item.thumbnail) {
|
|
42
|
+
createOptions.params = {
|
|
43
|
+
// Pass thumbnail file in via params because item property is serialized, which discards a blob
|
|
44
|
+
thumbnail: model.item.thumbnail
|
|
45
|
+
};
|
|
46
|
+
delete createOptions.item.thumbnail;
|
|
47
|
+
}
|
|
48
|
+
// Create the item
|
|
49
|
+
return (0, arcgis_rest_portal_1.createItem)(createOptions)
|
|
50
|
+
.then((createResponse) => {
|
|
51
|
+
// hold the id in the model
|
|
52
|
+
model.item.id = createResponse.id;
|
|
53
|
+
// and re-interpolate the item id
|
|
54
|
+
model = (0, hub_common_1.interpolateItemId)(model);
|
|
55
|
+
// Compute the item url based on current environment
|
|
56
|
+
// Storymaps store draft data in a timestamped resource attached to the item
|
|
57
|
+
// We'll just use the published data for the first "draft"
|
|
58
|
+
resources.push({
|
|
59
|
+
name: model.properties.draftFileName,
|
|
60
|
+
file: (0, hub_common_1.stringToBlob)(JSON.stringify(model.data))
|
|
61
|
+
});
|
|
62
|
+
resources.push({
|
|
63
|
+
name: "oembed.json",
|
|
64
|
+
file: (0, hub_common_1.stringToBlob)(JSON.stringify(model.properties.oembed))
|
|
65
|
+
});
|
|
66
|
+
resources.push({
|
|
67
|
+
name: "oembed.xml",
|
|
68
|
+
file: (0, hub_common_1.stringToBlob)(model.properties.oembedXML)
|
|
69
|
+
});
|
|
70
|
+
// remove the properties hash now that we've gotten what we need
|
|
71
|
+
delete model.properties;
|
|
72
|
+
// update the item with the newly re-interpolated model
|
|
73
|
+
return Promise.all([
|
|
74
|
+
(0, arcgis_rest_portal_1.updateItem)({
|
|
75
|
+
item: (0, hub_common_1.serializeModel)(model),
|
|
76
|
+
authentication
|
|
77
|
+
}),
|
|
78
|
+
authentication.getUsername()
|
|
79
|
+
]);
|
|
80
|
+
})
|
|
81
|
+
.then((responses) => {
|
|
82
|
+
const username = responses[1];
|
|
83
|
+
// add the resources
|
|
84
|
+
const failSafeAddItemResource = (0, hub_common_1.failSafe)(arcgis_rest_portal_1.addItemResource, {
|
|
85
|
+
success: true
|
|
86
|
+
});
|
|
87
|
+
const resourcePromises = resources.map(resource => {
|
|
88
|
+
return failSafeAddItemResource({
|
|
89
|
+
id: model.item.id,
|
|
90
|
+
owner: username,
|
|
91
|
+
resource: resource.file,
|
|
92
|
+
name: resource.name,
|
|
93
|
+
authentication
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
// Fire and forget as these are not critical-path
|
|
97
|
+
return Promise.all(resourcePromises);
|
|
98
|
+
})
|
|
99
|
+
.then(() => {
|
|
100
|
+
// Move it
|
|
101
|
+
return (0, arcgis_rest_portal_1.moveItem)({
|
|
102
|
+
itemId: model.item.id,
|
|
103
|
+
folderId,
|
|
104
|
+
authentication
|
|
105
|
+
});
|
|
106
|
+
})
|
|
107
|
+
.then(() => {
|
|
108
|
+
return model;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.createStoryMap = createStoryMap;
|
|
112
112
|
//# sourceMappingURL=create-storymap.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { UserSession } from "@esri/solution-common";
|
|
17
|
-
export declare function getPortalEnv(authentication: UserSession): string;
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2020 Esri
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { UserSession } from "@esri/solution-common";
|
|
17
|
+
export declare function getPortalEnv(authentication: UserSession): string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPortalEnv = void 0;
|
|
4
|
-
function getPortalEnv(authentication) {
|
|
5
|
-
const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
|
|
6
|
-
let result = "portal";
|
|
7
|
-
if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
|
|
8
|
-
result = "qaext";
|
|
9
|
-
}
|
|
10
|
-
else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
|
|
11
|
-
result = "devext";
|
|
12
|
-
}
|
|
13
|
-
else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
|
|
14
|
-
result = "www";
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
exports.getPortalEnv = getPortalEnv;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPortalEnv = void 0;
|
|
4
|
+
function getPortalEnv(authentication) {
|
|
5
|
+
const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
|
|
6
|
+
let result = "portal";
|
|
7
|
+
if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
|
|
8
|
+
result = "qaext";
|
|
9
|
+
}
|
|
10
|
+
else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
|
|
11
|
+
result = "devext";
|
|
12
|
+
}
|
|
13
|
+
else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
|
|
14
|
+
result = "www";
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
exports.getPortalEnv = getPortalEnv;
|
|
19
19
|
//# sourceMappingURL=get-portal-env.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { UserSession } from "@esri/solution-common";
|
|
17
|
-
/**
|
|
18
|
-
* For a given environment Prod/qa/dev/portal
|
|
19
|
-
* return the correct storymaps base url
|
|
20
|
-
*
|
|
21
|
-
* @param authentication
|
|
22
|
-
*/
|
|
23
|
-
export declare function getStoryMapBaseUrl(authentication: UserSession): string;
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2020 Esri
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { UserSession } from "@esri/solution-common";
|
|
17
|
+
/**
|
|
18
|
+
* For a given environment Prod/qa/dev/portal
|
|
19
|
+
* return the correct storymaps base url
|
|
20
|
+
*
|
|
21
|
+
* @param authentication
|
|
22
|
+
*/
|
|
23
|
+
export declare function getStoryMapBaseUrl(authentication: UserSession): string;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStoryMapBaseUrl = void 0;
|
|
4
|
-
const get_storymap_subdomain_1 = require("./get-storymap-subdomain");
|
|
5
|
-
/**
|
|
6
|
-
* For a given environment Prod/qa/dev/portal
|
|
7
|
-
* return the correct storymaps base url
|
|
8
|
-
*
|
|
9
|
-
* @param authentication
|
|
10
|
-
*/
|
|
11
|
-
function getStoryMapBaseUrl(authentication) {
|
|
12
|
-
let baseUrl = "";
|
|
13
|
-
const subdomain = (0, get_storymap_subdomain_1.getStoryMapSubdomain)(authentication);
|
|
14
|
-
if (subdomain) {
|
|
15
|
-
baseUrl = `https://${subdomain}.arcgis.com`;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
// we're on portal
|
|
19
|
-
// chop off the /sharing/rest to get the baseUrl
|
|
20
|
-
const portalBaseUrl = authentication.portal.replace("/sharing/rest", "");
|
|
21
|
-
baseUrl = `${portalBaseUrl}/apps/storymaps`;
|
|
22
|
-
}
|
|
23
|
-
return baseUrl;
|
|
24
|
-
}
|
|
25
|
-
exports.getStoryMapBaseUrl = getStoryMapBaseUrl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStoryMapBaseUrl = void 0;
|
|
4
|
+
const get_storymap_subdomain_1 = require("./get-storymap-subdomain");
|
|
5
|
+
/**
|
|
6
|
+
* For a given environment Prod/qa/dev/portal
|
|
7
|
+
* return the correct storymaps base url
|
|
8
|
+
*
|
|
9
|
+
* @param authentication
|
|
10
|
+
*/
|
|
11
|
+
function getStoryMapBaseUrl(authentication) {
|
|
12
|
+
let baseUrl = "";
|
|
13
|
+
const subdomain = (0, get_storymap_subdomain_1.getStoryMapSubdomain)(authentication);
|
|
14
|
+
if (subdomain) {
|
|
15
|
+
baseUrl = `https://${subdomain}.arcgis.com`;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
// we're on portal
|
|
19
|
+
// chop off the /sharing/rest to get the baseUrl
|
|
20
|
+
const portalBaseUrl = authentication.portal.replace("/sharing/rest", "");
|
|
21
|
+
baseUrl = `${portalBaseUrl}/apps/storymaps`;
|
|
22
|
+
}
|
|
23
|
+
return baseUrl;
|
|
24
|
+
}
|
|
25
|
+
exports.getStoryMapBaseUrl = getStoryMapBaseUrl;
|
|
26
26
|
//# sourceMappingURL=get-storymap-base-url.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel } from "@esri/hub-common";
|
|
17
|
-
/**
|
|
18
|
-
* Extract a list of Items this storymap depends on
|
|
19
|
-
* At this point we are just extracting webmaps
|
|
20
|
-
*
|
|
21
|
-
* @param model IModel
|
|
22
|
-
*/
|
|
23
|
-
export declare function getStoryMapDependencies(model: IModel): any[];
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2018 Esri
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { IModel } from "@esri/hub-common";
|
|
17
|
+
/**
|
|
18
|
+
* Extract a list of Items this storymap depends on
|
|
19
|
+
* At this point we are just extracting webmaps
|
|
20
|
+
*
|
|
21
|
+
* @param model IModel
|
|
22
|
+
*/
|
|
23
|
+
export declare function getStoryMapDependencies(model: IModel): any[];
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @license
|
|
3
|
-
* Copyright 2018 Esri
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.getStoryMapDependencies = void 0;
|
|
19
|
-
const hub_common_1 = require("@esri/hub-common");
|
|
20
|
-
/**
|
|
21
|
-
* Extract a list of Items this storymap depends on
|
|
22
|
-
* At this point we are just extracting webmaps
|
|
23
|
-
*
|
|
24
|
-
* @param model IModel
|
|
25
|
-
*/
|
|
26
|
-
function getStoryMapDependencies(model) {
|
|
27
|
-
const resources = (0, hub_common_1.getProp)(model, "data.resources") || {};
|
|
28
|
-
return Object.keys(resources).reduce((acc, key) => {
|
|
29
|
-
if ((0, hub_common_1.getProp)(resources, `${key}.type`) === "webmap") {
|
|
30
|
-
acc.push((0, hub_common_1.getProp)(resources, `${key}.data.itemId`));
|
|
31
|
-
}
|
|
32
|
-
return acc;
|
|
33
|
-
}, []);
|
|
34
|
-
}
|
|
35
|
-
exports.getStoryMapDependencies = getStoryMapDependencies;
|
|
1
|
+
"use strict";
|
|
2
|
+
/** @license
|
|
3
|
+
* Copyright 2018 Esri
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getStoryMapDependencies = void 0;
|
|
19
|
+
const hub_common_1 = require("@esri/hub-common");
|
|
20
|
+
/**
|
|
21
|
+
* Extract a list of Items this storymap depends on
|
|
22
|
+
* At this point we are just extracting webmaps
|
|
23
|
+
*
|
|
24
|
+
* @param model IModel
|
|
25
|
+
*/
|
|
26
|
+
function getStoryMapDependencies(model) {
|
|
27
|
+
const resources = (0, hub_common_1.getProp)(model, "data.resources") || {};
|
|
28
|
+
return Object.keys(resources).reduce((acc, key) => {
|
|
29
|
+
if ((0, hub_common_1.getProp)(resources, `${key}.type`) === "webmap") {
|
|
30
|
+
acc.push((0, hub_common_1.getProp)(resources, `${key}.data.itemId`));
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
35
|
+
exports.getStoryMapDependencies = getStoryMapDependencies;
|
|
36
36
|
//# sourceMappingURL=get-storymap-dependencies.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { UserSession } from "@esri/solution-common";
|
|
17
|
-
export declare function getStoryMapSubdomain(authentication: UserSession): string;
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2020 Esri
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { UserSession } from "@esri/solution-common";
|
|
17
|
+
export declare function getStoryMapSubdomain(authentication: UserSession): string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStoryMapSubdomain = void 0;
|
|
4
|
-
function getStoryMapSubdomain(authentication) {
|
|
5
|
-
const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
|
|
6
|
-
// TODO: Sort out how we locate storymaps on portal?
|
|
7
|
-
let result;
|
|
8
|
-
if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
|
|
9
|
-
result = "storymapsqa";
|
|
10
|
-
}
|
|
11
|
-
else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
|
|
12
|
-
result = "storymapsdev";
|
|
13
|
-
}
|
|
14
|
-
else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
|
|
15
|
-
result = "storymaps";
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
exports.getStoryMapSubdomain = getStoryMapSubdomain;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStoryMapSubdomain = void 0;
|
|
4
|
+
function getStoryMapSubdomain(authentication) {
|
|
5
|
+
const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
|
|
6
|
+
// TODO: Sort out how we locate storymaps on portal?
|
|
7
|
+
let result;
|
|
8
|
+
if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
|
|
9
|
+
result = "storymapsqa";
|
|
10
|
+
}
|
|
11
|
+
else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
|
|
12
|
+
result = "storymapsdev";
|
|
13
|
+
}
|
|
14
|
+
else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
|
|
15
|
+
result = "storymaps";
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
exports.getStoryMapSubdomain = getStoryMapSubdomain;
|
|
20
20
|
//# sourceMappingURL=get-storymap-subdomain.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* For some reason, the webmap resource key names are fancier than other resource keys
|
|
18
|
-
* They look like this: r-<webmap-item-id>-<timestamp>
|
|
19
|
-
* This interpolation is hard to accomplish given our current setup, so we're just overwriting
|
|
20
|
-
* them with "webmap0", "webmap1" and so forth. This _seems_ to make no difference.
|
|
21
|
-
*
|
|
22
|
-
* @param model
|
|
23
|
-
*/
|
|
24
|
-
export declare function remapWebmapKeys(resources?: any): any[];
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2018 Esri
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* For some reason, the webmap resource key names are fancier than other resource keys
|
|
18
|
+
* They look like this: r-<webmap-item-id>-<timestamp>
|
|
19
|
+
* This interpolation is hard to accomplish given our current setup, so we're just overwriting
|
|
20
|
+
* them with "webmap0", "webmap1" and so forth. This _seems_ to make no difference.
|
|
21
|
+
*
|
|
22
|
+
* @param model
|
|
23
|
+
*/
|
|
24
|
+
export declare function remapWebmapKeys(resources?: any): any[];
|