@esri/solution-viewer 1.3.10 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/viewer.d.ts +5 -4
- package/dist/esm/viewer.js +5 -4
- package/dist/esm/viewer.js.map +1 -1
- package/dist/node/viewer.d.ts +5 -4
- package/dist/node/viewer.js +5 -4
- package/dist/node/viewer.js.map +1 -1
- package/dist/umd/viewer.d.ts +5 -4
- package/dist/umd/viewer.umd.js +7 -6
- package/dist/umd/viewer.umd.js.map +1 -1
- package/dist/umd/viewer.umd.min.js +2 -2
- package/dist/umd/viewer.umd.min.js.map +1 -1
- package/package.json +15 -14
package/dist/esm/viewer.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param item Solution id
|
|
26
26
|
* @param authentication Credentials for the request to AGO
|
|
27
|
-
* @
|
|
27
|
+
* @returns List of results of checks of Solution
|
|
28
28
|
*/
|
|
29
29
|
export declare function checkSolution(itemId: string, authentication?: common.UserSession): Promise<string[]>;
|
|
30
30
|
/**
|
|
@@ -33,7 +33,7 @@ export declare function checkSolution(itemId: string, authentication?: common.Us
|
|
|
33
33
|
* @param item1 First item or its AGO id
|
|
34
34
|
* @param item2 Second item or its AGO id
|
|
35
35
|
* @param authentication Credentials for the request to AGO
|
|
36
|
-
* @
|
|
36
|
+
* @returns True if objects are the same
|
|
37
37
|
* @see Only comparable properties are compared; see deleteItemProps() in the `common` package
|
|
38
38
|
*/
|
|
39
39
|
export declare function compareItems(item1: string | any, item2: string | any, authentication?: common.UserSession): Promise<boolean>;
|
|
@@ -41,13 +41,14 @@ export declare function compareItems(item1: string | any, item2: string | any, a
|
|
|
41
41
|
* Creates a hierarchy of the items in a Solution template.
|
|
42
42
|
*
|
|
43
43
|
* @param templates Array of templates from a Solution
|
|
44
|
-
* @
|
|
44
|
+
* @returns List of top-level items, each containing a recursive list of its dependencies
|
|
45
45
|
*/
|
|
46
46
|
export declare function getItemHierarchy(templates: common.IItemTemplate[]): common.IHierarchyElement[];
|
|
47
47
|
/**
|
|
48
48
|
* Finds the top-level items in a Solution template--the items that are not dependencies of any other item.
|
|
49
49
|
*
|
|
50
50
|
* @param templates Array of templates from a Solution
|
|
51
|
-
* @
|
|
51
|
+
* @returns List of top-level item ids
|
|
52
|
+
* @private
|
|
52
53
|
*/
|
|
53
54
|
export declare function _getTopLevelItemIds(templates: common.IItemTemplate[]): string[];
|
package/dist/esm/viewer.js
CHANGED
|
@@ -25,7 +25,7 @@ import * as common from "@esri/solution-common";
|
|
|
25
25
|
*
|
|
26
26
|
* @param item Solution id
|
|
27
27
|
* @param authentication Credentials for the request to AGO
|
|
28
|
-
* @
|
|
28
|
+
* @returns List of results of checks of Solution
|
|
29
29
|
*/
|
|
30
30
|
export function checkSolution(itemId, authentication = null) {
|
|
31
31
|
const resultsHtml = [`Item ${itemId}`];
|
|
@@ -134,7 +134,7 @@ export function checkSolution(itemId, authentication = null) {
|
|
|
134
134
|
* @param item1 First item or its AGO id
|
|
135
135
|
* @param item2 Second item or its AGO id
|
|
136
136
|
* @param authentication Credentials for the request to AGO
|
|
137
|
-
* @
|
|
137
|
+
* @returns True if objects are the same
|
|
138
138
|
* @see Only comparable properties are compared; see deleteItemProps() in the `common` package
|
|
139
139
|
*/
|
|
140
140
|
export function compareItems(item1, item2, authentication = null) {
|
|
@@ -177,7 +177,7 @@ export function compareItems(item1, item2, authentication = null) {
|
|
|
177
177
|
* Creates a hierarchy of the items in a Solution template.
|
|
178
178
|
*
|
|
179
179
|
* @param templates Array of templates from a Solution
|
|
180
|
-
* @
|
|
180
|
+
* @returns List of top-level items, each containing a recursive list of its dependencies
|
|
181
181
|
*/
|
|
182
182
|
export function getItemHierarchy(templates) {
|
|
183
183
|
const hierarchy = [];
|
|
@@ -231,7 +231,8 @@ export function getItemHierarchy(templates) {
|
|
|
231
231
|
* Finds the top-level items in a Solution template--the items that are not dependencies of any other item.
|
|
232
232
|
*
|
|
233
233
|
* @param templates Array of templates from a Solution
|
|
234
|
-
* @
|
|
234
|
+
* @returns List of top-level item ids
|
|
235
|
+
* @private
|
|
235
236
|
*/
|
|
236
237
|
export function _getTopLevelItemIds(templates) {
|
|
237
238
|
// Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on
|
package/dist/esm/viewer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../src/viewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,wHAAwH;AAExH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAc,EACd,iBAAqC,IAAI;IAEzC,MAAM,WAAW,GAAa,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;IACjD,IAAI,IAA0B,CAAC;IAC/B,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,IAAI,aAAqC,CAAC;IAC1C,IAAI,eAAyB,CAAC;IAE9B,IAAI,aAAa,GAAW,8BAA8B,CAAC;IAC3D,OAAO,CACL,MAAM;SACH,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC;QAExC,kHAAkH;SACjH,IAAI,CAAC,CAAC,OAA6B,EAAE,EAAE;QACtC,aAAa,GAAG,EAAE,CAAC;QACnB,IAAI,GAAG,OAAO,CAAC;QAEf,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;SACtC;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC3C;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACtD,WAAW,CAAC,IAAI,CAAC,sCAAsC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AC,CAAC,OAAO,CAAC,UAAU,YAAY;YAC1D,MAAM,KAAK,GAAG,wBAAwB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAE7D,0BAA0B;YAC1B,IAAI,KAAK,IAAI,CAAC,EAAE;gBACd,qFAAqF;gBACrF,gFAAgF;gBAChF,wBAAwB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAAA,CAAC"}
|
package/dist/node/viewer.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param item Solution id
|
|
26
26
|
* @param authentication Credentials for the request to AGO
|
|
27
|
-
* @
|
|
27
|
+
* @returns List of results of checks of Solution
|
|
28
28
|
*/
|
|
29
29
|
export declare function checkSolution(itemId: string, authentication?: common.UserSession): Promise<string[]>;
|
|
30
30
|
/**
|
|
@@ -33,7 +33,7 @@ export declare function checkSolution(itemId: string, authentication?: common.Us
|
|
|
33
33
|
* @param item1 First item or its AGO id
|
|
34
34
|
* @param item2 Second item or its AGO id
|
|
35
35
|
* @param authentication Credentials for the request to AGO
|
|
36
|
-
* @
|
|
36
|
+
* @returns True if objects are the same
|
|
37
37
|
* @see Only comparable properties are compared; see deleteItemProps() in the `common` package
|
|
38
38
|
*/
|
|
39
39
|
export declare function compareItems(item1: string | any, item2: string | any, authentication?: common.UserSession): Promise<boolean>;
|
|
@@ -41,13 +41,14 @@ export declare function compareItems(item1: string | any, item2: string | any, a
|
|
|
41
41
|
* Creates a hierarchy of the items in a Solution template.
|
|
42
42
|
*
|
|
43
43
|
* @param templates Array of templates from a Solution
|
|
44
|
-
* @
|
|
44
|
+
* @returns List of top-level items, each containing a recursive list of its dependencies
|
|
45
45
|
*/
|
|
46
46
|
export declare function getItemHierarchy(templates: common.IItemTemplate[]): common.IHierarchyElement[];
|
|
47
47
|
/**
|
|
48
48
|
* Finds the top-level items in a Solution template--the items that are not dependencies of any other item.
|
|
49
49
|
*
|
|
50
50
|
* @param templates Array of templates from a Solution
|
|
51
|
-
* @
|
|
51
|
+
* @returns List of top-level item ids
|
|
52
|
+
* @private
|
|
52
53
|
*/
|
|
53
54
|
export declare function _getTopLevelItemIds(templates: common.IItemTemplate[]): string[];
|
package/dist/node/viewer.js
CHANGED
|
@@ -29,7 +29,7 @@ const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
|
29
29
|
*
|
|
30
30
|
* @param item Solution id
|
|
31
31
|
* @param authentication Credentials for the request to AGO
|
|
32
|
-
* @
|
|
32
|
+
* @returns List of results of checks of Solution
|
|
33
33
|
*/
|
|
34
34
|
function checkSolution(itemId, authentication = null) {
|
|
35
35
|
const resultsHtml = [`Item ${itemId}`];
|
|
@@ -139,7 +139,7 @@ exports.checkSolution = checkSolution;
|
|
|
139
139
|
* @param item1 First item or its AGO id
|
|
140
140
|
* @param item2 Second item or its AGO id
|
|
141
141
|
* @param authentication Credentials for the request to AGO
|
|
142
|
-
* @
|
|
142
|
+
* @returns True if objects are the same
|
|
143
143
|
* @see Only comparable properties are compared; see deleteItemProps() in the `common` package
|
|
144
144
|
*/
|
|
145
145
|
function compareItems(item1, item2, authentication = null) {
|
|
@@ -183,7 +183,7 @@ exports.compareItems = compareItems;
|
|
|
183
183
|
* Creates a hierarchy of the items in a Solution template.
|
|
184
184
|
*
|
|
185
185
|
* @param templates Array of templates from a Solution
|
|
186
|
-
* @
|
|
186
|
+
* @returns List of top-level items, each containing a recursive list of its dependencies
|
|
187
187
|
*/
|
|
188
188
|
function getItemHierarchy(templates) {
|
|
189
189
|
const hierarchy = [];
|
|
@@ -238,7 +238,8 @@ exports.getItemHierarchy = getItemHierarchy;
|
|
|
238
238
|
* Finds the top-level items in a Solution template--the items that are not dependencies of any other item.
|
|
239
239
|
*
|
|
240
240
|
* @param templates Array of templates from a Solution
|
|
241
|
-
* @
|
|
241
|
+
* @returns List of top-level item ids
|
|
242
|
+
* @private
|
|
242
243
|
*/
|
|
243
244
|
function _getTopLevelItemIds(templates) {
|
|
244
245
|
// Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on
|
package/dist/node/viewer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../src/viewer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,sEAAgD;AAEhD,wHAAwH;AAExH;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,MAAc,EACd,iBAAqC,IAAI;IAEzC,MAAM,WAAW,GAAa,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;IACjD,IAAI,IAA0B,CAAC;IAC/B,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,IAAI,aAAqC,CAAC;IAC1C,IAAI,eAAyB,CAAC;IAE9B,IAAI,aAAa,GAAW,8BAA8B,CAAC;IAC3D,OAAO,CACL,MAAM;SACH,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC;QAExC,kHAAkH;SACjH,IAAI,CAAC,CAAC,OAA6B,EAAE,EAAE;QACtC,aAAa,GAAG,EAAE,CAAC;QACnB,IAAI,GAAG,OAAO,CAAC;QAEf,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;SACtC;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC3C;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACtD,WAAW,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;SAC1D;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YAC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,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAE7D,0BAA0B;YAC1B,IAAI,KAAK,IAAI,CAAC,EAAE;gBACd,qFAAqF;gBACrF,gFAAgF;gBAChF,wBAAwB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,wBAAwB,CAAC;AAClC,CAAC;AApBD,kDAoBC;AAAA,CAAC"}
|
package/dist/umd/viewer.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param item Solution id
|
|
26
26
|
* @param authentication Credentials for the request to AGO
|
|
27
|
-
* @
|
|
27
|
+
* @returns List of results of checks of Solution
|
|
28
28
|
*/
|
|
29
29
|
export declare function checkSolution(itemId: string, authentication?: common.UserSession): Promise<string[]>;
|
|
30
30
|
/**
|
|
@@ -33,7 +33,7 @@ export declare function checkSolution(itemId: string, authentication?: common.Us
|
|
|
33
33
|
* @param item1 First item or its AGO id
|
|
34
34
|
* @param item2 Second item or its AGO id
|
|
35
35
|
* @param authentication Credentials for the request to AGO
|
|
36
|
-
* @
|
|
36
|
+
* @returns True if objects are the same
|
|
37
37
|
* @see Only comparable properties are compared; see deleteItemProps() in the `common` package
|
|
38
38
|
*/
|
|
39
39
|
export declare function compareItems(item1: string | any, item2: string | any, authentication?: common.UserSession): Promise<boolean>;
|
|
@@ -41,13 +41,14 @@ export declare function compareItems(item1: string | any, item2: string | any, a
|
|
|
41
41
|
* Creates a hierarchy of the items in a Solution template.
|
|
42
42
|
*
|
|
43
43
|
* @param templates Array of templates from a Solution
|
|
44
|
-
* @
|
|
44
|
+
* @returns List of top-level items, each containing a recursive list of its dependencies
|
|
45
45
|
*/
|
|
46
46
|
export declare function getItemHierarchy(templates: common.IItemTemplate[]): common.IHierarchyElement[];
|
|
47
47
|
/**
|
|
48
48
|
* Finds the top-level items in a Solution template--the items that are not dependencies of any other item.
|
|
49
49
|
*
|
|
50
50
|
* @param templates Array of templates from a Solution
|
|
51
|
-
* @
|
|
51
|
+
* @returns List of top-level item ids
|
|
52
|
+
* @private
|
|
52
53
|
*/
|
|
53
54
|
export declare function _getTopLevelItemIds(templates: common.IItemTemplate[]): string[];
|
package/dist/umd/viewer.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-viewer - v1.3.
|
|
2
|
+
* @esri/solution-viewer - v1.3.11 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
*
|
|
4
|
+
* Mon Apr 25 2022 12:02:00 GMT-0700 (Pacific Daylight Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
*
|
|
63
63
|
* @param item Solution id
|
|
64
64
|
* @param authentication Credentials for the request to AGO
|
|
65
|
-
* @
|
|
65
|
+
* @returns List of results of checks of Solution
|
|
66
66
|
*/
|
|
67
67
|
function checkSolution(itemId, authentication = null) {
|
|
68
68
|
const resultsHtml = [`Item ${itemId}`];
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
* @param item1 First item or its AGO id
|
|
172
172
|
* @param item2 Second item or its AGO id
|
|
173
173
|
* @param authentication Credentials for the request to AGO
|
|
174
|
-
* @
|
|
174
|
+
* @returns True if objects are the same
|
|
175
175
|
* @see Only comparable properties are compared; see deleteItemProps() in the `common` package
|
|
176
176
|
*/
|
|
177
177
|
function compareItems(item1, item2, authentication = null) {
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
* Creates a hierarchy of the items in a Solution template.
|
|
215
215
|
*
|
|
216
216
|
* @param templates Array of templates from a Solution
|
|
217
|
-
* @
|
|
217
|
+
* @returns List of top-level items, each containing a recursive list of its dependencies
|
|
218
218
|
*/
|
|
219
219
|
function getItemHierarchy(templates) {
|
|
220
220
|
const hierarchy = [];
|
|
@@ -268,7 +268,8 @@
|
|
|
268
268
|
* Finds the top-level items in a Solution template--the items that are not dependencies of any other item.
|
|
269
269
|
*
|
|
270
270
|
* @param templates Array of templates from a Solution
|
|
271
|
-
* @
|
|
271
|
+
* @returns List of top-level item ids
|
|
272
|
+
* @private
|
|
272
273
|
*/
|
|
273
274
|
function _getTopLevelItemIds(templates) {
|
|
274
275
|
// Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.umd.js","sources":["../../src/viewer.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Provides the access to the solution's contents.\r\n *\r\n * @module viewer\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Checks a Solution.\r\n *\r\n * @param item Solution id\r\n * @param authentication Credentials for the request to AGO\r\n * @return List of results of checks of Solution\r\n */\r\nexport function checkSolution(\r\n itemId: string,\r\n authentication: common.UserSession = null\r\n): Promise<string[]> {\r\n const resultsHtml: string[] = [`Item ${itemId}`];\r\n let item: common.ICompleteItem;\r\n let isTemplate = true;\r\n let templateItems: common.IItemTemplate[];\r\n let templateItemIds: string[];\r\n\r\n let currentAction: string = \" while getting complete item\";\r\n return (\r\n common\r\n .getCompleteItem(itemId, authentication)\r\n\r\n // ---------- Is it a Template or Deployed Solution? -----------------------------------------------------------//\r\n .then((results: common.ICompleteItem) => {\r\n currentAction = \"\";\r\n item = results;\r\n\r\n if (!item) {\r\n throw new Error(`item is not found`);\r\n } else if (item.base.type !== \"Solution\") {\r\n throw new Error(`item is not a Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Template\")) {\r\n resultsHtml.push(`✔ item is a Template Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Deployed\")) {\r\n isTemplate = false;\r\n resultsHtml.push(`✔ item is a Deployed Solution`);\r\n } else {\r\n throw new Error(\r\n `item is neither a Template Solution nor a Deployed Solution`\r\n );\r\n }\r\n\r\n // base: IItem; text/plain JSON\r\n // data: File; */*\r\n // thumbnail: File; image/*\r\n // metadata: File; application/xml\r\n // resources: File[]; list of */*\r\n // fwdRelatedItems: IRelatedItems[]; list of forward relationshipType/relatedItems[] pairs\r\n // revRelatedItems: IRelatedItems[]; list of reverse relationshipType/relatedItems[] pairs\r\n return common.blobToJson(item.data);\r\n })\r\n\r\n // ---------- Check the Solution2Item relationship from a Deployed Solution to each deployed item --------------//\r\n .then(itemDataJson => {\r\n templateItems = itemDataJson?.templates;\r\n /* istanbul ignore else */\r\n if (!templateItems || templateItems.length === 0) {\r\n throw new Error(\r\n `Solution's data are not valid JSON or the Solution contains no items`\r\n );\r\n }\r\n\r\n templateItemIds = templateItems\r\n .map((template: common.IItemTemplate) => template.itemId)\r\n .sort();\r\n\r\n if (!isTemplate) {\r\n // Make sure that there's a Solution2Item relationship to each deployed item\r\n const fwdRelatedItemIds = item.fwdRelatedItems\r\n .filter(\r\n relationshipSet =>\r\n relationshipSet.relationshipType === \"Solution2Item\"\r\n )\r\n .reduce(\r\n (flatSet, relationshipSet) =>\r\n flatSet.concat(relationshipSet.relatedItemIds),\r\n []\r\n )\r\n .sort();\r\n if (templateItemIds.length < fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ there are forward Solution2Item relationship(s) to unknown item(s)\"\r\n );\r\n } else if (templateItemIds.length > fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ missing forward Solution2Item relationship(s)\"\r\n );\r\n } else if (\r\n JSON.stringify(templateItemIds) !==\r\n JSON.stringify(fwdRelatedItemIds)\r\n ) {\r\n resultsHtml.push(\r\n \"✖ mismatching forward Solution2Item relationship(s)\"\r\n );\r\n } else {\r\n resultsHtml.push(\r\n \"✔ matching forward Solution2Item relationship(s)\"\r\n );\r\n }\r\n }\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Check that all dependency references are items in Solution ---------------------------------------//\r\n .then(() => {\r\n const dependencyIds = templateItems\r\n .reduce(\r\n (flatSet, template) => flatSet.concat(template.dependencies),\r\n []\r\n )\r\n .reduce((noDupSet, dependency) => {\r\n /* istanbul ignore else */\r\n if (!noDupSet.includes(dependency)) noDupSet.push(dependency);\r\n return noDupSet;\r\n }, [])\r\n .sort();\r\n\r\n const missingItems = dependencyIds.filter(\r\n (dependencyId: string) => !templateItemIds.includes(dependencyId)\r\n );\r\n\r\n if (missingItems.length === 0) {\r\n resultsHtml.push(\"✔ all dependencies are in Solution\");\r\n } else {\r\n resultsHtml.push(\r\n \"✖ dependencies that aren't in Solution: \" +\r\n JSON.stringify(missingItems)\r\n );\r\n }\r\n\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Done ---------------------------------------------------------------------------------------------//\r\n .then(() => {\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Fatal error --------------------------------------------------------------------------------------//\r\n .catch(error => {\r\n resultsHtml.push(`✖ error${currentAction}: ${error.message}`);\r\n return resultsHtml;\r\n })\r\n );\r\n}\r\n\r\n/**\r\n * Compares two AGO items, fetching them if only their id is supplied.\r\n *\r\n * @param item1 First item or its AGO id\r\n * @param item2 Second item or its AGO id\r\n * @param authentication Credentials for the request to AGO\r\n * @return True if objects are the same\r\n * @see Only comparable properties are compared; see deleteItemProps() in the `common` package\r\n */\r\nexport function compareItems(\r\n item1: string | any,\r\n item2: string | any,\r\n authentication: common.UserSession = null\r\n): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // If an input is a string, fetch the item; otherwise, clone the input because we will modify the\r\n // item base to remove incomparable properties\r\n let itemBaseDef1: Promise<any>;\r\n if (typeof item1 === \"string\") {\r\n itemBaseDef1 = common.getItemBase(item1, authentication);\r\n } else {\r\n itemBaseDef1 = Promise.resolve(common.cloneObject(item1));\r\n }\r\n\r\n let itemBaseDef2: Promise<any>;\r\n if (typeof item2 === \"string\") {\r\n itemBaseDef2 = common.getItemBase(item2, authentication);\r\n } else {\r\n itemBaseDef2 = Promise.resolve(common.cloneObject(item2));\r\n }\r\n\r\n Promise.all([itemBaseDef1, itemBaseDef2]).then(\r\n responses => {\r\n const [itemBase1, itemBase2] = responses;\r\n\r\n common.deleteItemProps(itemBase1);\r\n common.deleteItemProps(itemBase2);\r\n\r\n if (itemBase1.type === \"Solution\") {\r\n delete itemBase1.typeKeywords;\r\n delete itemBase1.size;\r\n delete itemBase2.typeKeywords;\r\n delete itemBase2.size;\r\n }\r\n\r\n /*console.log(\"----------------------------------------------------------------\");\r\n console.log(\"item 1 \" + item1 + \": \", JSON.stringify(itemBase1, null, 2));\r\n console.log(\"item 2 \" + item2 + \": \", JSON.stringify(itemBase2, null, 2));\r\n console.log(\"----------------------------------------------------------------\");*/\r\n\r\n resolve(common.compareJSONNoEmptyStrings(itemBase1, itemBase2));\r\n },\r\n e => reject(e)\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Creates a hierarchy of the items in a Solution template.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @return List of top-level items, each containing a recursive list of its dependencies\r\n */\r\nexport function getItemHierarchy(\r\n templates: common.IItemTemplate[]\r\n): common.IHierarchyElement[] {\r\n const hierarchy = [] as common.IHierarchyElement[];\r\n\r\n // Get the template specified by id out of a list of templates\r\n function getTemplateInSolution(templates: common.IItemTemplate[], id: string): common.IItemTemplate {\r\n const iTemplate = templates.findIndex((template) => id === template.itemId);\r\n return iTemplate >= 0 ? templates[iTemplate] : null;\r\n }\r\n\r\n // Hierarchically list the dependencies of specified node\r\n function traceItemId(id: string, accumulatedHierarchy: common.IHierarchyElement[], alreadyVisitedIds: string[] = []) {\r\n // Get the dependencies of the node\r\n const template = getTemplateInSolution(templates, id);\r\n /* istanbul ignore else */\r\n if (template) {\r\n const templateEntry = {\r\n id,\r\n dependencies: [] as common.IHierarchyElement[]\r\n };\r\n\r\n // Visit each dependency, but only if this template is not in the alreadyVisitedIds list to avoid infinite loops\r\n if (alreadyVisitedIds.indexOf(id) < 0) {\r\n // Add dependency to alreadyVisitedIds list\r\n alreadyVisitedIds.push(id);\r\n\r\n template.dependencies.forEach(\r\n dependencyId => {\r\n // Remove dependency from list of templates to visit in the top-level loop\r\n const iDependencyTemplate = templateItemIds.indexOf(dependencyId);\r\n if (iDependencyTemplate >= 0) {\r\n templateItemIds.splice(iDependencyTemplate, 1);\r\n }\r\n\r\n traceItemId(dependencyId, templateEntry.dependencies, alreadyVisitedIds);\r\n }\r\n );\r\n }\r\n accumulatedHierarchy.push(templateEntry);\r\n }\r\n }\r\n\r\n // Start with top-level nodes and add in the rest of the nodes to catch cycles without top-level nodes\r\n let templateItemIds: string[] = _getTopLevelItemIds(templates);\r\n\r\n const otherItems: common.IItemTemplate[] = templates\r\n .filter(template => templateItemIds.indexOf(template.itemId) < 0) // only keep non-top-level nodes\r\n .sort((a, b) => b.dependencies.length - a.dependencies.length); // sort so that nodes with more dependencies come first--reduces stubs\r\n\r\n templateItemIds = templateItemIds.concat(otherItems.map(template => template.itemId));\r\n\r\n // Step through the list of nodes; we'll also remove nodes as we visit them\r\n let itemId = templateItemIds.shift();\r\n while (typeof itemId !== \"undefined\") {\r\n traceItemId(itemId, hierarchy);\r\n itemId = templateItemIds.shift();\r\n }\r\n\r\n return hierarchy;\r\n}\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Finds the top-level items in a Solution template--the items that are not dependencies of any other item.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @return List of top-level item ids\r\n */\r\nexport function _getTopLevelItemIds(\r\n templates: common.IItemTemplate[]\r\n): string[] {\r\n // Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on\r\n const topLevelItemCandidateIds = templates.map(function (template) { return template.itemId; });\r\n\r\n templates.forEach(function (template) {\r\n (template.dependencies || []).forEach(function (dependencyId) {\r\n const iNode = topLevelItemCandidateIds.indexOf(dependencyId);\r\n\r\n /* istanbul ignore else */\r\n if (iNode >= 0) {\r\n // Node is somebody's dependency, so remove the node from the list of top-level nodes\r\n // If iNode == -1, then it's a shared dependency and it has already been removed\r\n topLevelItemCandidateIds.splice(iNode, 1);\r\n }\r\n });\r\n });\r\n\r\n return topLevelItemCandidateIds;\r\n};\r\n"],"names":["common"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;EAwBA;EAEA;;;;;;;WAOgB,aAAa,CAC3B,MAAc,EACd,iBAAqC,IAAI;MAEzC,MAAM,WAAW,GAAa,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;MACjD,IAAI,IAA0B,CAAC;MAC/B,IAAI,UAAU,GAAG,IAAI,CAAC;MACtB,IAAI,aAAqC,CAAC;MAC1C,IAAI,eAAyB,CAAC;MAE9B,IAAI,aAAa,GAAW,8BAA8B,CAAC;MAC3D,QACEA,iBAAM;WACH,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC;;WAGvC,IAAI,CAAC,CAAC,OAA6B;UAClC,aAAa,GAAG,EAAE,CAAC;UACnB,IAAI,GAAG,OAAO,CAAC;UAEf,IAAI,CAAC,IAAI,EAAE;cACT,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;WACtC;eAAM,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;cACxC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;WAC3C;eAAM,IAAI,IAAI,CAAC,IAAI,CAAC,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under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Provides the access to the solution's contents.\r\n *\r\n * @module viewer\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Checks a Solution.\r\n *\r\n * @param item Solution id\r\n * @param authentication Credentials for the request to AGO\r\n * @returns List of results of checks of Solution\r\n */\r\nexport function checkSolution(\r\n itemId: string,\r\n authentication: common.UserSession = null\r\n): Promise<string[]> {\r\n const resultsHtml: string[] = [`Item ${itemId}`];\r\n let item: common.ICompleteItem;\r\n let isTemplate = true;\r\n let templateItems: common.IItemTemplate[];\r\n let templateItemIds: string[];\r\n\r\n let currentAction: string = \" while getting complete item\";\r\n return (\r\n common\r\n .getCompleteItem(itemId, authentication)\r\n\r\n // ---------- Is it a Template or Deployed Solution? -----------------------------------------------------------//\r\n .then((results: common.ICompleteItem) => {\r\n currentAction = \"\";\r\n item = results;\r\n\r\n if (!item) {\r\n throw new Error(`item is not found`);\r\n } else if (item.base.type !== \"Solution\") {\r\n throw new Error(`item is not a Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Template\")) {\r\n resultsHtml.push(`✔ item is a Template Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Deployed\")) {\r\n isTemplate = false;\r\n resultsHtml.push(`✔ item is a Deployed Solution`);\r\n } else {\r\n throw new Error(\r\n `item is neither a Template Solution nor a Deployed Solution`\r\n );\r\n }\r\n\r\n // base: IItem; text/plain JSON\r\n // data: File; */*\r\n // thumbnail: File; image/*\r\n // metadata: File; application/xml\r\n // resources: File[]; list of */*\r\n // fwdRelatedItems: IRelatedItems[]; list of forward relationshipType/relatedItems[] pairs\r\n // revRelatedItems: IRelatedItems[]; list of reverse relationshipType/relatedItems[] pairs\r\n return common.blobToJson(item.data);\r\n })\r\n\r\n // ---------- Check the Solution2Item relationship from a Deployed Solution to each deployed item --------------//\r\n .then(itemDataJson => {\r\n templateItems = itemDataJson?.templates;\r\n /* istanbul ignore else */\r\n if (!templateItems || templateItems.length === 0) {\r\n throw new Error(\r\n `Solution's data are not valid JSON or the Solution contains no items`\r\n );\r\n }\r\n\r\n templateItemIds = templateItems\r\n .map((template: common.IItemTemplate) => template.itemId)\r\n .sort();\r\n\r\n if (!isTemplate) {\r\n // Make sure that there's a Solution2Item relationship to each deployed item\r\n const fwdRelatedItemIds = item.fwdRelatedItems\r\n .filter(\r\n relationshipSet =>\r\n relationshipSet.relationshipType === \"Solution2Item\"\r\n )\r\n .reduce(\r\n (flatSet, relationshipSet) =>\r\n flatSet.concat(relationshipSet.relatedItemIds),\r\n []\r\n )\r\n .sort();\r\n if (templateItemIds.length < fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ there are forward Solution2Item relationship(s) to unknown item(s)\"\r\n );\r\n } else if (templateItemIds.length > fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ missing forward Solution2Item relationship(s)\"\r\n );\r\n } else if (\r\n JSON.stringify(templateItemIds) !==\r\n JSON.stringify(fwdRelatedItemIds)\r\n ) {\r\n resultsHtml.push(\r\n \"✖ mismatching forward Solution2Item relationship(s)\"\r\n );\r\n } else {\r\n resultsHtml.push(\r\n \"✔ matching forward Solution2Item relationship(s)\"\r\n );\r\n }\r\n }\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Check that all dependency references are items in Solution ---------------------------------------//\r\n .then(() => {\r\n const dependencyIds = templateItems\r\n .reduce(\r\n (flatSet, template) => flatSet.concat(template.dependencies),\r\n []\r\n )\r\n .reduce((noDupSet, dependency) => {\r\n /* istanbul ignore else */\r\n if (!noDupSet.includes(dependency)) noDupSet.push(dependency);\r\n return noDupSet;\r\n }, [])\r\n .sort();\r\n\r\n const missingItems = dependencyIds.filter(\r\n (dependencyId: string) => !templateItemIds.includes(dependencyId)\r\n );\r\n\r\n if (missingItems.length === 0) {\r\n resultsHtml.push(\"✔ all dependencies are in Solution\");\r\n } else {\r\n resultsHtml.push(\r\n \"✖ dependencies that aren't in Solution: \" +\r\n JSON.stringify(missingItems)\r\n );\r\n }\r\n\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Done ---------------------------------------------------------------------------------------------//\r\n .then(() => {\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Fatal error --------------------------------------------------------------------------------------//\r\n .catch(error => {\r\n resultsHtml.push(`✖ error${currentAction}: ${error.message}`);\r\n return resultsHtml;\r\n })\r\n );\r\n}\r\n\r\n/**\r\n * Compares two AGO items, fetching them if only their id is supplied.\r\n *\r\n * @param item1 First item or its AGO id\r\n * @param item2 Second item or its AGO id\r\n * @param authentication Credentials for the request to AGO\r\n * @returns True if objects are the same\r\n * @see Only comparable properties are compared; see deleteItemProps() in the `common` package\r\n */\r\nexport function compareItems(\r\n item1: string | any,\r\n item2: string | any,\r\n authentication: common.UserSession = null\r\n): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // If an input is a string, fetch the item; otherwise, clone the input because we will modify the\r\n // item base to remove incomparable properties\r\n let itemBaseDef1: Promise<any>;\r\n if (typeof item1 === \"string\") {\r\n itemBaseDef1 = common.getItemBase(item1, authentication);\r\n } else {\r\n itemBaseDef1 = Promise.resolve(common.cloneObject(item1));\r\n }\r\n\r\n let itemBaseDef2: Promise<any>;\r\n if (typeof item2 === \"string\") {\r\n itemBaseDef2 = common.getItemBase(item2, authentication);\r\n } else {\r\n itemBaseDef2 = Promise.resolve(common.cloneObject(item2));\r\n }\r\n\r\n Promise.all([itemBaseDef1, itemBaseDef2]).then(\r\n responses => {\r\n const [itemBase1, itemBase2] = responses;\r\n\r\n common.deleteItemProps(itemBase1);\r\n common.deleteItemProps(itemBase2);\r\n\r\n if (itemBase1.type === \"Solution\") {\r\n delete itemBase1.typeKeywords;\r\n delete itemBase1.size;\r\n delete itemBase2.typeKeywords;\r\n delete itemBase2.size;\r\n }\r\n\r\n /*console.log(\"----------------------------------------------------------------\");\r\n console.log(\"item 1 \" + item1 + \": \", JSON.stringify(itemBase1, null, 2));\r\n console.log(\"item 2 \" + item2 + \": \", JSON.stringify(itemBase2, null, 2));\r\n console.log(\"----------------------------------------------------------------\");*/\r\n\r\n resolve(common.compareJSONNoEmptyStrings(itemBase1, itemBase2));\r\n },\r\n e => reject(e)\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Creates a hierarchy of the items in a Solution template.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @returns List of top-level items, each containing a recursive list of its dependencies\r\n */\r\nexport function getItemHierarchy(\r\n templates: common.IItemTemplate[]\r\n): common.IHierarchyElement[] {\r\n const hierarchy = [] as common.IHierarchyElement[];\r\n\r\n // Get the template specified by id out of a list of templates\r\n function getTemplateInSolution(templates: common.IItemTemplate[], id: string): common.IItemTemplate {\r\n const iTemplate = templates.findIndex((template) => id === template.itemId);\r\n return iTemplate >= 0 ? templates[iTemplate] : null;\r\n }\r\n\r\n // Hierarchically list the dependencies of specified node\r\n function traceItemId(id: string, accumulatedHierarchy: common.IHierarchyElement[], alreadyVisitedIds: string[] = []) {\r\n // Get the dependencies of the node\r\n const template = getTemplateInSolution(templates, id);\r\n /* istanbul ignore else */\r\n if (template) {\r\n const templateEntry = {\r\n id,\r\n dependencies: [] as common.IHierarchyElement[]\r\n };\r\n\r\n // Visit each dependency, but only if this template is not in the alreadyVisitedIds list to avoid infinite loops\r\n if (alreadyVisitedIds.indexOf(id) < 0) {\r\n // Add dependency to alreadyVisitedIds list\r\n alreadyVisitedIds.push(id);\r\n\r\n template.dependencies.forEach(\r\n dependencyId => {\r\n // Remove dependency from list of templates to visit in the top-level loop\r\n const iDependencyTemplate = templateItemIds.indexOf(dependencyId);\r\n if (iDependencyTemplate >= 0) {\r\n templateItemIds.splice(iDependencyTemplate, 1);\r\n }\r\n\r\n traceItemId(dependencyId, templateEntry.dependencies, alreadyVisitedIds);\r\n }\r\n );\r\n }\r\n accumulatedHierarchy.push(templateEntry);\r\n }\r\n }\r\n\r\n // Start with top-level nodes and add in the rest of the nodes to catch cycles without top-level nodes\r\n let templateItemIds: string[] = _getTopLevelItemIds(templates);\r\n\r\n const otherItems: common.IItemTemplate[] = templates\r\n .filter(template => templateItemIds.indexOf(template.itemId) < 0) // only keep non-top-level nodes\r\n .sort((a, b) => b.dependencies.length - a.dependencies.length); // sort so that nodes with more dependencies come first--reduces stubs\r\n\r\n templateItemIds = templateItemIds.concat(otherItems.map(template => template.itemId));\r\n\r\n // Step through the list of nodes; we'll also remove nodes as we visit them\r\n let itemId = templateItemIds.shift();\r\n while (typeof itemId !== \"undefined\") {\r\n traceItemId(itemId, hierarchy);\r\n itemId = templateItemIds.shift();\r\n }\r\n\r\n return hierarchy;\r\n}\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Finds the top-level items in a Solution template--the items that are not dependencies of any other item.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @returns List of top-level item ids\r\n * @private\r\n */\r\nexport function _getTopLevelItemIds(\r\n templates: common.IItemTemplate[]\r\n): string[] {\r\n // Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on\r\n const topLevelItemCandidateIds = templates.map(function (template) { return template.itemId; });\r\n\r\n templates.forEach(function (template) {\r\n (template.dependencies || []).forEach(function (dependencyId) {\r\n const iNode = topLevelItemCandidateIds.indexOf(dependencyId);\r\n\r\n /* istanbul ignore else */\r\n if (iNode >= 0) {\r\n // Node is somebody's dependency, so remove the node from the list of top-level nodes\r\n // If iNode == -1, then it's a shared dependency and it has already been removed\r\n topLevelItemCandidateIds.splice(iNode, 1);\r\n }\r\n });\r\n });\r\n\r\n return topLevelItemCand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A;UAClC,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,EAAE,OAAO,CAAC,UAAU,YAAY,EAAA;cAC1D,MAAM,KAAK,GAAG,wBAAwB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;;cAG7D,IAAI,KAAK,IAAI,CAAC,EAAE;;;EAGd,gBAAA,wBAAwB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;EAC3C,aAAA;EACH,SAAC,CAAC,CAAC;EACL,KAAC,CAAC,CAAC;EAEH,IAAA,OAAO,wBAAwB,CAAC;EAClC;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-viewer - v1.3.
|
|
2
|
+
* @esri/solution-viewer - v1.3.11 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
*
|
|
4
|
+
* Mon Apr 25 2022 12:02:10 GMT-0700 (Pacific Daylight Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.umd.min.js","sources":["../../src/viewer.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Provides the access to the solution's contents.\r\n *\r\n * @module viewer\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Checks a Solution.\r\n *\r\n * @param item Solution id\r\n * @param authentication Credentials for the request to AGO\r\n * @return List of results of checks of Solution\r\n */\r\nexport function checkSolution(\r\n itemId: string,\r\n authentication: common.UserSession = null\r\n): Promise<string[]> {\r\n const resultsHtml: string[] = [`Item ${itemId}`];\r\n let item: common.ICompleteItem;\r\n let isTemplate = true;\r\n let templateItems: common.IItemTemplate[];\r\n let templateItemIds: string[];\r\n\r\n let currentAction: string = \" while getting complete item\";\r\n return (\r\n common\r\n .getCompleteItem(itemId, authentication)\r\n\r\n // ---------- Is it a Template or Deployed Solution? -----------------------------------------------------------//\r\n .then((results: common.ICompleteItem) => {\r\n currentAction = \"\";\r\n item = results;\r\n\r\n if (!item) {\r\n throw new Error(`item is not found`);\r\n } else if (item.base.type !== \"Solution\") {\r\n throw new Error(`item is not a Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Template\")) {\r\n resultsHtml.push(`✔ item is a Template Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Deployed\")) {\r\n isTemplate = false;\r\n resultsHtml.push(`✔ item is a Deployed Solution`);\r\n } else {\r\n throw new Error(\r\n `item is neither a Template Solution nor a Deployed Solution`\r\n );\r\n }\r\n\r\n // base: IItem; text/plain JSON\r\n // data: File; */*\r\n // thumbnail: File; image/*\r\n // metadata: File; application/xml\r\n // resources: File[]; list of */*\r\n // fwdRelatedItems: IRelatedItems[]; list of forward relationshipType/relatedItems[] pairs\r\n // revRelatedItems: IRelatedItems[]; list of reverse relationshipType/relatedItems[] pairs\r\n return common.blobToJson(item.data);\r\n })\r\n\r\n // ---------- Check the Solution2Item relationship from a Deployed Solution to each deployed item --------------//\r\n .then(itemDataJson => {\r\n templateItems = itemDataJson?.templates;\r\n /* istanbul ignore else */\r\n if (!templateItems || templateItems.length === 0) {\r\n throw new Error(\r\n `Solution's data are not valid JSON or the Solution contains no items`\r\n );\r\n }\r\n\r\n templateItemIds = templateItems\r\n .map((template: common.IItemTemplate) => template.itemId)\r\n .sort();\r\n\r\n if (!isTemplate) {\r\n // Make sure that there's a Solution2Item relationship to each deployed item\r\n const fwdRelatedItemIds = item.fwdRelatedItems\r\n .filter(\r\n relationshipSet =>\r\n relationshipSet.relationshipType === \"Solution2Item\"\r\n )\r\n .reduce(\r\n (flatSet, relationshipSet) =>\r\n flatSet.concat(relationshipSet.relatedItemIds),\r\n []\r\n )\r\n .sort();\r\n if (templateItemIds.length < fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ there are forward Solution2Item relationship(s) to unknown item(s)\"\r\n );\r\n } else if (templateItemIds.length > fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ missing forward Solution2Item relationship(s)\"\r\n );\r\n } else if (\r\n JSON.stringify(templateItemIds) !==\r\n JSON.stringify(fwdRelatedItemIds)\r\n ) {\r\n resultsHtml.push(\r\n \"✖ mismatching forward Solution2Item relationship(s)\"\r\n );\r\n } else {\r\n resultsHtml.push(\r\n \"✔ matching forward Solution2Item relationship(s)\"\r\n );\r\n }\r\n }\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Check that all dependency references are items in Solution ---------------------------------------//\r\n .then(() => {\r\n const dependencyIds = templateItems\r\n .reduce(\r\n (flatSet, template) => flatSet.concat(template.dependencies),\r\n []\r\n )\r\n .reduce((noDupSet, dependency) => {\r\n /* istanbul ignore else */\r\n if (!noDupSet.includes(dependency)) noDupSet.push(dependency);\r\n return noDupSet;\r\n }, [])\r\n .sort();\r\n\r\n const missingItems = dependencyIds.filter(\r\n (dependencyId: string) => !templateItemIds.includes(dependencyId)\r\n );\r\n\r\n if (missingItems.length === 0) {\r\n resultsHtml.push(\"✔ all dependencies are in Solution\");\r\n } else {\r\n resultsHtml.push(\r\n \"✖ dependencies that aren't in Solution: \" +\r\n JSON.stringify(missingItems)\r\n );\r\n }\r\n\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Done ---------------------------------------------------------------------------------------------//\r\n .then(() => {\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Fatal error --------------------------------------------------------------------------------------//\r\n .catch(error => {\r\n resultsHtml.push(`✖ error${currentAction}: ${error.message}`);\r\n return resultsHtml;\r\n })\r\n );\r\n}\r\n\r\n/**\r\n * Compares two AGO items, fetching them if only their id is supplied.\r\n *\r\n * @param item1 First item or its AGO id\r\n * @param item2 Second item or its AGO id\r\n * @param authentication Credentials for the request to AGO\r\n * @return True if objects are the same\r\n * @see Only comparable properties are compared; see deleteItemProps() in the `common` package\r\n */\r\nexport function compareItems(\r\n item1: string | any,\r\n item2: string | any,\r\n authentication: common.UserSession = null\r\n): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // If an input is a string, fetch the item; otherwise, clone the input because we will modify the\r\n // item base to remove incomparable properties\r\n let itemBaseDef1: Promise<any>;\r\n if (typeof item1 === \"string\") {\r\n itemBaseDef1 = common.getItemBase(item1, authentication);\r\n } else {\r\n itemBaseDef1 = Promise.resolve(common.cloneObject(item1));\r\n }\r\n\r\n let itemBaseDef2: Promise<any>;\r\n if (typeof item2 === \"string\") {\r\n itemBaseDef2 = common.getItemBase(item2, authentication);\r\n } else {\r\n itemBaseDef2 = Promise.resolve(common.cloneObject(item2));\r\n }\r\n\r\n Promise.all([itemBaseDef1, itemBaseDef2]).then(\r\n responses => {\r\n const [itemBase1, itemBase2] = responses;\r\n\r\n common.deleteItemProps(itemBase1);\r\n common.deleteItemProps(itemBase2);\r\n\r\n if (itemBase1.type === \"Solution\") {\r\n delete itemBase1.typeKeywords;\r\n delete itemBase1.size;\r\n delete itemBase2.typeKeywords;\r\n delete itemBase2.size;\r\n }\r\n\r\n /*console.log(\"----------------------------------------------------------------\");\r\n console.log(\"item 1 \" + item1 + \": \", JSON.stringify(itemBase1, null, 2));\r\n console.log(\"item 2 \" + item2 + \": \", JSON.stringify(itemBase2, null, 2));\r\n console.log(\"----------------------------------------------------------------\");*/\r\n\r\n resolve(common.compareJSONNoEmptyStrings(itemBase1, itemBase2));\r\n },\r\n e => reject(e)\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Creates a hierarchy of the items in a Solution template.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @return List of top-level items, each containing a recursive list of its dependencies\r\n */\r\nexport function getItemHierarchy(\r\n templates: common.IItemTemplate[]\r\n): common.IHierarchyElement[] {\r\n const hierarchy = [] as common.IHierarchyElement[];\r\n\r\n // Get the template specified by id out of a list of templates\r\n function getTemplateInSolution(templates: common.IItemTemplate[], id: string): common.IItemTemplate {\r\n const iTemplate = templates.findIndex((template) => id === template.itemId);\r\n return iTemplate >= 0 ? templates[iTemplate] : null;\r\n }\r\n\r\n // Hierarchically list the dependencies of specified node\r\n function traceItemId(id: string, accumulatedHierarchy: common.IHierarchyElement[], alreadyVisitedIds: string[] = []) {\r\n // Get the dependencies of the node\r\n const template = getTemplateInSolution(templates, id);\r\n /* istanbul ignore else */\r\n if (template) {\r\n const templateEntry = {\r\n id,\r\n dependencies: [] as common.IHierarchyElement[]\r\n };\r\n\r\n // Visit each dependency, but only if this template is not in the alreadyVisitedIds list to avoid infinite loops\r\n if (alreadyVisitedIds.indexOf(id) < 0) {\r\n // Add dependency to alreadyVisitedIds list\r\n alreadyVisitedIds.push(id);\r\n\r\n template.dependencies.forEach(\r\n dependencyId => {\r\n // Remove dependency from list of templates to visit in the top-level loop\r\n const iDependencyTemplate = templateItemIds.indexOf(dependencyId);\r\n if (iDependencyTemplate >= 0) {\r\n templateItemIds.splice(iDependencyTemplate, 1);\r\n }\r\n\r\n traceItemId(dependencyId, templateEntry.dependencies, alreadyVisitedIds);\r\n }\r\n );\r\n }\r\n accumulatedHierarchy.push(templateEntry);\r\n }\r\n }\r\n\r\n // Start with top-level nodes and add in the rest of the nodes to catch cycles without top-level nodes\r\n let templateItemIds: string[] = _getTopLevelItemIds(templates);\r\n\r\n const otherItems: common.IItemTemplate[] = templates\r\n .filter(template => templateItemIds.indexOf(template.itemId) < 0) // only keep non-top-level nodes\r\n .sort((a, b) => b.dependencies.length - a.dependencies.length); // sort so that nodes with more dependencies come first--reduces stubs\r\n\r\n templateItemIds = templateItemIds.concat(otherItems.map(template => template.itemId));\r\n\r\n // Step through the list of nodes; we'll also remove nodes as we visit them\r\n let itemId = templateItemIds.shift();\r\n while (typeof itemId !== \"undefined\") {\r\n traceItemId(itemId, hierarchy);\r\n itemId = templateItemIds.shift();\r\n }\r\n\r\n return hierarchy;\r\n}\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Finds the top-level items in a Solution template--the items that are not dependencies of any other item.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @return List of top-level item ids\r\n */\r\nexport function _getTopLevelItemIds(\r\n templates: common.IItemTemplate[]\r\n): string[] {\r\n // Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on\r\n const topLevelItemCandidateIds = templates.map(function (template) { return template.itemId; });\r\n\r\n templates.forEach(function (template) {\r\n (template.dependencies || []).forEach(function (dependencyId) {\r\n const iNode = topLevelItemCandidateIds.indexOf(dependencyId);\r\n\r\n /* istanbul ignore else */\r\n if (iNode >= 0) {\r\n // Node is somebody's dependency, so remove the node from the list of top-level nodes\r\n // If iNode == -1, then it's a shared dependency and it has already been removed\r\n topLevelItemCandidateIds.splice(iNode, 1);\r\n }\r\n });\r\n });\r\n\r\n return topLevelItemCandidateIds;\r\n};\r\n"],"names":["_getTopLevelItemIds","templates","topLevelItemCandidateIds","map","template","itemId","forEach","dependencies","dependencyId","iNode","indexOf","splice","authentication","resultsHtml","item","templateItems","templateItemIds","isTemplate","currentAction","common","getCompleteItem","then","results","Error","base","type","typeKeywords","includes","push","blobToJson","data","itemDataJson","length","sort","fwdRelatedItemIds","fwdRelatedItems","filter","relationshipSet","relationshipType","reduce","flatSet","concat","relatedItemIds","JSON","stringify","missingItems","noDupSet","dependency","catch","error","message","item1","item2","Promise","resolve","reject","itemBaseDef1","itemBaseDef2","getItemBase","cloneObject","all","responses","itemBase1","itemBase2","deleteItemProps","size","compareJSONNoEmptyStrings","e","hierarchy","traceItemId","id","accumulatedHierarchy","alreadyVisitedIds","iTemplate","findIndex","getTemplateInSolution","templateEntry","iDependencyTemplate","otherItems","a","b","shift"],"mappings":";;;;;;;;;;;;;;;;;uoBAiTgBA,EACdC,GAGA,MAAMC,EAA2BD,EAAUE,KAAI,SAAUC,GAAY,OAAOA,EAASC,UAerF,OAbAJ,EAAUK,SAAQ,SAAUF,IACzBA,EAASG,cAAgB,IAAID,SAAQ,SAAUE,GAC9C,MAAMC,EAAQP,EAAyBQ,QAAQF,GAG3CC,GAAS,GAGXP,EAAyBS,OAAOF,EAAO,SAKtCP,mDAlSPG,EACAO,EAAqC,MAErC,MAAMC,EAAwB,CAAC,QAAQR,KACvC,IAAIS,EAEAC,EACAC,EAFAC,GAAa,EAIbC,EAAwB,+BAC5B,OACEC,EACGC,gBAAgBf,EAAQO,GAGxBS,MAAMC,IAIL,GAHAJ,EAAgB,GAChBJ,EAAOQ,GAEFR,EACH,MAAM,IAAIS,MAAM,qBACX,GAAuB,aAAnBT,EAAKU,KAAKC,KACnB,MAAM,IAAIF,MAAM,0BACX,GAAIT,EAAKU,KAAKE,aAAaC,SAAS,YACzCd,EAAYe,KAAK,4CACZ,CAAA,IAAId,EAAKU,KAAKE,aAAaC,SAAS,YAIzC,MAAM,IAAIJ,MACR,+DAJFN,GAAa,EACbJ,EAAYe,KAAK,wCAcnB,OAAOT,EAAOU,WAAWf,EAAKgB,SAI/BT,MAAKU,IAGJ,GAFAhB,EAAgBgB,GAAc9B,WAEzBc,GAA0C,IAAzBA,EAAciB,OAClC,MAAM,IAAIT,MACR,wEAQJ,GAJAP,EAAkBD,EACfZ,KAAKC,GAAmCA,EAASC,SACjD4B,QAEEhB,EAAY,CAEf,MAAMiB,EAAoBpB,EAAKqB,gBAC5BC,QACCC,GACuC,kBAArCA,EAAgBC,mBAEnBC,QACC,CAACC,EAASH,IACRG,EAAQC,OAAOJ,EAAgBK,iBACjC,IAEDT,OACCjB,EAAgBgB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C,EAAYC,EAAkDC,EAA8B,IAE/G,MAAMpE,EARR,SAA+BH,EAAmCqE,GAChE,MAAMG,EAAYxE,EAAUyE,WAAWtE,GAAakE,IAAOlE,EAASC,SACpE,OAAOoE,GAAa,EAAIxE,EAAUwE,GAAa,KAM9BE,CAAsB1E,EAAWqE,GAElD,GAAIlE,EAAU,CACZ,MAAMwE,EAAgB,CACpBN,GAAAA,EACA/D,aAAc,IAIZiE,EAAkB9D,QAAQ4D,GAAM,IAElCE,EAAkB5C,KAAK0C,GAEvBlE,EAASG,aAAaD,SACpBE,IAEE,MAAMqE,EAAsB7D,EAAgBN,QAAQF,GAChDqE,GAAuB,GACzB7D,EAAgBL,OAAOkE,EAAqB,GAG9CR,EAAY7D,EAAcoE,EAAcrE,aAAciE,OAI5DD,EAAqB3C,KAAKgD,IAK9B,IAAI5D,EAA4BhB,EAAoBC,GAEpD,MAAM6E,EAAqC7E,EACxCmC,QAAOhC,GAAYY,EAAgBN,QAAQN,EAASC,QAAU,IAC9D4B,MAAK,CAAC8C,EAAGC,IAAMA,EAAEzE,aAAayB,OAAS+C,EAAExE,aAAayB,SAEzDhB,EAAkBA,EAAgByB,OAAOqC,EAAW3E,KAAIC,GAAYA,EAASC,UAG7E,IAAIA,EAASW,EAAgBiE,QAC7B,UAAyB,IAAX5E,GACZgE,EAAYhE,EAAQ+D,GACpB/D,EAASW,EAAgBiE,QAG3B,OAAOb"}
|
|
1
|
+
{"version":3,"file":"viewer.umd.min.js","sources":["../../src/viewer.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Provides the access to the solution's contents.\r\n *\r\n * @module viewer\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Checks a Solution.\r\n *\r\n * @param item Solution id\r\n * @param authentication Credentials for the request to AGO\r\n * @returns List of results of checks of Solution\r\n */\r\nexport function checkSolution(\r\n itemId: string,\r\n authentication: common.UserSession = null\r\n): Promise<string[]> {\r\n const resultsHtml: string[] = [`Item ${itemId}`];\r\n let item: common.ICompleteItem;\r\n let isTemplate = true;\r\n let templateItems: common.IItemTemplate[];\r\n let templateItemIds: string[];\r\n\r\n let currentAction: string = \" while getting complete item\";\r\n return (\r\n common\r\n .getCompleteItem(itemId, authentication)\r\n\r\n // ---------- Is it a Template or Deployed Solution? -----------------------------------------------------------//\r\n .then((results: common.ICompleteItem) => {\r\n currentAction = \"\";\r\n item = results;\r\n\r\n if (!item) {\r\n throw new Error(`item is not found`);\r\n } else if (item.base.type !== \"Solution\") {\r\n throw new Error(`item is not a Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Template\")) {\r\n resultsHtml.push(`✔ item is a Template Solution`);\r\n } else if (item.base.typeKeywords.includes(\"Deployed\")) {\r\n isTemplate = false;\r\n resultsHtml.push(`✔ item is a Deployed Solution`);\r\n } else {\r\n throw new Error(\r\n `item is neither a Template Solution nor a Deployed Solution`\r\n );\r\n }\r\n\r\n // base: IItem; text/plain JSON\r\n // data: File; */*\r\n // thumbnail: File; image/*\r\n // metadata: File; application/xml\r\n // resources: File[]; list of */*\r\n // fwdRelatedItems: IRelatedItems[]; list of forward relationshipType/relatedItems[] pairs\r\n // revRelatedItems: IRelatedItems[]; list of reverse relationshipType/relatedItems[] pairs\r\n return common.blobToJson(item.data);\r\n })\r\n\r\n // ---------- Check the Solution2Item relationship from a Deployed Solution to each deployed item --------------//\r\n .then(itemDataJson => {\r\n templateItems = itemDataJson?.templates;\r\n /* istanbul ignore else */\r\n if (!templateItems || templateItems.length === 0) {\r\n throw new Error(\r\n `Solution's data are not valid JSON or the Solution contains no items`\r\n );\r\n }\r\n\r\n templateItemIds = templateItems\r\n .map((template: common.IItemTemplate) => template.itemId)\r\n .sort();\r\n\r\n if (!isTemplate) {\r\n // Make sure that there's a Solution2Item relationship to each deployed item\r\n const fwdRelatedItemIds = item.fwdRelatedItems\r\n .filter(\r\n relationshipSet =>\r\n relationshipSet.relationshipType === \"Solution2Item\"\r\n )\r\n .reduce(\r\n (flatSet, relationshipSet) =>\r\n flatSet.concat(relationshipSet.relatedItemIds),\r\n []\r\n )\r\n .sort();\r\n if (templateItemIds.length < fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ there are forward Solution2Item relationship(s) to unknown item(s)\"\r\n );\r\n } else if (templateItemIds.length > fwdRelatedItemIds.length) {\r\n resultsHtml.push(\r\n \"✖ missing forward Solution2Item relationship(s)\"\r\n );\r\n } else if (\r\n JSON.stringify(templateItemIds) !==\r\n JSON.stringify(fwdRelatedItemIds)\r\n ) {\r\n resultsHtml.push(\r\n \"✖ mismatching forward Solution2Item relationship(s)\"\r\n );\r\n } else {\r\n resultsHtml.push(\r\n \"✔ matching forward Solution2Item relationship(s)\"\r\n );\r\n }\r\n }\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Check that all dependency references are items in Solution ---------------------------------------//\r\n .then(() => {\r\n const dependencyIds = templateItems\r\n .reduce(\r\n (flatSet, template) => flatSet.concat(template.dependencies),\r\n []\r\n )\r\n .reduce((noDupSet, dependency) => {\r\n /* istanbul ignore else */\r\n if (!noDupSet.includes(dependency)) noDupSet.push(dependency);\r\n return noDupSet;\r\n }, [])\r\n .sort();\r\n\r\n const missingItems = dependencyIds.filter(\r\n (dependencyId: string) => !templateItemIds.includes(dependencyId)\r\n );\r\n\r\n if (missingItems.length === 0) {\r\n resultsHtml.push(\"✔ all dependencies are in Solution\");\r\n } else {\r\n resultsHtml.push(\r\n \"✖ dependencies that aren't in Solution: \" +\r\n JSON.stringify(missingItems)\r\n );\r\n }\r\n\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Done ---------------------------------------------------------------------------------------------//\r\n .then(() => {\r\n return resultsHtml;\r\n })\r\n\r\n // ---------- Fatal error --------------------------------------------------------------------------------------//\r\n .catch(error => {\r\n resultsHtml.push(`✖ error${currentAction}: ${error.message}`);\r\n return resultsHtml;\r\n })\r\n );\r\n}\r\n\r\n/**\r\n * Compares two AGO items, fetching them if only their id is supplied.\r\n *\r\n * @param item1 First item or its AGO id\r\n * @param item2 Second item or its AGO id\r\n * @param authentication Credentials for the request to AGO\r\n * @returns True if objects are the same\r\n * @see Only comparable properties are compared; see deleteItemProps() in the `common` package\r\n */\r\nexport function compareItems(\r\n item1: string | any,\r\n item2: string | any,\r\n authentication: common.UserSession = null\r\n): Promise<boolean> {\r\n return new Promise<boolean>((resolve, reject) => {\r\n // If an input is a string, fetch the item; otherwise, clone the input because we will modify the\r\n // item base to remove incomparable properties\r\n let itemBaseDef1: Promise<any>;\r\n if (typeof item1 === \"string\") {\r\n itemBaseDef1 = common.getItemBase(item1, authentication);\r\n } else {\r\n itemBaseDef1 = Promise.resolve(common.cloneObject(item1));\r\n }\r\n\r\n let itemBaseDef2: Promise<any>;\r\n if (typeof item2 === \"string\") {\r\n itemBaseDef2 = common.getItemBase(item2, authentication);\r\n } else {\r\n itemBaseDef2 = Promise.resolve(common.cloneObject(item2));\r\n }\r\n\r\n Promise.all([itemBaseDef1, itemBaseDef2]).then(\r\n responses => {\r\n const [itemBase1, itemBase2] = responses;\r\n\r\n common.deleteItemProps(itemBase1);\r\n common.deleteItemProps(itemBase2);\r\n\r\n if (itemBase1.type === \"Solution\") {\r\n delete itemBase1.typeKeywords;\r\n delete itemBase1.size;\r\n delete itemBase2.typeKeywords;\r\n delete itemBase2.size;\r\n }\r\n\r\n /*console.log(\"----------------------------------------------------------------\");\r\n console.log(\"item 1 \" + item1 + \": \", JSON.stringify(itemBase1, null, 2));\r\n console.log(\"item 2 \" + item2 + \": \", JSON.stringify(itemBase2, null, 2));\r\n console.log(\"----------------------------------------------------------------\");*/\r\n\r\n resolve(common.compareJSONNoEmptyStrings(itemBase1, itemBase2));\r\n },\r\n e => reject(e)\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Creates a hierarchy of the items in a Solution template.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @returns List of top-level items, each containing a recursive list of its dependencies\r\n */\r\nexport function getItemHierarchy(\r\n templates: common.IItemTemplate[]\r\n): common.IHierarchyElement[] {\r\n const hierarchy = [] as common.IHierarchyElement[];\r\n\r\n // Get the template specified by id out of a list of templates\r\n function getTemplateInSolution(templates: common.IItemTemplate[], id: string): common.IItemTemplate {\r\n const iTemplate = templates.findIndex((template) => id === template.itemId);\r\n return iTemplate >= 0 ? templates[iTemplate] : null;\r\n }\r\n\r\n // Hierarchically list the dependencies of specified node\r\n function traceItemId(id: string, accumulatedHierarchy: common.IHierarchyElement[], alreadyVisitedIds: string[] = []) {\r\n // Get the dependencies of the node\r\n const template = getTemplateInSolution(templates, id);\r\n /* istanbul ignore else */\r\n if (template) {\r\n const templateEntry = {\r\n id,\r\n dependencies: [] as common.IHierarchyElement[]\r\n };\r\n\r\n // Visit each dependency, but only if this template is not in the alreadyVisitedIds list to avoid infinite loops\r\n if (alreadyVisitedIds.indexOf(id) < 0) {\r\n // Add dependency to alreadyVisitedIds list\r\n alreadyVisitedIds.push(id);\r\n\r\n template.dependencies.forEach(\r\n dependencyId => {\r\n // Remove dependency from list of templates to visit in the top-level loop\r\n const iDependencyTemplate = templateItemIds.indexOf(dependencyId);\r\n if (iDependencyTemplate >= 0) {\r\n templateItemIds.splice(iDependencyTemplate, 1);\r\n }\r\n\r\n traceItemId(dependencyId, templateEntry.dependencies, alreadyVisitedIds);\r\n }\r\n );\r\n }\r\n accumulatedHierarchy.push(templateEntry);\r\n }\r\n }\r\n\r\n // Start with top-level nodes and add in the rest of the nodes to catch cycles without top-level nodes\r\n let templateItemIds: string[] = _getTopLevelItemIds(templates);\r\n\r\n const otherItems: common.IItemTemplate[] = templates\r\n .filter(template => templateItemIds.indexOf(template.itemId) < 0) // only keep non-top-level nodes\r\n .sort((a, b) => b.dependencies.length - a.dependencies.length); // sort so that nodes with more dependencies come first--reduces stubs\r\n\r\n templateItemIds = templateItemIds.concat(otherItems.map(template => template.itemId));\r\n\r\n // Step through the list of nodes; we'll also remove nodes as we visit them\r\n let itemId = templateItemIds.shift();\r\n while (typeof itemId !== \"undefined\") {\r\n traceItemId(itemId, hierarchy);\r\n itemId = templateItemIds.shift();\r\n }\r\n\r\n return hierarchy;\r\n}\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Finds the top-level items in a Solution template--the items that are not dependencies of any other item.\r\n *\r\n * @param templates Array of templates from a Solution\r\n * @returns List of top-level item ids\r\n * @private\r\n */\r\nexport function _getTopLevelItemIds(\r\n templates: common.IItemTemplate[]\r\n): string[] {\r\n // Find the top-level nodes. Start with all nodes, then remove those that other nodes depend on\r\n const topLevelItemCandidateIds = templates.map(function (template) { return template.itemId; });\r\n\r\n templates.forEach(function (template) {\r\n (template.dependencies || []).forEach(function (dependencyId) {\r\n const iNode = topLevelItemCandidateIds.indexOf(dependencyId);\r\n\r\n /* istanbul ignore else */\r\n if (iNode >= 0) {\r\n // Node is somebody's dependency, so remove the node from the list of top-level nodes\r\n // If iNode == -1, then it's a shared dependency and it has already been removed\r\n topLevelItemCandidateIds.splice(iNode, 1);\r\n }\r\n });\r\n });\r\n\r\n return topLevelItemCandidateIds;\r\n};\r\n"],"names":["_getTopLevelItemIds","templates","topLevelItemCandidateIds","map","template","itemId","forEach","dependencies","dependencyId","iNode","indexOf","splice","authentication","resultsHtml","item","templateItems","templateItemIds","isTemplate","currentAction","common","getCompleteItem","then","results","Error","base","type","typeKeywords","includes","push","blobToJson","data","itemDataJson","length","sort","fwdRelatedItemIds","fwdRelatedItems","filter","relationshipSet","relationshipType","reduce","flatSet","concat","relatedItemIds","JSON","stringify","missingItems","noDupSet","dependency","catch","error","message","item1","item2","Promise","resolve","reject","itemBaseDef1","itemBaseDef2","getItemBase","cloneObject","all","responses","itemBase1","itemBase2","deleteItemProps","size","compareJSONNoEmptyStrings","e","hierarchy","traceItemId","id","accumulatedHierarchy","alreadyVisitedIds","iTemplate","findIndex","getTemplateInSolution","templateEntry","iDependencyTemplate","otherItems","a","b","shift"],"mappings":";;;;;;;;;;;;;;;;;8nBAkTM,SAAUA,EACdC,GAGA,MAAMC,EAA2BD,EAAUE,KAAI,SAAUC,GAAY,OAAOA,EAASC,UAerF,OAbAJ,EAAUK,SAAQ,SAAUF,IACzBA,EAASG,cAAgB,IAAID,SAAQ,SAAUE,GAC9C,MAAMC,EAAQP,EAAyBQ,QAAQF,GAG3CC,GAAS,GAGXP,EAAyBS,OAAOF,EAAO,SAKtCP,mDAnSPG,EACAO,EAAqC,MAErC,MAAMC,EAAwB,CAAC,QAAQR,KACvC,IAAIS,EAEAC,EACAC,EAFAC,GAAa,EAIbC,EAAwB,+BAC5B,OACEC,EACGC,gBAAgBf,EAAQO,GAGxBS,MAAMC,IAIL,GAHAJ,EAAgB,GAChBJ,EAAOQ,GAEFR,EACH,MAAM,IAAIS,MAAM,qBACX,GAAuB,aAAnBT,EAAKU,KAAKC,KACnB,MAAM,IAAIF,MAAM,0BACX,GAAIT,EAAKU,KAAKE,aAAaC,SAAS,YACzCd,EAAYe,KAAK,4CACZ,CAAA,IAAId,EAAKU,KAAKE,aAAaC,SAAS,YAIzC,MAAM,IAAIJ,MACR,+DAJFN,GAAa,EACbJ,EAAYe,KAAK,wCAcnB,OAAOT,EAAOU,WAAWf,EAAKgB,SAI/BT,MAAKU,IAGJ,GAFAhB,EAAgBgB,GAAc9B,WAEzBc,GAA0C,IAAzBA,EAAciB,OAClC,MAAM,IAAIT,MACR,wEAQJ,GAJAP,EAAkBD,EACfZ,KAAKC,GAAmCA,EAASC,SACjD4B,QAEE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qC,EAAUpC,oBACVoC,EAAUG,YACVF,EAAUrC,oBACVqC,EAAUE,MAQnBX,EAAQnC,EAAO+C,0BAA0BJ,EAAWC,OAEtDI,GAAKZ,EAAOY,4BAWZ,SACJlE,GAEA,MAAMmE,EAAY,GASlB,SAASC,EAAYC,EAAYC,EAAkDC,EAA8B,IAE/G,MAAMpE,EARR,SAA+BH,EAAmCqE,GAChE,MAAMG,EAAYxE,EAAUyE,WAAWtE,GAAakE,IAAOlE,EAASC,SACpE,OAAOoE,GAAa,EAAIxE,EAAUwE,GAAa,KAM9BE,CAAsB1E,EAAWqE,GAElD,GAAIlE,EAAU,CACZ,MAAMwE,EAAgB,CACpBN,GAAAA,EACA/D,aAAc,IAIZiE,EAAkB9D,QAAQ4D,GAAM,IAElCE,EAAkB5C,KAAK0C,GAEvBlE,EAASG,aAAaD,SACpBE,IAEE,MAAMqE,EAAsB7D,EAAgBN,QAAQF,GAChDqE,GAAuB,GACzB7D,EAAgBL,OAAOkE,EAAqB,GAG9CR,EAAY7D,EAAcoE,EAAcrE,aAAciE,OAI5DD,EAAqB3C,KAAKgD,IAK9B,IAAI5D,EAA4BhB,EAAoBC,GAEpD,MAAM6E,EAAqC7E,EACxCmC,QAAOhC,GAAYY,EAAgBN,QAAQN,EAASC,QAAU,IAC9D4B,MAAK,CAAC8C,EAAGC,IAAMA,EAAEzE,aAAayB,OAAS+C,EAAExE,aAAayB,SAEzDhB,EAAkBA,EAAgByB,OAAOqC,EAAW3E,KAAIC,GAAYA,EAASC,UAG7E,IAAIA,EAASW,EAAgBiE,QAC7B,UAAyB,IAAX5E,GACZgE,EAAYhE,EAAQ+D,GACpB/D,EAASW,EAAgBiE,QAG3B,OAAOb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/solution-viewer",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"description": "Simplifies access to @esri/solution.js.",
|
|
5
5
|
"main": "dist/node/index.js",
|
|
6
6
|
"unpkg": "dist/umd/viewer.umd.min.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"@esri/arcgis-rest-portal": "3.4.3",
|
|
19
19
|
"@esri/arcgis-rest-request": "3.4.3",
|
|
20
20
|
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
21
|
-
"@esri/hub-common": "9.
|
|
22
|
-
"@esri/hub-initiatives": "9.
|
|
23
|
-
"@esri/hub-sites": "9.
|
|
24
|
-
"@esri/hub-teams": "9.
|
|
25
|
-
"rollup": "
|
|
21
|
+
"@esri/hub-common": "9.29.0",
|
|
22
|
+
"@esri/hub-initiatives": "9.29.0",
|
|
23
|
+
"@esri/hub-sites": "9.29.0",
|
|
24
|
+
"@esri/hub-teams": "9.29.0",
|
|
25
|
+
"rollup": "2.70.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@esri/arcgis-rest-auth": "3.4.3",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@esri/arcgis-rest-portal": "3.4.3",
|
|
31
31
|
"@esri/arcgis-rest-request": "3.4.3",
|
|
32
32
|
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
33
|
-
"@esri/hub-common": "9.
|
|
34
|
-
"@esri/hub-initiatives": "9.
|
|
35
|
-
"@esri/hub-sites": "9.
|
|
36
|
-
"@esri/hub-teams": "9.
|
|
33
|
+
"@esri/hub-common": "9.29.0",
|
|
34
|
+
"@esri/hub-initiatives": "9.29.0",
|
|
35
|
+
"@esri/hub-sites": "9.29.0",
|
|
36
|
+
"@esri/hub-teams": "9.29.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@esri/solution-common": "^1.3.
|
|
40
|
-
"tslib": "1.
|
|
39
|
+
"@esri/solution-common": "^1.3.11",
|
|
40
|
+
"tslib": "1.14.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"prepare": "npm run build",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"build:node": "tsc -p ./tsconfig.json --module commonjs --outDir ./dist/node",
|
|
48
48
|
"dev:esm": "tsc -w --module esnext --outDir ./dist/esm --declaration",
|
|
49
49
|
"dev:umd": "rollup -w -c ../../umd-base-profile.js",
|
|
50
|
-
"dev:node": "tsc -w --module commonjs --outDir ./dist/node"
|
|
50
|
+
"dev:node": "tsc -w --module commonjs --outDir ./dist/node",
|
|
51
|
+
"getupdates": "npm-check-updates --upgrade"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
|
@@ -89,5 +90,5 @@
|
|
|
89
90
|
"esri",
|
|
90
91
|
"ES6"
|
|
91
92
|
],
|
|
92
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "eb2ce85aa37bd71c0961df7b7bd89d461cf9b697"
|
|
93
94
|
}
|