@esri/solution-velocity 5.2.3 → 5.2.4

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.
@@ -0,0 +1,572 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2021 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._updateName = exports._removeProp = exports._removeIdPropsAndSetName = exports._removeIdProps = exports.cleanDataSourcesAndFeeds = exports._fetch = exports._getRequestOpts = exports.start = exports.validate = exports._validateAndStart = exports.getUniqueTitle = exports._getOutputLabel = exports._updateDataOutput = exports._updateFeed = exports._validateMessages = exports._validateOutputs = exports.getTitle = exports.postVelocityData = exports.getVelocityUrl = void 0;
19
+ const solution_common_1 = require("@esri/solution-common");
20
+ /**
21
+ * Common function to build urls for reading and interacting with the velocity api
22
+ *
23
+ *
24
+ * @param authentication Credentials for the requests
25
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
26
+ * @param type The type of velocity item we are constructing a url for
27
+ * @param id Optional The id of the velocity item we are constructing a url for
28
+ * @param isDeploy Optional Is this being constructed as a part of deployment
29
+ * @param urlPrefix Optional prefix args necessary for some url construction
30
+ * @param urlSuffix Optional suffix args necessary for some url construction
31
+ *
32
+ * @returns a promise that will resolve the constructed url
33
+ *
34
+ */
35
+ function getVelocityUrl(authentication, templateDictionary, type, id = "", isDeploy = false, urlPrefix = "", urlSuffix = "") {
36
+ return (0, solution_common_1.getVelocityUrlBase)(authentication, templateDictionary).then(url => {
37
+ if (url) {
38
+ const _type = type === "Real Time Analytic"
39
+ ? "analytics/realtime"
40
+ : type === "Big Data Analytic"
41
+ ? "analytics/bigdata"
42
+ : type.toLowerCase();
43
+ const suffix = urlSuffix ? `/${urlSuffix}` : "";
44
+ const prefix = urlPrefix ? `/${urlPrefix}` : "";
45
+ return Promise.resolve(isDeploy
46
+ ? `${url}/iot/${_type}${prefix}${suffix}`
47
+ : id
48
+ ? `${url}/iot/${_type}${prefix}/${id}${suffix}/?f=json&token=${authentication.token}`
49
+ : `${url}/iot/${_type}${prefix}${suffix}/?f=json&token=${authentication.token}`);
50
+ }
51
+ else {
52
+ return Promise.resolve(url);
53
+ }
54
+ });
55
+ }
56
+ exports.getVelocityUrl = getVelocityUrl;
57
+ /**
58
+ * Handles the creation of velocity items.
59
+ *
60
+ * @param authentication Credentials for the requests
61
+ * @param template The current itemTemplate that is being used for deployment
62
+ * @param data The velocity item data used to create the items.
63
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
64
+ * @param autoStart This can be leveraged to start certain velocity items after they are created.
65
+ *
66
+ * @returns a promise that will resolve an object containing the item, id, type, and post process flag
67
+ *
68
+ */
69
+ function postVelocityData(authentication, template, data, templateDictionary, autoStart = false) {
70
+ return getVelocityUrl(authentication, templateDictionary, template.type, undefined, true).then(url => {
71
+ if (url) {
72
+ return getTitle(authentication, data.label, url).then((titleInfo) => {
73
+ const titles = titleInfo.titles;
74
+ data.label = titleInfo.label;
75
+ data.id = "";
76
+ const body = (0, solution_common_1.replaceInTemplate)(data, templateDictionary);
77
+ const dataOutputs = (data.outputs ? data.outputs : data.output ? [data.output] : []).map((o) => {
78
+ return {
79
+ id: o.id,
80
+ name: o.properties[`${o.name}.name`]
81
+ };
82
+ });
83
+ const feeds = (body.feeds ? body.feeds : body.feed ? [body.feed] : []).map((o) => {
84
+ return {
85
+ id: o.id ? o.id : o.properties[`${o.name}.portalItemId`] || "",
86
+ name: o.label ? o.label : data.label
87
+ };
88
+ });
89
+ return _validateOutputs(authentication, templateDictionary, template.type, body, titles, dataOutputs, feeds).then(updatedBody => {
90
+ return _fetch(authentication, url, "POST", updatedBody).then(rr => {
91
+ template.item.url = `${url}/${rr.id}`;
92
+ template.item.title = data.label;
93
+ // Update the template dictionary
94
+ templateDictionary[template.itemId]["url"] = template.item.url;
95
+ templateDictionary[template.itemId]["label"] = data.label;
96
+ templateDictionary[template.itemId]["itemId"] = rr.id;
97
+ const finalResult = {
98
+ item: (0, solution_common_1.replaceInTemplate)(template.item, templateDictionary),
99
+ id: rr.id,
100
+ type: template.type,
101
+ postProcess: false
102
+ };
103
+ if (autoStart) {
104
+ return _validateAndStart(authentication, templateDictionary, template, rr.id).then(() => {
105
+ return Promise.resolve(finalResult);
106
+ });
107
+ }
108
+ else {
109
+ return Promise.resolve(finalResult);
110
+ }
111
+ });
112
+ });
113
+ });
114
+ }
115
+ else {
116
+ return Promise.reject((0, solution_common_1.fail)("Velocity NOT Supported by Organization"));
117
+ }
118
+ });
119
+ }
120
+ exports.postVelocityData = postVelocityData;
121
+ /**
122
+ * Velocity item titles must be unique across the organization.
123
+ * Check and ensure we set a unique title
124
+ *
125
+ * @param authentication Credentials for the requests
126
+ * @param label The current label of the item from the solution template
127
+ * @param url The base velocity url for checking status
128
+ *
129
+ * @returns a promise that will resolve a unique title
130
+ *
131
+ */
132
+ function getTitle(authentication, label, url) {
133
+ return _fetch(authentication, `${url}StatusList?view=admin`, "GET").then(items => {
134
+ const titles = items && Array.isArray(items)
135
+ ? items.map(item => {
136
+ return { title: item.label };
137
+ })
138
+ : [];
139
+ return Promise.resolve({ label: getUniqueTitle(label, { titles }, "titles"), titles: titles.map(t => t.title) });
140
+ });
141
+ }
142
+ exports.getTitle = getTitle;
143
+ /**
144
+ * Validate the data that will be used and handle any reported issues with the outputs.
145
+ * The output names must be unique across the organization.
146
+ *
147
+ * This function will update the data arg that is passed in with a unique name.
148
+ *
149
+ * @param authentication Credentials for the requests
150
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
151
+ * @param type The type of velocity item
152
+ * @param data The data used to construct the velocity item
153
+ * @param titles The list of know titles that exist in the org
154
+ * @param dataOutputs The velocity items output objects
155
+ * @param feeds The velocity items feed objects
156
+ *
157
+ * @returns a promise that will resolve the data object passed in with any necessary changes.
158
+ *
159
+ * @private
160
+ */
161
+ function _validateOutputs(authentication, templateDictionary, type, data, titles, dataOutputs = [], feeds = []) {
162
+ if (dataOutputs.length > 0 || feeds.length > 0) {
163
+ return validate(authentication, templateDictionary, type, "", data).then((validateResults) => {
164
+ const names = _validateMessages(validateResults);
165
+ if (names.length > 0) {
166
+ /* istanbul ignore else */
167
+ if (dataOutputs.length > 0) {
168
+ _updateDataOutput(dataOutputs, data, names);
169
+ }
170
+ /* istanbul ignore else */
171
+ if (feeds.length > 0) {
172
+ _updateFeed(feeds, data, names.concat(titles));
173
+ }
174
+ return _validateOutputs(authentication, templateDictionary, type, data, titles, dataOutputs, feeds);
175
+ }
176
+ else {
177
+ return Promise.resolve(data);
178
+ }
179
+ });
180
+ }
181
+ else {
182
+ return Promise.resolve(data);
183
+ }
184
+ }
185
+ exports._validateOutputs = _validateOutputs;
186
+ /**
187
+ * Check the validate results for any name conflicts and store the conflicting names.
188
+ *
189
+ * @param validateResults The results object to check for name conflict errors
190
+ *
191
+ * @returns a list of names that already exist in the org
192
+ *
193
+ * @private
194
+ */
195
+ function _validateMessages(validateResults) {
196
+ let messages = (0, solution_common_1.getProp)(validateResults, "validation.messages");
197
+ const nodes = (0, solution_common_1.getProp)(validateResults, "nodes");
198
+ /* istanbul ignore else */
199
+ if (nodes && Array.isArray(nodes)) {
200
+ nodes.forEach(node => {
201
+ messages = messages.concat((0, solution_common_1.getProp)(node, "validation.messages") || []);
202
+ });
203
+ }
204
+ let names = [];
205
+ /* istanbul ignore else */
206
+ if (messages && Array.isArray(messages)) {
207
+ messages.forEach(message => {
208
+ // I don't see a way to ask for all output names that exist
209
+ // velocityUrl + /outputs/ just gives you generic defaults not what currently exists
210
+ const nameErrors = [
211
+ "VALIDATION_ANALYTICS__MULTIPLE_CREATE_FEATURE_LAYER_OUTPUTS_REFERENCE_SAME_LAYER_NAME",
212
+ "VALIDATION_ANALYTICS__MULTIPLE_CREATE_STREAM_LAYER_OUTPUTS_REFERENCE_SAME_LAYER_NAME",
213
+ "ITEM_MANAGER__CREATE_ANALYTIC_FAILED_DUPLICATE_OUTPUT_NAMES_IN_ORGANIZATION_NOT_ALLOWED",
214
+ "ITEM_MANAGER__CREATE_BIG_DATA_ANALYTIC_FAILED_DUPLICATE_NAMES_NOT_ALLOWED",
215
+ "ITEM_MANAGER__CREATE_REAL_TIME_ANALYTIC_FAILED_DUPLICATE_NAMES_NOT_ALLOWED",
216
+ "ITEM_MANAGER__CREATE_FEED_FAILED_DUPLICATE_NAME"
217
+ ];
218
+ // The names returned here seem to replace " " with "_" so they do not match exactly
219
+ /* istanbul ignore else */
220
+ if (nameErrors.indexOf(message.key) > -1) {
221
+ names = names.concat(message.args);
222
+ }
223
+ });
224
+ }
225
+ return names;
226
+ }
227
+ exports._validateMessages = _validateMessages;
228
+ /**
229
+ * Updates the feed object with a new name when validation fails.
230
+ *
231
+ * @param feeds The feed objects from the velocity item.
232
+ * @param data The full data object used for deploying the velocity item.
233
+ * @param names The names that failed due to duplicate error in validation.
234
+ *
235
+ * @private
236
+ */
237
+ function _updateFeed(feeds, data, names) {
238
+ feeds.forEach(f => {
239
+ const update = _getOutputLabel(names, f);
240
+ /* istanbul ignore else */
241
+ if (update) {
242
+ data.label = update.label;
243
+ f.name = update.label;
244
+ }
245
+ });
246
+ }
247
+ exports._updateFeed = _updateFeed;
248
+ /**
249
+ * Updates the data object with a new name when validation fails.
250
+ *
251
+ * @param dataOutputs The data output objects from the velocity item.
252
+ * @param data The full data object used for deploying the velocity item.
253
+ * @param names The names that failed due to duplicate error in validation.
254
+ *
255
+ * @private
256
+ */
257
+ function _updateDataOutput(dataOutputs, data, names) {
258
+ dataOutputs.forEach(dataOutput => {
259
+ const update = _getOutputLabel(names, dataOutput);
260
+ /* istanbul ignore else */
261
+ if (update) {
262
+ const _outputs = (data.outputs ? data.outputs : data.output ? [data.output] : []).map((_dataOutput) => {
263
+ /* istanbul ignore else */
264
+ if (_dataOutput.id === update.id) {
265
+ /* istanbul ignore else */
266
+ if (_dataOutput.properties) {
267
+ const nameProp = `${_dataOutput.name}.name`;
268
+ /* istanbul ignore else */
269
+ if (Object.keys(_dataOutput.properties).indexOf(nameProp) > -1) {
270
+ _dataOutput.properties[nameProp] = update.label;
271
+ }
272
+ }
273
+ }
274
+ return _dataOutput;
275
+ });
276
+ /* istanbul ignore else */
277
+ if (data.outputs) {
278
+ data.outputs = _outputs;
279
+ }
280
+ /* istanbul ignore else */
281
+ if (data.output) {
282
+ data.output = _outputs[0];
283
+ }
284
+ }
285
+ });
286
+ }
287
+ exports._updateDataOutput = _updateDataOutput;
288
+ /**
289
+ * Get a unique label for the item.
290
+ *
291
+ * @param names The names that failed due to duplicate error in validation.
292
+ * @param dataOutput The current data output that is being evaluated.
293
+ *
294
+ * @returns an object with a unique label and the outputs id when a name
295
+ * conflict is found...otherwise returns undefined
296
+ *
297
+ * @private
298
+ */
299
+ function _getOutputLabel(names, dataOutput) {
300
+ const titles = names.map((name) => {
301
+ return { title: name };
302
+ });
303
+ const label = getUniqueTitle(dataOutput.name, { titles }, "titles");
304
+ return label !== dataOutput.name
305
+ ? {
306
+ label,
307
+ id: dataOutput.id
308
+ }
309
+ : undefined;
310
+ }
311
+ exports._getOutputLabel = _getOutputLabel;
312
+ /**
313
+ * Will return the provided title if it does not exist as a property
314
+ * in one of the objects at the defined path. Otherwise the title will
315
+ * have a numerical value attached.
316
+ *
317
+ * This is based on "getUniqueTitle" from common but adds the "_" replacement check for velocity names.
318
+ * Could switch to using common if Velocity has a way to get a list of all names that are already used.
319
+ *
320
+ * @param title The root title to test
321
+ * @param templateDictionary Hash of the facts
322
+ * @param path to the objects to evaluate for potantial name clashes
323
+ *
324
+ * @returns string The unique title to use
325
+ *
326
+ */
327
+ function getUniqueTitle(title, templateDictionary, path) {
328
+ title = title ? title.trim() : "_";
329
+ const objs = (0, solution_common_1.getProp)(templateDictionary, path) || [];
330
+ const titles = objs.map(obj => {
331
+ return obj.title;
332
+ });
333
+ let newTitle = title;
334
+ let i = 0;
335
+ // replace added for velocitcy
336
+ // validation seems to add "_" to names listed in outputs..so no way to compare without hacking the name
337
+ while (titles.indexOf(newTitle) > -1 ||
338
+ titles.indexOf(newTitle.replace(/ /g, "_")) > -1) {
339
+ i++;
340
+ newTitle = title + " " + i;
341
+ }
342
+ return newTitle;
343
+ }
344
+ exports.getUniqueTitle = getUniqueTitle;
345
+ /**
346
+ * Start the item if validation passes and the item is executable.
347
+ *
348
+ * @param authentication Credentials for the requests
349
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
350
+ * @param template the item template that has the details for deployment
351
+ * @param id the new id for the velocity item that was deployed
352
+ *
353
+ * @returns a promise that will resolve with the validation results
354
+ * or the start results when validation indicates the item is executable
355
+ *
356
+ * @private
357
+ */
358
+ function _validateAndStart(authentication, templateDictionary, template, id) {
359
+ return validate(authentication, templateDictionary, template.type, id).then(validateResult => {
360
+ if (validateResult.executable) {
361
+ return start(authentication, templateDictionary, template.type, id);
362
+ }
363
+ else {
364
+ return Promise.resolve(validateResult);
365
+ }
366
+ });
367
+ }
368
+ exports._validateAndStart = _validateAndStart;
369
+ /**
370
+ * Validate the velocity item.
371
+ * Used to help find and handle duplicate name errors.
372
+ *
373
+ * @param authentication Credentials for the requests
374
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
375
+ * @param type The type of velocity item we are constructing a url for
376
+ * @param id? Optional The id of the velocity item we are constructing a url for
377
+ * @param body? Optional the request body to validate.
378
+ *
379
+ * @returns a promise that will resolve with an object containing messages
380
+ * indicating any issues found when validating such as name conflict errors
381
+ *
382
+ */
383
+ function validate(authentication, templateDictionary, type, id, body) {
384
+ // /iot/feed/validate/{id}/
385
+ // /iot/analytics/realtime/validate/{id}/
386
+ return getVelocityUrl(authentication, templateDictionary, type, id, false, "validate", "").then(url => {
387
+ return _fetch(authentication, url, "POST", body).then(result => {
388
+ return Promise.resolve(result);
389
+ });
390
+ });
391
+ }
392
+ exports.validate = validate;
393
+ /**
394
+ * Start the given velocity item that has been deployed.
395
+ *
396
+ * @param authentication Credentials for the requests
397
+ * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
398
+ * @param type The type of velocity item we are constructing a url for
399
+ * @param id? Optional The id of the velocity item we are constructing a url for
400
+ *
401
+ * @returns a promise that will resolve with the result of the start call
402
+ *
403
+ */
404
+ function start(authentication, templateDictionary, type, id) {
405
+ // /iot/feed/{id}/start/
406
+ // /iot/analytics/realtime/{id}/start/
407
+ return getVelocityUrl(authentication, templateDictionary, type, id, false, "", "start").then(url => {
408
+ return _fetch(authentication, url, "GET").then(result => {
409
+ return Promise.resolve(result);
410
+ });
411
+ });
412
+ }
413
+ exports.start = start;
414
+ /**
415
+ * Gets the required request options for requests to the velocity API.
416
+ *
417
+ * @param authentication Credentials for the requests
418
+ * @param method Indicate if "GET" or "POST"
419
+ *
420
+ * @returns generic request options used for various calls to velocity api
421
+ *
422
+ * @private
423
+ */
424
+ function _getRequestOpts(authentication, method) {
425
+ return {
426
+ headers: {
427
+ Accept: "application/json",
428
+ "Content-Type": "application/json",
429
+ Authorization: "token=" + authentication.token
430
+ },
431
+ method
432
+ };
433
+ }
434
+ exports._getRequestOpts = _getRequestOpts;
435
+ /**
436
+ * Generic fetch function for making calls to the velocity API.
437
+ *
438
+ * @param authentication Credentials for the requests
439
+ * @param url The url from the velocity API to handle reading and writing
440
+ * @param method The method for the request "GET" or "POST"
441
+ * @param body The body for POST requests
442
+ *
443
+ * @returns a promise that will resolve with the result of the fetch call
444
+ *
445
+ * @private
446
+ */
447
+ function _fetch(authentication, url, method, // GET or POST
448
+ body) {
449
+ const requestOpts = _getRequestOpts(authentication, method);
450
+ /* istanbul ignore else */
451
+ if (body) {
452
+ requestOpts.body = JSON.stringify(body);
453
+ }
454
+ return fetch(url, requestOpts).then(r => Promise.resolve(r.json()));
455
+ }
456
+ exports._fetch = _fetch;
457
+ /**
458
+ * Remove key properties if the dependency was removed due to having the "IoTFeatureLayer" typeKeyword
459
+ * This function will update the input template.
460
+ *
461
+ * @param template The template that for the velocity item
462
+ *
463
+ */
464
+ function cleanDataSourcesAndFeeds(template, velocityUrl) {
465
+ const dependencies = template.dependencies;
466
+ [
467
+ (0, solution_common_1.getProp)(template, "data.sources") ? template.data.sources : [],
468
+ (0, solution_common_1.getProp)(template, "data.source") ? [template.data.source] : [],
469
+ (0, solution_common_1.getProp)(template, "data.feeds") ? template.data.feeds : [],
470
+ (0, solution_common_1.getProp)(template, "data.feed") ? [template.data.feed] : []
471
+ ].forEach(d => _removeIdProps(d, dependencies, velocityUrl));
472
+ [
473
+ (0, solution_common_1.getProp)(template, "data.outputs") ? template.data.outputs : [],
474
+ (0, solution_common_1.getProp)(template, "data.output") ? [template.data.output] : []
475
+ ].forEach(outputs => _removeIdPropsAndSetName(outputs, dependencies));
476
+ }
477
+ exports.cleanDataSourcesAndFeeds = cleanDataSourcesAndFeeds;
478
+ /**
479
+ * Remove key properties from the input source or feed
480
+ *
481
+ * @param sourcesOrFeeds The list of dataSources or feeds
482
+ * @param dependencies The list of dependencies
483
+ *
484
+ * @private
485
+ */
486
+ function _removeIdProps(sourcesOrFeeds, dependencies, velocityUrl) {
487
+ sourcesOrFeeds.forEach(dataSource => {
488
+ const idProp = "feature-layer.portalItemId";
489
+ const layerIdProp = "feature-layer.layerId";
490
+ /* istanbul ignore else */
491
+ if (dataSource.properties) {
492
+ /* istanbul ignore else */
493
+ if (dataSource.properties[idProp]) {
494
+ const id = dataSource.properties[idProp];
495
+ /* istanbul ignore else */
496
+ if (id && dependencies.indexOf(id) < 0) {
497
+ delete dataSource.properties[idProp];
498
+ delete dataSource.properties[layerIdProp];
499
+ }
500
+ }
501
+ const urlProp = "simulator.url";
502
+ const url = dataSource.properties[urlProp];
503
+ // only remove velocity based simulator urls
504
+ // otherwise we will leave as is with no templatization
505
+ /* istanbul ignore else */
506
+ if (url && url.indexOf(velocityUrl) > -1) {
507
+ delete dataSource.properties[urlProp];
508
+ }
509
+ }
510
+ });
511
+ }
512
+ exports._removeIdProps = _removeIdProps;
513
+ /**
514
+ * Remove key properties from the outputs.
515
+ *
516
+ * @param outputs The list of outputs
517
+ * @param dependencies The list of dependencies
518
+ *
519
+ * @private
520
+ */
521
+ function _removeIdPropsAndSetName(outputs, dependencies) {
522
+ outputs.forEach(output => {
523
+ /* istanbul ignore else */
524
+ if (output.properties) {
525
+ const names = (0, solution_common_1.getProp)(output, "name") ? [output.name] : solution_common_1.BASE_NAMES;
526
+ names.forEach(n => {
527
+ solution_common_1.PROP_NAMES.forEach(p => _removeProp(output.properties, n + p, dependencies));
528
+ });
529
+ _updateName(output.properties);
530
+ }
531
+ });
532
+ }
533
+ exports._removeIdPropsAndSetName = _removeIdPropsAndSetName;
534
+ /**
535
+ * Generic helper function to remove key properties .
536
+ *
537
+ * @param props the list of props to update
538
+ * @param prop the individual prop to remove
539
+ * @param dependencies The list of dependencies
540
+ *
541
+ * @private
542
+ */
543
+ function _removeProp(props, prop, dependencies) {
544
+ const id = props[prop];
545
+ /* istanbul ignore else */
546
+ if (id && dependencies.indexOf(id) < 0) {
547
+ delete props[prop];
548
+ }
549
+ }
550
+ exports._removeProp = _removeProp;
551
+ /**
552
+ * Update the feature layer name to include the solution item id.
553
+ *
554
+ * @param props the list of props to update
555
+ *
556
+ * @private
557
+ */
558
+ function _updateName(props) {
559
+ [
560
+ "feat-lyr-new.name",
561
+ "stream-lyr-new.name",
562
+ "feat-lyr-existing.name"
563
+ ].forEach(n => {
564
+ const name = props[n];
565
+ /* istanbul ignore else */
566
+ if (name && name.indexOf("{{solutionItemId}}") < 0) {
567
+ props[n] = `${name}_{{solutionItemId}}`;
568
+ }
569
+ });
570
+ }
571
+ exports._updateName = _updateName;
572
+ //# sourceMappingURL=velocity-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"velocity-helpers.js","sourceRoot":"","sources":["../../../src/helpers/velocity-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAU+B;AAE/B;;;;;;;;;;;;;;GAcG;AACH,SAAgB,cAAc,CAC5B,cAA2B,EAC3B,kBAAuB,EACvB,IAAY,EACZ,KAAa,EAAE,EACf,WAAoB,KAAK,EACzB,YAAoB,EAAE,EACtB,YAAoB,EAAE;IAEtB,OAAO,IAAA,oCAAkB,EAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACvE,IAAI,GAAG,EAAE;YACP,MAAM,KAAK,GACT,IAAI,KAAK,oBAAoB;gBAC3B,CAAC,CAAC,oBAAoB;gBACtB,CAAC,CAAC,IAAI,KAAK,mBAAmB;oBAC9B,CAAC,CAAC,mBAAmB;oBACrB,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAEzB,MAAM,MAAM,GAAW,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,MAAM,MAAM,GAAW,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAExD,OAAO,OAAO,CAAC,OAAO,CACpB,QAAQ;gBACN,CAAC,CAAC,GAAG,GAAG,QAAQ,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE;gBACzC,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,GAAG,GAAG,QAAQ,KAAK,GAAG,MAAM,IAAI,EAAE,GAAG,MAAM,kBAAkB,cAAc,CAAC,KAAK,EAAE;oBACrF,CAAC,CAAC,GAAG,GAAG,QAAQ,KAAK,GAAG,MAAM,GAAG,MAAM,kBAAkB,cAAc,CAAC,KAAK,EAAE,CAClF,CAAC;SACH;aAAM;YACL,OAAO,OAAO,CA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E,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBAChB,4BAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;YAC/E,CAAC,CAAC,CAAC;YAEH,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;SAChC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAfD,4DAeC;AAED;;;;;;;;GAQG;AACH,SAAgB,WAAW,CACzB,KAAU,EACV,IAAY,EACZ,YAAsB;IAEtB,MAAM,EAAE,GAAW,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,0BAA0B;IAC1B,IAAI,EAAE,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;QACtC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;KACpB;AACH,CAAC;AAVD,kCAUC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,KAAU;IACpC;QACE,mBAAmB;QACnB,qBAAqB;QACrB,wBAAwB;KACzB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACZ,MAAM,IAAI,GAAW,KAAK,CAAC,CAAC,CAAC,CAAC;QAC9B,0BAA0B;QAC1B,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE;YAClD,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,qBAAqB,CAAC;SACzC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAZD,kCAYC"}
@@ -0,0 +1,71 @@
1
+ /** @license
2
+ * Copyright 2021 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 } from "@esri/solution-common";
17
+ /**
18
+ * Updates the template by adding variables for key properties that will
19
+ * need to be swapped when deploying
20
+ *
21
+ * @param template velocity item info that should be templatized
22
+ *
23
+ * @returns void
24
+ *
25
+ */
26
+ export declare function templatizeVelocity(template: IItemTemplate): void;
27
+ /**
28
+ * Generic wrapper for the templatize functions that
29
+ * will get and set the key properties
30
+ *
31
+ * @param template velocity item info that should be templatized
32
+ * @param prop the prop path to evaluate and set with a templatized variable
33
+ * @param fn the templatize function that should be called for this prop
34
+ *
35
+ * @returns void
36
+ *
37
+ * @private
38
+ */
39
+ export declare function _templatize(template: IItemTemplate, prop: string, fn: (arg: any) => void): void;
40
+ /**
41
+ * Updates the template by adding variables for the itemId and the label
42
+ * The label controls the name and must be unique for the org.
43
+ *
44
+ * @param feeds array of velocity feeds that should be templatized
45
+ *
46
+ * @returns The updated list of feed objects with templatized id and label
47
+ *
48
+ * @private
49
+ */
50
+ export declare function _templatizeFeeds(feeds: any[]): any;
51
+ /**
52
+ * Updates the portal item id and feature layer id variables for the feed properties.
53
+ *
54
+ * @param feed the feed object from the item
55
+ *
56
+ * @returns the updated feed object with templatized portalItemId and layer id
57
+ *
58
+ * @private
59
+ */
60
+ export declare function _templatizeFeed(feed: any): any;
61
+ /**
62
+ * Velocity datasources share the same props as feeds so they can leverage
63
+ * the same templatize function
64
+ *
65
+ * @param dataSources array of data sources from the item
66
+ *
67
+ * @returns the updated dataSources object with templatized ids and labels
68
+ *
69
+ * @private
70
+ */
71
+ export declare function _templatizeDatasources(dataSources: any[]): any;