@esri/solution-simple-types 6.0.5-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,193 +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
- import * as dashboard from "../dashboard";
18
- import * as notebook from "../notebook";
19
- import * as oic from "../oic";
20
- import * as quickcapture from "../quickcapture";
21
- import * as webmap from "../webmap";
22
- import * as webmappingapplication from "../webmappingapplication";
23
- import * as workforce from "../workforce";
24
- // ------------------------------------------------------------------------------------------------------------------ //
25
- /**
26
- * Converts an item into a template.
27
- *
28
- * @param itemInfo Info about the item
29
- * @param destAuthentication Credentials for requests to the destination organization
30
- * @param srcAuthentication Credentials for requests to source items
31
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
32
- *
33
- * @returns A promise that will resolve when the template has been created
34
- */
35
- export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
36
- return new Promise((resolve, reject) => {
37
- // Init template
38
- const itemTemplate = common.createInitializedItemTemplate(itemInfo);
39
- // Templatize item info property values
40
- itemTemplate.item.id = common.templatizeTerm(itemTemplate.item.id, itemTemplate.item.id, ".itemId");
41
- // Request related items
42
- const relatedPromise = common.getItemRelatedItemsInSameDirection(itemTemplate.itemId, "forward", srcAuthentication);
43
- // Perform type-specific handling
44
- let dataPromise = Promise.resolve({});
45
- let resourcesPromise = Promise.resolve([]);
46
- switch (itemInfo.type) {
47
- case "Dashboard":
48
- case "Data Pipeline":
49
- case "Feature Collection":
50
- case "Feature Service":
51
- case "Hub Initiative":
52
- case "Hub Page":
53
- case "Hub Site Application":
54
- case "Insights Model":
55
- case "Oriented Imagery Catalog":
56
- case "Project Package":
57
- case "Style":
58
- case "Workforce Project":
59
- case "Web Map":
60
- case "Web Mapping Application":
61
- case "Web Scene":
62
- case "Notebook":
63
- dataPromise = new Promise((resolveJSON) => {
64
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
65
- common.getItemDataAsJson(itemTemplate.itemId, srcAuthentication).then((json) => resolveJSON(json));
66
- });
67
- break;
68
- case "Form":
69
- dataPromise = common.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name, srcAuthentication);
70
- break;
71
- case "QuickCapture Project":
72
- // Fetch all of the resources to get the config
73
- resourcesPromise = common.getItemResourcesFiles(itemTemplate.itemId, srcAuthentication);
74
- break;
75
- }
76
- // Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:
77
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
78
- Promise.all([dataPromise, relatedPromise, resourcesPromise]).then((responses) => {
79
- const [itemDataResponse, relatedItemsResponse, resourcesResponse] = responses;
80
- common.preProcessWebTool(itemTemplate, templateDictionary);
81
- // need to pre-process for velocity urls before they could be templatized by other processors
82
- itemTemplate.data = common.updateVelocityReferences(itemDataResponse, itemInfo.type, templateDictionary);
83
- const relationships = relatedItemsResponse;
84
- // Save the mappings to related items & add those items to the dependencies, but not WMA Code Attachments
85
- itemTemplate.dependencies = [];
86
- itemTemplate.relatedItems = [];
87
- relationships.forEach((relationship) => {
88
- /* istanbul ignore else */
89
- if (relationship.relationshipType !== "WMA2Code") {
90
- itemTemplate.relatedItems.push(relationship);
91
- relationship.relatedItemIds.forEach((relatedItemId) => {
92
- if (itemTemplate.dependencies.indexOf(relatedItemId) < 0) {
93
- itemTemplate.dependencies.push(relatedItemId);
94
- }
95
- });
96
- }
97
- });
98
- // Add Data Pipeline source and sink feature layers to dependencies
99
- if (itemInfo.type === "Data Pipeline") {
100
- itemTemplate.dependencies = itemTemplate.dependencies.concat(_getDataPipelineSourcesAndSinks(itemDataResponse));
101
- }
102
- // Create the template
103
- let templateModifyingPromise = Promise.resolve(itemTemplate);
104
- switch (itemInfo.type) {
105
- case "Dashboard":
106
- dashboard.convertItemToTemplate(itemTemplate, templateDictionary);
107
- break;
108
- case "Notebook":
109
- templateModifyingPromise = notebook.convertNotebookToTemplate(itemTemplate);
110
- break;
111
- case "Oriented Imagery Catalog":
112
- templateModifyingPromise = oic.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication);
113
- break;
114
- case "QuickCapture Project":
115
- // Save all of the resources that we've fetched so as to not fetch them again
116
- itemTemplate.resources = resourcesResponse;
117
- // Get the QC config
118
- templateModifyingPromise = new Promise(
119
- // eslint-disable-next-line @typescript-eslint/no-misused-promises, no-async-promise-executor
120
- async (qcResolve) => {
121
- // Remove the qc.project.json file from the list of resources
122
- let qcProjectFile = null;
123
- let iQcProjectFile = -1;
124
- if (resourcesResponse) {
125
- resourcesResponse.some((file, i) => {
126
- const haveConfigFile = file.name === "qc.project.json";
127
- if (haveConfigFile) {
128
- qcProjectFile = file;
129
- iQcProjectFile = i;
130
- }
131
- return haveConfigFile;
132
- });
133
- // Discard the qc.project.json file
134
- if (iQcProjectFile >= 0) {
135
- resourcesResponse.splice(iQcProjectFile, 1);
136
- }
137
- }
138
- // Copy the qc.project.json file into the data section
139
- if (qcProjectFile) {
140
- itemTemplate.data = {
141
- application: {
142
- ...(await common.blobToJson(qcProjectFile)),
143
- },
144
- name: "qc.project.json",
145
- };
146
- }
147
- // Save the basemap dependency
148
- if (itemTemplate.data.application?.basemap?.type === "Web Map") {
149
- itemTemplate.dependencies.push(itemTemplate.data.application.basemap.itemId);
150
- }
151
- // Create the template
152
- const updatedTemplate = quickcapture.convertQuickCaptureToTemplate(itemTemplate);
153
- qcResolve(updatedTemplate);
154
- });
155
- break;
156
- case "Vector Tile Service":
157
- case "Web Map":
158
- case "Web Scene":
159
- templateModifyingPromise = webmap.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication, templateDictionary);
160
- break;
161
- case "Web Mapping Application":
162
- if (itemDataResponse) {
163
- templateModifyingPromise = webmappingapplication.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication, templateDictionary);
164
- }
165
- break;
166
- case "Workforce Project":
167
- templateModifyingPromise = workforce.convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication, templateDictionary);
168
- break;
169
- }
170
- templateModifyingPromise.then(resolve, (err) => reject(common.fail(err)));
171
- });
172
- });
173
- }
174
- /**
175
- * Extracts the feature layer ids for a Data Pipeline's sources and sinks.
176
- *
177
- * @param itemData Data Pipeline's data section
178
- * @return List of feature layer ids or an empty list if there are no sources or sinks in the pipeline
179
- */
180
- export function _getDataPipelineSourcesAndSinks(itemData) {
181
- const dependencies = [];
182
- const sourcesAndSinks = (itemData?.inputs ?? []).concat(itemData?.outputs ?? []);
183
- sourcesAndSinks.forEach((sourceOrSink) => {
184
- if (sourceOrSink.type === "FeatureServiceSource" || sourceOrSink.type === "FeatureServiceSink") {
185
- const featureServiceId = common.getProp(sourceOrSink, "parameters.layer.value.itemId");
186
- if (featureServiceId) {
187
- dependencies.push(featureServiceId);
188
- }
189
- }
190
- });
191
- return dependencies;
192
- }
193
- //# sourceMappingURL=convert-item-to-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-item-to-template.js","sourceRoot":"","sources":["../../../src/helpers/convert-item-to-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,wHAAwH;AAExH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,gBAAgB;QAChB,MAAM,YAAY,GAAyB,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;QAE1F,uCAAuC;QACvC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAEpG,wBAAwB;QACxB,MAAM,cAAc,GAAG,MAAM,CAAC,kCAAkC,CAAC,YAAY,CAAC,MAAM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B,CAAC,QAAa;IAC3D,MAAM,YAAY,GAAG,EAAc,CAAC;IACpC,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAEjF,eAAe,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;QACvC,IAAI,YAAY,CAAC,IAAI,KAAK,sBAAsB,IAAI,YAAY,CAAC,IAAI,KAAK,oBAAoB,EAAE;YAC9F,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,+BAA+B,CAAC,CAAC;YACvF,IAAI,gBAAgB,EAAE;gBACpB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aACrC;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,17 +0,0 @@
1
- /** @license
2
- * Copyright 2020 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import * as common from "@esri/solution-common";
17
- export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
@@ -1,140 +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
- import * as notebook from "../notebook";
18
- import * as webmappingapplication from "../webmappingapplication";
19
- import * as workforce from "../workforce";
20
- export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
21
- return new Promise((resolve) => {
22
- // Interrupt process if progress callback returns `false`
23
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
24
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
25
- resolve(common.generateEmptyCreationResponse(template.type));
26
- }
27
- else {
28
- // Replace the templatized symbols in a copy of the template
29
- let newItemTemplate = common.cloneObject(template);
30
- newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
31
- let qcProjectFileContents;
32
- // Create the item, then update its URL with its new id
33
- // some fieldnames are used as keys for objects
34
- // when we templatize field references for web applications we first stringify the components of the
35
- // web application that could contain field references and then search for them with a regular expression.
36
- // We also need to stringify the web application when de-templatizing so it will find all of these occurrences as well.
37
- if (template.type === "Web Mapping Application" && template.data) {
38
- newItemTemplate = JSON.parse(common.replaceInTemplate(JSON.stringify(newItemTemplate), templateDictionary));
39
- }
40
- else if (template.type === "QuickCapture Project" && template.data) {
41
- // Save the data section for creating the qc.project.json later
42
- qcProjectFileContents = JSON.stringify(newItemTemplate.data.application);
43
- // Delete the data section
44
- delete newItemTemplate.data;
45
- }
46
- if (template.item.thumbnail) {
47
- newItemTemplate.item.thumbnail = template.item.thumbnail; // make sure that our File is still there
48
- }
49
- common
50
- .createItemWithData(newItemTemplate.item, newItemTemplate.data, destinationAuthentication, templateDictionary.folderId)
51
- .then((createResponse) => {
52
- // Interrupt process if progress callback returns `false`
53
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
54
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
55
- common.removeItem(createResponse.id, destinationAuthentication).then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
56
- }
57
- else {
58
- // Add the new item to the settings
59
- templateDictionary[template.itemId] = {
60
- itemId: createResponse.id,
61
- itemUrl: templateDictionary["portalBaseUrl"] + "/sharing/rest/content/items/" + createResponse.id,
62
- };
63
- newItemTemplate.itemId = createResponse.id;
64
- // Set the appItemId manually to get around cases where the path was incorrectly set
65
- // in legacy deployments
66
- if (newItemTemplate.type === "Web Mapping Application" && template.data) {
67
- common.setProp(newItemTemplate, "data.appItemId", createResponse.id);
68
- }
69
- const postProcess = common.hasUnresolvedVariables(newItemTemplate.data);
70
- // Update the template again now that we have the new item id
71
- const originalURL = newItemTemplate.item.url;
72
- newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
73
- // Update relationships
74
- let relationshipsDef = Promise.resolve([]);
75
- if (newItemTemplate.relatedItems) {
76
- // Templatize references in relationships obj
77
- const updatedRelatedItems = common.replaceInTemplate(common.templatizeIds(newItemTemplate.relatedItems), templateDictionary);
78
- // Add the relationships
79
- relationshipsDef = common.addForwardItemRelationships(newItemTemplate.itemId, updatedRelatedItems, destinationAuthentication);
80
- }
81
- // Check for extra processing for web mapping application et al.
82
- let customProcDef;
83
- if (template.type === "Web Mapping Application" &&
84
- template.data &&
85
- common.hasAnyKeyword(template, ["WAB2D", "WAB3D", "Web AppBuilder"])) {
86
- // If this is a Web AppBuilder application, we will create a Code Attachment for downloading
87
- customProcDef = webmappingapplication.fineTuneCreatedItem(template, newItemTemplate, templateDictionary, destinationAuthentication);
88
- }
89
- else if (template.type === "Workforce Project") {
90
- customProcDef = workforce.fineTuneCreatedItem(newItemTemplate, destinationAuthentication, templateDictionary);
91
- }
92
- else if (template.type === "QuickCapture Project") {
93
- if (qcProjectFileContents) {
94
- // Generate the qc.project.json file resource from the data section after handling templatized variables
95
- const qcProjectFile = common.jsonToFile(common.replaceInTemplate(JSON.parse(qcProjectFileContents), templateDictionary), "qc.project.json");
96
- // Send the created qc.project.json file to the item
97
- customProcDef = common.addBlobResource(qcProjectFile, newItemTemplate.itemId, "", qcProjectFile.name, destinationAuthentication);
98
- }
99
- }
100
- else if (template.type === "Notebook") {
101
- customProcDef = notebook.fineTuneCreatedItem(template, newItemTemplate, templateDictionary, destinationAuthentication);
102
- }
103
- else if (originalURL !== newItemTemplate.item.url) {
104
- // For web mapping applications that are not Web AppBuilder apps
105
- customProcDef = new Promise((resolve2, reject2) => {
106
- common
107
- .updateItemURL(createResponse.id, newItemTemplate.item.url, destinationAuthentication)
108
- .then(() => resolve2(), reject2);
109
- });
110
- }
111
- else {
112
- customProcDef = Promise.resolve(null);
113
- }
114
- Promise.all([relationshipsDef, customProcDef]).then(() => {
115
- // Interrupt process if progress callback returns `false`
116
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
117
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
118
- common.removeItem(createResponse.id, destinationAuthentication).then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
119
- }
120
- else {
121
- resolve({
122
- item: newItemTemplate,
123
- id: createResponse.id,
124
- type: newItemTemplate.type,
125
- postProcess: postProcess,
126
- });
127
- }
128
- }, () => {
129
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
130
- resolve(common.generateEmptyCreationResponse(template.type)); // fails to deploy all resources to the item
131
- });
132
- }
133
- }, () => {
134
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
135
- resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
136
- });
137
- }
138
- });
139
- }
140
- //# sourceMappingURL=create-item-from-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-item-from-template.js","sourceRoot":"","sources":["../../../src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AAM,EAAE,CAAC,CAAC,CAAC;gBAC5E,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;YACvF,CAAC,CACF,CAAC;SACL;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,19 +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 { convertItemToTemplate } from "./convert-item-to-template";
17
- import { createItemFromTemplate } from "./create-item-from-template";
18
- import { updateNotebookData } from "./update-notebook-data";
19
- export { createItemFromTemplate, convertItemToTemplate, updateNotebookData };
@@ -1,21 +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 { convertItemToTemplate } from "./convert-item-to-template";
17
- import { createItemFromTemplate } from "./create-item-from-template";
18
- import { updateNotebookData } from "./update-notebook-data";
19
- // Export the Notebook Helper module
20
- export { createItemFromTemplate, convertItemToTemplate, updateNotebookData };
21
- //# sourceMappingURL=notebook-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-helpers.js","sourceRoot":"","sources":["../../../src/helpers/notebook-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,oCAAoC;AACpC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,18 +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 { convertItemToTemplate } from "./convert-item-to-template";
17
- import { createItemFromTemplate } from "./create-item-from-template";
18
- export { createItemFromTemplate, convertItemToTemplate };
@@ -1,20 +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 { convertItemToTemplate } from "./convert-item-to-template";
17
- import { createItemFromTemplate } from "./create-item-from-template";
18
- // Export the QuickCapture Helper module
19
- export { createItemFromTemplate, convertItemToTemplate };
20
- //# sourceMappingURL=quickcapture-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickcapture-helpers.js","sourceRoot":"","sources":["../../../src/helpers/quickcapture-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,wCAAwC;AACxC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,18 +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 { convertItemToTemplate } from "./convert-item-to-template";
17
- import { createItemFromTemplate } from "./create-item-from-template";
18
- export { createItemFromTemplate, convertItemToTemplate };
@@ -1,20 +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 { convertItemToTemplate } from "./convert-item-to-template";
17
- import { createItemFromTemplate } from "./create-item-from-template";
18
- // Export the simpleTypesHelper module
19
- export { createItemFromTemplate, convertItemToTemplate };
20
- //# sourceMappingURL=simple-type-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-type-helpers.js","sourceRoot":"","sources":["../../../src/helpers/simple-type-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,sCAAsC;AACtC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,17 +0,0 @@
1
- /** @license
2
- * Copyright 2020 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { UserSession } from "@esri/solution-common";
17
- export declare function updateNotebookData(itemId: string, data: any, authentication: UserSession): Promise<any>;
@@ -1,24 +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 { jsonToBlob, updateItem } from "@esri/solution-common";
17
- export function updateNotebookData(itemId, data, authentication) {
18
- const updateOptions = {
19
- id: itemId,
20
- data: jsonToBlob(data),
21
- };
22
- return updateItem(updateOptions, authentication);
23
- }
24
- //# sourceMappingURL=update-notebook-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-notebook-data.js","sourceRoot":"","sources":["../../../src/helpers/update-notebook-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAA4B,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEzF,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,IAAS,EAAE,cAA2B;IACvF,MAAM,aAAa,GAAgB;QACjC,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;KACvB,CAAC;IACF,OAAO,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AACnD,CAAC"}
@@ -1,27 +0,0 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Manages the creation and deployment of simple item types.
18
- *
19
- * @module simple-types
20
- */
21
- import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
22
- import * as notebookHelpers from "./helpers/notebook-helpers";
23
- import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
24
- import * as simpleTypes from "./simple-types";
25
- import * as notebookProcessor from "./notebook";
26
- import * as quickcaptureProcessor from "./quickcapture";
27
- export { simpleTypes, notebookProcessor, notebookHelpers, simpleTypeHelpers, quickcaptureHelpers, quickcaptureProcessor, };
package/dist/esm/index.js DELETED
@@ -1,28 +0,0 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Manages the creation and deployment of simple item types.
18
- *
19
- * @module simple-types
20
- */
21
- import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
22
- import * as notebookHelpers from "./helpers/notebook-helpers";
23
- import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
24
- import * as simpleTypes from "./simple-types";
25
- import * as notebookProcessor from "./notebook";
26
- import * as quickcaptureProcessor from "./quickcapture";
27
- export { simpleTypes, notebookProcessor, notebookHelpers, simpleTypeHelpers, quickcaptureHelpers, quickcaptureProcessor, };
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,iBAAiB,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,qBAAqB,MAAM,gBAAgB,CAAC;AAExD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GACtB,CAAC"}