@esri/solution-simple-types 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 (91) hide show
  1. package/package.json +3 -3
  2. package/dist/cjs/dashboard.d.ts +0 -93
  3. package/dist/cjs/dashboard.js +0 -351
  4. package/dist/cjs/dashboard.js.map +0 -1
  5. package/dist/cjs/helpers/convert-item-to-template.d.ts +0 -34
  6. package/dist/cjs/helpers/convert-item-to-template.js +0 -199
  7. package/dist/cjs/helpers/convert-item-to-template.js.map +0 -1
  8. package/dist/cjs/helpers/create-item-from-template.d.ts +0 -17
  9. package/dist/cjs/helpers/create-item-from-template.js +0 -145
  10. package/dist/cjs/helpers/create-item-from-template.js.map +0 -1
  11. package/dist/cjs/helpers/notebook-helpers.d.ts +0 -19
  12. package/dist/cjs/helpers/notebook-helpers.js +0 -25
  13. package/dist/cjs/helpers/notebook-helpers.js.map +0 -1
  14. package/dist/cjs/helpers/quickcapture-helpers.d.ts +0 -18
  15. package/dist/cjs/helpers/quickcapture-helpers.js +0 -23
  16. package/dist/cjs/helpers/quickcapture-helpers.js.map +0 -1
  17. package/dist/cjs/helpers/simple-type-helpers.d.ts +0 -18
  18. package/dist/cjs/helpers/simple-type-helpers.js +0 -23
  19. package/dist/cjs/helpers/simple-type-helpers.js.map +0 -1
  20. package/dist/cjs/helpers/update-notebook-data.d.ts +0 -17
  21. package/dist/cjs/helpers/update-notebook-data.js +0 -28
  22. package/dist/cjs/helpers/update-notebook-data.js.map +0 -1
  23. package/dist/cjs/index.d.ts +0 -27
  24. package/dist/cjs/index.js +0 -37
  25. package/dist/cjs/index.js.map +0 -1
  26. package/dist/cjs/notebook.d.ts +0 -73
  27. package/dist/cjs/notebook.js +0 -164
  28. package/dist/cjs/notebook.js.map +0 -1
  29. package/dist/cjs/oic.d.ts +0 -53
  30. package/dist/cjs/oic.js +0 -170
  31. package/dist/cjs/oic.js.map +0 -1
  32. package/dist/cjs/quickcapture.d.ts +0 -75
  33. package/dist/cjs/quickcapture.js +0 -143
  34. package/dist/cjs/quickcapture.js.map +0 -1
  35. package/dist/cjs/simple-types.d.ts +0 -56
  36. package/dist/cjs/simple-types.js +0 -94
  37. package/dist/cjs/simple-types.js.map +0 -1
  38. package/dist/cjs/webmap.d.ts +0 -102
  39. package/dist/cjs/webmap.js +0 -314
  40. package/dist/cjs/webmap.js.map +0 -1
  41. package/dist/cjs/webmappingapplication.d.ts +0 -176
  42. package/dist/cjs/webmappingapplication.js +0 -661
  43. package/dist/cjs/webmappingapplication.js.map +0 -1
  44. package/dist/cjs/workforce.d.ts +0 -34
  45. package/dist/cjs/workforce.js +0 -45
  46. package/dist/cjs/workforce.js.map +0 -1
  47. package/dist/esm/dashboard.d.ts +0 -93
  48. package/dist/esm/dashboard.js +0 -338
  49. package/dist/esm/dashboard.js.map +0 -1
  50. package/dist/esm/helpers/convert-item-to-template.d.ts +0 -34
  51. package/dist/esm/helpers/convert-item-to-template.js +0 -193
  52. package/dist/esm/helpers/convert-item-to-template.js.map +0 -1
  53. package/dist/esm/helpers/create-item-from-template.d.ts +0 -17
  54. package/dist/esm/helpers/create-item-from-template.js +0 -140
  55. package/dist/esm/helpers/create-item-from-template.js.map +0 -1
  56. package/dist/esm/helpers/notebook-helpers.d.ts +0 -19
  57. package/dist/esm/helpers/notebook-helpers.js +0 -21
  58. package/dist/esm/helpers/notebook-helpers.js.map +0 -1
  59. package/dist/esm/helpers/quickcapture-helpers.d.ts +0 -18
  60. package/dist/esm/helpers/quickcapture-helpers.js +0 -20
  61. package/dist/esm/helpers/quickcapture-helpers.js.map +0 -1
  62. package/dist/esm/helpers/simple-type-helpers.d.ts +0 -18
  63. package/dist/esm/helpers/simple-type-helpers.js +0 -20
  64. package/dist/esm/helpers/simple-type-helpers.js.map +0 -1
  65. package/dist/esm/helpers/update-notebook-data.d.ts +0 -17
  66. package/dist/esm/helpers/update-notebook-data.js +0 -24
  67. package/dist/esm/helpers/update-notebook-data.js.map +0 -1
  68. package/dist/esm/index.d.ts +0 -27
  69. package/dist/esm/index.js +0 -28
  70. package/dist/esm/index.js.map +0 -1
  71. package/dist/esm/notebook.d.ts +0 -73
  72. package/dist/esm/notebook.js +0 -153
  73. package/dist/esm/notebook.js.map +0 -1
  74. package/dist/esm/oic.d.ts +0 -53
  75. package/dist/esm/oic.js +0 -162
  76. package/dist/esm/oic.js.map +0 -1
  77. package/dist/esm/quickcapture.d.ts +0 -75
  78. package/dist/esm/quickcapture.js +0 -131
  79. package/dist/esm/quickcapture.js.map +0 -1
  80. package/dist/esm/simple-types.d.ts +0 -56
  81. package/dist/esm/simple-types.js +0 -86
  82. package/dist/esm/simple-types.js.map +0 -1
  83. package/dist/esm/webmap.d.ts +0 -102
  84. package/dist/esm/webmap.js +0 -301
  85. package/dist/esm/webmap.js.map +0 -1
  86. package/dist/esm/webmappingapplication.d.ts +0 -176
  87. package/dist/esm/webmappingapplication.js +0 -635
  88. package/dist/esm/webmappingapplication.js.map +0 -1
  89. package/dist/esm/workforce.d.ts +0 -34
  90. package/dist/esm/workforce.js +0 -39
  91. package/dist/esm/workforce.js.map +0 -1
