@esri/solution-common 1.2.0 → 1.3.2

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 (54) hide show
  1. package/dist/esm/generalHelpers.d.ts +12 -1
  2. package/dist/esm/generalHelpers.js +22 -0
  3. package/dist/esm/generalHelpers.js.map +1 -1
  4. package/dist/esm/resources/convert-item-resource-to-storage-resource.d.ts +4 -2
  5. package/dist/esm/resources/convert-item-resource-to-storage-resource.js +24 -2
  6. package/dist/esm/resources/convert-item-resource-to-storage-resource.js.map +1 -1
  7. package/dist/esm/restHelpers.d.ts +53 -8
  8. package/dist/esm/restHelpers.js +139 -13
  9. package/dist/esm/restHelpers.js.map +1 -1
  10. package/dist/esm/templatization.js +1 -0
  11. package/dist/esm/templatization.js.map +1 -1
  12. package/dist/node/completeItem.js +3 -2
  13. package/dist/node/completeItem.js.map +1 -1
  14. package/dist/node/deleteHelpers/deleteGroupIfEmpty.js +2 -1
  15. package/dist/node/deleteHelpers/deleteGroupIfEmpty.js.map +1 -1
  16. package/dist/node/deleteHelpers/deleteSolutionContents.js +6 -5
  17. package/dist/node/deleteHelpers/deleteSolutionContents.js.map +1 -1
  18. package/dist/node/deleteHelpers/deleteSolutionFolder.js +2 -1
  19. package/dist/node/deleteHelpers/deleteSolutionFolder.js.map +1 -1
  20. package/dist/node/deleteHelpers/deleteSolutionItem.js +3 -2
  21. package/dist/node/deleteHelpers/deleteSolutionItem.js.map +1 -1
  22. package/dist/node/deleteHelpers/reconstructBuildOrderIds.js +2 -1
  23. package/dist/node/deleteHelpers/reconstructBuildOrderIds.js.map +1 -1
  24. package/dist/node/deleteHelpers/removeItems.js +5 -4
  25. package/dist/node/deleteHelpers/removeItems.js.map +1 -1
  26. package/dist/node/deleteSolution.js +3 -2
  27. package/dist/node/deleteSolution.js.map +1 -1
  28. package/dist/node/generalHelpers.d.ts +12 -1
  29. package/dist/node/generalHelpers.js +24 -1
  30. package/dist/node/generalHelpers.js.map +1 -1
  31. package/dist/node/getDeletableSolutionInfo.js +3 -2
  32. package/dist/node/getDeletableSolutionInfo.js.map +1 -1
  33. package/dist/node/getSolutionSummary.js +4 -3
  34. package/dist/node/getSolutionSummary.js.map +1 -1
  35. package/dist/node/libConnectors.js +2 -1
  36. package/dist/node/libConnectors.js.map +1 -1
  37. package/dist/node/resources/convert-item-resource-to-storage-resource.d.ts +4 -2
  38. package/dist/node/resources/convert-item-resource-to-storage-resource.js +24 -2
  39. package/dist/node/resources/convert-item-resource-to-storage-resource.js.map +1 -1
  40. package/dist/node/resources/copyAssociatedFiles.js +2 -1
  41. package/dist/node/resources/copyAssociatedFiles.js.map +1 -1
  42. package/dist/node/restHelpers.d.ts +53 -8
  43. package/dist/node/restHelpers.js +145 -15
  44. package/dist/node/restHelpers.js.map +1 -1
  45. package/dist/node/templatization.js +1 -0
  46. package/dist/node/templatization.js.map +1 -1
  47. package/dist/umd/common.umd.js +220 -45
  48. package/dist/umd/common.umd.js.map +1 -1
  49. package/dist/umd/common.umd.min.js +4 -4
  50. package/dist/umd/common.umd.min.js.map +1 -1
  51. package/dist/umd/generalHelpers.d.ts +12 -1
  52. package/dist/umd/resources/convert-item-resource-to-storage-resource.d.ts +4 -2
  53. package/dist/umd/restHelpers.d.ts +53 -8
  54. package/package.json +10 -10
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemTemplate } from "./interfaces";
16
+ import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemTemplate, IStringValuePair } from "./interfaces";
17
17
  import { Sanitizer } from "./libConnectors";
18
18
  /**
19
19
  * Returns a URL with a query parameter appended
@@ -222,6 +222,17 @@ export declare function getProp(obj: {
222
222
  * @return Array of the values plucked from the object; only defined values are returned
223
223
  */
