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

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,14 @@ 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 "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*', '<', '>', '\t'
555
+ *
556
+ * @param name The candidate service name
557
+ * @returns The sanitized name, or the input unchanged if it is not a string
558
+ */
559
+ export declare function sanitizeFeatureServiceName(name: string): string;
552
560
  /**
553
561
  * Gets the full definitions of the layers affiliated with a hosted service.
554
562
  *
@@ -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,17 @@ 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 "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*', '<', '>', '\t'
1697
+ *
1698
+ * @param name The candidate service name
1699
+ * @returns The sanitized name, or the input unchanged if it is not a string
1700
+ */
1701
+ function sanitizeFeatureServiceName(name) {
1702
+ return typeof name === "string" ? name.replace(/ /g, "").replace(/[#%&"\\/+?:*<>\t]/g, "_") : name;
1703
+ }
1704
+ exports.sanitizeFeatureServiceName = sanitizeFeatureServiceName;
1694
1705
  /**
1695
1706
  * Gets the full definitions of the layers affiliated with a hosted service.
1696
1707
  *
@@ -1741,6 +1752,7 @@ function _getCreateServiceOptions(newItemTemplate, authentication, templateDicti
1741
1752
  }
1742
1753
  createOptions.item = (0, templatization_1.replaceInTemplate)(createOptions.item, templateDictionary);
1743
1754
  createOptions.params = (0, templatization_1.replaceInTemplate)(createOptions.params, templateDictionary);
1755
+ createOptions.item.name = sanitizeFeatureServiceName(createOptions.item.name);
1744
1756
  if (newItemTemplate.item.thumbnail) {
1745
1757
  // Pass thumbnail file in via params because item property is serialized, which discards a blob
1746
1758
  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,14 @@ 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 "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*', '<', '>', '\t'
555
+ *
556
+ * @param name The candidate service name
557
+ * @returns The sanitized name, or the input unchanged if it is not a string
558
+ */
559
+ export declare function sanitizeFeatureServiceName(name: string): string;
552
560
  /**
553
561
  * Gets the full definitions of the layers affiliated with a hosted service.
554
562
  *
@@ -1635,6 +1635,16 @@ 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 "_"): '#', '%', '&', '"', '\', '/', '+', '?', ':', '*', '<', '>', '\t'
1641
+ *
1642
+ * @param name The candidate service name
1643
+ * @returns The sanitized name, or the input unchanged if it is not a string
1644
+ */
1645
+ export function sanitizeFeatureServiceName(name) {
1646
+ return typeof name === "string" ? name.replace(/ /g, "").replace(/[#%&"\\/+?:*<>\t]/g, "_") : name;
1647
+ }
1638
1648
  /**
1639
1649
  * Gets the full definitions of the layers affiliated with a hosted service.
1640
1650
  *
@@ -1685,6 +1695,7 @@ export function _getCreateServiceOptions(newItemTemplate, authentication, templa
1685
1695
  }
1686
1696
  createOptions.item = replaceInTemplate(createOptions.item, templateDictionary);
1687
1697
  createOptions.params = replaceInTemplate(createOptions.params, templateDictionary);
1698
+ createOptions.item.name = sanitizeFeatureServiceName(createOptions.item.name);
1688
1699
  if (newItemTemplate.item.thumbnail) {
1689
1700
  // Pass thumbnail file in via params because item property is serialized, which discards a blob
1690
1701
  createOptions.params.thumbnail = newItemTemplate.item.thumbnail;
@@ -1,10 +1,10 @@
1
- Built 06/10/2026 20:42:40.90
1
+ Built 06/11/2026 20:42:42.68
2
2
  develop
3
- commit d6a3ffbb5f139814a5703700efe2cb3e90cda142
4
- Merge: 040dc8b18 8c2cd0b39
3
+ commit c863f76817a8ca40b8aa7c94e5ce094365a58f0a
4
+ Merge: 4ff447205 48c692aa4
5
5
  Author: John Hauck <jhauck@esri.com>
6
- Date: Wed Jun 10 12:52:03 2026 -0600
6
+ Date: Thu Jun 11 18:36:20 2026 -0600
7
7
 
8
- Merge pull request #1588 from Esri/start-default-wkid
8
+ Merge pull request #1589 from Esri/add-seperate-build-solution-param
9
9
 
10
- remove full and initial extent for create service when NaN
10
+ add buildSolution param to deploy solution
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.65",
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": "c863f76817a8ca40b8aa7c94e5ce094365a58f0a"
100
100
  }