@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.
Files changed (45) hide show
  1. package/dist/cjs/classic-storymap-processor.d.ts +24 -24
  2. package/dist/cjs/classic-storymap-processor.js +68 -68
  3. package/dist/cjs/helpers/convert-storymap-to-template.d.ts +24 -24
  4. package/dist/cjs/helpers/convert-storymap-to-template.js +98 -98
  5. package/dist/cjs/helpers/create-storymap-model-from-template.d.ts +22 -22
  6. package/dist/cjs/helpers/create-storymap-model-from-template.js +42 -42
  7. package/dist/cjs/helpers/create-storymap.d.ts +25 -25
  8. package/dist/cjs/helpers/create-storymap.js +111 -111
  9. package/dist/cjs/helpers/get-portal-env.d.ts +17 -17
  10. package/dist/cjs/helpers/get-portal-env.js +18 -18
  11. package/dist/cjs/helpers/get-storymap-base-url.d.ts +23 -23
  12. package/dist/cjs/helpers/get-storymap-base-url.js +25 -25
  13. package/dist/cjs/helpers/get-storymap-dependencies.d.ts +23 -23
  14. package/dist/cjs/helpers/get-storymap-dependencies.js +35 -35
  15. package/dist/cjs/helpers/get-storymap-subdomain.d.ts +17 -17
  16. package/dist/cjs/helpers/get-storymap-subdomain.js +19 -19
  17. package/dist/cjs/helpers/remap-webmap-keys.d.ts +24 -24
  18. package/dist/cjs/helpers/remap-webmap-keys.js +43 -43
  19. package/dist/cjs/index.d.ts +23 -23
  20. package/dist/cjs/index.js +28 -28
  21. package/dist/cjs/storymap-processor.d.ts +40 -40
  22. package/dist/cjs/storymap-processor.js +140 -140
  23. package/dist/esm/classic-storymap-processor.d.ts +24 -24
  24. package/dist/esm/classic-storymap-processor.js +61 -61
  25. package/dist/esm/helpers/convert-storymap-to-template.d.ts +24 -24
  26. package/dist/esm/helpers/convert-storymap-to-template.js +94 -94
  27. package/dist/esm/helpers/create-storymap-model-from-template.d.ts +22 -22
  28. package/dist/esm/helpers/create-storymap-model-from-template.js +38 -38
  29. package/dist/esm/helpers/create-storymap.d.ts +25 -25
  30. package/dist/esm/helpers/create-storymap.js +107 -107
  31. package/dist/esm/helpers/get-portal-env.d.ts +17 -17
  32. package/dist/esm/helpers/get-portal-env.js +14 -14
  33. package/dist/esm/helpers/get-storymap-base-url.d.ts +23 -23
  34. package/dist/esm/helpers/get-storymap-base-url.js +21 -21
  35. package/dist/esm/helpers/get-storymap-dependencies.d.ts +23 -23
  36. package/dist/esm/helpers/get-storymap-dependencies.js +31 -31
  37. package/dist/esm/helpers/get-storymap-subdomain.d.ts +17 -17
  38. package/dist/esm/helpers/get-storymap-subdomain.js +15 -15
  39. package/dist/esm/helpers/remap-webmap-keys.d.ts +24 -24
  40. package/dist/esm/helpers/remap-webmap-keys.js +39 -39
  41. package/dist/esm/index.d.ts +23 -23
  42. package/dist/esm/index.js +23 -23
  43. package/dist/esm/storymap-processor.d.ts +40 -40
  44. package/dist/esm/storymap-processor.js +134 -134
  45. package/package.json +3 -3
