@adminide-stack/core
Advanced tools
Comparing version 9.2.1-alpha.48 to 9.2.1-alpha.51
@@ -28,3 +28,8 @@ import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import queryString from'query-string';import {parseCdecodeUri}from'./cdecodeUri.js';import {IConfigCollectionName}from'../interfaces/generated/generated-models.js';import'../interfaces/configuration/configuration.js';import'../interfaces/organization/organization-context.js';import'@workbench-stack/core/lib/constants/extensions.js';import'@workbench-stack/core/lib/interfaces/lifecycle/lifecycle.js';import'../interfaces/permissions.js';import {reviveUri}from'./reviveUri.js';// moved to `@workbench-stack/core` | ||
queryData.orgName = parsedUri.pathSegments.organization; | ||
queryData.resourceId = parsedUri.pathSegments.resourceId; | ||
// Handle resourceId as either _id (Mongo ObjectId) or name | ||
if (isMongoObjectId(parsedUri.pathSegments.resourceId)) { | ||
queryData.resourceId = parsedUri.pathSegments.resourceId; | ||
} else { | ||
queryData.resourceName = parsedUri.pathSegments.resourceId; | ||
} | ||
queryData.resourceGroup = parsedUri.pathSegments.resourceGroup; | ||
@@ -68,2 +73,10 @@ } else if (parsedUri.pathSegments.resourceGroup) { | ||
throw new Error('Unsupported resource type'); | ||
} | ||
/** | ||
* Utility function to check if a string is a valid MongoDB ObjectId | ||
* @param id | ||
*/ | ||
function isMongoObjectId(id) { | ||
const objectIdRegex = /^[a-fA-F0-9]{24}$/; | ||
return objectIdRegex.test(id); | ||
}export{convertToResourceUri,resourcePath};//# sourceMappingURL=resourceUriConversion.js.map |
{ | ||
"name": "@adminide-stack/core", | ||
"version": "9.2.1-alpha.48", | ||
"version": "9.2.1-alpha.51", | ||
"description": "AdminIDE core for higher packages to depend on", | ||
@@ -37,3 +37,3 @@ "license": "ISC", | ||
}, | ||
"gitHead": "248df89ff71cd83aba9b40b303e6c6c35f1d9d84", | ||
"gitHead": "36342c85237b7b1f1f504ecdcc335a04e8b8e6ba", | ||
"typescript": { | ||
@@ -40,0 +40,0 @@ "definition": "lib/index.d.ts" |
Sorry, the diff of this file is not supported yet
1775217
38184