@esri/solution-common 6.6.1-next.64 → 6.6.1-next.66

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.
@@ -461,9 +461,6 @@ function setNamesAndTitles(templates) {
461
461
  let baseName = t.item.name || t.item.title;
462
462
  // If the name already contains a GUID remove it
463
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, "_");
467
464
  // The name length limit is 98
468
465
  // Limit the baseName to 50 characters before the _<guid>
469
466
  // If the baseName includes '{{params' it is likely being used in a template replacement, so do not truncate.
@@ -549,6 +549,15 @@ export declare function _addItemMetadataFile(itemId: string, metadataFile: File,
549
549
  * @private
550
550
  */
551
551
  export declare function _countRelationships(layers: any[]): number;
552
+ /**
553
+ * Remove spaces and replace other characters that are not allowed in a feature service name with "_".
554
+ * Spaces are removed entirely. Disallowed (replaced with "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*',
555
+ * '<', '>', '\t', '!', '@', "'", ';', ','
556
+ *
557
+ * @param name The candidate service name
558
+ * @returns The sanitized name, or the input unchanged if it is not a string
559
+ */
560
+ export declare function sanitizeFeatureServiceName(name: string): string;
552
561
  /**
553
562
  * Gets the full definitions of the layers affiliated with a hosted service.
554
563
  *
@@ -16,7 +16,7 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports._addItemDataFile = exports.updateItemURL = exports.updateItemTemplateFromDictionary = exports.updateItemExtended = exports.updateGroup = exports.updateItem = exports.shareItem = exports.removeUsers = exports.reassignGroup = exports.searchGroupContents = exports.searchGroupAllContents = exports.searchAllGroups = exports.searchGroups = exports.searchAllItems = exports.searchItems = exports.removeItemOrGroup = exports.removeItem = exports.removeGroup = exports.removeFolder = exports.hasInvalidGroupDesignations = exports._parseAdminServiceData = exports.setWorkflowConfigurationZip = exports.getWorkflowConfigurationZip = exports.getFeatureServiceProperties = exports.getServiceLayersAndTables = exports.getRequest = exports._sortRelationships = exports.moveItemsToFolder = exports.moveItemToFolder = exports.getLayerUpdates = exports.getLayers = exports.extractDependencies = exports.createUniqueGroup = exports.createUniqueFolder = exports.createItemWithData = exports.createFullItem = exports.createFeatureService = exports.convertExtent = exports.convertExtentWithFallback = exports._removeLayerExtents = exports._extentIsValid = exports._validateExtent = exports.convertToISearchOptions = exports.checkRequestStatus = exports.addToServiceDefinition = exports.addTokenToUrl = exports.addForwardItemRelationships = exports.addForwardItemRelationship = exports.getUserSession = exports.addItemData = void 0;
19
- exports._updateItemURL = exports._updateIndexesForRelationshipKeyFields = exports._setItemProperties = exports._reportVariablesInItem = exports._lowercaseDomain = exports._getUpdate = exports._getSubtypeUpdates = exports._getContingentValuesUpdates = exports._getRelationshipUpdates = exports._getCreateServiceOptions = exports._countRelationships = exports._addItemMetadataFile = void 0;
19
+ exports._updateItemURL = exports._updateIndexesForRelationshipKeyFields = exports._setItemProperties = exports._reportVariablesInItem = exports._lowercaseDomain = exports._getUpdate = exports._getSubtypeUpdates = exports._getContingentValuesUpdates = exports._getRelationshipUpdates = exports._getCreateServiceOptions = exports.sanitizeFeatureServiceName = exports._countRelationships = exports._addItemMetadataFile = void 0;
20
20
  /**
21
21
  * Provides common functions involving the arcgis-rest-js library.
22
22
  *
@@ -1691,6 +1691,18 @@ function _countRelationships(layers) {
1691
1691
  return layers.reduce(reducer, 0);
1692
1692
  }
1693
1693
  exports._countRelationships = _countRelationships;
1694
+ /**
1695
+ * Remove spaces and replace other characters that are not allowed in a feature service name with "_".
1696
+ * Spaces are removed entirely. Disallowed (replaced with "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*',
1697
+ * '<', '>', '\t', '!', '@', "'", ';', ','
1698
+ *
1699
+ * @param name The candidate service name
1700
+ * @returns The sanitized name, or the input unchanged if it is not a string
1701
+ */
1702
+ function sanitizeFeatureServiceName(name) {
1703
+ return typeof name === "string" ? name.replace(/ /g, "").replace(/[#%&"\\/+?:*<>\t!@';,]/g, "_") : name;
1704
+ }
1705
+ exports.sanitizeFeatureServiceName = sanitizeFeatureServiceName;
1694
1706
  /**
1695
1707
  * Gets the full definitions of the layers affiliated with a hosted service.
1696
1708
  *
@@ -1741,6 +1753,7 @@ function _getCreateServiceOptions(newItemTemplate, authentication, templateDicti
1741
1753
  }
1742
1754
  createOptions.item = (0, templatization_1.replaceInTemplate)(createOptions.item, templateDictionary);
1743
1755
  createOptions.params = (0, templatization_1.replaceInTemplate)(createOptions.params, templateDictionary);
1756
+ createOptions.item.name = sanitizeFeatureServiceName(createOptions.item.name);
1744
1757
  if (newItemTemplate.item.thumbnail) {
1745
1758
  // Pass thumbnail file in via params because item property is serialized, which discards a blob
1746
1759
  createOptions.params.thumbnail = newItemTemplate.item.thumbnail;
@@ -443,9 +443,6 @@ export function setNamesAndTitles(templates) {
443
443
  let baseName = t.item.name || t.item.title;
444
444
  // If the name already contains a GUID remove it
445
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, "_");
449
446
  // The name length limit is 98
450
447
  // Limit the baseName to 50 characters before the _<guid>
451
448
  // If the baseName includes '{{params' it is likely being used in a template replacement, so do not truncate.
@@ -549,6 +549,15 @@ export declare function _addItemMetadataFile(itemId: string, metadataFile: File,
549
549
  * @private
550
550
  */
551
551
  export declare function _countRelationships(layers: any[]): number;
552
+ /**
553
+ * Remove spaces and replace other characters that are not allowed in a feature service name with "_".
554
+ * Spaces are removed entirely. Disallowed (replaced with "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*',
555
+ * '<', '>', '\t', '!', '@', "'", ';', ','
556
+ *
557
+ * @param name The candidate service name
558
+ * @returns The sanitized name, or the input unchanged if it is not a string
559
+ */
560
+ export declare function sanitizeFeatureServiceName(name: string): string;
552
561
  /**
553
562
  * Gets the full definitions of the layers affiliated with a hosted service.
554
563
  *
@@ -1635,6 +1635,17 @@ export function _countRelationships(layers) {
1635
1635
  const reducer = (accumulator, currentLayer) => accumulator + (currentLayer.relationships ? currentLayer.relationships.length : 0);
1636
1636
  return layers.reduce(reducer, 0);
1637
1637
  }
1638
+ /**
1639
+ * Remove spaces and replace other characters that are not allowed in a feature service name with "_".
1640
+ * Spaces are removed entirely. Disallowed (replaced with "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*',
1641
+ * '<', '>', '\t', '!', '@', "'", ';', ','
1642
+ *
1643
+ * @param name The candidate service name
1644
+ * @returns The sanitized name, or the input unchanged if it is not a string
1645
+ */
1646
+ export function sanitizeFeatureServiceName(name) {
1647
+ return typeof name === "string" ? name.replace(/ /g, "").replace(/[#%&"\\/+?:*<>\t!@';,]/g, "_") : name;
1648
+ }
1638
1649
  /**
1639
1650
  * Gets the full definitions of the layers affiliated with a hosted service.
1640
1651
  *
@@ -1685,6 +1696,7 @@ export function _getCreateServiceOptions(newItemTemplate, authentication, templa
1685
1696
  }
1686
1697
  createOptions.item = replaceInTemplate(createOptions.item, templateDictionary);
1687
1698
  createOptions.params = replaceInTemplate(createOptions.params, templateDictionary);
1699
+ createOptions.item.name = sanitizeFeatureServiceName(createOptions.item.name);
1688
1700
  if (newItemTemplate.item.thumbnail) {
1689
1701
  // Pass thumbnail file in via params because item property is serialized, which discards a blob
1690
1702
  createOptions.params.thumbnail = newItemTemplate.item.thumbnail;
@@ -1,10 +1,10 @@
1
- Built 06/10/2026 20:42:40.90
1
+ Built 06/12/2026 20:42:11.62
2
2
  develop
3
- commit d6a3ffbb5f139814a5703700efe2cb3e90cda142
4
- Merge: 040dc8b18 8c2cd0b39
3
+ commit 307d5009be47540e9814c131fa0c7bdf0077bff2
4
+ Merge: 9cd693d93 cf483e6ed
5
5
  Author: John Hauck <jhauck@esri.com>
6
- Date: Wed Jun 10 12:52:03 2026 -0600
6
+ Date: Fri Jun 12 10:41:41 2026 -0600
7
7
 
8
- Merge pull request #1588 from Esri/start-default-wkid
8
+ Merge pull request #1590 from Esri/add-seperate-build-solution-param
9
9
 
10
- remove full and initial extent for create service when NaN
10
+ replace additional characters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-common",
3
- "version": "6.6.1-next.64",
3
+ "version": "6.6.1-next.66",
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": "d6a3ffbb5f139814a5703700efe2cb3e90cda142"
99
+ "gitHead": "307d5009be47540e9814c131fa0c7bdf0077bff2"
100
100
  }