@@ -1,108 +1,108 @@
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
- // TODO ENSURE THIS CREATES IN THE TARGET FOLDER
17
- import { failSafe, serializeModel, interpolateItemId, stringToBlob } from "@esri/hub-common";
18
- import { createItem, moveItem, addItemResource, updateItem } from "@esri/arcgis-rest-portal";
19
- /**
20
- * Create a StoryMap from an interpolated template
21
- *
22
- * @param model
23
- * @param options
24
- * @param authentication
25
- */
26
- export function createStoryMap(model, folderId, options, authentication) {
27
- // create an array to hold well-known resources
28
- // that we have to generate from the passed in model
29
- const resources = [];
30
- // For unknown reasons we can not seem to spy on createItemInFolder
31
- // so we will create-then-move for now
32
- const createOptions = {
33
- // need to serialize
34
- item: serializeModel(model),
35
- authentication
36
- };
37
- /* istanbul ignore else */
38
- if (model.item.thumbnail) {
39
- createOptions.params = {
40
- // Pass thumbnail file in via params because item property is serialized, which discards a blob
41
- thumbnail: model.item.thumbnail
42
- };
43
- delete createOptions.item.thumbnail;
44
- }
45
- // Create the item
46
- return createItem(createOptions)
47
- .then((createResponse) => {
48
- // hold the id in the model
49
- model.item.id = createResponse.id;
50
- // and re-interpolate the item id
51
- model = interpolateItemId(model);
52
- // Compute the item url based on current environment
53
- // Storymaps store draft data in a timestamped resource attached to the item
54
- // We'll just use the published data for the first "draft"
55
- resources.push({
56
- name: model.properties.draftFileName,
57
- file: stringToBlob(JSON.stringify(model.data))
58
- });
59
- resources.push({
60
- name: "oembed.json",
61
- file: stringToBlob(JSON.stringify(model.properties.oembed))
62
- });
63
- resources.push({
64
- name: "oembed.xml",
65
- file: stringToBlob(model.properties.oembedXML)
66
- });
67
- // remove the properties hash now that we've gotten what we need
68
- delete model.properties;
69
- // update the item with the newly re-interpolated model
70
- return Promise.all([
71
- updateItem({
72
- item: serializeModel(model),
73
- authentication
74
- }),
75
- authentication.getUsername()
76
- ]);
77
- })
78
- .then((responses) => {
79
- const username = responses[1];
80
- // add the resources
81
- const failSafeAddItemResource = failSafe(addItemResource, {
82
- success: true
83
- });
84
- const resourcePromises = resources.map(resource => {
85
- return failSafeAddItemResource({
86
- id: model.item.id,
87
- owner: username,
88
- resource: resource.file,
89
- name: resource.name,
90
- authentication
91
- });
92
- });
93
- // Fire and forget as these are not critical-path
94
- return Promise.all(resourcePromises);
95
- })
96
- .then(() => {
97
- // Move it
98
- return moveItem({
99
- itemId: model.item.id,
100
- folderId,
101
- authentication
102
- });
103
- })
104
- .then(() => {
105
- return model;
106
- });
107
- }
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
+ // TODO ENSURE THIS CREATES IN THE TARGET FOLDER
17
+ import { failSafe, serializeModel, interpolateItemId, stringToBlob } from "@esri/hub-common";
18
+ import { createItem, moveItem, addItemResource, updateItem } from "@esri/arcgis-rest-portal";
19
+ /**
20
+ * Create a StoryMap from an interpolated template
21
+ *
22
+ * @param model
23
+ * @param options
24
+ * @param authentication
25
+ */
26
+ export function createStoryMap(model, folderId, options, authentication) {
27
+ // create an array to hold well-known resources
28
+ // that we have to generate from the passed in model
29
+ const resources = [];
30
+ // For unknown reasons we can not seem to spy on createItemInFolder
31
+ // so we will create-then-move for now
32
+ const createOptions = {
33
+ // need to serialize
34
+ item: serializeModel(model),
35
+ authentication
36
+ };
37
+ /* istanbul ignore else */
38
+ if (model.item.thumbnail) {
39
+ createOptions.params = {
40
+ // Pass thumbnail file in via params because item property is serialized, which discards a blob
41
+ thumbnail: model.item.thumbnail
42
+ };
43
+ delete createOptions.item.thumbnail;
44
+ }
45
+ // Create the item
46
+ return createItem(createOptions)
47
+ .then((createResponse) => {
48
+ // hold the id in the model
49
+ model.item.id = createResponse.id;
50
+ // and re-interpolate the item id
51
+ model = interpolateItemId(model);
52
+ // Compute the item url based on current environment
53
+ // Storymaps store draft data in a timestamped resource attached to the item
54
+ // We'll just use the published data for the first "draft"
55
+ resources.push({
56
+ name: model.properties.draftFileName,
57
+ file: stringToBlob(JSON.stringify(model.data))
58
+ });
59
+ resources.push({
60
+ name: "oembed.json",
61
+ file: stringToBlob(JSON.stringify(model.properties.oembed))
62
+ });
63
+ resources.push({
64
+ name: "oembed.xml",
65
+ file: stringToBlob(model.properties.oembedXML)
66
+ });
67
+ // remove the properties hash now that we've gotten what we need
68
+ delete model.properties;
69
+ // update the item with the newly re-interpolated model
70
+ return Promise.all([
71
+ updateItem({
72
+ item: serializeModel(model),
73
+ authentication
74
+ }),
75
+ authentication.getUsername()
76
+ ]);
77
+ })
78
+ .then((responses) => {
79
+ const username = responses[1];
80
+ // add the resources
81
+ const failSafeAddItemResource = failSafe(addItemResource, {
82
+ success: true
83
+ });
84
+ const resourcePromises = resources.map(resource => {
85
+ return failSafeAddItemResource({
86
+ id: model.item.id,
87
+ owner: username,
88
+ resource: resource.file,
89
+ name: resource.name,
90
+ authentication
91
+ });
92
+ });
93
+ // Fire and forget as these are not critical-path
94
+ return Promise.all(resourcePromises);
95
+ })
96
+ .then(() => {
97
+ // Move it
98
+ return moveItem({
99
+ itemId: model.item.id,
100
+ folderId,
101
+ authentication
102
+ });
103
+ })
104
+ .then(() => {
105
+ return model;
106
+ });
107
+ }
108
108
  //# 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,15 +1,15 @@
