@esri/solution-velocity 1.3.10 → 1.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/helpers/get-velocity-dependencies.d.ts +5 -2
- package/dist/esm/helpers/get-velocity-dependencies.js +5 -2
- package/dist/esm/helpers/get-velocity-dependencies.js.map +1 -1
- package/dist/esm/helpers/velocity-helpers.d.ts +24 -13
- package/dist/esm/helpers/velocity-helpers.js +24 -13
- package/dist/esm/helpers/velocity-helpers.js.map +1 -1
- package/dist/esm/helpers/velocity-templatize.d.ts +9 -5
- package/dist/esm/helpers/velocity-templatize.js +9 -5
- package/dist/esm/helpers/velocity-templatize.js.map +1 -1
- package/dist/esm/velocity-processor.d.ts +2 -2
- package/dist/esm/velocity-processor.js +2 -2
- package/dist/node/helpers/get-velocity-dependencies.d.ts +5 -2
- package/dist/node/helpers/get-velocity-dependencies.js +5 -2
- package/dist/node/helpers/get-velocity-dependencies.js.map +1 -1
- package/dist/node/helpers/velocity-helpers.d.ts +24 -13
- package/dist/node/helpers/velocity-helpers.js +24 -13
- package/dist/node/helpers/velocity-helpers.js.map +1 -1
- package/dist/node/helpers/velocity-templatize.d.ts +9 -5
- package/dist/node/helpers/velocity-templatize.js +9 -5
- package/dist/node/helpers/velocity-templatize.js.map +1 -1
- package/dist/node/velocity-processor.d.ts +2 -2
- package/dist/node/velocity-processor.js +2 -2
- package/dist/umd/helpers/get-velocity-dependencies.d.ts +5 -2
- package/dist/umd/helpers/velocity-helpers.d.ts +24 -13
- package/dist/umd/helpers/velocity-templatize.d.ts +9 -5
- package/dist/umd/velocity-processor.d.ts +2 -2
- package/dist/umd/velocity.umd.js +42 -24
- package/dist/umd/velocity.umd.js.map +1 -1
- package/dist/umd/velocity.umd.min.js +2 -2
- package/dist/umd/velocity.umd.min.js.map +1 -1
- package/package.json +8 -7
|
@@ -21,7 +21,7 @@ import { IItemTemplate, UserSession } from "@esri/solution-common";
|
|
|
21
21
|
* @param template The template that for the velocity item
|
|
22
22
|
* @param authentication The credentials for any requests
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @returns a list of dependency ids
|
|
25
25
|
*/
|
|
26
26
|
export declare function getVelocityDependencies(template: IItemTemplate, authentication: UserSession): Promise<string[]>;
|
|
27
27
|
/**
|
|
@@ -32,7 +32,8 @@ export declare function getVelocityDependencies(template: IItemTemplate, authent
|
|
|
32
32
|
* @param dependencies Any dependencies that have been found for this item
|
|
33
33
|
* @param authentication The credentials for any requests
|
|
34
34
|
*
|
|
35
|
-
* @
|
|
35
|
+
* @returns a list of dependency ids
|
|
36
|
+
* @private
|
|
36
37
|
*/
|
|
37
38
|
export declare function _validateDependencies(dependencies: string[], authentication: UserSession): Promise<string[]>;
|
|
38
39
|
/**
|
|
@@ -41,6 +42,7 @@ export declare function _validateDependencies(dependencies: string[], authentica
|
|
|
41
42
|
*
|
|
42
43
|
* @param feeds The list of feeds from the velocity template
|
|
43
44
|
* @param dependencies The current list of dependencies
|
|
45
|
+
* @private
|
|
44
46
|
*/
|
|
45
47
|
export declare function _getFeedDependencies(feeds: any[], dependencies: string[]): void;
|
|
46
48
|
/**
|
|
@@ -50,5 +52,6 @@ export declare function _getFeedDependencies(feeds: any[], dependencies: string[
|
|
|
50
52
|
* @param outputs The list of outputs from the velocity item
|
|
51
53
|
* @param dependencies The current list of dependencies
|
|
52
54
|
* @param prop The individual prop to evaluate
|
|
55
|
+
* @private
|
|
53
56
|
*/
|
|
54
57
|
export declare function _getDependencies(outputs: any[], dependencies: string[]): void;
|
|
@@ -26,7 +26,7 @@ import { IItemTemplate, IVelocityTitle, UserSession } from "@esri/solution-commo
|
|
|
26
26
|
* @param urlPrefix Optional prefix args necessary for some url construction
|
|
27
27
|
* @param urlSuffix Optional suffix args necessary for some url construction
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @returns a promise that will resolve the constructed url
|
|
30
30
|
*
|
|
31
31
|
*/
|
|
32
32
|
export declare function getVelocityUrl(authentication: UserSession, templateDictionary: any, type: string, id?: string, isDeploy?: boolean, urlPrefix?: string, urlSuffix?: string): Promise<string>;
|
|
@@ -39,7 +39,7 @@ export declare function getVelocityUrl(authentication: UserSession, templateDict
|
|
|
39
39
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
40
40
|
* @param autoStart This can be leveraged to start certain velocity items after they are created.
|
|
41
41
|
*
|
|
42
|
-
* @
|
|
42
|
+
* @returns a promise that will resolve an object containing the item, id, type, and post process flag
|
|
43
43
|
*
|
|
44
44
|
*/
|
|
45
45
|
export declare function postVelocityData(authentication: UserSession, template: IItemTemplate, data: any, templateDictionary: any, autoStart?: boolean): Promise<any>;
|
|
@@ -51,7 +51,7 @@ export declare function postVelocityData(authentication: UserSession, template:
|
|
|
51
51
|
* @param label The current label of the item from the solution template
|
|
52
52
|
* @param url The base velocity url for checking status
|
|
53
53
|
*
|
|
54
|
-
* @
|
|
54
|
+
* @returns a promise that will resolve a unique title
|
|
55
55
|
*
|
|
56
56
|
*/
|
|
57
57
|
export declare function getTitle(authentication: UserSession, label: string, url: string): Promise<IVelocityTitle>;
|
|
@@ -69,8 +69,9 @@ export declare function getTitle(authentication: UserSession, label: string, url
|
|
|
69
69
|
* @param dataOutputs The velocity items output objects
|
|
70
70
|
* @param feeds The velocity items feed objects
|
|
71
71
|
*
|
|
72
|
-
* @
|
|
72
|
+
* @returns a promise that will resolve the data object passed in with any necessary changes.
|
|
73
73
|
*
|
|
74
|
+
* @private
|
|
74
75
|
*/
|
|
75
76
|
export declare function _validateOutputs(authentication: UserSession, templateDictionary: any, type: string, data: any, titles: any[], dataOutputs?: any[], feeds?: any[]): Promise<any>;
|
|
76
77
|
/**
|
|
@@ -78,8 +79,9 @@ export declare function _validateOutputs(authentication: UserSession, templateDi
|
|
|
78
79
|
*
|
|
79
80
|
* @param validateResults The results object to check for name conflict errors
|
|
80
81
|
*
|
|
81
|
-
* @
|
|
82
|
+
* @returns a list of names that already exist in the org
|
|
82
83
|
*
|
|
84
|
+
* @private
|
|
83
85
|
*/
|
|
84
86
|
export declare function _validateMessages(validateResults: any): string[];
|
|
85
87
|
/**
|
|
@@ -89,6 +91,7 @@ export declare function _validateMessages(validateResults: any): string[];
|
|
|
89
91
|
* @param data The full data object used for deploying the velocity item.
|
|
90
92
|
* @param names The names that failed due to duplicate error in validation.
|
|
91
93
|
*
|
|
94
|
+
* @private
|
|
92
95
|
*/
|
|
93
96
|
export declare function _updateFeed(feeds: any[], data: any, names: string[]): void;
|
|
94
97
|
/**
|
|
@@ -98,7 +101,7 @@ export declare function _updateFeed(feeds: any[], data: any, names: string[]): v
|
|
|
98
101
|
* @param data The full data object used for deploying the velocity item.
|
|
99
102
|
* @param names The names that failed due to duplicate error in validation.
|
|
100
103
|
*
|
|
101
|
-
*
|
|
104
|
+
* @private
|
|
102
105
|
*/
|
|
103
106
|
export declare function _updateDataOutput(dataOutputs: any[], data: any, names: string[]): void;
|
|
104
107
|
/**
|
|
@@ -107,9 +110,10 @@ export declare function _updateDataOutput(dataOutputs: any[], data: any, names:
|
|
|
107
110
|
* @param names The names that failed due to duplicate error in validation.
|
|
108
111
|
* @param dataOutput The current data output that is being evaluated.
|
|
109
112
|
*
|
|
110
|
-
* @
|
|
113
|
+
* @returns an object with a unique label and the outputs id when a name
|
|
111
114
|
* conflict is found...otherwise returns undefined
|
|
112
115
|
*
|
|
116
|
+
* @private
|
|
113
117
|
*/
|
|
114
118
|
export declare function _getOutputLabel(names: any[], dataOutput: any): any;
|
|
115
119
|
/**
|
|
@@ -124,7 +128,7 @@ export declare function _getOutputLabel(names: any[], dataOutput: any): any;
|
|
|
124
128
|
* @param templateDictionary Hash of the facts
|
|
125
129
|
* @param path to the objects to evaluate for potantial name clashes
|
|
126
130
|
*
|
|
127
|
-
* @
|
|
131
|
+
* @returns string The unique title to use
|
|
128
132
|
*
|
|
129
133
|
*/
|
|
130
134
|
export declare function getUniqueTitle(title: string, templateDictionary: any, path: string): string;
|
|
@@ -136,9 +140,10 @@ export declare function getUniqueTitle(title: string, templateDictionary: any, p
|
|
|
136
140
|
* @param template the item template that has the details for deployment
|
|
137
141
|
* @param id the new id for the velocity item that was deployed
|
|
138
142
|
*
|
|
139
|
-
* @
|
|
143
|
+
* @returns a promise that will resolve with the validation results
|
|
140
144
|
* or the start results when validation indicates the item is executable
|
|
141
145
|
*
|
|
146
|
+
* @private
|
|
142
147
|
*/
|
|
143
148
|
export declare function _validateAndStart(authentication: UserSession, templateDictionary: any, template: IItemTemplate, id: string): Promise<any>;
|
|
144
149
|
/**
|
|
@@ -151,7 +156,7 @@ export declare function _validateAndStart(authentication: UserSession, templateD
|
|
|
151
156
|
* @param id? Optional The id of the velocity item we are constructing a url for
|
|
152
157
|
* @param body? Optional the request body to validate.
|
|
153
158
|
*
|
|
154
|
-
* @
|
|
159
|
+
* @returns a promise that will resolve with an object containing messages
|
|
155
160
|
* indicating any issues found when validating such as name conflict errors
|
|
156
161
|
*
|
|
157
162
|
*/
|
|
@@ -164,7 +169,7 @@ export declare function validate(authentication: UserSession, templateDictionary
|
|
|
164
169
|
* @param type The type of velocity item we are constructing a url for
|
|
165
170
|
* @param id? Optional The id of the velocity item we are constructing a url for
|
|
166
171
|
*
|
|
167
|
-
* @
|
|
172
|
+
* @returns a promise that will resolve with the result of the start call
|
|
168
173
|
*
|
|
169
174
|
*/
|
|
170
175
|
export declare function start(authentication: UserSession, templateDictionary: any, type: string, id?: string): Promise<any>;
|
|
@@ -174,8 +179,9 @@ export declare function start(authentication: UserSession, templateDictionary: a
|
|
|
174
179
|
* @param authentication Credentials for the requests
|
|
175
180
|
* @param method Indicate if "GET" or "POST"
|
|
176
181
|
*
|
|
177
|
-
* @
|
|
182
|
+
* @returns generic request options used for various calls to velocity api
|
|
178
183
|
*
|
|
184
|
+
* @private
|
|
179
185
|
*/
|
|
180
186
|
export declare function _getRequestOpts(authentication: UserSession, method: string): RequestInit;
|
|
181
187
|
/**
|
|
@@ -186,8 +192,9 @@ export declare function _getRequestOpts(authentication: UserSession, method: str
|
|
|
186
192
|
* @param method The method for the request "GET" or "POST"
|
|
187
193
|
* @param body The body for POST requests
|
|
188
194
|
*
|
|
189
|
-
* @
|
|
195
|
+
* @returns a promise that will resolve with the result of the fetch call
|
|
190
196
|
*
|
|
197
|
+
* @private
|
|
191
198
|
*/
|
|
192
199
|
export declare function _fetch(authentication: UserSession, url: string, method: string, // GET or POST
|
|
193
200
|
body?: any): Promise<any>;
|
|
@@ -205,6 +212,7 @@ export declare function cleanDataSourcesAndFeeds(template: IItemTemplate, veloci
|
|
|
205
212
|
* @param sourcesOrFeeds The list of dataSources or feeds
|
|
206
213
|
* @param dependencies The list of dependencies
|
|
207
214
|
*
|
|
215
|
+
* @private
|
|
208
216
|
*/
|
|
209
217
|
export declare function _removeIdProps(sourcesOrFeeds: any[], dependencies: string[], velocityUrl: string): void;
|
|
210
218
|
/**
|
|
@@ -213,6 +221,7 @@ export declare function _removeIdProps(sourcesOrFeeds: any[], dependencies: stri
|
|
|
213
221
|
* @param outputs The list of outputs
|
|
214
222
|
* @param dependencies The list of dependencies
|
|
215
223
|
*
|
|
224
|
+
* @private
|
|
216
225
|
*/
|
|
217
226
|
export declare function _removeIdPropsAndSetName(outputs: any[], dependencies: string[]): void;
|
|
218
227
|
/**
|
|
@@ -222,6 +231,7 @@ export declare function _removeIdPropsAndSetName(outputs: any[], dependencies: s
|
|
|
222
231
|
* @param prop the individual prop to remove
|
|
223
232
|
* @param dependencies The list of dependencies
|
|
224
233
|
*
|
|
234
|
+
* @private
|
|
225
235
|
*/
|
|
226
236
|
export declare function _removeProp(props: any, prop: string, dependencies: string[]): void;
|
|
227
237
|
/**
|
|
@@ -229,5 +239,6 @@ export declare function _removeProp(props: any, prop: string, dependencies: stri
|
|
|
229
239
|
*
|
|
230
240
|
* @param props the list of props to update
|
|
231
241
|
*
|
|
242
|
+
* @private
|
|
232
243
|
*/
|
|
233
244
|
export declare function _updateName(props: any): void;
|
|
@@ -20,7 +20,7 @@ import { IItemTemplate } from "@esri/solution-common";
|
|
|
20
20
|
*
|
|
21
21
|
* @param template velocity item info that should be templatized
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
23
|
+
* @returns void
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
export declare function templatizeVelocity(template: IItemTemplate): void;
|
|
@@ -32,8 +32,9 @@ export declare function templatizeVelocity(template: IItemTemplate): void;
|
|
|
32
32
|
* @param prop the prop path to evaluate and set with a templatized variable
|
|
33
33
|
* @param fn the templatize function that should be called for this prop
|
|
34
34
|
*
|
|
35
|
-
* @
|
|
35
|
+
* @returns void
|
|
36
36
|
*
|
|
37
|
+
* @private
|
|
37
38
|
*/
|
|
38
39
|
export declare function _templatize(template: IItemTemplate, prop: string, fn: (arg: any) => void): void;
|
|
39
40
|
/**
|
|
@@ -42,8 +43,9 @@ export declare function _templatize(template: IItemTemplate, prop: string, fn: (
|
|
|
42
43
|
*
|
|
43
44
|
* @param feeds array of velocity feeds that should be templatized
|
|
44
45
|
*
|
|
45
|
-
* @
|
|
46
|
+
* @returns The updated list of feed objects with templatized id and label
|
|
46
47
|
*
|
|
48
|
+
* @private
|
|
47
49
|
*/
|
|
48
50
|
export declare function _templatizeFeeds(feeds: any[]): any;
|
|
49
51
|
/**
|
|
@@ -51,8 +53,9 @@ export declare function _templatizeFeeds(feeds: any[]): any;
|
|
|
51
53
|
*
|
|
52
54
|
* @param feed the feed object from the item
|
|
53
55
|
*
|
|
54
|
-
* @
|
|
56
|
+
* @returns the updated feed object with templatized portalItemId and layer id
|
|
55
57
|
*
|
|
58
|
+
* @private
|
|
56
59
|
*/
|
|
57
60
|
export declare function _templatizeFeed(feed: any): any;
|
|
58
61
|
/**
|
|
@@ -61,7 +64,8 @@ export declare function _templatizeFeed(feed: any): any;
|
|
|
61
64
|
*
|
|
62
65
|
* @param dataSources array of data sources from the item
|
|
63
66
|
*
|
|
64
|
-
* @
|
|
67
|
+
* @returns the updated dataSources object with templatized ids and labels
|
|
65
68
|
*
|
|
69
|
+
* @private
|
|
66
70
|
*/
|
|
67
71
|
export declare function _templatizeDatasources(dataSources: any[]): any;
|
|
@@ -28,7 +28,7 @@ import { UserSession, IItemProgressCallback, IItemTemplate, ICreateItemFromTempl
|
|
|
28
28
|
* @param srcAuthentication Credentials for requests to source items
|
|
29
29
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
30
30
|
*
|
|
31
|
-
* @
|
|
31
|
+
* @returns a promise that will resolve the constructed IItemTemplate from the input itemInfo
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
|
|
@@ -40,7 +40,7 @@ export declare function convertItemToTemplate(solutionItemId: string, itemInfo:
|
|
|
40
40
|
* @param destinationAuthentication Credentials for the deployment requests
|
|
41
41
|
* @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
|
|
42
42
|
*
|
|
43
|
-
* @
|
|
43
|
+
* @returns a promise that will resolve with the new item info, id, type, and postProcess flag
|
|
44
44
|
*
|
|
45
45
|
*/
|
|
46
46
|
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
package/dist/umd/velocity.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-velocity - v1.3.
|
|
2
|
+
* @esri/solution-velocity - v1.3.13 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
* Tue
|
|
4
|
+
* Tue Apr 26 2022 15:05:07 GMT-0700 (Pacific Daylight Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
*
|
|
43
43
|
* @param template velocity item info that should be templatized
|
|
44
44
|
*
|
|
45
|
-
* @
|
|
45
|
+
* @returns void
|
|
46
46
|
*
|
|
47
47
|
*/
|
|
48
48
|
function templatizeVelocity(template) {
|
|
@@ -58,8 +58,9 @@
|
|
|
58
58
|
* @param prop the prop path to evaluate and set with a templatized variable
|
|
59
59
|
* @param fn the templatize function that should be called for this prop
|
|
60
60
|
*
|
|
61
|
-
* @
|
|
61
|
+
* @returns void
|
|
62
62
|
*
|
|
63
|
+
* @private
|
|
63
64
|
*/
|
|
64
65
|
function _templatize(template, prop, fn) {
|
|
65
66
|
const obj = solutionCommon.getProp(template, prop);
|
|
@@ -74,8 +75,9 @@
|
|
|
74
75
|
*
|
|
75
76
|
* @param feeds array of velocity feeds that should be templatized
|
|
76
77
|
*
|
|
77
|
-
* @
|
|
78
|
+
* @returns The updated list of feed objects with templatized id and label
|
|
78
79
|
*
|
|
80
|
+
* @private
|
|
79
81
|
*/
|
|
80
82
|
function _templatizeFeeds(feeds) {
|
|
81
83
|
return feeds.map((feed) => {
|
|
@@ -89,8 +91,9 @@
|
|
|
89
91
|
*
|
|
90
92
|
* @param feed the feed object from the item
|
|
91
93
|
*
|
|
92
|
-
* @
|
|
94
|
+
* @returns the updated feed object with templatized portalItemId and layer id
|
|
93
95
|
*
|
|
96
|
+
* @private
|
|
94
97
|
*/
|
|
95
98
|
function _templatizeFeed(feed) {
|
|
96
99
|
let id = solutionCommon.getProp(feed, "properties.feature-layer.portalItemId");
|
|
@@ -115,8 +118,9 @@
|
|
|
115
118
|
*
|
|
116
119
|
* @param dataSources array of data sources from the item
|
|
117
120
|
*
|
|
118
|
-
* @
|
|
121
|
+
* @returns the updated dataSources object with templatized ids and labels
|
|
119
122
|
*
|
|
123
|
+
* @private
|
|
120
124
|
*/
|
|
121
125
|
function _templatizeDatasources(dataSources) {
|
|
122
126
|
return dataSources.map((ds) => _templatizeFeed(ds));
|
|
@@ -144,7 +148,7 @@
|
|
|
144
148
|
* @param template The template that for the velocity item
|
|
145
149
|
* @param authentication The credentials for any requests
|
|
146
150
|
*
|
|
147
|
-
* @
|
|
151
|
+
* @returns a list of dependency ids
|
|
148
152
|
*/
|
|
149
153
|
function getVelocityDependencies(template, authentication) {
|
|
150
154
|
const dependencies = [];
|
|
@@ -168,7 +172,8 @@
|
|
|
168
172
|
* @param dependencies Any dependencies that have been found for this item
|
|
169
173
|
* @param authentication The credentials for any requests
|
|
170
174
|
*
|
|
171
|
-
* @
|
|
175
|
+
* @returns a list of dependency ids
|
|
176
|
+
* @private
|
|
172
177
|
*/
|
|
173
178
|
function _validateDependencies(dependencies, authentication) {
|
|
174
179
|
const defs = dependencies.map(d => {
|
|
@@ -189,6 +194,7 @@
|
|
|
189
194
|
*
|
|
190
195
|
* @param feeds The list of feeds from the velocity template
|
|
191
196
|
* @param dependencies The current list of dependencies
|
|
197
|
+
* @private
|
|
192
198
|
*/
|
|
193
199
|
function _getFeedDependencies(feeds, dependencies) {
|
|
194
200
|
feeds.reduce((prev, cur) => {
|
|
@@ -211,6 +217,7 @@
|
|
|
211
217
|
* @param outputs The list of outputs from the velocity item
|
|
212
218
|
* @param dependencies The current list of dependencies
|
|
213
219
|
* @param prop The individual prop to evaluate
|
|
220
|
+
* @private
|
|
214
221
|
*/
|
|
215
222
|
function _getDependencies(outputs, dependencies) {
|
|
216
223
|
outputs.reduce((prev, cur) => {
|
|
@@ -258,7 +265,7 @@
|
|
|
258
265
|
* @param urlPrefix Optional prefix args necessary for some url construction
|
|
259
266
|
* @param urlSuffix Optional suffix args necessary for some url construction
|
|
260
267
|
*
|
|
261
|
-
* @
|
|
268
|
+
* @returns a promise that will resolve the constructed url
|
|
262
269
|
*
|
|
263
270
|
*/
|
|
264
271
|
function getVelocityUrl(authentication, templateDictionary, type, id = "", isDeploy = false, urlPrefix = "", urlSuffix = "") {
|
|
@@ -291,7 +298,7 @@
|
|
|
291
298
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
292
299
|
* @param autoStart This can be leveraged to start certain velocity items after they are created.
|
|
293
300
|
*
|
|
294
|
-
* @
|
|
301
|
+
* @returns a promise that will resolve an object containing the item, id, type, and post process flag
|
|
295
302
|
*
|
|
296
303
|
*/
|
|
297
304
|
function postVelocityData(authentication, template, data, templateDictionary, autoStart = false) {
|
|
@@ -353,7 +360,7 @@
|
|
|
353
360
|
* @param label The current label of the item from the solution template
|
|
354
361
|
* @param url The base velocity url for checking status
|
|
355
362
|
*
|
|
356
|
-
* @
|
|
363
|
+
* @returns a promise that will resolve a unique title
|
|
357
364
|
*
|
|
358
365
|
*/
|
|
359
366
|
function getTitle(authentication, label, url) {
|
|
@@ -380,8 +387,9 @@
|
|
|
380
387
|
* @param dataOutputs The velocity items output objects
|
|
381
388
|
* @param feeds The velocity items feed objects
|
|
382
389
|
*
|
|
383
|
-
* @
|
|
390
|
+
* @returns a promise that will resolve the data object passed in with any necessary changes.
|
|
384
391
|
*
|
|
392
|
+
* @private
|
|
385
393
|
*/
|
|
386
394
|
function _validateOutputs(authentication, templateDictionary, type, data, titles, dataOutputs = [], feeds = []) {
|
|
387
395
|
if (dataOutputs.length > 0 || feeds.length > 0) {
|
|
@@ -412,8 +420,9 @@
|
|
|
412
420
|
*
|
|
413
421
|
* @param validateResults The results object to check for name conflict errors
|
|
414
422
|
*
|
|
415
|
-
* @
|
|
423
|
+
* @returns a list of names that already exist in the org
|
|
416
424
|
*
|
|
425
|
+
* @private
|
|
417
426
|
*/
|
|
418
427
|
function _validateMessages(validateResults) {
|
|
419
428
|
let messages = solutionCommon.getProp(validateResults, "validation.messages");
|
|
@@ -454,6 +463,7 @@
|
|
|
454
463
|
* @param data The full data object used for deploying the velocity item.
|
|
455
464
|
* @param names The names that failed due to duplicate error in validation.
|
|
456
465
|
*
|
|
466
|
+
* @private
|
|
457
467
|
*/
|
|
458
468
|
function _updateFeed(feeds, data, names) {
|
|
459
469
|
feeds.forEach(f => {
|
|
@@ -472,7 +482,7 @@
|
|
|
472
482
|
* @param data The full data object used for deploying the velocity item.
|
|
473
483
|
* @param names The names that failed due to duplicate error in validation.
|
|
474
484
|
*
|
|
475
|
-
*
|
|
485
|
+
* @private
|
|
476
486
|
*/
|
|
477
487
|
function _updateDataOutput(dataOutputs, data, names) {
|
|
478
488
|
dataOutputs.forEach(dataOutput => {
|
|
@@ -510,9 +520,10 @@
|
|
|
510
520
|
* @param names The names that failed due to duplicate error in validation.
|
|
511
521
|
* @param dataOutput The current data output that is being evaluated.
|
|
512
522
|
*
|
|
513
|
-
* @
|
|
523
|
+
* @returns an object with a unique label and the outputs id when a name
|
|
514
524
|
* conflict is found...otherwise returns undefined
|
|
515
525
|
*
|
|
526
|
+
* @private
|
|
516
527
|
*/
|
|
517
528
|
function _getOutputLabel(names, dataOutput) {
|
|
518
529
|
const titles = names.map((name) => {
|
|
@@ -538,7 +549,7 @@
|
|
|
538
549
|
* @param templateDictionary Hash of the facts
|
|
539
550
|
* @param path to the objects to evaluate for potantial name clashes
|
|
540
551
|
*
|
|
541
|
-
* @
|
|
552
|
+
* @returns string The unique title to use
|
|
542
553
|
*
|
|
543
554
|
*/
|
|
544
555
|
function getUniqueTitle(title, templateDictionary, path) {
|
|
@@ -566,9 +577,10 @@
|
|
|
566
577
|
* @param template the item template that has the details for deployment
|
|
567
578
|
* @param id the new id for the velocity item that was deployed
|
|
568
579
|
*
|
|
569
|
-
* @
|
|
580
|
+
* @returns a promise that will resolve with the validation results
|
|
570
581
|
* or the start results when validation indicates the item is executable
|
|
571
582
|
*
|
|
583
|
+
* @private
|
|
572
584
|
*/
|
|
573
585
|
function _validateAndStart(authentication, templateDictionary, template, id) {
|
|
574
586
|
return validate(authentication, templateDictionary, template.type, id).then(validateResult => {
|
|
@@ -590,7 +602,7 @@
|
|
|
590
602
|
* @param id? Optional The id of the velocity item we are constructing a url for
|
|
591
603
|
* @param body? Optional the request body to validate.
|
|
592
604
|
*
|
|
593
|
-
* @
|
|
605
|
+
* @returns a promise that will resolve with an object containing messages
|
|
594
606
|
* indicating any issues found when validating such as name conflict errors
|
|
595
607
|
*
|
|
596
608
|
*/
|
|
@@ -611,7 +623,7 @@
|
|
|
611
623
|
* @param type The type of velocity item we are constructing a url for
|
|
612
624
|
* @param id? Optional The id of the velocity item we are constructing a url for
|
|
613
625
|
*
|
|
614
|
-
* @
|
|
626
|
+
* @returns a promise that will resolve with the result of the start call
|
|
615
627
|
*
|
|
616
628
|
*/
|
|
617
629
|
function start(authentication, templateDictionary, type, id) {
|
|
@@ -629,8 +641,9 @@
|
|
|
629
641
|
* @param authentication Credentials for the requests
|
|
630
642
|
* @param method Indicate if "GET" or "POST"
|
|
631
643
|
*
|
|
632
|
-
* @
|
|
644
|
+
* @returns generic request options used for various calls to velocity api
|
|
633
645
|
*
|
|
646
|
+
* @private
|
|
634
647
|
*/
|
|
635
648
|
function _getRequestOpts(authentication, method) {
|
|
636
649
|
return {
|
|
@@ -650,8 +663,9 @@
|
|
|
650
663
|
* @param method The method for the request "GET" or "POST"
|
|
651
664
|
* @param body The body for POST requests
|
|
652
665
|
*
|
|
653
|
-
* @
|
|
666
|
+
* @returns a promise that will resolve with the result of the fetch call
|
|
654
667
|
*
|
|
668
|
+
* @private
|
|
655
669
|
*/
|
|
656
670
|
function _fetch(authentication, url, method, // GET or POST
|
|
657
671
|
body) {
|
|
@@ -688,6 +702,7 @@
|
|
|
688
702
|
* @param sourcesOrFeeds The list of dataSources or feeds
|
|
689
703
|
* @param dependencies The list of dependencies
|
|
690
704
|
*
|
|
705
|
+
* @private
|
|
691
706
|
*/
|
|
692
707
|
function _removeIdProps(sourcesOrFeeds, dependencies, velocityUrl) {
|
|
693
708
|
sourcesOrFeeds.forEach(dataSource => {
|
|
@@ -721,6 +736,7 @@
|
|
|
721
736
|
* @param outputs The list of outputs
|
|
722
737
|
* @param dependencies The list of dependencies
|
|
723
738
|
*
|
|
739
|
+
* @private
|
|
724
740
|
*/
|
|
725
741
|
function _removeIdPropsAndSetName(outputs, dependencies) {
|
|
726
742
|
outputs.forEach(output => {
|
|
@@ -741,6 +757,7 @@
|
|
|
741
757
|
* @param prop the individual prop to remove
|
|
742
758
|
* @param dependencies The list of dependencies
|
|
743
759
|
*
|
|
760
|
+
* @private
|
|
744
761
|
*/
|
|
745
762
|
function _removeProp(props, prop, dependencies) {
|
|
746
763
|
const id = props[prop];
|
|
@@ -754,6 +771,7 @@
|
|
|
754
771
|
*
|
|
755
772
|
* @param props the list of props to update
|
|
756
773
|
*
|
|
774
|
+
* @private
|
|
757
775
|
*/
|
|
758
776
|
function _updateName(props) {
|
|
759
777
|
[
|
|
@@ -793,7 +811,7 @@
|
|
|
793
811
|
* @param srcAuthentication Credentials for requests to source items
|
|
794
812
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
795
813
|
*
|
|
796
|
-
* @
|
|
814
|
+
* @returns a promise that will resolve the constructed IItemTemplate from the input itemInfo
|
|
797
815
|
*
|
|
798
816
|
*/
|
|
799
817
|
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
@@ -828,7 +846,7 @@
|
|
|
828
846
|
* @param destinationAuthentication Credentials for the deployment requests
|
|
829
847
|
* @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
|
|
830
848
|
*
|
|
831
|
-
* @
|
|
849
|
+
* @returns a promise that will resolve with the new item info, id, type, and postProcess flag
|
|
832
850
|
*
|
|
833
851
|
*/
|
|
834
852
|
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|