@@ -1,73 +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 * as common from "@esri/solution-common";
17
- /**
18
- * Converts a notebook item into a template.
19
- *
20
- * @param itemInfo Info about the item
21
- * @param destAuthentication Credentials for requests to the destination organization
22
- * @param srcAuthentication Credentials for requests to source items
23
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
24
- * @returns A promise that will resolve when the template has been created
25
- */
26
- export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
27
- export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
28
- /**
29
- * Converts a Python Notebook item to a template.
30
- *
31
- * @param itemTemplate template for the Python Notebook
32
- * @returns templatized itemTemplate
33
- */
34
- export declare function convertNotebookToTemplate(itemTemplate: common.IItemTemplate): Promise<common.IItemTemplate>;
35
- /**
36
- * Swap any ids found in the items data section with itemId variables
37
- *
38
- * @param templates IItemTemplate[] all templates for the current solution
39
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
40
- * @returns templatized IItemTemplate[]
41
- */
42
- export declare function postProcessNotebookTemplates(templates: common.IItemTemplate[], templateDictionary: any): common.IItemTemplate[];
43
- /**
44
- * Remove interpreter and papermill props
45
- *
46
- * This function will update the data passed in by removing key props
47
- *
48
- * @param data The notebooks data object
49
- *
50
- */
51
- export declare function deleteProps(data: any): void;
52
- /**
53
- * Update the notebooks data
54
- *
55
- * @param originalTemplate The original template item
56
- * @param newlyCreatedItem The current item that may have unswapped variables
57
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
58
- * @param authentication Credentials for the requests to the destination
59
- *
60
- * @returns A promise that will resolve once any updates have been made
61
- */
62
- export declare function fineTuneCreatedItem(originalTemplate: common.IItemTemplate, newlyCreatedItem: common.IItemTemplate, templateDictionary: any, authentication: common.UserSession): Promise<void>;
63
- /**
64
- * Notebook specific post-processing actions
65
- *
66
- * @param {string} itemId The item ID
67
- * @param {string} type The template type
68
- * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
69
- * @param {any} templateDictionary The template dictionary
70
- * @param {UserSession} authentication The destination session info
71
- * @returns {Promise<any>}
72
- */
73
- export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: common.IItemTemplate, templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): Promise<any>;
@@ -1,153 +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 * as common from "@esri/solution-common";
17
- // Need to import collectively to enable spying
18
- import * as notebookHelpers from "./helpers/notebook-helpers";
19
- /**
20
- * Converts a notebook item into a template.
21
- *
22
- * @param itemInfo Info about the item
23
- * @param destAuthentication Credentials for requests to the destination organization
24
- * @param srcAuthentication Credentials for requests to source items
25
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
26
- * @returns A promise that will resolve when the template has been created
27
- */
28
- export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
29
- // Delegate back to simple-types, which will in-turn delegate
30
- // to convertNotebookToTemplate at the correct point in the process
31
- // This is a temporary refactor step
32
- return notebookHelpers.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
33
- }
34
- // Delegate back to simple-types
35
- // This is a temporary refactor step
36
- export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
37
- return notebookHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
38
- }
39
- /**
40
- * Converts a Python Notebook item to a template.
41
- *
42
- * @param itemTemplate template for the Python Notebook
43
- * @returns templatized itemTemplate
44
- */
45
- export function convertNotebookToTemplate(itemTemplate) {
46
- return new Promise((resolve) => {
47
- deleteProps(itemTemplate.data);
48
- resolve(itemTemplate);
49
- });
50
- }
51
- /**
52
- * Swap any ids found in the items data section with itemId variables
53
- *
54
- * @param templates IItemTemplate[] all templates for the current solution
55
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
56
- * @returns templatized IItemTemplate[]
57
- */
58
- export function postProcessNotebookTemplates(templates, templateDictionary) {
59
- const hasNotebook = templates.some((t) => {
60
- return t.type === "Notebook";
61
- });
62
- if (hasNotebook) {
63
- const fsUrlKeys = Object.keys(templateDictionary)
64
- .filter((k) => k.indexOf("FeatureServer") > -1)
65
- .sort()
66
- .reverse();
67
- const ids = templates.reduce((prev, cur) => {
68
- prev = [...new Set([...prev, ...cur.dependencies, cur.itemId])];
69
- return prev;
70
- }, []);
71
- templates = templates.map((t) => {
72
- if (t.type === "Notebook") {
73
- let dataString = t.data && JSON.stringify(t.data);
74
- ids.forEach((id) => {
75
- const idTest = new RegExp(id, "gim");
76
- if (idTest.test(dataString)) {
77
- dataString = dataString.replace(id, "{{" + id + ".itemId}}");
78
- if (t.dependencies.indexOf(id) < 0) {
79
- t.dependencies.push(id);
80
- }
81
- }
82
- });
83
- fsUrlKeys.forEach((url) => {
84
- const urlTest = new RegExp(url, "gim");
85
- if (urlTest.test(dataString)) {
86
- const urlVar = templateDictionary[url];
87
- dataString = dataString.replace(urlTest, urlVar);
88
- const idTest = /[0-9A-F]{32}/gim;
89
- const id = urlVar.match(idTest)[0];
90
- if (t.dependencies.indexOf(id) < 0) {
91
- t.dependencies.push(id);
92
- }
93
- }
94
- });
95
- t.data = JSON.parse(dataString);
96
- return t;
97
- }
98
- });
99
- }
100
- return templates;
101
- }
102
- /**
103
- * Remove interpreter and papermill props
104
- *
105
- * This function will update the data passed in by removing key props
106
- *
107
- * @param data The notebooks data object
108
- *
109
- */
110
- export function deleteProps(data) {
111
- /* istanbul ignore else */
112
- if (data) {
113
- const props = ["metadata.interpreter", "metadata.papermill"];
114
- common.deleteProps(data, props);
115
- (data.cells || []).forEach((cell) => {
116
- common.deleteProps(cell, props);
117
- });
118
- }
119
- }
120
- /**
121
- * Update the notebooks data
122
- *
123
- * @param originalTemplate The original template item
124
- * @param newlyCreatedItem The current item that may have unswapped variables
125
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
126
- * @param authentication Credentials for the requests to the destination
127
- *
128
- * @returns A promise that will resolve once any updates have been made
129
- */
130
- export function fineTuneCreatedItem(originalTemplate, newlyCreatedItem, templateDictionary, authentication) {
131
- return new Promise((resolve, reject) => {
132
- const updateOptions = {
133
- id: newlyCreatedItem.itemId,
134
- url: newlyCreatedItem.item.url,
135
- data: common.jsonToFile(newlyCreatedItem.data, newlyCreatedItem.itemId + ".ipynb"),
136
- };
137
- common.updateItem(updateOptions, authentication).then(() => resolve(null), reject);
138
- });
139
- }
140
- /**
141
- * Notebook specific post-processing actions
142
- *
143
- * @param {string} itemId The item ID
144
- * @param {string} type The template type
145
- * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
146
- * @param {any} templateDictionary The template dictionary
147
- * @param {UserSession} authentication The destination session info
148
- * @returns {Promise<any>}
149
- */
150
- export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
151
- return common.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
152
- }
153
- //# sourceMappingURL=notebook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook.js","sourceRoot":"","sources":["../../src/notebook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,+CAA+C;AAC/C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,6DAA6D;IAC7D,mEAAmE;IACnE,oCAAoC;IACpC,OAAO,eAAe,CAAC,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,E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;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAA8B,EAC9B,SAAiC,EACjC,kBAAuB,EACvB,cAAkC;IAElC,OAAO,MAAM,CAAC,gCAAgC,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAC7F,CAAC"}
package/dist/esm/oic.d.ts DELETED
@@ -1,53 +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 * as common from "@esri/solution-common";
17
- /**
18
- * Converts an AGOL OIC (Oriented Imagery Catalog) item to a template.
19
- *
20
- * @param itemTemplate Template for the OIC (Oriented Imagery Catalog) item
21
- * @param destAuthentication Credentials for requests to the destination organization
22
- * @param srcAuthentication Credentials for requests to source items
23
- * @returns Template for the solution item that contains key details for item reconstruction
24
- */
25
- export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
26
- /**
27
- * Gets the ids of the dependencies of an AGOL OIC (Oriented Imagery Catalog) item.
28
- *
29
- * @param itemTemplate A OIC (Oriented Imagery Catalog) item whose dependencies are sought
30
- * @param authentication Credentials for any requests
31
- * @returns List of dependencies ids and url/itemId hash
32
- * @private
33
- */
34
- export declare function _extractDependencies(itemTemplate: common.IItemTemplate, authentication: common.UserSession): Promise<any>;
35
- /**
36
- * Extracts the AGOL itemId for each layer in a list using the url.
37
- *
38
- * @param layerURLs List of OIC layer URLs
39
- * @param dependencies Current list of dependencies
40
- * @param authentication Credentials for any requests
41
- * @returns List of dependencies ids and url/itemId hash
42
- * @private
43
- */
44
- export declare function _getLayerIds(layerURLs: string[], dependencies: string[], authentication: common.UserSession): Promise<any>;
45
- /**
46
- * Templatizes the url and item id for a layer.
47
- *
48
- * @param layerURL OIC layer URL
49
- * @param urlHash Lookup object for analysis layers
50
- * @returns Templatized URL if layerURL is in the urlHash
51
- * @private
52
- */
53
- export declare function _templatizeOicLayerUrl(layerURL: string, urlHash: any): string;
package/dist/esm/oic.js DELETED
@@ -1,162 +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 * as common from "@esri/solution-common";
17
- // ------------------------------------------------------------------------------------------------------------------ //
18
- /**
19
- * Converts an AGOL OIC (Oriented Imagery Catalog) item to a template.
20
- *
21
- * @param itemTemplate Template for the OIC (Oriented Imagery Catalog) item
22
- * @param destAuthentication Credentials for requests to the destination organization
23
- * @param srcAuthentication Credentials for requests to source items
24
- * @returns Template for the solution item that contains key details for item reconstruction
25
- */
26
- export function convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication) {
27
- return new Promise((resolve, reject) => {
28
- // Extract dependencies
29
- _extractDependencies(itemTemplate, srcAuthentication).then((results) => {
30
- itemTemplate.dependencies = results.dependencies;
31
- // Templatize the map layer ids after we've extracted them as dependencies
32
- /* istanbul ignore else */
33
- if (itemTemplate.data?.properties) {
34
- itemTemplate.data.properties.ServiceURL = _templatizeOicLayerUrl(itemTemplate.data.properties.ServiceURL, results.urlHash);
35
- itemTemplate.data.properties.OverviewURL = _templatizeOicLayerUrl(itemTemplate.data.properties.OverviewURL, results.urlHash);
36
- }
37
- resolve(itemTemplate);
38
- }, (e) => reject(common.fail(e)));
39
- });
40
- }
41
- /**
42
- * Gets the ids of the dependencies of an AGOL OIC (Oriented Imagery Catalog) item.
43
- *
44
- * @param itemTemplate A OIC (Oriented Imagery Catalog) item whose dependencies are sought
45
- * @param authentication Credentials for any requests
46
- * @returns List of dependencies ids and url/itemId hash
47
- * @private
48
- */
49
- export function _extractDependencies(itemTemplate, authentication) {
50
- return new Promise((resolve, reject) => {
51
- const dependencies = [];
52
- if (itemTemplate.data?.properties) {
53
- const layerURLs = [];
54
- /* istanbul ignore else */
55
- if (itemTemplate.data.properties.ServiceURL) {
56
- layerURLs.push(itemTemplate.data.properties.ServiceURL);
57
- }
58
- /* istanbul ignore else */
59
- if (itemTemplate.data.properties.OverviewURL &&
60
- itemTemplate.data.properties.OverviewURL !== itemTemplate.data.properties.ServiceURL) {
61
- layerURLs.push(itemTemplate.data.properties.OverviewURL);
62
- }
63
- _getLayerIds(layerURLs, dependencies, authentication).then((results) => {
64
- resolve(results);
65
- }, (e) => reject(common.fail(e)));
66
- }
67
- else {
68
- resolve({
69
- dependencies: dependencies,
70
- urlHash: {},
71
- });
72
- }
73
- });
74
- }
75
- /**
76
- * Extracts the AGOL itemId for each layer in a list using the url.
77
- *
78
- * @param layerURLs List of OIC layer URLs
79
- * @param dependencies Current list of dependencies
80
- * @param authentication Credentials for any requests
81
- * @returns List of dependencies ids and url/itemId hash
82
- * @private
83
- */
84
- export function _getLayerIds(layerURLs, dependencies, authentication) {
85
- return new Promise((resolve, reject) => {
86
- const urlHash = {};
87
- const options = {
88
- f: "json",
89
- authentication: authentication,
90
- };
91
- const layerPromises = [];
92
- const layerChecks = {};
93
- const filteredLayerURLs = layerURLs.filter((layerURL) => {
94
- if (layerURL) {
95
- const results = /.+FeatureServer/g.exec(layerURL);
96
- const baseUrl = Array.isArray(results) && results.length > 0 ? results[0] : undefined;
97
- if (baseUrl) {
98
- // avoid redundant checks when we have a layer with subLayers
99
- /* istanbul ignore else */
100
- if (Object.keys(layerChecks).indexOf(baseUrl) < 0) {
101
- layerChecks[baseUrl] = common.request(layerURL, options);
102
- }
103
- layerPromises.push(layerChecks[baseUrl]);
104
- return true;
105
- }
106
- else {
107
- return false;
108
- }
109
- }
110
- else {
111
- return false;
112
- }
113
- });
114
- if (layerPromises.length > 0) {
115
- Promise.all(layerPromises).then((serviceResponses) => {
116
- serviceResponses.forEach((serviceResponse, i) => {
117
- /* istanbul ignore else */
118
- if (common.getProp(serviceResponse, "serviceItemId")) {
119
- const id = serviceResponse.serviceItemId;
120
- /* istanbul ignore else */
121
- if (dependencies.indexOf(id) < 0) {
122
- dependencies.push(id);
123
- }
124
- urlHash[filteredLayerURLs[i]] = id;
125
- }
126
- });
127
- resolve({
128
- dependencies: dependencies,
129
- urlHash: urlHash,
130
- });
131
- }, (e) => reject(common.fail(e)));
132
- }
133
- else {
134
- resolve({
135
- dependencies: dependencies,
136
- urlHash: urlHash,
137
- });
138
- }
139
- });
140
- }
141
- /**
142
- * Templatizes the url and item id for a layer.
143
- *
144
- * @param layerURL OIC layer URL
145
- * @param urlHash Lookup object for analysis layers
146
- * @returns Templatized URL if layerURL is in the urlHash
147
- * @private
148
- */
149
- export function _templatizeOicLayerUrl(layerURL, urlHash) {
150
- let templatizedURL = layerURL;
151
- if (layerURL) {
152
- const id = urlHash[layerURL];
153
- if (id) {
154
- const layerId = layerURL.substr(layerURL.lastIndexOf("/") + 1);
155
- templatizedURL = common.templatizeTerm(id, id, ".layer" + layerId + ".url");
156
- }
157
- // replace everything up until /home with portalBaseUrl var and templatize the itemId
158
- templatizedURL = common.templatizeIds(templatizedURL.replace(/.+?(?=\/home)/, "{{portalBaseUrl}}"));
159
- }
160
- return templatizedURL;
161
- }
162
- //# sourceMappingURL=oic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oic.js","sourceRoot":"","sources":["../../src/oic.ts"],"names":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BAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;qBACpC;gBACH,CAAC,CAAC,CAAC;gBACH,OAAO,CAAC;oBACN,YAAY,EAAE,YAAY;oBAC1B,OAAO,EAAE,OAAO;iBACjB,CAAC,CAAC;YACL,CAAC,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC9B,CAAC;SACH;aAAM;YACL,OAAO,CAAC;gBACN,YAAY,EAAE,YAAY;gBAC1B,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB,EAAE,OAAY;IACnE,IAAI,cAAc,GAAG,QAAQ,CAAC;IAC9B,IAAI,QAAQ,EAAE;QACZ,MAAM,EAAE,GAAQ,OAAO,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,EAAE,EAAE;YACN,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/D,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;SAC7E;QAED,qFAAqF;QACrF,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC;KACrG;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -1,75 +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 * as common from "@esri/solution-common";
17
- /**
18
- * Converts a Quick Capture item into a template.
19
- *
20
- * @param itemInfo Info about the item
21
- * @param destAuthentication Credentials for requests to the destination organization
22
- * @param srcAuthentication Credentials for requests to source items
23
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
24
- * @returns A promise that will resolve when the template has been created
25
- */
26
- export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
27
- /**
28
- * Converts an quick capture item to a template.
29
- *
30
- * @param itemTemplate template for the quick capture project item
31
- * @returns templatized itemTemplate
32
- */
33
- export declare function convertQuickCaptureToTemplate(itemTemplate: common.IItemTemplate): common.IItemTemplate;
34
- /**
35
- * Templatizes key properties for a quick capture project and gathers item dependencies
36
- *
37
- * @param data the projects json
38
- * @param itemTemplate template for the quick capture project item
39
- * @returns templatized itemTemplate
40
- * @private
41
- */
42
- export declare function _templatizeApplication(data: any, itemTemplate: common.IItemTemplate): any;
43
- /**
44
- * Templatize the email property
45
- *
46
- * @param data the quick capture application
47
- * @private
48
- */
49
- export declare function _templatizeAdminEmail(data: any): void;
50
- /**
51
- * Updates the templates dependencies list with unique item ids
52
- *
53
- * @param id the item id of the dependency
54
- * @param itemTemplate template for the quick capture project item
55
- * @returns templatized itemTemplate
56
- */
57
- export declare function _updateDependencies(id: string, itemTemplate: common.IItemTemplate): void;
58
- /**
59
- * Templatize a url property
60
- *
61
- * @param obj the datasource object
62
- * @param idPath the path to the id property
63
- * @param urlPath the path to the url property
64
- * @private
65
- */
66
- export declare function _templatizeUrl(obj: any, idPath: string, urlPath: string): void;
67
- /**
68
- * Templatize the item id property
69
- *
70
- * @param obj the datasource or object that contains the item id property
71
- * @param path the path to the id property
72
- * @private
73
- */
74
- export declare function _templatizeId(obj: any, path: string): void;
75
- export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
@@ -1,131 +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 * as common from "@esri/solution-common";
17
- import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
18
- //#region Publish Process ---------------------------------------------------------------------------------------//
19
- /**
20
- * Converts a Quick Capture item into a template.
21
- *
22
- * @param itemInfo Info about the item
23
- * @param destAuthentication Credentials for requests to the destination organization
24
- * @param srcAuthentication Credentials for requests to source items
25
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
26
- * @returns A promise that will resolve when the template has been created
27
- */
28
- export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
29
- // Delegate back to simple-types, which will in-turn delegate
30
- // to convertNotebookToTemplate at the correct point in the process
31
- // This is a temporary refactor step
32
- return quickcaptureHelpers.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
33
- }
34
- /**
35
- * Converts an quick capture item to a template.
36
- *
37
- * @param itemTemplate template for the quick capture project item
38
- * @returns templatized itemTemplate
39
- */
40
- export function convertQuickCaptureToTemplate(itemTemplate) {
41
- common.setProp(itemTemplate, "data.application", _templatizeApplication(itemTemplate.data.application, itemTemplate));
42
- return itemTemplate;
43
- }
44
- /**
45
- * Templatizes key properties for a quick capture project and gathers item dependencies
46
- *
47
- * @param data the projects json
48
- * @param itemTemplate template for the quick capture project item
49
- * @returns templatized itemTemplate
50
- * @private
51
- */
52
- export function _templatizeApplication(data, itemTemplate) {
53
- // Quick Project item id
54
- _templatizeId(data, "itemId");
55
- // Set the admin email
56
- _templatizeAdminEmail(data);
57
- // datasource item id and url
58
- const dataSources = data?.dataSources;
59
- if (dataSources && Array.isArray(dataSources)) {
60
- dataSources.forEach((ds) => {
61
- const id = ds.featureServiceItemId;
62
- if (id) {
63
- _updateDependencies(id, itemTemplate);
64
- _templatizeUrl(ds, "featureServiceItemId", "url");
65
- _templatizeId(ds, "featureServiceItemId");
66
- }
67
- });
68
- }
69
- return data;
70
- }
71
- /**
72
- * Templatize the email property
73
- *
74
- * @param data the quick capture application
75
- * @private
76
- */
77
- export function _templatizeAdminEmail(data) {
78
- if (common.getProp(data, "preferences.adminEmail")) {
79
- common.setProp(data, "preferences.adminEmail", "{{user.email}}");
80
- }
81
- }
82
- /**
83
- * Updates the templates dependencies list with unique item ids
84
- *
85
- * @param id the item id of the dependency
86
- * @param itemTemplate template for the quick capture project item
87
- * @returns templatized itemTemplate
88
- */
89
- export function _updateDependencies(id, itemTemplate) {
90
- if (itemTemplate.dependencies.indexOf(id) === -1) {
91
- itemTemplate.dependencies.push(id);
92
- }
93
- }
94
- /**
95
- * Templatize a url property
96
- *
97
- * @param obj the datasource object
98
- * @param idPath the path to the id property
99
- * @param urlPath the path to the url property
100
- * @private
101
- */
102
- export function _templatizeUrl(obj, idPath, urlPath) {
103
- const id = common.getProp(obj, idPath);
104
- const url = common.getProp(obj, urlPath);
105
- if (url) {
106
- const layerId = url.substr(url.lastIndexOf("/") + 1);
107
- common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
108
- }
109
- }
110
- /**
111
- * Templatize the item id property
112
- *
113
- * @param obj the datasource or object that contains the item id property
114
- * @param path the path to the id property
115
- * @private
116
- */
117
- export function _templatizeId(obj, path) {
118
- const id = common.getProp(obj, path);
119
- if (id) {
120
- common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
121
- }
122
- }
123
- //#endregion
124
- //#region Deploy Process ---------------------------------------------------------------------------------------//
125
- // Delegate back to simple-types
126
- // This is a temporary refactor step
127
- export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
128
- return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
129
- }
130
- //#endregion
131
- //# sourceMappingURL=quickcapture.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AAEtE,mHAAmH;AAEnH;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,6DAA6D;IAC7D,mEAAmE;IACnE,oCAAoC;IACpC,OAAO,mBAAmB,CAAC,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AACxH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAC,YAAkC;IAC9E,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IACtH,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAS,EAAE,YAAkC;IAClF,wBAAwB;IACxB,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE9B,sBAAsB;IACtB,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAE5B,6BAA6B;IAC7B,MAAM,WAAW,GAA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