@esri/solution-common 6.6.1-next.6 → 6.6.1-next.60

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.
@@ -19,9 +19,12 @@
19
19
  import { IFolderIdOptions, IGetGroupContentOptions, IGetUserOptions, IGroup, IGroupContentResult, IGetRelatedItemsResponse, IGroupSharingOptions, IItem, IItemRelationshipOptions, IItemResourceOptions, IItemResourceResponse, IPortal, IRemoveItemResourceOptions, ISearchOptions, ISearchResult, ISharingResponse, IUpdateGroupOptions, IUpdateItemOptions, IUpdateItemResponse, IUser, IUserGroupOptions, IUserItemOptions, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
20
20
  import { IRequestOptions } from "@esri/arcgis-rest-request";
21
21
  import { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, IQueryRelatedOptions, IQueryRelatedResponse } from "@esri/arcgis-rest-feature-service";
22
- export { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, ICreateServiceParams, ICreateServiceResult, IExtent, ISpatialReference, IFeature, IQueryRelatedOptions, IQueryRelatedResponse, IRelatedRecordGroup, createFeatureService as svcAdminCreateFeatureService, queryFeatures, addFeatures, applyEdits, } from "@esri/arcgis-rest-feature-service";
23
- export { IAddFolderResponse, IAddItemDataOptions, ICreateItemOptions, ICreateItemResponse, IFolder, IFolderIdOptions, IGetGroupContentOptions, IGetRelatedItemsResponse, IGroup, IGroupAdd, IGroupCategorySchema as restIGroupCategorySchema, IItem, IItemRelationshipOptions, IItemResourceOptions, IItemResourceResponse, IManageItemRelationshipOptions, IMoveItemOptions, IMoveItemResponse, IPagedResponse, IPagingParams, IPortal, IRemoveItemResourceOptions, ISearchGroupContentOptions, ISearchOptions, ISearchResult, ISetAccessOptions, ISharingResponse, ItemRelationshipType, IUpdateGroupOptions, IUpdateItemOptions, IUpdateItemResponse, IUser, IUserContentResponse, IUserGroupOptions, IGroupSharingOptions, IUserItemOptions, addItemData as restAddItemData, addItemRelationship, createFolder, createGroup, createItem, createItemInFolder, moveItem, protectItem, SearchQueryBuilder, getGroupCategorySchema as restGetGroupCategorySchema, getItem, getItemData, getItemResources as restGetItemResources, getUserContent, getPortal as restGetPortal, getPortalUrl, searchGroupContent, setItemAccess, searchGroups as restSearchGroups, removeGroupUsers, removeItem as restRemoveItem, } from "@esri/arcgis-rest-portal";
24
- export { IArcGISIdentityManagerOptions, ICredential, IRequestOptions, IParams, ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession, } from "@esri/arcgis-rest-request";
22
+ export { createFeatureService as svcAdminCreateFeatureService, queryFeatures, addFeatures, applyEdits, } from "@esri/arcgis-rest-feature-service";
23
+ export type { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, ICreateServiceParams, ICreateServiceResult, IExtent, ISpatialReference, IFeature, IQueryRelatedOptions, IQueryRelatedResponse, IRelatedRecordGroup, } from "@esri/arcgis-rest-feature-service";
24
+ export { addItemData as restAddItemData, addItemRelationship, createFolder, createGroup, createItem, createItemInFolder, moveItem, protectItem, SearchQueryBuilder, getGroupCategorySchema as restGetGroupCategorySchema, getItem, getItemData, getItemResources as restGetItemResources, getUserContent, getPortal as restGetPortal, getPortalUrl, searchGroupContent, setItemAccess, searchGroups as restSearchGroups, removeGroupUsers, removeItem as restRemoveItem, } from "@esri/arcgis-rest-portal";
25
+ export type { IAddFolderResponse, IAddItemDataOptions, ICreateItemOptions, ICreateItemResponse, IFolder, IFolderIdOptions, IGetGroupContentOptions, IGetRelatedItemsResponse, IGroup, IGroupAdd, IGroupCategorySchema as restIGroupCategorySchema, IItem, IItemRelationshipOptions, IItemResourceOptions, IItemResourceResponse, IManageItemRelationshipOptions, IMoveItemOptions, IMoveItemResponse, IPagedResponse, IPagingParams, IPortal, IRemoveItemResourceOptions, ISearchGroupContentOptions, ISearchOptions, ISearchResult, ISetAccessOptions, ISharingResponse, ItemRelationshipType, IUpdateGroupOptions, IUpdateItemOptions, IUpdateItemResponse, IUser, IUserContentResponse, IUserGroupOptions, IGroupSharingOptions, IUserItemOptions, } from "@esri/arcgis-rest-portal";
26
+ export { ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession } from "@esri/arcgis-rest-request";
27
+ export type { IArcGISIdentityManagerOptions, ICredential, IRequestOptions, IParams } from "@esri/arcgis-rest-request";
25
28
  export interface IFolderSuccessResult {
26
29
  success: boolean;
27
30
  folder: {
@@ -158,9 +158,11 @@ exports.deleteViewProps = deleteViewProps;
158
158
  */
159
159
  function cacheFieldInfos(layer, fieldInfos, isView, isPortal) {
160
160
  // cache the source fields as they are in the original source
161
- if (layer && layer.fields) {
161
+ // Note: layer.id is commonly 0 for the first layer, so use a presence check
162
+ // (not a truthy check) to avoid skipping the layer with id === 0.
163
+ if (layer && layer.id !== undefined && layer.id !== null) {
162
164
  fieldInfos[layer.id] = {
163
- sourceFields: JSON.parse(JSON.stringify(layer.fields)),
165
+ sourceFields: layer.fields ? JSON.parse(JSON.stringify(layer.fields)) : [],
164
166
  type: layer.type,
165
167
  id: layer.id,
166
168
  };
@@ -459,9 +461,15 @@ function setNamesAndTitles(templates) {
459
461
  let baseName = t.item.name || t.item.title;
460
462
  // If the name already contains a GUID remove it
461
463
  baseName = baseName.replace(/_[0-9A-F]{32}/gi, "");
464
+ // Replace characters that are not allowed in a feature service name with "_"
465
+ // Disallowed: '#', '%', '&', '"', '\', '/', '+', '?', ':', '*', '<', '>', ' ', '\t'
466
+ baseName = baseName.replace(/[#%&"\\/+?:*<> \t]/g, "_");
462
467
  // The name length limit is 98
463
468
  // Limit the baseName to 50 characters before the _<guid>
464
- const name = baseName.substring(0, 50) + "_" + guid;
469
+ // If the baseName includes '{{params' it is likely being used in a template replacement, so do not truncate.
470
+ const name = baseName.includes("{{params")
471
+ ? baseName + "_" + guid
472
+ : baseName.substring(0, 50) + "_" + guid;
465
473
  // If the name + GUID already exists then append "_occurrenceCount"
466
474
  t.item.name = names.indexOf(name) === -1 ? name : `${name}_${names.filter((n) => n === name).length}`;
467
475
  names.push(name);
@@ -826,7 +834,12 @@ function addFeatureServiceDefinition(serviceUrl, listToAdd, templateDictionary,
826
834
  removeLayerOptimization(item);
827
835
  // this can still chunk layers
828
836
  options = _updateAddOptions(itemTemplate, options, layerChunks, isSelfReferential, authentication);
829
- if (item.type === "Feature Layer") {
837
+ // Route based on the discriminator set by getLayersAndTables (which derives from
838
+ // properties.layers vs properties.tables) rather than the layer object's own `type`
839
+ // field. The latter may be missing when users supply custom layer JSON via
840
+ // params (e.g. {{params.buildSolution.items.<id>.service.layers}}), which would
841
+ // otherwise cause every layer to be pushed into the `tables` array.
842
+ if (toAdd.type === "layer" || item.type === "Feature Layer") {
830
843
  options.layers.push(item);
831
844
  }
832
845
  else {
@@ -19,9 +19,12 @@
19
19
  import { IFolderIdOptions, IGetGroupContentOptions, IGetUserOptions, IGroup, IGroupContentResult, IGetRelatedItemsResponse, IGroupSharingOptions, IItem, IItemRelationshipOptions, IItemResourceOptions, IItemResourceResponse, IPortal, IRemoveItemResourceOptions, ISearchOptions, ISearchResult, ISharingResponse, IUpdateGroupOptions, IUpdateItemOptions, IUpdateItemResponse, IUser, IUserGroupOptions, IUserItemOptions, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
20
20
  import { IRequestOptions } from "@esri/arcgis-rest-request";
21
21
  import { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, IQueryRelatedOptions, IQueryRelatedResponse } from "@esri/arcgis-rest-feature-service";
22
- export { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, ICreateServiceParams, ICreateServiceResult, IExtent, ISpatialReference, IFeature, IQueryRelatedOptions, IQueryRelatedResponse, IRelatedRecordGroup, createFeatureService as svcAdminCreateFeatureService, queryFeatures, addFeatures, applyEdits, } from "@esri/arcgis-rest-feature-service";
23
- export { IAddFolderResponse, IAddItemDataOptions, ICreateItemOptions, ICreateItemResponse, IFolder, IFolderIdOptions, IGetGroupContentOptions, IGetRelatedItemsResponse, IGroup, IGroupAdd, IGroupCategorySchema as restIGroupCategorySchema, IItem, IItemRelationshipOptions, IItemResourceOptions, IItemResourceResponse, IManageItemRelationshipOptions, IMoveItemOptions, IMoveItemResponse, IPagedResponse, IPagingParams, IPortal, IRemoveItemResourceOptions, ISearchGroupContentOptions, ISearchOptions, ISearchResult, ISetAccessOptions, ISharingResponse, ItemRelationshipType, IUpdateGroupOptions, IUpdateItemOptions, IUpdateItemResponse, IUser, IUserContentResponse, IUserGroupOptions, IGroupSharingOptions, IUserItemOptions, addItemData as restAddItemData, addItemRelationship, createFolder, createGroup, createItem, createItemInFolder, moveItem, protectItem, SearchQueryBuilder, getGroupCategorySchema as restGetGroupCategorySchema, getItem, getItemData, getItemResources as restGetItemResources, getUserContent, getPortal as restGetPortal, getPortalUrl, searchGroupContent, setItemAccess, searchGroups as restSearchGroups, removeGroupUsers, removeItem as restRemoveItem, } from "@esri/arcgis-rest-portal";
24
- export { IArcGISIdentityManagerOptions, ICredential, IRequestOptions, IParams, ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession, } from "@esri/arcgis-rest-request";
22
+ export { createFeatureService as svcAdminCreateFeatureService, queryFeatures, addFeatures, applyEdits, } from "@esri/arcgis-rest-feature-service";
23
+ export type { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, ICreateServiceParams, ICreateServiceResult, IExtent, ISpatialReference, IFeature, IQueryRelatedOptions, IQueryRelatedResponse, IRelatedRecordGroup, } from "@esri/arcgis-rest-feature-service";
24
+ export { addItemData as restAddItemData, addItemRelationship, createFolder, createGroup, createItem, createItemInFolder, moveItem, protectItem, SearchQueryBuilder, getGroupCategorySchema as restGetGroupCategorySchema, getItem, getItemData, getItemResources as restGetItemResources, getUserContent, getPortal as restGetPortal, getPortalUrl, searchGroupContent, setItemAccess, searchGroups as restSearchGroups, removeGroupUsers, removeItem as restRemoveItem, } from "@esri/arcgis-rest-portal";
25
+ export type { IAddFolderResponse, IAddItemDataOptions, ICreateItemOptions, ICreateItemResponse, IFolder, IFolderIdOptions, IGetGroupContentOptions, IGetRelatedItemsResponse, IGroup, IGroupAdd, IGroupCategorySchema as restIGroupCategorySchema, IItem, IItemRelationshipOptions, IItemResourceOptions, IItemResourceResponse, IManageItemRelationshipOptions, IMoveItemOptions, IMoveItemResponse, IPagedResponse, IPagingParams, IPortal, IRemoveItemResourceOptions, ISearchGroupContentOptions, ISearchOptions, ISearchResult, ISetAccessOptions, ISharingResponse, ItemRelationshipType, IUpdateGroupOptions, IUpdateItemOptions, IUpdateItemResponse, IUser, IUserContentResponse, IUserGroupOptions, IGroupSharingOptions, IUserItemOptions, } from "@esri/arcgis-rest-portal";
26
+ export { ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession } from "@esri/arcgis-rest-request";
27
+ export type { IArcGISIdentityManagerOptions, ICredential, IRequestOptions, IParams } from "@esri/arcgis-rest-request";
25
28
  export interface IFolderSuccessResult {
26
29
  success: boolean;
27
30
  folder: {
@@ -21,7 +21,7 @@ import { request as restRequest } from "@esri/arcgis-rest-request";
21
21
  import { addToServiceDefinition, queryRelated as restQueryRelated, } from "@esri/arcgis-rest-feature-service";
22
22
  export { createFeatureService as svcAdminCreateFeatureService, queryFeatures, addFeatures, applyEdits, } from "@esri/arcgis-rest-feature-service";
23
23
  export { addItemData as restAddItemData, addItemRelationship, createFolder, createGroup, createItem, createItemInFolder, moveItem, protectItem, SearchQueryBuilder, getGroupCategorySchema as restGetGroupCategorySchema, getItem, getItemData, getItemResources as restGetItemResources, getUserContent, getPortal as restGetPortal, getPortalUrl, searchGroupContent, setItemAccess, searchGroups as restSearchGroups, removeGroupUsers, removeItem as restRemoveItem, } from "@esri/arcgis-rest-portal";
24
- export { ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession, } from "@esri/arcgis-rest-request";
24
+ export { ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession } from "@esri/arcgis-rest-request";
25
25
  //custom export functions that mimic the same export function from arcgis-rest-js
26
26
  //to bypass unit test error:
27
27
  //Error: <spyOn> : <functon or property> is not declared writable or has no setter
@@ -151,9 +151,11 @@ export function deleteViewProps(layer, isPortal) {
151
151
  */
152
152
  export function cacheFieldInfos(layer, fieldInfos, isView, isPortal) {
153
153
  // cache the source fields as they are in the original source
154
- if (layer && layer.fields) {
154
+ // Note: layer.id is commonly 0 for the first layer, so use a presence check
155
+ // (not a truthy check) to avoid skipping the layer with id === 0.
156
+ if (layer && layer.id !== undefined && layer.id !== null) {
155
157
  fieldInfos[layer.id] = {
156
- sourceFields: JSON.parse(JSON.stringify(layer.fields)),
158
+ sourceFields: layer.fields ? JSON.parse(JSON.stringify(layer.fields)) : [],
157
159
  type: layer.type,
158
160
  id: layer.id,
159
161
  };
@@ -441,9 +443,15 @@ export function setNamesAndTitles(templates) {
441
443
  let baseName = t.item.name || t.item.title;
442
444
  // If the name already contains a GUID remove it
443
445
  baseName = baseName.replace(/_[0-9A-F]{32}/gi, "");
446
+ // Replace characters that are not allowed in a feature service name with "_"
447
+ // Disallowed: '#', '%', '&', '"', '\', '/', '+', '?', ':', '*', '<', '>', ' ', '\t'
448
+ baseName = baseName.replace(/[#%&"\\/+?:*<> \t]/g, "_");
444
449
  // The name length limit is 98
445
450
  // Limit the baseName to 50 characters before the _<guid>
446
- const name = baseName.substring(0, 50) + "_" + guid;
451
+ // If the baseName includes '{{params' it is likely being used in a template replacement, so do not truncate.
452
+ const name = baseName.includes("{{params")
453
+ ? baseName + "_" + guid
454
+ : baseName.substring(0, 50) + "_" + guid;
447
455
  // If the name + GUID already exists then append "_occurrenceCount"
448
456
  t.item.name = names.indexOf(name) === -1 ? name : `${name}_${names.filter((n) => n === name).length}`;
449
457
  names.push(name);
@@ -800,7 +808,12 @@ export function addFeatureServiceDefinition(serviceUrl, listToAdd, templateDicti
800
808
  removeLayerOptimization(item);
801
809
  // this can still chunk layers
802
810
  options = _updateAddOptions(itemTemplate, options, layerChunks, isSelfReferential, authentication);
803
- if (item.type === "Feature Layer") {
811
+ // Route based on the discriminator set by getLayersAndTables (which derives from
812
+ // properties.layers vs properties.tables) rather than the layer object's own `type`
813
+ // field. The latter may be missing when users supply custom layer JSON via
814
+ // params (e.g. {{params.buildSolution.items.<id>.service.layers}}), which would
815
+ // otherwise cause every layer to be pushed into the `tables` array.
816
+ if (toAdd.type === "layer" || item.type === "Feature Layer") {
804
817
  options.layers.push(item);
805
818
  }
806
819
  else {
@@ -1,10 +1,7 @@
1
- Built 04/13/2026 20:42:22.12
1
+ Built 06/06/2026 20:42:24.69
2
2
  develop
3
- commit 41d23d544ad4435825ea41dfc3ba38db37c8b860
4
- Merge: b1da19f37 714bb5a3e
5
- Author: John Hauck <jhauck@esri.com>
6
- Date: Mon Apr 13 11:40:22 2026 -0600
3
+ commit 6dfd793a53027e77552abf563e0677ec7bba8ed1
4
+ Author: Ryan Cosby <ryan9313@esri.com>
5
+ Date: Fri Jun 5 20:49:16 2026 -0700
7
6
 
8
- Merge pull request #1575 from Esri/ts-config-updates
9
-
10
- Ts config updates
7
+ v6.6.1-next.59
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-common",
3
- "version": "6.6.1-next.6",
3
+ "version": "6.6.1-next.60",
4
4
  "description": "Provides general helper functions for @esri/solution.js.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -96,5 +96,5 @@
96
96
  "esri",
97
97
  "ES6"
98
98
  ],
99
- "gitHead": "41d23d544ad4435825ea41dfc3ba38db37c8b860"
99
+ "gitHead": "6dfd793a53027e77552abf563e0677ec7bba8ed1"
100
100
  }