@esri/solution-storymap 6.0.4-alpha.0 → 6.1.0-alpha.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 (67) hide show
  1. package/package.json +4 -4
  2. package/dist/cjs/classic-storymap-processor.d.ts +0 -24
  3. package/dist/cjs/classic-storymap-processor.js +0 -69
  4. package/dist/cjs/classic-storymap-processor.js.map +0 -1
  5. package/dist/cjs/helpers/convert-storymap-to-template.d.ts +0 -24
  6. package/dist/cjs/helpers/convert-storymap-to-template.js +0 -99
  7. package/dist/cjs/helpers/convert-storymap-to-template.js.map +0 -1
  8. package/dist/cjs/helpers/create-storymap-model-from-template.d.ts +0 -22
  9. package/dist/cjs/helpers/create-storymap-model-from-template.js +0 -43
  10. package/dist/cjs/helpers/create-storymap-model-from-template.js.map +0 -1
  11. package/dist/cjs/helpers/create-storymap.d.ts +0 -25
  12. package/dist/cjs/helpers/create-storymap.js +0 -119
  13. package/dist/cjs/helpers/create-storymap.js.map +0 -1
  14. package/dist/cjs/helpers/get-portal-env.d.ts +0 -17
  15. package/dist/cjs/helpers/get-portal-env.js +0 -19
  16. package/dist/cjs/helpers/get-portal-env.js.map +0 -1
  17. package/dist/cjs/helpers/get-storymap-base-url.d.ts +0 -23
  18. package/dist/cjs/helpers/get-storymap-base-url.js +0 -26
  19. package/dist/cjs/helpers/get-storymap-base-url.js.map +0 -1
  20. package/dist/cjs/helpers/get-storymap-dependencies.d.ts +0 -23
  21. package/dist/cjs/helpers/get-storymap-dependencies.js +0 -36
  22. package/dist/cjs/helpers/get-storymap-dependencies.js.map +0 -1
  23. package/dist/cjs/helpers/get-storymap-subdomain.d.ts +0 -17
  24. package/dist/cjs/helpers/get-storymap-subdomain.js +0 -20
  25. package/dist/cjs/helpers/get-storymap-subdomain.js.map +0 -1
  26. package/dist/cjs/helpers/remap-webmap-keys.d.ts +0 -24
  27. package/dist/cjs/helpers/remap-webmap-keys.js +0 -44
  28. package/dist/cjs/helpers/remap-webmap-keys.js.map +0 -1
  29. package/dist/cjs/index.d.ts +0 -23
  30. package/dist/cjs/index.js +0 -29
  31. package/dist/cjs/index.js.map +0 -1
  32. package/dist/cjs/storymap-processor.d.ts +0 -39
  33. package/dist/cjs/storymap-processor.js +0 -139
  34. package/dist/cjs/storymap-processor.js.map +0 -1
  35. package/dist/esm/classic-storymap-processor.d.ts +0 -24
  36. package/dist/esm/classic-storymap-processor.js +0 -62
  37. package/dist/esm/classic-storymap-processor.js.map +0 -1
  38. package/dist/esm/helpers/convert-storymap-to-template.d.ts +0 -24
  39. package/dist/esm/helpers/convert-storymap-to-template.js +0 -95
  40. package/dist/esm/helpers/convert-storymap-to-template.js.map +0 -1
  41. package/dist/esm/helpers/create-storymap-model-from-template.d.ts +0 -22
  42. package/dist/esm/helpers/create-storymap-model-from-template.js +0 -39
  43. package/dist/esm/helpers/create-storymap-model-from-template.js.map +0 -1
  44. package/dist/esm/helpers/create-storymap.d.ts +0 -25
  45. package/dist/esm/helpers/create-storymap.js +0 -115
  46. package/dist/esm/helpers/create-storymap.js.map +0 -1
  47. package/dist/esm/helpers/get-portal-env.d.ts +0 -17
  48. package/dist/esm/helpers/get-portal-env.js +0 -15
  49. package/dist/esm/helpers/get-portal-env.js.map +0 -1
  50. package/dist/esm/helpers/get-storymap-base-url.d.ts +0 -23
  51. package/dist/esm/helpers/get-storymap-base-url.js +0 -22
  52. package/dist/esm/helpers/get-storymap-base-url.js.map +0 -1
  53. package/dist/esm/helpers/get-storymap-dependencies.d.ts +0 -23
  54. package/dist/esm/helpers/get-storymap-dependencies.js +0 -32
  55. package/dist/esm/helpers/get-storymap-dependencies.js.map +0 -1
  56. package/dist/esm/helpers/get-storymap-subdomain.d.ts +0 -17
  57. package/dist/esm/helpers/get-storymap-subdomain.js +0 -16
  58. package/dist/esm/helpers/get-storymap-subdomain.js.map +0 -1
  59. package/dist/esm/helpers/remap-webmap-keys.d.ts +0 -24
  60. package/dist/esm/helpers/remap-webmap-keys.js +0 -40
  61. package/dist/esm/helpers/remap-webmap-keys.js.map +0 -1
  62. package/dist/esm/index.d.ts +0 -23
  63. package/dist/esm/index.js +0 -24
  64. package/dist/esm/index.js.map +0 -1
  65. package/dist/esm/storymap-processor.d.ts +0 -39
  66. package/dist/esm/storymap-processor.js +0 -133
  67. package/dist/esm/storymap-processor.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-storymap",