224
224
  export declare function getProps(obj: any, props: string[]): any;
225
+ /**
226
+ * Get a property out of a deeply nested object
227
+ * Does not handle anything but nested object graph
228
+ *
229
+ * @param obj Object to retrieve value from
230
+ * @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
231
+ * in obj
232
+ * @param defaultV Optional value to use if any part of path--including final value--is undefined
233
+ * @return Value at end of path
234
+ */
235
+ export declare function getPropWithDefault(obj: IStringValuePair, path: string, defaultV?: any): any;
225
236
  /**
226
237
  * Updates a list of the items dependencies if more are found in the
227
238
  * provided value.
@@ -13,18 +13,20 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { SolutionResourceType } from "./solution-resource";
16
17
  /**
17
18
  * Generates a folder and filename for storing a copy of an item's resource in a storage item.
18
19
  *
19
20
  * @param prefix Base prefix for resource
20
- * @param storageVersion Version of the Solution template
21
21
  * @param sourceResourceFilename Either filename or folder/filename to resource
22
+ * @param storageVersion Version of the Solution template
23
+ * @param storageFileType Optional argument that when supplied will control the how the prefix is created
22
24
  * @return Folder and filename for storage; folder is the itemID plus ("_" + storageFolder) if storageFolder
23
25
  * exists plus ("_" + part of sourceResourceFilename before "/" if that separator exists);
24
26
  * file is sourceResourceFilename
25
27
  * @see convertStorageResourceToItemResource
26
28
  */
