@esri/solution-velocity 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 (31) hide show
  1. package/package.json +3 -3
  2. package/dist/cjs/helpers/get-velocity-dependencies.d.ts +0 -57
  3. package/dist/cjs/helpers/get-velocity-dependencies.js +0 -120
  4. package/dist/cjs/helpers/get-velocity-dependencies.js.map +0 -1
  5. package/dist/cjs/helpers/velocity-helpers.d.ts +0 -244
  6. package/dist/cjs/helpers/velocity-helpers.js +0 -567
  7. package/dist/cjs/helpers/velocity-helpers.js.map +0 -1
  8. package/dist/cjs/helpers/velocity-templatize.d.ts +0 -71
  9. package/dist/cjs/helpers/velocity-templatize.js +0 -114
  10. package/dist/cjs/helpers/velocity-templatize.js.map +0 -1
  11. package/dist/cjs/index.d.ts +0 -17
  12. package/dist/cjs/index.js +0 -22
  13. package/dist/cjs/index.js.map +0 -1
  14. package/dist/cjs/velocity-processor.d.ts +0 -60
  15. package/dist/cjs/velocity-processor.js +0 -134
  16. package/dist/cjs/velocity-processor.js.map +0 -1
  17. package/dist/esm/helpers/get-velocity-dependencies.d.ts +0 -57
  18. package/dist/esm/helpers/get-velocity-dependencies.js +0 -113
  19. package/dist/esm/helpers/get-velocity-dependencies.js.map +0 -1
  20. package/dist/esm/helpers/velocity-helpers.d.ts +0 -244
  21. package/dist/esm/helpers/velocity-helpers.js +0 -545
  22. package/dist/esm/helpers/velocity-helpers.js.map +0 -1
  23. package/dist/esm/helpers/velocity-templatize.d.ts +0 -71
  24. package/dist/esm/helpers/velocity-templatize.js +0 -106
  25. package/dist/esm/helpers/velocity-templatize.js.map +0 -1
  26. package/dist/esm/index.d.ts +0 -17
  27. package/dist/esm/index.js +0 -18
  28. package/dist/esm/index.js.map +0 -1
  29. package/dist/esm/velocity-processor.d.ts +0 -60
  30. package/dist/esm/velocity-processor.js +0 -128
  31. package/dist/esm/velocity-processor.js.map +0 -1