1
- export function getPortalEnv(authentication) {
2
- const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
3
- let result = "portal";
4
- if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
5
- result = "qaext";
6
- }
7
- else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
8
- result = "devext";
9
- }
10
- else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
11
- result = "www";
12
- }
13
- return result;
14
- }
1
+ export function getPortalEnv(authentication) {
2
+ const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
3
+ let result = "portal";
4
+ if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
5
+ result = "qaext";
6
+ }
7
+ else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
8
+ result = "devext";
9
+ }
10
+ else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
11
+ result = "www";
12
+ }
13
+ return result;
14
+ }
15
15
  //# 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,22 +1,22 @@
1
- import { getStoryMapSubdomain } from "./get-storymap-subdomain";
2
- /**
3
- * For a given environment Prod/qa/dev/portal
4
- * return the correct storymaps base url
5
- *
6
- * @param authentication
7
- */
8
- export function getStoryMapBaseUrl(authentication) {
9
- let baseUrl = "";
10
- const subdomain = getStoryMapSubdomain(authentication);
11
- if (subdomain) {
12
- baseUrl = `https://${subdomain}.arcgis.com`;
13
- }
14
- else {
15
- // we're on portal
16
- // chop off the /sharing/rest to get the baseUrl
17
- const portalBaseUrl = authentication.portal.replace("/sharing/rest", "");
18
- baseUrl = `${portalBaseUrl}/apps/storymaps`;
19
- }
20
- return baseUrl;
21
- }
1
+ import { getStoryMapSubdomain } from "./get-storymap-subdomain";
2
+ /**
3
+ * For a given environment Prod/qa/dev/portal
4
+ * return the correct storymaps base url
5
+ *
6
+ * @param authentication
7
+ */
8
+ export function getStoryMapBaseUrl(authentication) {
9
+ let baseUrl = "";
10
+ const subdomain = getStoryMapSubdomain(authentication);
11
+ if (subdomain) {
12
+ baseUrl = `https://${subdomain}.arcgis.com`;
13
+ }
14
+ else {
15
+ // we're on portal
16
+ // chop off the /sharing/rest to get the baseUrl
17
+ const portalBaseUrl = authentication.portal.replace("/sharing/rest", "");
18
+ baseUrl = `${portalBaseUrl}/apps/storymaps`;
19
+ }
20
+ return baseUrl;
21
+ }
22
22
  //# 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,32 +1,32 @@
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 { getProp } 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 function getStoryMapDependencies(model) {
24
- const resources = getProp(model, "data.resources") || {};
25
- return Object.keys(resources).reduce((acc, key) => {
26
- if (getProp(resources, `${key}.type`) === "webmap") {
27
- acc.push(getProp(resources, `${key}.data.itemId`));
28
- }
29
- return acc;
30
- }, []);
31
- }
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 { getProp } 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 function getStoryMapDependencies(model) {
24
+ const resources = getProp(model, "data.resources") || {};
25
+ return Object.keys(resources).reduce((acc, key) => {
26
+ if (getProp(resources, `${key}.type`) === "webmap") {
27
+ acc.push(getProp(resources, `${key}.data.itemId`));
28
+ }
29
+ return acc;
30
+ }, []);
31
+ }
32
32
  //# 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,16 +1,16 @@
1
- export function getStoryMapSubdomain(authentication) {
2
- const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
3
- // TODO: Sort out how we locate storymaps on portal?
4
- let result;
5
- if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
6
- result = "storymapsqa";
7
- }
8
- else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
9
- result = "storymapsdev";
10
- }
11
- else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
12
- result = "storymaps";
13
- }
14
- return result;
15
- }
1
+ export function getStoryMapSubdomain(authentication) {
2
+ const portalUrl = authentication.portal || "https://www.arcgis.com/sharing/rest";
3
+ // TODO: Sort out how we locate storymaps on portal?
4
+ let result;
5
+ if (portalUrl.match(/(qaext|\.mapsqa)\.arcgis.com/)) {
6
+ result = "storymapsqa";
7
+ }
8
+ else if (portalUrl.match(/(devext|\.mapsdevext)\.arcgis.com/)) {
9
+ result = "storymapsdev";
10
+ }
11
+ else if (portalUrl.match(/(www|\.maps)\.arcgis.com/)) {
12
+ result = "storymaps";
13
+ }
14
+ return result;
15
+ }
16
16
  //# 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[];