3
- "version": "6.0.4-alpha.0",
3
+ "version": "6.1.0-alpha.0",
4
4
  "description": "Manages the creation and deployment of Story Map item types for @esri/solution.js.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -21,8 +21,8 @@
21
21
  "npm-check-updates": "^17.1.0"
22
22
  },
23
23
  "dependencies": {
24
- "@esri/hub-common": "https://hub-library-preview.s3.amazonaws.com/@esri/hub-common/PR-1850/86607069d967e4c20d11826a50faeb711bf6f437.tgz",
25
- "@esri/solution-common": "^6.0.4-alpha.0",
24
+ "@esri/hub-common": "^17.0.2",
25
+ "@esri/solution-common": "^6.1.0-alpha.0",
26
26
  "tslib": "1.14.1"
27
27
  },
28
28
  "scripts": {
@@ -76,5 +76,5 @@
76
76
  "esri",
77
77
  "ES6"
78
78
  ],
79
- "gitHead": "bcb7bdb81c58fc94f1dc497547bb8dbffb85fdbd"
79
+ "gitHead": "19cbc20f4da03baa4676b3fad82abcea533432c3"
80
80
  }
@@ -1,24 +0,0 @@
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
- * Manages the creation and deployment of Story Map item types.
18
- *
19
- * @module storymap
20
- */
21
- import * as common from "@esri/solution-common";
22
- export declare function convertItemToTemplate(itemInfo: any): Promise<common.IItemTemplate>;
23
- export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
24
- export declare function isAStoryMap(itemType: string, itemUrl?: string): boolean;
@@ -1,69 +0,0 @@
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.isAStoryMap = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
19
- const tslib_1 = require("tslib");
20
- /**
21
- * Manages the creation and deployment of Story Map item types.
22
- *
23
- * @module storymap
24
- */
25
- const common = tslib_1.__importStar(require("@esri/solution-common"));
26
- // ------------------------------------------------------------------------------------------------------------------ //
27
- function convertItemToTemplate(itemInfo) {
28
- return new Promise((resolve, reject) => {
29
- if (isAStoryMap(itemInfo.type, itemInfo.url)) {
30
- reject(common.fail("Classic StoryMap is not yet implemented"));
31
- }
32
- else {
33
- reject(common.fail(itemInfo.id + " is not a StoryMap"));
34
- }
35
- });
36
- }
37
- exports.convertItemToTemplate = convertItemToTemplate;
38
- function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
39
- return new Promise((resolve) => {
40
- if (isAStoryMap(template.type, template.item.url)) {
41
- // Not yet implemented
42
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
43
- resolve(common.generateEmptyCreationResponse(template.type));
44
- }
45
- else {
46
- // Not valid
47
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
48
- resolve(common.generateEmptyCreationResponse(template.type));
49
- }
50
- });
51
- }
52
- exports.createItemFromTemplate = createItemFromTemplate;
53
- function isAStoryMap(itemType, itemUrl) {
54
- if (itemUrl) {
55
- return [
56
- /\/apps\/Cascade\//i,
57
- /\/apps\/MapJournal\//i,
58
- /\/apps\/MapSeries\//i,
59
- /\/apps\/MapTour\//i,
60
- /\/apps\/Shortlist\//i,
61
- /\/apps\/StoryMap\//i,
62
- /\/apps\/StoryMapBasic\//i,
63
- /\/apps\/StorytellingSwipe\//i,
64
- ].some((pattern) => pattern.test(itemUrl));
65
- }
66
- return false;
67
- }
68
- exports.isAStoryMap = isAStoryMap;
69
- //# sourceMappingURL=classic-storymap-processor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"classic-storymap-processor.js","sourceRoot":"","sources":["../../src/classic-storymap-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,sEAAgD;AAEhD,wHAAwH;AAExH,SAAgB,qBAAqB,CAAC,QAAa;IACjD,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC,CAAC;SAChE;aAAM;YACL,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC;SACzD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AARD,sDAQC;AAED,SAAgB,sBAAsB,CACpC,QAA8B,EAC9B,kBAAuB,EACvB,yBAA6C,EAC7C,oBAAkD;IAElD,OAAO,IAAI,OAAO,CAAyC,CAAC,OAAO,EAAE,EAAE;QACrE,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACjD,sBAAsB;YACtB,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC5E,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;aAAM;YACL,YAAY;YACZ,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC5E,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,wDAiBC;AAED,SAAgB,WAAW,CAAC,QAAgB,EAAE,OAAgB;IAC5D,IAAI,OAAO,EAAE;QACX,OAAO;YACL,oBAAoB;YACpB,uBAAuB;YACvB,sBAAsB;YACtB,oBAAoB;YACpB,sBAAsB;YACtB,qBAAqB;YACrB,0BAA0B;YAC1B,8BAA8B;SAC/B,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;KAC5C;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAdD,kCAcC"}
@@ -1,24 +0,0 @@
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
- import { IItemTemplate } from "@esri/solution-common";
18
- /**
19
- * Convert a StoryMap IModel to an IItemTemplate
20
- *
21
- * @param model
22
- * @param authentication
23
- */
24
- export declare function convertStoryMapToTemplate(model: IModel): Promise<IItemTemplate>;
@@ -1,99 +0,0 @@
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.convertStoryMapToTemplate = void 0;
19
- const hub_common_1 = require("@esri/hub-common");
20
- const solution_common_1 = require("@esri/solution-common");
21
- const remap_webmap_keys_1 = require("./remap-webmap-keys");
22
- const get_storymap_dependencies_1 = require("./get-storymap-dependencies");
23
- /**
24
- * Convert a StoryMap IModel to an IItemTemplate
25
- *
26
- * @param model
27
- * @param authentication
28
- */
29
- function convertStoryMapToTemplate(model) {
30
- const tmpl = (0, solution_common_1.createPlaceholderTemplate)(model.item.id, model.item.type);
31
- tmpl.key = `${(0, hub_common_1.propifyString)(model.item.title)}_${(0, hub_common_1.createId)("i")}`;
32
- const clone = (0, hub_common_1.cloneObject)(model);
33
- tmpl.data = clone.data;
34
- // We need to save these properties in order to restore them after hub.js deletes them
35
- const created = clone.item.created;
36
- const modified = clone.item.modified;
37
- tmpl.item = (0, hub_common_1.normalizeSolutionTemplateItem)(clone.item);
38
- tmpl.item.created = created;
39
- tmpl.item.modified = modified;
40
- // templatize the url
41
- tmpl.item.url = "{{storyMapTemplateUrl}}";
42
- // Storymap Webmap Resources have complex keys that we need to remap
43
- const webmapRemaps = (0, remap_webmap_keys_1.remapWebmapKeys)(tmpl.data.resources);
44
- // and then replace in the rest of the structure
45
- webmapRemaps.forEach((remap) => {
46
- tmpl.data.resources[remap.updated] = (0, hub_common_1.cloneObject)(tmpl.data.resources[remap.original]);
47
- delete tmpl.data.resources[remap.original];
48
- tmpl.data.nodes = (0, hub_common_1.deepStringReplace)(tmpl.data.nodes, remap.original, remap.updated);
49
- });
50
- // use typeKeyword to mark item as published
51
- // Note: Hub team decided to discard unpublished drafts when creating a template
52
- const typeKeywords = tmpl.item.typeKeywords;
53
- if (typeKeywords.indexOf(unPublishedChangesKW) !== -1) {
54
- tmpl.item.typeKeywords = [publishedChangesKW].concat(tmpl.item.typeKeywords.filter((word) => word !== unPublishedChangesKW));
55
- }
56
- tmpl.properties = {};
57
- tmpl.properties.draftFileName = "draft_{{timestamp}}.json";
58
- Object.assign(tmpl.properties, oEmbedTemplates);
59
- tmpl.dependencies = (0, get_storymap_dependencies_1.getStoryMapDependencies)(model);
60
- return Promise.resolve(tmpl);
61
- // TODO: For now, we let the generic process handle item resources
62
- // However, many newer item types have complex type-specific resource handling
63
- // requirements so this code may be useful in the future
64
- // ------------------------------------------------------
65
- // return getItemResources(tmpl.itemId, hubRequestOptions)
66
- // .then((response) => {
67
- // tmpl.resources = response.resources.map(e => e.resource)
68
- // // Don't directly copy oembed resources because we need to template these
69
- // // Also, discard draft version of the storymap itself
70
- // .filter(filename => !filename.includes('oembed') && filename.search(/draft_[0-9]+.json/) === -1);
71
- // return tmpl;
72
- // });
73
- }
74
- exports.convertStoryMapToTemplate = convertStoryMapToTemplate;
75
- // Internal constants
76
- const unPublishedChangesKW = "smstatusunpublishedchanges";
77
- const publishedChangesKW = "smstatuspublished";
78
- /**
79
- * Template for oEmbed
80
- */
81
- const oEmbedTemplates = {
82
- oembed: {
83
- version: "1.0",
84
- type: "rich",
85
- title: "Example StoryMap",
86
- url: "{{storyMapTemplateUrl}}",
87
- provider_name: "ArcGIS StoryMaps",
88
- provider_url: "{{storyMapBaseUrl}}",
89
- width: 800,
90
- height: 600,
91
- thumbnail_url: "{{storyMapThumbnailUrl}}",
92
- thumbnail_height: "100.5",
93
- thumbnail_width: "400",
94
- html: '<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',
95
- cache_age: 86400,
96
- },
97
- oembedXML: '<?xml version="1.0" encoding="utf-8" standalone="yes"?>\n <oembed>\n <version>1.0</version>\n <type>rich</type>\n <title>Example StoryMap</title>\n <url>{{storyMapTemplateUrl}}</url>\n <author_name>undefined</author_name>\n <provider_name>ArcGIS StoryMaps</provider_name>\n <provider_url>{{storyMapBaseUrl}}</provider_url>\n <width>800</width>\n <height>600</height>\n <thumbnail_url>{{storyMapThumbnailUrl}}</thumbnail_url>\n <thumbnail_height>100.5</thumbnail_height>\n <thumbnail_width>400</thumbnail_width>\n <html><iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen="true"></iframe></html>\n <cache_age>86400</cache_age>\n </oembed>',
98
- };
99
- //# sourceMappingURL=convert-storymap-to-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-storymap-to-template.js","sourceRoot":"","sources":["../../../src/helpers/convert-storymap-to-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,iDAO0B;AAC1B,2DAAwF;AACxF,2DAAsD;AACtD,2EAAsE;AAEtE;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,KAAa;IACrD,MAAM,IAAI,GAAG,IAAA,2CAAyB,EAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvE,IAAI,CAAC,GAAG,GAAG,GAAG,IAAA,0BAAa,EAAC,KAAK,CAAC,IAAI,CAAC,KAA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AAE,KAAK;QACtB,IAAI,EAAE,0HAA0H;QAChI,SAAS,EAAE,KAAK;KACjB;IACD,SAAS,EACP,0rBAA0rB;CAC7rB,CAAC"}
@@ -1,22 +0,0 @@
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
- /**
17
- * Given a template, process it and interpolate it such that
18
- * we have a model that is ready to be sent to the Portal API
19
- */
20
- import { IModelTemplate } from "@esri/hub-common";
21
- import { UserSession } from "@esri/solution-common";
22
- export declare function createStoryMapModelFromTemplate(templateModel: IModelTemplate, settings: any, transforms: any, authentication: UserSession): Promise<any>;
@@ -1,43 +0,0 @@
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
- /**
18
- * Given a template, process it and interpolate it such that
19
- * we have a model that is ready to be sent to the Portal API
20
- */
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.createStoryMapModelFromTemplate = void 0;
23
- const hub_common_1 = require("@esri/hub-common");
24
- const get_portal_env_1 = require("./get-portal-env");
25
- const get_storymap_base_url_1 = require("./get-storymap-base-url");
26
- const get_storymap_subdomain_1 = require("./get-storymap-subdomain");
27
- function createStoryMapModelFromTemplate(templateModel, settings, transforms, authentication) {
28
- const timestamp = new Date().getTime();
29
- // Keep these around in case we encounter some old templates
30
- settings.agoenv = (0, get_portal_env_1.getPortalEnv)(authentication);
31
- settings.smBase = (0, get_storymap_subdomain_1.getStoryMapSubdomain)(authentication);
32
- settings.timestamp = new Date().getTime();
33
- // These are used in the oembed resource, as well as the item url
34
- // they have `{{appid}}` in them so that the id of the created item
35
- // will be interpolated into it after the item is created
36
- settings.storyMapBaseUrl = (0, get_storymap_base_url_1.getStoryMapBaseUrl)(authentication);
37
- settings.storyMapTemplateUrl = `${settings.storyMapBaseUrl}/stories/{{appid}}`;
38
- settings.storyMapThumnailUrl = `${authentication.portal}/content/items/{{appid}}/info/thumbnail/thumbnail.jpg/?w=400&d=${timestamp}`;
39
- const model = (0, hub_common_1.interpolate)(templateModel, settings, transforms);
40
- return Promise.resolve(model);
41
- }
42
- exports.createStoryMapModelFromTemplate = createStoryMapModelFromTemplate;
43
- //# sourceMappingURL=create-storymap-model-from-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-storymap-model-from-template.js","sourceRoot":"","sources":["../../../src/helpers/create-storymap-model-from-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH;;;GAGG;;;AAEH,iDAA+D;AAE/D,qDAAgD;AAChD,mEAA6D;AAC7D,qEAAgE;AAEhE,SAAgB,+BAA+B,CAC7C,aAA6B,EAC7B,QAAa,EACb,UAAe,EACf,cAA2B;IAE3B,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IACvC,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,GAAG,IAAA,6BAAY,EAAC,cAAc,CAAC,CAAC;IAC/C,QAAQ,CAAC,MAAM,GAAG,IAAA,6CAAoB,EAAC,cAAc,CAAC,CAAC;IACvD,QAAQ,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAC1C,iEAAiE;IACjE,mEAAmE;IACnE,yDAAyD;IACzD,QAAQ,CAAC,eAAe,GAAG,IAAA,0CAAkB,EAAC,cAAc,CAAC,CAAC;IAC9D,QAAQ,CAAC,mBAAmB,GAAG,GAAG,QAAQ,CAAC,eAAe,oBAAoB,CAAC;IAC/E,QAAQ,CAAC,mBAAmB,GAAG,GAAG,cAAc,CAAC,MAAM,kEAAkE,SAAS,EAAE,CAAC;IAErI,MAAM,KAAK,GAAG,IAAA,wBAAW,EAAC,aAAa,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAE/D,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AArBD,0EAqBC"}
@@ -1,25 +0,0 @@
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 { IModel } from "@esri/hub-common";
17
- import { UserSession } from "@esri/solution-common";
18
- /**
19
- * Create a StoryMap from an interpolated template
20
- *
21
- * @param model
22
- * @param options
23
- * @param authentication
24
- */
25
- export declare function createStoryMap(model: IModel, folderId: string, options: any, authentication: UserSession): Promise<IModel>;
@@ -1,119 +0,0 @@
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 solution_common_1 = require("@esri/solution-common");
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
- // The data section has been de-templatized. Some entries need to be encoded URLs, so we'll find and encode them.
34
- model.data = JSON.parse(JSON.stringify(model.data).replace(/portalUrl=https:\/\//g, "portalUrl=https%3A%2F%2F"));
35
- // For unknown reasons we can not seem to spy on createItemInFolder
36
- // so we will create-then-move for now
37
- const createOptions = {
38
- // need to serialize
39
- item: (0, hub_common_1.serializeModel)(model),
40
- authentication,
41
- };
42
- /* istanbul ignore else */
43
- if (model.item.thumbnail) {
44
- createOptions.params = {
45
- // Pass thumbnail file in via params because item property is serialized, which discards a blob
46
- thumbnail: model.item.thumbnail,
47
- };
48
- delete createOptions.item.thumbnail;
49
- }
50
- // Create the item
51
- return (0, solution_common_1.createItem)(createOptions)
52
- .then((createResponse) => {
53
- // hold the id in the model
54
- model.item.id = createResponse.id;
55
- // and re-interpolate the item id
56
- model = (0, hub_common_1.interpolateItemId)(model);
57
- // Compute the item url based on current environment
58
- // Storymaps store draft data in a timestamped resource attached to the item
59
- // We'll just use the published data for the first "draft"
60
- const dataBlob = (0, hub_common_1.stringToBlob)(JSON.stringify(model.data));
61
- resources.push({
62
- name: model.properties.draftFileName,
63
- file: dataBlob,
64
- });
65
- resources.push({
66
- name: "oembed.json",
67
- file: (0, hub_common_1.stringToBlob)(JSON.stringify(model.properties.oembed)),
68
- });
69
- resources.push({
70
- name: "oembed.xml",
71
- file: (0, hub_common_1.stringToBlob)(model.properties.oembedXML),
72
- });
73
- resources.push({
74
- name: "published_data.json",
75
- file: dataBlob,
76
- });
77
- // remove the properties hash now that we've gotten what we need
78
- delete model.properties;
79
- // update the item with the newly re-interpolated model
80
- return Promise.all([
81
- (0, solution_common_1.restUpdateItem)({
82
- item: (0, hub_common_1.serializeModel)(model),
83
- authentication,
84
- }),
85
- authentication.getUsername(),
86
- ]);
87
- })
88
- .then((responses) => {
89
- const username = responses[1];
90
- // add the resources
91
- const failSafeAddItemResource = (0, hub_common_1.failSafe)(solution_common_1.addItemResource, {
92
- success: true,
93
- });
94
- const resourcePromises = resources.map((resource) => {
95
- return failSafeAddItemResource({
96
- id: model.item.id,
97
- owner: username,
98
- resource: resource.file,
99
- name: resource.name,
100
- authentication,
101
- });
102
- });
103
- // Fire and forget as these are not critical-path
104
- return Promise.all(resourcePromises);
105
- })
106
- .then(() => {
107
- // Move it
108
- return (0, solution_common_1.moveItem)({
109
- itemId: model.item.id,
110
- folderId,
111
- authentication,
112
- });
113
- })
114
- .then(() => {
115
- return model;
116
- });
117
- }
118
- exports.createStoryMap = createStoryMap;
119
- //# sourceMappingURL=create-storymap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-storymap.js","sourceRoot":"","sources":["../../../src/helpers/create-storymap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,gDAAgD;AAChD,iDAAqG;AAErG,2DAQ+B;AAE/B;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,KAAa,EACb,QAAgB,EAChB,OAAY,EACZ,cAA2B;IAE3B,+CAA+C;IAC/C,oDAAoD;IACpD,MAAM,SAAS,GAAU,EAAE,CAAC;IAE5B,iHAAiH;IACjH,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CAAC,CAAC;IA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-1,17 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=get-portal-env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-portal-env.js","sourceRoot":"","sources":["../../../src/helpers/get-portal-env.ts"],"names":[],"mappings":";;;AAiBA,SAAgB,YAAY,CAAC,cAA2B;IACtD,MAAM,SAAS,GAAG,cAAc,CAAC,MAAM,IAAI,qCAAqC,CAAC;IACjF,IAAI,MAAM,GAAG,QAAQ,CAAC;IACtB,IAAI,SAAS,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE;QACnD,MAAM,GAAG,OAAO,CAAC;KAClB;SAAM,IAAI,SAAS,CAAC,KAAK,CAAC,mCAAmC,CAAC,EAAE;QAC/D,MAAM,GAAG,QAAQ,CAAC;KACnB;SAAM,IAAI,SAAS,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE;QACtD,MAAM,GAAG,KAAK,CAAC;KAChB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,oCAWC"}
@@ -1,23 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=get-storymap-base-url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-storymap-base-url.js","sourceRoot":"","sources":["../../../src/helpers/get-storymap-base-url.ts"],"names":[],"mappings":";;;AAgBA,qEAAgE;AAChE;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,cAA2B;IAC5D,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,MAAM,SAAS,GAAG,IAAA,6CAAoB,EAAC,cAAc,CAAC,CAAC;IACvD,IAAI,SAAS,EAAE;QACb,OAAO,GAAG,WAAW,SAAS,aAAa,CAAC;KAC7C;SAAM;QACL,kBAAkB;QAClB,gDAAgD;QAChD,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;QACzE,OAAO,GAAG,GAAG,aAAa,iBAAiB,CAAC;KAC7C;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAdD,gDAcC"}
@@ -1,23 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=get-storymap-dependencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-storymap-dependencies.js","sourceRoot":"","sources":["../../../src/helpers/get-storymap-dependencies.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,iDAAmD;AAEnD;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC;IACzD,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAChD,IAAI,IAAA,oBAAO,EAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,QAAQ,EAAE;YAClD,GAAG,CAAC,IAAI,CAAC,IAAA,oBAAO,EAAC,SAAS,EAAE,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC;SACpD;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AARD,0DAQC"}