@esri/solution-creator 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 (37) hide show
  1. package/package.json +15 -15
  2. package/dist/cjs/createItemTemplate.d.ts +0 -117
  3. package/dist/cjs/createItemTemplate.js +0 -484
  4. package/dist/cjs/createItemTemplate.js.map +0 -1
  5. package/dist/cjs/creator.d.ts +0 -107
  6. package/dist/cjs/creator.js +0 -374
  7. package/dist/cjs/creator.js.map +0 -1
  8. package/dist/cjs/helpers/add-content-to-solution.d.ts +0 -159
  9. package/dist/cjs/helpers/add-content-to-solution.js +0 -561
  10. package/dist/cjs/helpers/add-content-to-solution.js.map +0 -1
  11. package/dist/cjs/helpers/template.d.ts +0 -30
  12. package/dist/cjs/helpers/template.js +0 -49
  13. package/dist/cjs/helpers/template.js.map +0 -1
  14. package/dist/cjs/index.d.ts +0 -23
  15. package/dist/cjs/index.js +0 -27
  16. package/dist/cjs/index.js.map +0 -1
  17. package/dist/cjs/module-map.d.ts +0 -23
  18. package/dist/cjs/module-map.js +0 -234
  19. package/dist/cjs/module-map.js.map +0 -1
  20. package/dist/esm/createItemTemplate.d.ts +0 -117
  21. package/dist/esm/createItemTemplate.js +0 -471
  22. package/dist/esm/createItemTemplate.js.map +0 -1
  23. package/dist/esm/creator.d.ts +0 -107
  24. package/dist/esm/creator.js +0 -362
  25. package/dist/esm/creator.js.map +0 -1
  26. package/dist/esm/helpers/add-content-to-solution.d.ts +0 -159
  27. package/dist/esm/helpers/add-content-to-solution.js +0 -540
  28. package/dist/esm/helpers/add-content-to-solution.js.map +0 -1
  29. package/dist/esm/helpers/template.d.ts +0 -30
  30. package/dist/esm/helpers/template.js +0 -44
  31. package/dist/esm/helpers/template.js.map +0 -1
  32. package/dist/esm/index.d.ts +0 -23
  33. package/dist/esm/index.js +0 -24
  34. package/dist/esm/index.js.map +0 -1
  35. package/dist/esm/module-map.d.ts +0 -23
  36. package/dist/esm/module-map.js +0 -230
  37. package/dist/esm/module-map.js.map +0 -1