@@ -1,244 +0,0 @@
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, IVelocityTitle, UserSession } from "@esri/solution-common";
17
- /**
18
- * Common function to build urls for reading and interacting with the velocity api
19
- *
20
- *
21
- * @param authentication Credentials for the requests
22
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
23
- * @param type The type of velocity item we are constructing a url for
24
- * @param id Optional The id of the velocity item we are constructing a url for
25
- * @param isDeploy Optional Is this being constructed as a part of deployment
26
- * @param urlPrefix Optional prefix args necessary for some url construction
27
- * @param urlSuffix Optional suffix args necessary for some url construction
28
- *
29
- * @returns a promise that will resolve the constructed url
30
- *
31
- */
32
- export declare function getVelocityUrl(authentication: UserSession, templateDictionary: any, type: string, id?: string, isDeploy?: boolean, urlPrefix?: string, urlSuffix?: string): Promise<string>;
33
- /**
34
- * Handles the creation of velocity items.
35
- *
36
- * @param authentication Credentials for the requests
37
- * @param template The current itemTemplate that is being used for deployment
38
- * @param data The velocity item data used to create the items.
39
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
40
- * @param autoStart This can be leveraged to start certain velocity items after they are created.
41
- *
42
- * @returns a promise that will resolve an object containing the item, id, type, and post process flag
43
- *
44
- */
45
- export declare function postVelocityData(authentication: UserSession, template: IItemTemplate, data: any, templateDictionary: any, autoStart?: boolean): Promise<any>;
46
- /**
47
- * Velocity item titles must be unique across the organization.
48
- * Check and ensure we set a unique title
49
- *
50
- * @param authentication Credentials for the requests
51
- * @param label The current label of the item from the solution template
52
- * @param url The base velocity url for checking status
53
- *
54
- * @returns a promise that will resolve a unique title
55
- *
56
- */
57
- export declare function getTitle(authentication: UserSession, label: string, url: string): Promise<IVelocityTitle>;
58
- /**
59
- * Validate the data that will be used and handle any reported issues with the outputs.
60
- * The output names must be unique across the organization.
61
- *
62
- * This function will update the data arg that is passed in with a unique name.
63
- *
64
- * @param authentication Credentials for the requests
65
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
66
- * @param type The type of velocity item
67
- * @param data The data used to construct the velocity item
68
- * @param titles The list of know titles that exist in the org
69
- * @param dataOutputs The velocity items output objects
70
- * @param feeds The velocity items feed objects
71
- *
72
- * @returns a promise that will resolve the data object passed in with any necessary changes.
73
- *
74
- * @private
75
- */
76
- export declare function _validateOutputs(authentication: UserSession, templateDictionary: any, type: string, data: any, titles: any[], dataOutputs?: any[], feeds?: any[]): Promise<any>;
77
- /**
78
- * Check the validate results for any name conflicts and store the conflicting names.
79
- *
80
- * @param validateResults The results object to check for name conflict errors
81
- *
82
- * @returns a list of names that already exist in the org
83
- *
84
- * @private
85
- */
86
- export declare function _validateMessages(validateResults: any): string[];
87
- /**
88
- * Updates the feed object with a new name when validation fails.
89
- *
90
- * @param feeds The feed objects from the velocity item.
91
- * @param data The full data object used for deploying the velocity item.
92
- * @param names The names that failed due to duplicate error in validation.
93
- *
94
- * @private
95
- */
96
- export declare function _updateFeed(feeds: any[], data: any, names: string[]): void;
97
- /**
98
- * Updates the data object with a new name when validation fails.
99
- *
100
- * @param dataOutputs The data output objects from the velocity item.
101
- * @param data The full data object used for deploying the velocity item.
102
- * @param names The names that failed due to duplicate error in validation.
103
- *
104
- * @private
105
- */
106
- export declare function _updateDataOutput(dataOutputs: any[], data: any, names: string[]): void;
107
- /**
108
- * Get a unique label for the item.
109
- *
110
- * @param names The names that failed due to duplicate error in validation.
111
- * @param dataOutput The current data output that is being evaluated.
112
- *
113
- * @returns an object with a unique label and the outputs id when a name
114
- * conflict is found...otherwise returns undefined
115
- *
116
- * @private
117
- */
118
- export declare function _getOutputLabel(names: any[], dataOutput: any): any;
119
- /**
120
- * Will return the provided title if it does not exist as a property
121
- * in one of the objects at the defined path. Otherwise the title will
122
- * have a numerical value attached.
123
- *
124
- * This is based on "getUniqueTitle" from common but adds the "_" replacement check for velocity names.
125
- * Could switch to using common if Velocity has a way to get a list of all names that are already used.
126
- *
127
- * @param title The root title to test
128
- * @param templateDictionary Hash of the facts
129
- * @param path to the objects to evaluate for potantial name clashes
130
- *
131
- * @returns string The unique title to use
132
- *
133
- */
134
- export declare function getUniqueTitle(title: string, templateDictionary: any, path: string): string;
135
- /**
136
- * Start the item if validation passes and the item is executable.
137
- *
138
- * @param authentication Credentials for the requests
139
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
140
- * @param template the item template that has the details for deployment
141
- * @param id the new id for the velocity item that was deployed
142
- *
143
- * @returns a promise that will resolve with the validation results
144
- * or the start results when validation indicates the item is executable
145
- *
146
- * @private
147
- */
148
- export declare function _validateAndStart(authentication: UserSession, templateDictionary: any, template: IItemTemplate, id: string): Promise<any>;
149
- /**
150
- * Validate the velocity item.
151
- * Used to help find and handle duplicate name errors.
152
- *
153
- * @param authentication Credentials for the requests
154
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
155
- * @param type The type of velocity item we are constructing a url for
156
- * @param id? Optional The id of the velocity item we are constructing a url for
157
- * @param body? Optional the request body to validate.
158
- *
159
- * @returns a promise that will resolve with an object containing messages
160
- * indicating any issues found when validating such as name conflict errors
161
- *
162
- */
163
- export declare function validate(authentication: UserSession, templateDictionary: any, type: string, id?: string, body?: any): Promise<any>;
164
- /**
165
- * Start the given velocity item that has been deployed.
166
- *
167
- * @param authentication Credentials for the requests
168
- * @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
169
- * @param type The type of velocity item we are constructing a url for
170
- * @param id? Optional The id of the velocity item we are constructing a url for
171
- *
172
- * @returns a promise that will resolve with the result of the start call
173
- *
174
- */
175
- export declare function start(authentication: UserSession, templateDictionary: any, type: string, id?: string): Promise<any>;
176
- /**
177
- * Gets the required request options for requests to the velocity API.
178
- *
179
- * @param authentication Credentials for the requests
180
- * @param method Indicate if "GET" or "POST"
181
- *
182
- * @returns generic request options used for various calls to velocity api
183
- *
184
- * @private
185
- */
186
- export declare function _getRequestOpts(authentication: UserSession, method: string): RequestInit;
187
- /**
188
- * Generic fetch function for making calls to the velocity API.
189
- *
190
- * @param authentication Credentials for the requests
191
- * @param url The url from the velocity API to handle reading and writing
192
- * @param method The method for the request "GET" or "POST"
193
- * @param body The body for POST requests
194
- *
195
- * @returns a promise that will resolve with the result of the fetch call
196
- *
197
- * @private
198
- */
199
- export declare function _fetch(authentication: UserSession, url: string, method: string, // GET or POST
200
- body?: any): Promise<any>;
201
- /**
202
- * Remove key properties if the dependency was removed due to having the "IoTFeatureLayer" typeKeyword
203
- * This function will update the input template.
204
- *
205
- * @param template The template that for the velocity item
206
- *
207
- */
208
- export declare function cleanDataSourcesAndFeeds(template: IItemTemplate, velocityUrl: string): void;
209
- /**
210
- * Remove key properties from the input source or feed
211
- *
212
- * @param sourcesOrFeeds The list of dataSources or feeds
213
- * @param dependencies The list of dependencies
214
- *
215
- * @private
216
- */
217
- export declare function _removeIdProps(sourcesOrFeeds: any[], dependencies: string[], velocityUrl: string): void;
218
- /**
219
- * Remove key properties from the outputs.
220
- *
221
- * @param outputs The list of outputs
222
- * @param dependencies The list of dependencies
223
- *
224
- * @private
225
- */
226
- export declare function _removeIdPropsAndSetName(outputs: any[], dependencies: string[]): void;
227
- /**
228
- * Generic helper function to remove key properties .
229
- *
230
- * @param props the list of props to update
231
- * @param prop the individual prop to remove
232
- * @param dependencies The list of dependencies
233
- *
234
- * @private
235
- */
236
- export declare function _removeProp(props: any, prop: string, dependencies: string[]): void;
237
- /**
238
- * Update the feature layer name to include the solution item id.
239
- *
240
- * @param props the list of props to update
241
- *
242
- * @private
243
- */
244
- export declare function _updateName(props: any): void;