27
- export declare function convertItemResourceToStorageResource(prefix: string, sourceResourceFilename: string, storageVersion?: number): {
29
+ export declare function convertItemResourceToStorageResource(prefix: string, sourceResourceFilename: string, storageVersion?: number, storageFileType?: SolutionResourceType): {
28
30
  folder: string;
29
31
  filename: string;
30
32
  };
@@ -25,14 +25,6 @@ export { request as rest_request } from "@esri/arcgis-rest-request";
25
25
  * @return UserSession
26
26
  */
27
27
  export declare function getUserSession(options?: IUserSessionOptions): UserSession;
28
- /**
29
- * Searches for items matching a query and that the caller has access to.
30
- *
31
- * @param search Search string (e.g., "q=redlands+map")
32
- * @return Promise resolving with search results
33
- * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
34
- */
35
- export declare function searchItems(search: string | ISearchOptions | SearchQueryBuilder): Promise<ISearchResult<IItem>>;
36
28
  /**
37
29
  * Adds a forward relationship between two items.
38
30
  *
@@ -84,6 +76,13 @@ export declare function addToServiceDefinition(url: string, options: any, skipRe
84
76
  * @return A promise that will resolve when the request has completed
85
77
  */
86
78
  export declare function checkRequestStatus(result: any, authentication: any): Promise<void>;
79
+ /**
80
+ * Converts a general search into an ISearchOptions structure.
81
+ *
82
+ * @param search Search specified in one of three ways
83
+ * @return Recast search
84
+ */
85
+ export declare function convertToISearchOptions(search: string | ISearchOptions | SearchQueryBuilder): ISearchOptions;
87
86
  /**
88
87
  * Simple validate function to ensure all coordinates are numbers
89
88
  * In some cases orgs can have null or undefined coordinate values associated with the org extent
@@ -308,6 +307,23 @@ export declare function removeItem(itemId: string, authentication: UserSession):
308
307
  * @return A promise that will resolve with the result of the request
309
308
  */
310
309
  export declare function removeItemOrGroup(itemId: string, authentication: UserSession): Promise<IStatusResponse>;
310
+ /**
311
+ * Searches for items matching a query and that the caller has access to.
312
+ *
313
+ * @param search Search string (e.g., "q=redlands+map") or a more detailed structure that can include authentication
314
+ * @return Promise resolving with search results
315
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
316
+ */
317
+ export declare function searchItems(search: string | ISearchOptions | SearchQueryBuilder): Promise<ISearchResult<IItem>>;
318
+ /**
319
+ * Searches for items matching a query and that the caller has access to, continuing recursively until done.
320
+ *
321
+ * @param search Search string (e.g., "q=redlands+map") or a more detailed structure that can include authentication
322
+ * @param accumulatedResponse Response built from previous requests
323
+ * @return Promise resolving with search results
324
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
325
+ */
326
+ export declare function searchAllItems(search: string | ISearchOptions | SearchQueryBuilder, accumulatedResponse?: ISearchResult<IItem>): Promise<ISearchResult<IItem>>;
311
327
  /**
312
328
  * Searches for groups matching criteria.
313
329
  *
@@ -331,6 +347,22 @@ export declare function searchGroups(searchString: string, authentication: UserS
331
347
  * @return A promise that will resolve with all groups that meet the search criteria
332
348
  */
333
349
  export declare function searchAllGroups(searchString: string, authentication: UserSession, groups?: IGroup[], inPagingParams?: IPagingParams): Promise<IGroup[]>;
350
+ /**
351
+ * Searches for group contents matching criteria recursively.
352
+ *
353
+ * @param groupId Group whose contents are to be searched
354
+ * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
355
+ * @param authentication Credentials for the request to AGO
356
+ * @param additionalSearchOptions Adjustments to search, such as tranche size and categories of interest; categories
357
+ * are supplied as an array: each array element consists of one or more categories to be ORed; array elements are ANDed
358
+ * @param portalUrl Rest Url of the portal to perform the search
359
+ * @param accumulatedResponse Response built from previous requests
360
+ * @return A promise that will resolve with a structure with a tranche of results and
361
+ * describing how many items are available
362
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm
363
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
364
+ */
365
+ export declare function searchGroupAllContents(groupId: string, searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalSearchOptions, portalUrl?: string, accumulatedResponse?: ISearchResult<IItem>): Promise<ISearchResult<IItem>>;
334
366
  /**
335
367
  * Searches for group contents matching criteria.
336
368
  *
@@ -391,6 +423,19 @@ export declare function shareItem(groupId: string, id: string, destinationAuthen
391
423
  * @return
392
424
  */
393
425
  export declare function updateItem(itemInfo: IItemUpdate, authentication: UserSession, folderId?: string, additionalParams?: any): Promise<IUpdateItemResponse>;
426
+ /**
427
+ * Updates a group.
428
+ *
429
+ * @param groupInfo The base info of a group; note that this content will be serialized, which doesn't work
430
+ * for binary content
431
+ * @param authentication Credentials for request
432
+ * @param additionalParams Updates that are put under the `params` property, which is not serialized
433
+ * @return A Promise that will resolve with the success/failure status of the request
434
+ */
435
+ export declare function updateGroup(groupInfo: IGroup, authentication: UserSession, additionalParams?: any): Promise<{
436
+ success: boolean;
437
+ groupId: string;
438
+ }>;
394
439
  /**
395
440
  * Updates an item.
396
441
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-common",
3
- "version": "1.2.0",
3
+ "version": "1.3.2",
4
4
  "description": "Provides general helper functions for @esri/solution.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "unpkg": "dist/umd/common.umd.min.js",
@@ -18,10 +18,10 @@
18
18
  "@esri/arcgis-rest-portal": "3.4.3",
19
19
  "@esri/arcgis-rest-request": "3.4.3",
20
20
  "@esri/arcgis-rest-service-admin": "3.4.3",
21
- "@esri/hub-common": "9.7.2",
22
- "@esri/hub-initiatives": "9.7.2",
23
- "@esri/hub-sites": "9.7.2",
24
- "@esri/hub-teams": "9.7.2",
21
+ "@esri/hub-common": "9.15.0",
22
+ "@esri/hub-initiatives": "9.15.0",
23
+ "@esri/hub-sites": "9.15.0",
24
+ "@esri/hub-teams": "9.15.0",
25
25
  "@types/adlib": "^3.0.1",
26
26
  "rollup": "^2.60.0"
27
27
  },
@@ -31,10 +31,10 @@
31
31
  "@esri/arcgis-rest-portal": "3.4.3",
32
32
  "@esri/arcgis-rest-request": "3.4.3",
33
33
  "@esri/arcgis-rest-service-admin": "3.4.3",
34
- "@esri/hub-common": "9.7.2",
35
- "@esri/hub-initiatives": "9.7.2",
36
- "@esri/hub-sites": "9.7.2",
37
- "@esri/hub-teams": "9.7.2"
34
+ "@esri/hub-common": "9.15.0",
35
+ "@esri/hub-initiatives": "9.15.0",
36
+ "@esri/hub-sites": "9.15.0",
37
+ "@esri/hub-teams": "9.15.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "@esri/arcgis-html-sanitizer": "2.8.0",
@@ -95,5 +95,5 @@
95
95
  "esri",
96
96
  "ES6"
97
97
  ],
98
- "gitHead": "70f706fb28a50db0b9b13030f263f8e9e270b98d"
98
+ "gitHead": "08334d19a46a19455c798c89c325f50b9305d8b3"
99
99
  }