@@ -1,561 +0,0 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2020 Esri
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports._templatizeWorkflowConfig = exports._templatizeSolutionIds = exports._templatizeOrgUrl = exports._simplifyUrlsInItemDescriptions = exports._restoreDataFilesToTemplates = exports._replaceRemainingIdsInString = exports._replaceRemainingIdsInObject = exports._replaceDictionaryItemsInObject = exports._getDataFilesFromTemplates = exports._postProcessIgnoredItems = exports._postProcessGroupDependencies = exports._getTemplateVariables = exports._getSolutionItemUrls = exports._getOrgUrl = exports._getIdsOutOfTemplateVariables = exports._getDependencies = exports.addContentToSolution = void 0;
19
- const tslib_1 = require("tslib");
20
- const solution_common_1 = require("@esri/solution-common");
21
- const hub_common_1 = require("@esri/hub-common");
22
- const createItemTemplate_1 = require("../createItemTemplate");
23
- const form = tslib_1.__importStar(require("@esri/solution-form"));
24
- const template_1 = require("./template");
25
- const solution_simple_types_1 = require("@esri/solution-simple-types");
26
- const workflow = tslib_1.__importStar(require("@esri/solution-workflow"));
27
- // ------------------------------------------------------------------------------------------------------------------ //
28
- /**
29
- * Adds a list of AGO item ids to a solution item.
30
- *
31
- * @param solutionItemId AGO id of solution to receive items
32
- * @param options Customizations for creating the solution
33
- * @param srcAuthentication Credentials for requests to source items
34
- * @param destAuthentication Credentials for the requests to destination solution
35
- * @returns A promise that resolves with the AGO id of the updated solution
36
- * @internal
37
- */
38
- function addContentToSolution(solutionItemId, options, srcAuthentication, destAuthentication) {
39
- return new Promise((resolve, reject) => {
40
- if (!options.itemIds || options.itemIds.length === 0) {
41
- resolve(solutionItemId);
42
- return;
43
- }
44
- // Prepare feedback mechanism
45
- let totalEstimatedCost = 2 * options.itemIds.length + 1; // solution items, plus avoid divide by 0
46
- let percentDone = 16; // allow for previous creation work
47
- let progressPercentStep = (95 - percentDone) / totalEstimatedCost; // leave some % for caller for wrapup
48
- const failedItemIds = [];
49
- let totalExpended = 0;
50
- let statusOK = true;
51
- const itemProgressCallback = (itemId, status, costUsed) => {
52
- // ---------------------------------------------------------------------------------------------------------------
53
- if (options.itemIds.indexOf(itemId) < 0) {
54
- // New item--a dependency that wasn't in the supplied list of itemIds; add it to the list
55
- // and recalculate the progress percent step based on how much progress remains to be done
56
- options.itemIds.push(itemId);
57
- totalEstimatedCost += 2;
58
- progressPercentStep = (95 - percentDone) / (totalEstimatedCost - totalExpended);
59
- }
60
- totalExpended += costUsed;
61
- percentDone += progressPercentStep * costUsed;
62
- if (options.progressCallback) {
63
- options.progressCallback(Math.round(percentDone), options.jobId);
64
- }
65
- /* istanbul ignore if */
66
- if (options.consoleProgress) {
67
- console.log(Date.now(), itemId, options.jobId ?? "", solution_common_1.SItemProgressStatus[status], percentDone.toFixed(0) + "%", costUsed);
68
- }
69
- if (status === solution_common_1.EItemProgressStatus.Failed) {
70
- let error = "";
71
- solutionTemplates.some((t) => {
72
- /* istanbul ignore else */
73
- if (t.itemId === itemId) {
74
- /* istanbul ignore else */
75
- if ((0, hub_common_1.getProp)(t, "properties.error")) {
76
- error = t.properties.error;
77
- try {
78
- // parse for better console logging if we can
79
- error = JSON.parse(error);
80
- }
81
- catch (e) {
82
- /* istanbul ignore next */
83
- // do nothing and show the error as is
84
- }
85
- }
86
- return true;
87
- }
88
- });
89
- (0, solution_common_1.removeTemplate)(solutionTemplates, itemId);
90
- if (failedItemIds.indexOf(itemId) < 0) {
91
- failedItemIds.push(itemId);
92
- }
93
- statusOK = false;
94
- }
95
- else if (status === solution_common_1.EItemProgressStatus.Ignored) {
96
- (0, solution_common_1.removeTemplate)(solutionTemplates, itemId);
97
- }
98
- return statusOK;
99
- // ---------------------------------------------------------------------------------------------------------------
100
- };
101
- // Replacement dictionary and created templates
102
- const templateDictionary = options.templateDictionary ?? {};
103
- let solutionTemplates = [];
104
- // Handle a list of one or more AGO ids by stepping through the list
105
- // and calling this function recursively
106
- const getItemsPromise = [];
107
- options.itemIds.forEach((itemId) => {
108
- const createDef = (0, createItemTemplate_1.createItemTemplate)(solutionItemId, itemId, templateDictionary, srcAuthentication, destAuthentication, solutionTemplates, itemProgressCallback);
109
- getItemsPromise.push(createDef);
110
- });
111
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
112
- Promise.all(getItemsPromise).then(async (multipleResourceItemFiles) => {
113
- if (failedItemIds.length > 0) {
114
- reject((0, solution_common_1.failWithIds)(failedItemIds, "One or more items cannot be converted into templates"));
115
- }
116
- else {
117
- if (solutionTemplates.length > 0) {
118
- // Coalesce the resource file paths from the created templates
119
- let resourceItemFiles = multipleResourceItemFiles.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
120
- // test for and update group dependencies and other post-processing
121
- solutionTemplates = await form.postProcessFormItems(solutionTemplates, templateDictionary);
122
- solutionTemplates = workflow.postProcessFormItems(solutionTemplates);
123
- solutionTemplates = _postProcessGroupDependencies(solutionTemplates);
124
- solutionTemplates = (0, solution_common_1.postProcessWorkforceTemplates)(solutionTemplates);
125
- // Filter out any resources from items that have been removed from the templates, such as
126
- // Living Atlas layers
127
- solutionTemplates = _postProcessIgnoredItems(solutionTemplates, templateDictionary);
128
- const templateIds = solutionTemplates.map((template) => template.itemId);
129
- // check notebooks data for any item or group references
130
- solution_simple_types_1.notebookProcessor.postProcessNotebookTemplates(solutionTemplates, templateDictionary);
131
- solutionTemplates = (0, solution_common_1.postProcessWebToolReferences)(solutionTemplates, templateDictionary);
132
- // Extract resource data files from templates
133
- resourceItemFiles = resourceItemFiles.concat((0, template_1.getDataFilesFromTemplates)(solutionTemplates));
134
- // Coalesce the resource file paths from the created templates
135
- resourceItemFiles = resourceItemFiles.filter((file) => templateIds.includes(file.itemId));
136
- // Send the accumulated resources to the solution item
137
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
138
- (0, solution_common_1.copyFilesToStorageItem)(resourceItemFiles, solutionItemId, destAuthentication).then(() => {
139
- // Remove data files from templates--no longer needed
140
- (0, template_1.removeDataFilesFromTemplates)(solutionTemplates);
141
- _templatizeSolutionIds(solutionTemplates);
142
- _simplifyUrlsInItemDescriptions(solutionTemplates);
143
- solutionTemplates.forEach((template) => {
144
- if (template.type !== "Vector Tile Service") {
145
- _replaceDictionaryItemsInObject(templateDictionary, template);
146
- }
147
- });
148
- // Get the org's URL
149
- _getOrgUrl(destAuthentication).then((orgUrl) => {
150
- // Templatizes occurrences of the URL to the user's organization in the `item` and `data` template sections
151
- templateDictionary.portalBaseUrl = orgUrl;
152
- const solutionTemplates2 = _templatizeOrgUrl(solutionTemplates, orgUrl);
153
- // Templatize any references to AGO ids in the workflow configuration
154
- _templatizeWorkflowConfig(solutionTemplates, templateDictionary);
155
- // Update solution item with its data JSON
156
- const solutionData = {
157
- metadata: { version: solution_common_1.SolutionTemplateFormatVersion },
158
- templates: options.templatizeFields
159
- ? (0, createItemTemplate_1.postProcessFieldReferences)(solutionTemplates2)
160
- : solutionTemplates2,
161
- };
162
- const itemInfo = {
163
- id: solutionItemId,
164
- text: solutionData,
165
- };
166
- (0, solution_common_1.updateItem)(itemInfo, destAuthentication).then(() => {
167
- resolve(solutionItemId);
168
- }, reject);
169
- }, reject);
170
- });
171
- }
172
- else {
173
- resolve(solutionItemId);
174
- }
175
- }
176
- });
177
- });
178
- }
179
- exports.addContentToSolution = addContentToSolution;
180
- // ------------------------------------------------------------------------------------------------------------------ //
181
- /**
182
- * Gets the dependencies of an item by merging its dependencies list with item references in template variables.
183
- *
184
- * @param template Template to examine
185
- * @returns List of dependency ids
186
- * @private
187
- */
188
- function _getDependencies(template) {
189
- // Get all dependencies
190
- let deps = template.dependencies.concat(_getIdsOutOfTemplateVariables(_getTemplateVariables(JSON.stringify(template.data))));
191
- // Remove duplicates and self-references
192
- deps.sort();
193
- deps = deps.filter((elem, index, array) => {
194
- if (elem === template.itemId) {
195
- return false;
196
- }
197
- else if (index > 0) {
198
- return elem !== array[index - 1];
199
- }
200
- else {
201
- return true;
202
- }
203
- });
204
- return deps;
205
- }
206
- exports._getDependencies = _getDependencies;
207
- /**
208
- * Extracts AGO ids out of template variables.
209
- *
210
- * @param variables List of template variables to examine
211
- * @returns List of AGO ids referenced in `variables`
212
- * @private
213
- */
214
- function _getIdsOutOfTemplateVariables(variables) {
215
- return variables
216
- .map((variable) => {
217
- const idList = variable.match(/[0-9A-F]{32}/i); // is it a guid?
218
- if (idList) {
219
- return idList[0];
220
- }
221
- else {
222
- return null;
223
- }
224
- })
225
- .filter((variable) => !!variable);
226
- }
227
- exports._getIdsOutOfTemplateVariables = _getIdsOutOfTemplateVariables;
228
- /**
229
- * Fetches the organization's URL.
230
- *
231
- * @param destAuthentication Credentials for request organization info
232
- * @returns Promise resolving with the organization's URL
233
- * @private
234
- */
235
- async function _getOrgUrl(destAuthentication) {
236
- // Get the org's URL
237
- const org = await (0, solution_common_1.getPortal)(null, destAuthentication);
238
- const orgUrl = "https://" + org.urlKey + "." + org.customBaseUrl;
239
- return orgUrl;
240
- }
241
- exports._getOrgUrl = _getOrgUrl;
242
- /**
243
- * Creates a list of item URLs.
244
- *
245
- * @param templates Templates to check for URLs
246
- * @returns List of URLs
247
- * @private
248
- */
249
- function _getSolutionItemUrls(templates) {
250
- const solutionUrls = [];
251
- templates.forEach((template) => {
252
- /* istanbul ignore else */
253
- if (template.item.origUrl) {
254
- solutionUrls.push([template.itemId, template.item.origUrl]);
255
- }
256
- });
257
- return solutionUrls;
258
- }
259
- exports._getSolutionItemUrls = _getSolutionItemUrls;
260
- /**
261
- * Extracts template variables out of a string.
262
- *
263
- * @param text String to examine
264
- * @returns List of template variables found in string
265
- * @private
266
- */
267
- function _getTemplateVariables(text) {
268
- return (text.match(/{{[a-z0-9.]*}}/gi) || []) // find variable
269
- .map((variable) => variable.substring(2, variable.length - 2)); // remove "{{" & "}}"
270
- }
271
- exports._getTemplateVariables = _getTemplateVariables;
272
- /**
273
- * Update the items dependencies and groups arrays
274
- *
275
- * @param templates The array of templates to evaluate
276
- * @returns Updated version of the templates
277
- * @private
278
- */
279
- function _postProcessGroupDependencies(templates) {
280
- return templates.map((template) => {
281
- if (template.type === "Group") {
282
- const id = template.itemId;
283
- // remove group dependencies if we find a circular dependency with one of its items
284
- let removeDependencies = false;
285
- // before we remove update each dependants groups array
286
- template.dependencies.forEach((dependencyId) => {
287
- const dependantTemplate = (0, solution_common_1.getTemplateById)(templates, dependencyId);
288
- // Not all items shared to the group will exist in the templates array
289
- // i.e. Hub Initiative items or any other unsupported types
290
- if (dependantTemplate) {
291
- // check if the group is in the dependantTemplate's list of dependencies
292
- const gIndex = (0, hub_common_1.getWithDefault)(dependantTemplate, "dependencies", []).indexOf(id);
293
- /* istanbul ignore else */
294
- if (gIndex > -1) {
295
- removeDependencies = true;
296
- }
297
- // if the dependant template does not have the group id
298
- // in it's groups array, add it
299
- const groups = (0, hub_common_1.getWithDefault)(dependantTemplate, "groups", []);
300
- if (groups.indexOf(id) === -1) {
301
- groups.push(id);
302
- dependantTemplate.groups = groups;
303
- }
304
- }
305
- });
306
- if (removeDependencies) {
307
- template.dependencies = [];
308
- }
309
- }
310
- return template;
311
- });
312
- }
313
- exports._postProcessGroupDependencies = _postProcessGroupDependencies;
314
- /**
315
- * Check for feature service items that have been flagged for invalid designations.
316
- * Remove templates that have invalid designations from the solution item and other item dependencies.
317
- * Clean up any references to items with invalid designations in the other templates.
318
- *
319
- * @param templates The array of templates to evaluate
320
- * @param templateDictionary Hash of key details used for variable replacement
321
- * @returns Updated version of the templates
322
- * @private
323
- */
324
- function _postProcessIgnoredItems(templates, templateDictionary) {
325
- // replace in template
326
- const updateDictionary = templates.reduce((result, template) => {
327
- const invalidDes = template.properties.hasInvalidDesignations;
328
- const unreachableVal = (0, hub_common_1.getProp)(templateDictionary, `${solution_common_1.UNREACHABLE}.${template.itemId}`);
329
- if (invalidDes && unreachableVal && Object.keys(template.data).length < 1) {
330
- template.data[template.itemId] = unreachableVal;
331
- }
332
- return invalidDes ? Object.assign(result, template.data) : result;
333
- }, {});
334
- // adlib breaks Form data files, so we'll save any in the templates list so that we can restore them
335
- const dataFiles = _getDataFilesFromTemplates(templates);
336
- Object.keys(updateDictionary).forEach((k) => {
337
- (0, solution_common_1.removeTemplate)(templates, k);
338
- templates = templates.map((t) => {
339
- t.dependencies = t.dependencies.filter((id) => id !== k);
340
- return (0, solution_common_1.replaceInTemplate)(t, updateDictionary);
341
- });
342
- });
343
- // Restore the data files to the templates
344
- _restoreDataFilesToTemplates(templates, dataFiles);
345
- return templates;
346
- }
347
- exports._postProcessIgnoredItems = _postProcessIgnoredItems;
348
- /**
349
- * Retrieves the Form dataFiles from a list of templates and removes them from the templates.
350
- *
351
- * @param templates Templates to be scanned and have their `dataFile` property deleted
352
- * @returns List of Form dataFiles from the templates, which have their `dataFile` property removed;
353
- * the list is in the same order as the templates and has `undefined` for templates that don't have a dataFile
354
- */
355
- function _getDataFilesFromTemplates(templates) {
356
- return templates.reduce((acc, template) => {
357
- const dataFile = template.dataFile;
358
- delete template.dataFile;
359
- return acc.concat(dataFile);
360
- }, []);
361
- }
362
- exports._getDataFilesFromTemplates = _getDataFilesFromTemplates;
363
- /**
364
- * Recursively runs through an object to find and replace any strings found in a dictionary.
365
- *
366
- * @param templateDictionary Hash of things to be replaced
367
- * @param obj Object to be examined
368
- * @private
369
- */
370
- function _replaceDictionaryItemsInObject(hash, obj) {
371
- /* istanbul ignore else */
372
- if (obj) {
373
- Object.keys(obj).forEach((prop) => {
374
- const propObj = obj[prop];
375
- if (propObj) {
376
- if (typeof propObj === "object") {
377
- _replaceDictionaryItemsInObject(hash, propObj);
378
- }
379
- else if (typeof propObj === "string") {
380
- obj[prop] = hash[propObj] || propObj;
381
- }
382
- }
383
- });
384
- }
385
- return obj;
386
- }
387
- exports._replaceDictionaryItemsInObject = _replaceDictionaryItemsInObject;
388
- /**
389
- * Recursively runs through an object to find and templatize any remaining references to solution's items.
390
- *
391
- * @param ids Ids to be replaced in strings found in object
392
- * @param obj Object to be examined
393
- * @private
394
- */
395
- function _replaceRemainingIdsInObject(ids, obj) {
396
- /* istanbul ignore else */
397
- if (obj) {
398
- Object.keys(obj).forEach((prop) => {
399
- const propObj = obj[prop];
400
- if (propObj) {
401
- if (typeof propObj === "object") {
402
- _replaceRemainingIdsInObject(ids, propObj);
403
- }
404
- else if (typeof propObj === "string") {
405
- obj[prop] = _replaceRemainingIdsInString(ids, propObj);
406
- }
407
- }
408
- });
409
- }
410
- return obj;
411
- }
412
- exports._replaceRemainingIdsInObject = _replaceRemainingIdsInObject;
413
- /**
414
- * Templatizes ids from a list in a string if they're not already templatized.
415
- *
416
- * @param ids Ids to be replaced in source string
417
- * @param str Source string to be examined
418
- * @returns A copy of the source string with any templatization changes
419
- * @private
420
- */
421
- function _replaceRemainingIdsInString(ids, str) {
422
- let updatedStr = str;
423
- const untemplatizedIds = (0, solution_common_1.getIDs)(str);
424
- if (untemplatizedIds.length > 0) {
425
- untemplatizedIds.forEach((id) => {
426
- if (ids.includes(id)) {
427
- const re = new RegExp("({*)" + id, "gi");
428
- updatedStr = updatedStr.replace(re, (match) => match.indexOf("{{") < 0 ? "{{" + id.replace("{", "") + ".itemId}}" : match);
429
- }
430
- });
431
- }
432
- return updatedStr;
433
- }
434
- exports._replaceRemainingIdsInString = _replaceRemainingIdsInString;
435
- /**
436
- * Restores the Form dataFiles to the templates.
437
- *
438
- * @param templates Templates to be updated with the dataFiles; the `dataFile` property is added back to the templates
439
- * that originally had it
440
- * @param dataFiles List of Form dataFiles to be restored to the templates; the list is in the same order
441
- * as the templates and has `undefined` for templates that don't have a dataFile
442
- */
443
- function _restoreDataFilesToTemplates(templates, dataFiles) {
444
- templates.forEach((template, i) => {
445
- if (dataFiles[i]) {
446
- template.dataFile = dataFiles[i];
447
- }
448
- });
449
- }
450
- exports._restoreDataFilesToTemplates = _restoreDataFilesToTemplates;
451
- /**
452
- * Finds and templatizes any URLs in solution items' descriptions.
453
- *
454
- * @param templates The array of templates to evaluate, modified in place
455
- * @private
456
- */
457
- function _simplifyUrlsInItemDescriptions(templates) {
458
- // Get the urls in the solution along with their item ids & convert the id into the form
459
- // "{{fcb2bf2837a6404ebb418a1f805f976a.url}}"
460
- const solutionUrls = _getSolutionItemUrls(templates).map((idUrl) => ["{{" + idUrl[0] + ".url}}", idUrl[1]]);
461
- /* istanbul ignore else */
462
- if (solutionUrls.length > 0) {
463
- // Make the replacements
464
- templates.forEach((template) => {
465
- solutionUrls.forEach(
466
- // TypeScript for es2015 doesn't have a definition for `replaceAll`
467
- (idUrl) => {
468
- /* istanbul ignore else */
469
- if (template.item.description) {
470
- template.item.description = template.item.description.replaceAll(idUrl[1], idUrl[0]);
471
- }
472
- });
473
- });
474
- }
475
- }
476
- exports._simplifyUrlsInItemDescriptions = _simplifyUrlsInItemDescriptions;
477
- /**
478
- * Templatizes occurrences of the URL to the user's organization in the `item` and `data` template sections.
479
- *
480
- * @param templates The array of templates to evaluate; `templates` is modified in place
481
- * @param orgUrl The organization's URL
482
- * @returns Updated templates
483
- * @private
484
- */
485
- function _templatizeOrgUrl(templates, orgUrl) {
486
- const templatizedOrgUrl = "{{portalBaseUrl}}";
487
- // Cycle through each of the items in the template and scan the `item` and `data` sections of each for replacements
488
- templates.forEach((template) => {
489
- (0, solution_common_1.globalStringReplace)(template.item, new RegExp(orgUrl, "gi"), templatizedOrgUrl);
490
- (0, solution_common_1.globalStringReplace)(template.data, new RegExp(orgUrl, "gi"), templatizedOrgUrl);
491
- });
492
- // Handle encoded URLs
493
- orgUrl = orgUrl.replace("https://", "https%3A%2F%2F");
494
- // Cycle through each of the items in the template and scan the `data` sections of each for replacements
495
- templates.forEach((template) => {
496
- (0, solution_common_1.globalStringReplace)(template.data, new RegExp(orgUrl, "gi"), templatizedOrgUrl);
497
- });
498
- return templates;
499
- }
500
- exports._templatizeOrgUrl = _templatizeOrgUrl;
501
- /**
502
- * Finds and templatizes any references to solution's items.
503
- *
504
- * @param templates The array of templates to evaluate, modified in place
505
- * @private
506
- */
507
- function _templatizeSolutionIds(templates) {
508
- // Get the ids in the solution
509
- const solutionIds = templates.map((template) => template.itemId);
510
- // Cycle through each of the items in the template and
511
- // 1. templatize untemplatized ids in our solution in the `item` and `data` sections;
512
- // 2. update the `dependencies` section
513
- templates.forEach((template) => {
514
- _replaceRemainingIdsInObject(solutionIds, template.item);
515
- _replaceRemainingIdsInObject(solutionIds, template.data);
516
- /* istanbul ignore else */
517
- if (template.type !== "Group" && !(0, solution_common_1.isWorkforceProject)(template)) {
518
- template.dependencies = _getDependencies(template);
519
- }
520
- });
521
- }
522
- exports._templatizeSolutionIds = _templatizeSolutionIds;
523
- /**
524
- * Finds and templatizes any references to AGO ids in the workflow configuration.
525
- *
526
- * @param templates The array of templates whose workflow configurations are to be templatized; this array is
527
- * modified in place
528
- * @param templateDictionary Hash of key details used for variable replacement
529
- */
530
- function _templatizeWorkflowConfig(templates, templateDictionary) {
531
- // Cycle through each of the items in the template and templatize each workflow configuration
532
- templates.forEach((template) => {
533
- if (template.type === "Workflow") {
534
- let configStr = JSON.stringify(template.properties.configuration);
535
- const agoIdRegEx = (0, solution_common_1.getAgoIdRegEx)();
536
- const agoIdMatches = (0, solution_common_1.dedupe)(configStr.match(agoIdRegEx) ?? []);
537
- // Replace things that look like AGO ids in the file content with templates
538
- // iff they are present in the template dictionary
539
- agoIdMatches.forEach((match) => {
540
- const entry = templateDictionary[match];
541
- if (entry) {
542
- const matchRegExp = new RegExp(match, "g");
543
- // Only proceed if the match is in the configuration string
544
- if (matchRegExp.test(configStr)) {
545
- configStr = configStr.replace(matchRegExp, `{{${match}.itemId}}`);
546
- // Add the match as a dependency if it's not the template's id
547
- if (match !== template.itemId) {
548
- template.dependencies.push(match);
549
- }
550
- }
551
- }
552
- });
553
- // Replace the organization's URL in the configuration
554
- configStr = configStr.replace(new RegExp(`${templateDictionary.portalBaseUrl}`, "g"), "{{portalBaseUrl}}");
555
- // Update configuration
556
- template.properties.configuration = JSON.parse(configStr);
557
- }
558
- });
559
- }
560
- exports._templatizeWorkflowConfig = _templatizeWorkflowConfig;
561
- //# sourceMappingURL=add-content-to-solution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-content-to-solution.js","sourceRoot":"","sources":["../../../src/helpers/add-content-to-solution.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,2DA2B+B;AAC/B,iDAA2D;AAC3D,8DAAuF;AACvF,kEAA4C;AAC5C,yCAAqF;AACrF,uEAAgE;AAChE,0EAAoD;AAEpD,wHAAwH;AAExH;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAClC,cAAsB,EACtB,OAA+B,EAC/B,iBAA8B,EAC9B,kBAA+B;IAE/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YACpD,OAAO,CAAC,cAAc,CAAC,CAAC;YACxB,OAAO;SACR;QAED,6BAA6B;QAC7B,IAAI,kBAAkB,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,yCAAyC;QAClG,IAAI,WAAW,GAAW,EAAE,CAAC,CAAC,mCAAmC;QACjE,IAAI,mBAAmB,GAAG,CAAC,EAAE,GAAG,WAAW,CAAC,GAAG,kBAAkB,CAAC,CAAC,qCAAqC;QAExG,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,IAAI,QAAQ,GA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1
- /** @license
2
- * Copyright 2022 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 { IItemTemplate, ISourceFile } from "@esri/solution-common";
17
- /**
18
- * Extracts resource data files from templates.
19
- *
20
- * @param templates List of templates to examine
21
- *
22
- * @return List of resource data files found in supplied templates
23
- */
24
- export declare function getDataFilesFromTemplates(templates: IItemTemplate[]): ISourceFile[];
25
- /**
26
- * Removes data files from templates.
27
- *
28
- * @param templates List of templates to modify
29
- */
30
- export declare function removeDataFilesFromTemplates(templates: IItemTemplate[]): void;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2022 Esri
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.removeDataFilesFromTemplates = exports.getDataFilesFromTemplates = void 0;
19
- /**
20
- * Extracts resource data files from templates.
21
- *
22
- * @param templates List of templates to examine
23
- *
24
- * @return List of resource data files found in supplied templates
25
- */
26
- function getDataFilesFromTemplates(templates) {
27
- const resourceItemFiles = [];
28
- templates.forEach((template) => {
29
- if (template.dataFile) {
30
- resourceItemFiles.push(template.dataFile);
31
- }
32
- });
33
- return resourceItemFiles;
34
- }
35
- exports.getDataFilesFromTemplates = getDataFilesFromTemplates;
36
- /**
37
- * Removes data files from templates.
38
- *
39
- * @param templates List of templates to modify
40
- */
41
- function removeDataFilesFromTemplates(templates) {
42
- templates.forEach((template) => {
43
- if (template.dataFile) {
44
- delete template.dataFile;
45
- }
46
- });
47
- }
48
- exports.removeDataFilesFromTemplates = removeDataFilesFromTemplates;
49
- //# sourceMappingURL=template.js.map